このページでは

RadialGradient QML Type

放射状グラデーション。詳細...

Import Statement: import QtQuick.Shapes 1.12
Inherits:

ShapeGradient

プロパティ

詳細な説明

放射状グラデーションは、Shape アイテム内の焦点円と中心円の間で色を補間します。これら2つの円で定義される円錐の外側にある点は、透明になります。

端点の外側では、スプレッドタイプに応じて、グラデーションがパディング、反転、または繰り返し処理されます。

以下は、単純な放射状グラデーションの例です。ここでは、指定された点と、半径によって定義された円上の端点との間で色が補間されます:

fillGradient: RadialGradient {
    centerX: 50; centerY: 50
    centerRadius: 100
    focalX: centerX; focalY: centerY
    GradientStop { position: 0; color: "blue" }
    GradientStop { position: 0.2; color: "green" }
    GradientStop { position: 0.4; color: "red" }
    GradientStop { position: 0.6; color: "yellow" }
    GradientStop { position: 1; color: "cyan" }
}

中心が白で、外縁がシアン色の放射状グラデーションが施された楕円

別の焦点円が指定される拡張ラジアルグラデーションもサポートされています。

注:RadialGradientは Shapeアイテムとの組み合わせでのみサポートされています。Rectangle とは互換性がありません。 はGradient のみをサポートしているためです。

「QRadialGradient」も参照してください 。

プロパティのドキュメント

centerRadius : real

focalRadius : real

これらのプロパティは、中心と焦点半径を定義します。単純な放射状グラデーションの場合、focalRadius は0 (デフォルト値)に設定する必要があります。

centerX : real

centerY : real

focalX : real

focalY : real

これらのプロパティは、中心と焦点の位置を定義します。単純な放射状グラデーションを指定するには、focalX とfocalY を、それぞれcenterX およびcenterY の値に設定します。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.