このページでは

boxgradient2d QML Value Type

QCanvasBoxGradient との boxgradient2d タイプの互換性を提供します。詳細...

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

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

メソッド

詳細な説明

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

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

メソッドのドキュメント

void addColorStop(real offset, string color)

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

例:

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

real feather()

ボックスのグラデーションのフェザーを返します。

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

real radius()

ボックスのグラデーションの半径を返します。

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

rect rect()

ボックスのグラデーションの矩形領域を返します。

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

void setFeather(real feather)

ボックスのグラデーションのフェザーをfeather に設定します。

「feather()」も参照してください 。

void setRadius(real radius)

ボックスのグラデーションの半径を `radius` に設定します。最大半径は、rect() の幅または高さのうち、小さい方の半分となります。

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

void setRect(x, y, width, height)

ボックスのグラデーションの矩形を、位置(x 、y )およびサイズ(width 、height )に設定します。

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

void setRect(rect)

ボックスのグラデーションの矩形を `rect` に設定します。

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

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