QPaintedTextureImage Class
class Qt3DRender::QPaintedTextureImageQPainter を通して書き込めるQAbstractTextureImage...続きを読む
ヘッダー | #include <QPaintedTextureImage> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS 3drender) target_link_libraries(mytarget PRIVATE Qt6::3drender) |
qmake: | QT += 3drender |
を継承する: | Qt3DRender::QAbstractTextureImage |
ステータス | 非推奨 |
プロパティ
パブリック機能
パブリックスロット
シグナル
void | heightChanged(int w) |
void | sizeChanged(QSize size) |
void | widthChanged(int w) |
保護された関数
virtual void | paint(QPainter *painter) = 0 |
詳細説明
QPaintedTextureImage は、QPainter を通してテクスチャ画像(ひいては OpenGL テクスチャ)を指定する方法を提供します。テクスチャ画像の幅と高さは、width プロパティと height プロパティ、または size プロパティを通して指定できます。
QPaintedTextureImage をサブクラス化し、仮想paint() 関数を実装する必要があります。QPaintedTextureImage でupdate() が呼び出されるたびに、paint() 関数が呼び出され、結果の画像がアップロードされます。
QPaintedTextureImage は、QAbstractTexture にアタッチする必要があります。
プロパティ・ドキュメント
height : int
このプロパティは、テクスチャ画像の高さを保持します。高さは1以上でなければならない。
アクセス関数
int | height() const |
void | setHeight(int h) |
通知シグナル
void | heightChanged(int w) |
size : QSize
このプロパティは、テクスチャ画像のサイズを保持する。
アクセス関数
QSize | size() const |
void | setSize(QSize size) |
通知シグナル:
void | sizeChanged(QSize size) |
width : int
このプロパティは、テクスチャ画像の幅を保持します。幅は1以上でなければならない。
アクセス関数
int | width() const |
void | setWidth(int w) |
通知シグナル:
void | widthChanged(int w) |
メンバ関数ドキュメント
[pure virtual protected]
void QPaintedTextureImage::paint(QPainter *painter)
指定されたQPainter オブジェクトpainter でテクスチャ画像をペイントします。
QPainter OpenGL はテクスチャの左下隅を原点としますが、OpenGL は画像の左上隅を原点とします。この違いを考慮する簡単な方法は、他のペイントを行う前に、ペインターにカスタムビューポートを設定することです:
painter->setViewport(0, height(), width(), -height()); ...
[slot]
void QPaintedTextureImage::setHeight(int h)
テクスチャ画像の高さ (h) を設定します。サイズが変更されると、更新がトリガーされます。
注: プロパティheight のセッター関数です。
height()も参照してください 。
[slot]
void QPaintedTextureImage::setSize(QSize size)
テクスチャ画像の幅と高さを設定します。size が変更された場合、更新をトリガーします。
注: プロパティsize のセッター関数です。
size()も参照してください 。
[slot]
void QPaintedTextureImage::setWidth(int w)
テクスチャ画像の幅 (w) を設定します。サイズが変更されると、更新がトリガーされます。
注: プロパティwidth のセッター関数です。
width()も参照してください 。
void QPaintedTextureImage::update(const QRect &rect = QRect())
ペイントされたテクスチャのpaint() 関数を即座にトリガーし、新しい画像を GPU にアップロードします。ペイントされたテクスチャに複数の変更を加える場合は、必要な再描画の回数を最小限に抑えるために、すべての変更が完了するまで待ってから update を呼び出すことを検討してください。
パラメータrect は現在未使用です。
© 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.