このページでは

QSGSimpleTextureNode Class

QSGSimpleTextureNode クラスは、QML シーングラフを使用してテクスチャ付きコンテンツを簡単に描画できるようにするための便宜的な機能として提供されています。詳細...

ヘッダー: #include <QSGSimpleTextureNode>
CMake: find_package(Qt6 REQUIRED COMPONENTS Quick)
target_link_libraries(mytarget PRIVATE Qt6::Quick)
qmake: QT += quick
継承元: QSGGeometryNode

パブリック型

enum TextureCoordinatesTransformFlag { NoTransform, MirrorHorizontally, MirrorVertically }
flags TextureCoordinatesTransformMode

パブリック関数

QSGSimpleTextureNode()
virtual ~QSGSimpleTextureNode() override
QSGTexture::Filtering filtering() const
bool ownsTexture() const
QRectF rect() const
void setFiltering(QSGTexture::Filtering filtering)
void setOwnsTexture(bool owns)
void setRect(const QRectF &r)
void setRect(qreal x, qreal y, qreal w, qreal h)
void setSourceRect(const QRectF &r)
void setSourceRect(qreal x, qreal y, qreal w, qreal h)
void setTexture(QSGTexture *texture)
void setTextureCoordinatesTransform(QSGSimpleTextureNode::TextureCoordinatesTransformMode mode)
QRectF sourceRect() const
QSGTexture *texture() const
QSGSimpleTextureNode::TextureCoordinatesTransformMode textureCoordinatesTransform() const

詳細な説明

警告: シンプルなテクスチャノードクラスは 、レンダリングのためにシーングラフに追加される前に、テクスチャを設定しておく必要があります。

警告:このユーティリティクラスは 、Qt Quick シーングラフのデフォルトまたはソフトウェアバックエンドで実行する場合にのみ機能します。代替手段として、QQuickWindow::createImageNode() を通じてQSGImageNode を使用することをお勧めします。ただし、サブクラス化して使用し、アプリケーションが特別なシーングラフバックエンドが関与しないことを認識している場合は、このスタンドアロンクラスも有用です。

メンバ型のドキュメント

enum QSGSimpleTextureNode::TextureCoordinatesTransformFlag
flags QSGSimpleTextureNode::TextureCoordinatesTransformMode

TextureCoordinatesTransformFlag 列挙型は、テクスチャが適用されたクワッドのテクスチャ座標を生成するために使用されるモードを指定するために使用されます。

定数値説明
QSGSimpleTextureNode::NoTransform0x00テクスチャ座標は、ウィンドウ座標、つまり左上を原点とする座標系で方向付けられます。
QSGSimpleTextureNode::MirrorHorizontally0x01テクスチャ座標は、ウィンドウ座標系に対して水平軸で反転されます。
QSGSimpleTextureNode::MirrorVertically0x02テクスチャ座標は、ウィンドウ座標系に対して垂直軸で反転しています。

TextureCoordinatesTransformMode 型は、QFlags<TextureCoordinatesTransformFlag> の typedef です。これは、TextureCoordinatesTransformFlag 値の OR 組み合わせを格納します。

メンバ関数のドキュメント

QSGSimpleTextureNode::QSGSimpleTextureNode()

新しいシンプルなテクスチャノードを作成します

[override virtual noexcept] QSGSimpleTextureNode::~QSGSimpleTextureNode()

テクスチャノードを削除します

QSGTexture::Filtering QSGSimpleTextureNode::filtering() const

このテクスチャノードに現在設定されているフィルタリング情報を返します

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

bool QSGSimpleTextureNode::ownsTexture() const

ノードがテクスチャの所有権を取得した場合は `true ` を返し、そうでない場合は `false` を返します。

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

QRectF QSGSimpleTextureNode::rect() const

このテクスチャノードのターゲット矩形を返します。

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

void QSGSimpleTextureNode::setFiltering(QSGTexture::Filtering filtering)

このテクスチャノードで使用するフィルタリングを「filtering 」に設定します。

滑らかなスケーリングを行うには `QSGTexture::Linear` を使用し、通常のスケーリングを行うには `QSGTexture::Nearest` を使用します。

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

void QSGSimpleTextureNode::setOwnsTexture(bool owns)

ノードがテクスチャの所有権を取得するかどうかをowns に設定します。

デフォルトでは、ノードはテクスチャの所有権を取得しません。

ownsTexture() およびsetTexture()も参照してください 。

void QSGSimpleTextureNode::setRect(const QRectF &r)

このテクスチャノードのターゲット矩形を `r` に設定します。

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

void QSGSimpleTextureNode::setRect(qreal x, qreal y, qreal w, qreal h)

このテクスチャノードの矩形を、(x,y) から始まり、幅がw 、高さがh になるように設定します。

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

void QSGSimpleTextureNode::setSourceRect(const QRectF &r)

このテクスチャノードのソース矩形を `r` に設定します。

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

void QSGSimpleTextureNode::setSourceRect(qreal x, qreal y, qreal w, qreal h)

このテクスチャノードの矩形領域を設定し、(x,y) からのテクスチャを表示するようにします。また、QSGTexture::textureSize に対する相対位置として、幅をw 、高さをh に設定します。

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

void QSGSimpleTextureNode::setTexture(QSGTexture *texture)

このテクスチャノードのテクスチャを `texture` に設定します。

setOwnsTexture() を使用して、ノードがテクスチャの所有権を取得するかどうかを設定します。デフォルトでは、ノードは所有権を取得しません。

警告: テクスチャノードは 、レンダリングのためにシーングラフに追加される前に、テクスチャを保持している必要があります。

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

void QSGSimpleTextureNode::setTextureCoordinatesTransform(QSGSimpleTextureNode::TextureCoordinatesTransformMode mode)

テクスチャ座標の生成に使用するメソッドを `mode` に設定します。これにより、テクスチャの正しい向きを取得できます。OpenGLではQt Quick と比較してY軸が反転しているため、サードパーティ製のOpenGLライブラリを使用してテクスチャへのレンダリングを行う場合、一般的にこの設定が必要となります。

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

QRectF QSGSimpleTextureNode::sourceRect() const

このテクスチャノードのソース矩形を返します。

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

QSGTexture *QSGSimpleTextureNode::texture() const

このテクスチャノードのテクスチャを返します

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

QSGSimpleTextureNode::TextureCoordinatesTransformMode QSGSimpleTextureNode::textureCoordinatesTransform() const

このノードのテクスチャ座標を生成するために使用されるモードを返します。

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

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