QWaylandView Class
QWaylandView クラスは、出力上のサーフェスのビューを表します。詳細...
| ヘッダー: | #include <QWaylandView> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor) target_link_libraries(mytarget PRIVATE Qt6::WaylandCompositor) |
| qmake: | QT += waylandcompositor |
| 継承元: | QObject |
プロパティ
- allowDiscardFrontBuffer : bool
- bufferLocked : bool
- output : QWaylandOutput*
- surface : QWaylandSurface*
パブリック関数
| QWaylandView(QObject *renderObject = nullptr, QObject *parent = nullptr) | |
| virtual | ~QWaylandView() override |
| virtual bool | advance() |
| bool | allowDiscardFrontBuffer() const |
| virtual void | bufferCommitted(const QWaylandBufferRef &buffer, const QRegion &damage) |
| virtual QWaylandBufferRef | currentBuffer() |
| virtual QRegion | currentDamage() |
| virtual void | discardCurrentBuffer() |
| bool | isBufferLocked() const |
| bool | isPrimary() const |
| QWaylandOutput * | output() const |
| void | setAllowDiscardFrontBuffer(bool discard) |
| void | setBufferLocked(bool locked) |
| void | setOutput(QWaylandOutput *output) |
| void | setPrimary() |
| void | setSurface(QWaylandSurface *surface) |
| QWaylandSurface * | surface() const |
| struct wl_resource * | surfaceResource() const |
シグナル
| void | allowDiscardFrontBufferChanged() |
| void | bufferLockedChanged() |
| void | outputChanged() |
| void | surfaceChanged() |
詳細な説明
QWaylandView は、特定の出力先におけるサーフェスの表示に対応しており、レンダリングされる内容を含むバッファを管理します。同じサーフェスに対して複数のビューを設定することができます。
プロパティのドキュメント
allowDiscardFrontBuffer : bool
デフォルトでは、ビューはadvance()が呼び出されるまで現在のバッファをロックします。このプロパティをtrue に設定すると、プライマリビューがバッファを使用しなくなった時点で、Qtがバッファを解放できるようになります。
これにより、更新頻度の低いセカンダリビューによってクライアントアプリケーションのフレームレートが低下してしまう状況を回避できます。
アクセス関数:
| bool | allowDiscardFrontBuffer() const |
| void | setAllowDiscardFrontBuffer(bool discard) |
Notifierシグナル:
| void | allowDiscardFrontBufferChanged() |
bufferLocked : bool
このプロパティは、ビューのバッファが現在ロックされているかどうかを示します。バッファがロックされている場合、advance() は次のバッファに進まず、false を返します。
デフォルト値は `false` です。
アクセス関数:
| bool | isBufferLocked() const |
| void | setBufferLocked(bool locked) |
通知シグナル:
| void | bufferLockedChanged() |
output : QWaylandOutput*
このプロパティには、このビューがその表面を表示する出力先が格納されます。
アクセス関数:
| QWaylandOutput * | output() const |
| void | setOutput(QWaylandOutput *output) |
通知シグナル:
| void | outputChanged() |
surface : QWaylandSurface*
このプロパティには、このQWaylandView が認識している表面が格納されています。
アクセス関数:
| QWaylandSurface * | surface() const |
| void | setSurface(QWaylandSurface *surface) |
通知シグナル:
| void | surfaceChanged() |
メンバ関数のドキュメント
QWaylandView::QWaylandView(QObject *renderObject = nullptr, QObject *parent = nullptr)
指定されたrenderObject およびparent を使用して、QWaylandViewを構築します。
[override virtual noexcept] QWaylandView::~QWaylandView()
QWaylandView を削除します。
[virtual] bool QWaylandView::advance()
現在のバッファとダメージ領域を、クライアントによってコミットされた最新の状態に更新します。前回の advance() の呼び出し以降に新しいコンテンツがコミットされていた場合は true を返します。それ以外の場合は false を返します。
currentBuffer() およびcurrentDamage()も参照してください 。
[virtual] void QWaylandView::bufferCommitted(const QWaylandBufferRef &buffer, const QRegion &damage)
この関数は、新しいbuffer がこのビューのサーフェスにコミットされたときに呼び出されます。damage には、現在のバッファとは異なる領域、つまり更新が必要な領域が含まれています。新しいbuffer は、次にadvance()が呼び出された際に現在のバッファとなります。
この関数を再実装するサブクラスは、基底クラスの実装を呼び出す必要があります。
[virtual] QWaylandBufferRef QWaylandView::currentBuffer()
このビューの現在のバッファへの参照を返します。
[virtual] QRegion QWaylandView::currentDamage()
このビューの現在のダメージ領域を返します。
[virtual] void QWaylandView::discardCurrentBuffer()
ビューに現在のバッファを破棄させ、クライアント側で再利用できるようにします。
bool QWaylandView::isPrimary() const
このQWaylandView が、QWaylandSurface
「QWaylandSurface::primaryView」も参照してください 。
void QWaylandView::setPrimary()
このQWaylandView をサーフェスのプライマリビューに設定します。
このQWaylandView にデータが含まれていない場合、この設定は効果を持ちません。QWaylandSurface
isPrimary() およびQWaylandSurface::primaryViewも参照してください 。
struct wl_resource *QWaylandView::surfaceResource() const
このQWaylandView に対応するWaylandサーフェスリソースを返します。
© 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.