このページでは

radialgradient2d QML Value Type

QCanvasRadialGradient との「radialgradient2d」タイプの互換性を提供します。詳細...

Import Statement: import QtCanvas2D
Since: Qt 6.12
Status: Technology preview

この型はテクノロジープレビュー段階にあり、変更される可能性があります。

メソッド

詳細な説明

この値型は、QtCanvas2D インポートによって提供されます。

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

メソッドのドキュメント

void addColorStop(real offset, string color)

指定されたcolor を持つカラーストップを、指定されたoffset のグラデーションに追加します。0.0はグラデーションの一方の端からのオフセット、1.0は他方の端からのオフセットを表します。

例:

const gradient = ctx.createRadialGradient(100, 1000, 10, 100, 100, 80);
gradient.addColorStop(0.0, Qt.rgba(1, 0, 0, 1));
gradient.addColorStop(0.5, "#ff8040");
gradient.addColorStop(1.0, "red");

point centerPosition()

放射状グラデーションの中心点を返します。これは `outerCenterPosition()` と同じです。

setCenterPosition()も参照してください 。

point innerCenterPosition()

放射状グラデーションの内側の中心点を返します。

setInnerCenterPosition()も参照してください 。

real innerRadius()

放射状グラデーションの内半径を返します。

setInnerRadius()も参照してください 。

point outerCenterPosition()

放射状グラデーションの外側の中心点を返します。

setOuterCenterPosition()も参照してください 。

real outerRadius()

放射状グラデーションの外側の半径を返します。

setOuterRadius()も参照してください 。

void setCenterPosition(real x, real y)

放射状グラデーションの両方の中心点を (x,y) に設定します。したがって、これを呼び出した後、グラデーションは対称になります(内側と外側の位置が同じになります)。

centerPosition()も参照してください 。

void setCenterPosition(point center)

放射状グラデーションの両方の中心点をcenter に設定します。したがって、これを呼び出すと、グラデーションは対称になります(内側と外側の位置が同じになります)。

これはオーバーロードされた関数です。

void setInnerCenterPosition(real x, real y)

放射状グラデーションの内側の中心点を (x,y) に設定します。

innerCenterPosition()も参照してください 。

void setInnerCenterPosition(point center)

放射状グラデーションの内側の中心点をcenter に設定します。

これはオーバーロードされた関数です。

void setInnerRadius(real radius)

放射状グラデーションの内側半径をradius に設定します。開始色は、内側の中心位置からこの半径の位置で描画されます。デフォルトの内側半径は0.0 であり、これはグラデーションが内側の中心位置から直接始まることを意味します。

innerRadius()も参照してください 。

void setOuterCenterPosition(real x, real y)

放射状グラデーションの外側の中心点を (x,y) に設定します。

outerCenterPosition()も参照してください 。

void setOuterCenterPosition(point center)

放射状グラデーションの外側の中心点を `center` に設定します。

これはオーバーロードされた関数です。

void setOuterRadius(real radius)

放射状グラデーションの外側半径をradius に設定します。この半径の位置から、外側の中心を起点として終了色が描画されます。

outerRadius()も参照してください 。

© 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.