TraceCanvas QML Type
Traceオブジェクトのレンダリングに特化したCanvasタイプ。詳細...
Import Statement: | import QtQuick.VirtualKeyboard.Styles |
Since: | QtQuick.VirtualKeyboard 2.0 |
Inherits: |
プロパティ
- autoDestroy : bool
- autoDestroyDelay : int
- renderFunction : var
- trace : Trace
信号
- onRecycle(var traceCanvas)
(since QtQuick.VirtualKeyboard.Styles 6.1)
方法
- recycle()
(since QtQuick.VirtualKeyboard.Styles 6.1)
- renderClear()
(since QtQuick.VirtualKeyboard.Styles 6.1)
- renderSmoothedLine()
詳細説明
この型は、画面上にTraceオブジェクトをレンダリングする機能を提供する。
Trace レンダリングをキーボードで利用できるようにするには、この型をKeyboardStyle.traceCanvasDelegate コンポーネントとして宣言する必要があります。
traceCanvasDelegate: TraceCanvas { }
カスタム描画属性は、Canvas.available シグナルで初期化できます。例えば
onAvailableChanged: { if (!available) return; var ctx = getContext("2d") ctx.lineWidth = 8 * scaleHint ctx.lineCap = "round" ctx.strokeStyle = Qt.rgba(0xFF, 0xFF, 0xFF) ctx.fillStyle = ctx.strokeStyle }
この型は、Traceレンダリングの組み込みオプションを提供します。現在、以下のレンダリング・オプションが利用可能です:
renderSmoothedLine
角が丸い平滑化された線をレンダリングする(デフォルト)
レンダリング関数はrenderFunction プロパティで変更できます。
renderFunction: renderSmoothedLine
カスタムレンダリング関数もサポートされています。次の例を見てください:
renderFunction: renderCustomLine function renderCustomLine() { getContext("2d") var points = trace.points() ... }
プロパティの説明
autoDestroy : bool |
自動破棄モードを有効にします。
有効にすると、trace
オブジェクトが破棄されたときに、この項目も破棄される。
デフォルト値は false です。この場合、onRecycle シグナルがトリガーされた後、キャンバスを再利用することができます。
autoDestroyDelay : int |
オブジェクトが破棄または再利用されるまでのおおよその遅延を、自動破棄の開始から数えてミリ秒単位で指定します。
この遅延によって、例えば、破壊前にアイテムをアニメーションさせることが可能になります。
デフォルト値は 0 です。
renderFunction : var |
このプロパティは、レンダリング関数を定義します。
デフォルト値はrenderSmoothedLine
Signal ドキュメント
|
traceCanvas がリサイクルされるときに発せられる。
注意: 対応するハンドラはonOnRecycle
です。
このシグナルは QtQuick.VirtualKeyboard.Styles 6.1 で導入されました。
メソッドのドキュメント
|
すべての描画をクリアして変数をリセットすることにより、トレースキャンバスをリサイクルします。
この関数は、完了後(return の前)にonRecycle シグナルをトリガーします。
リサイクルに成功すると、この関数は true を返します。
このメソッドは QtQuick.VirtualKeyboard.Styles 6.1 で導入されました。
|
画面をクリアし、レンダリングをリセットします。
このメソッドは QtQuick.VirtualKeyboard.Styles 6.1 で導入されました。
renderSmoothedLine() |
角を丸くして滑らかにした線をレンダリングします。
この関数はインクリメンタルで、トレースに追加された新しい部分のみをレンダリングします。
この関数はキャンバスの属性を変更しません。
© 2025 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.