このページでは

lineargradient2d QML Value Type

QCanvasLinearGradient に対する lineargradient2d 型の対応を提供します。詳細...

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

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

メソッド

詳細な説明

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

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

メソッドのドキュメント

void addColorStop(real offset, string color)

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

例:

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

point endPosition()

線形グラデーションの終点を返します。

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

void setEndPosition(real x, real y)

線形グラデーションの終点を (x,y) に設定します。

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

void setEndPosition(point end)

線形グラデーションの終点をend に設定します。

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

void setStartPosition(real x, real y)

線形グラデーションの開始点を (x,y) に設定します。

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

void setStartPosition(point start)

線形グラデーションの開始点をstart に設定します。

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

point startPosition()

線形グラデーションの開始点を返します。

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

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