このページでは

QWaylandSurface Class

QWaylandSurface クラスは、出力デバイス上の長方形の領域を表します。詳細...

ヘッダー: #include <QWaylandSurface>
CMake: find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor)
target_link_libraries(mytarget PRIVATE Qt6::WaylandCompositor)
qmake: QT += waylandcompositor
QML内: WaylandSurface
継承元: QWaylandObject

パブリック型

enum Origin { OriginTopLeft, OriginBottomLeft }

プロパティ

パブリック関数

QWaylandSurface()
QWaylandSurface(QWaylandCompositor *compositor, QWaylandClient *client, uint id, int version)
virtual ~QWaylandSurface() override
int bufferScale() const
QSize bufferSize() const
QWaylandClient *client() const
QWaylandCompositor *compositor() const
Qt::ScreenOrientation contentOrientation() const
QSize destinationSize() const
void destroy()
void frameStarted()
bool hasContent() const
bool inhibitsIdle() const
void initialize(QWaylandCompositor *compositor, QWaylandClient *client, uint id, int version)
bool inputRegionContains(const QPoint &p) const
bool inputRegionContains(const QPointF &position) const
bool isCursorSurface() const
bool isDestroyed() const
bool isInitialized() const
bool isOpaque() const
void markAsCursorSurface(bool cursorSurface)
QWaylandSurface::Origin origin() const
QWaylandView *primaryView() const
struct wl_resource *resource() const
void sendFrameCallbacks()
void setPrimaryView(QWaylandView *view)
bool setRole(QWaylandSurfaceRole *role, wl_resource *errorResource, uint32_t errorCode)
QRectF sourceGeometry() const
QList<QWaylandView *> views() const
wl_client *waylandClient() const

パブリックスロット

シグナル

静的パブリックメンバー

QWaylandSurface *fromResource(wl_resource *resource)

詳細な説明

このクラスは、出力デバイスに表示されるピクセルの矩形領域をカプセル化します。これは、Waylandプロトコルにおけるwl_surface インターフェースに対応しています。

メンバ型のドキュメント

enum QWaylandSurface::Origin

この列挙型は、QWaylandSurface のバッファの起源を指定するために使用されます。

定数定数値説明
QWaylandSurface::OriginTopLeft0原点は、バッファの左上隅です。
QWaylandSurface::OriginBottomLeft1原点は、バッファの左下隅です。

プロパティのドキュメント

[read-only] bufferScale : int

このプロパティは、QWaylandSurface のバッファスケールを保持します。バッファスケールを使用すると、クライアントは高解像度出力で使用する高解像度のバッファデータを指定することができます。

アクセス関数:

int bufferScale() const

通知信号:

void bufferScaleChanged()

[read-only] bufferSize : QSize

このプロパティは、このQWaylandSurface の現在のバッファのサイズを、サーフェス座標ではなくピクセル単位で保持します。

サーフェス座標でのサイズを取得するには、代わりにdestinationSize を使用してください。

アクセス関数:

QSize bufferSize() const

通知シグナル:

void bufferSizeChanged()

関連項目: ` destinationSize ` および `bufferScale`。

[read-only] client : QWaylandClient* const

このプロパティには、この `QWaylandSurface` を使用しているクライアントが格納されます。

アクセス関数:

QWaylandClient *client() const

[read-only] contentOrientation : Qt::ScreenOrientation

このプロパティは、QWaylandSurface のコンテンツの向きを保持します。

アクセス関数:

Qt::ScreenOrientation contentOrientation() const

通知シグナル:

void contentOrientationChanged()

「QWaylandOutput::transform」も参照してください 。

cursorSurface : bool

このプロパティは、QWaylandSurface がカーソルサーフェスであるかどうかを示します。

アクセス関数:

bool isCursorSurface() const
void markAsCursorSurface(bool cursorSurface)

通知シグナル:

void cursorSurfaceChanged()

[read-only] destinationSize : QSize

このプロパティは、このWaylandSurface の表面座標系におけるサイズを保持します。

アクセス関数:

QSize destinationSize() const

通知シグナル:

void destinationSizeChanged()

関連項目: bufferScale およびbufferSize 。

[read-only] hasContent : bool

このプロパティは、そのサーフェスが現在、確定済みでNULLではないバッファを持っているかどうかを表します。

アクセス関数:

bool hasContent() const

通知シグナル:

void hasContentChanged()

関連項目: QWaylandSurface::bufferSize 。

[read-only] inhibitsIdle : bool

このプロパティは、このサーフェスが、画面の消灯、ロック、スクリーンセーバーなどのコンポジターのアイドル動作を抑制するよう意図されているかどうかを示します。

アクセス関数:

bool inhibitsIdle() const

通知シグナル:

void inhibitsIdleChanged()

関連項目: QWaylandIdleInhibitManagerV1 。

[read-only, since 6.4] isOpaque : bool

このプロパティは、set_opaque_region リクエストを通じてクライアントから報告されたとおり、サーフェスが完全に不透明であるかどうかにかかわらず保持されます。

この列挙型は Qt 6.4 で導入されました。

アクセス関数:

bool isOpaque() const

Notifierシグナル:

void isOpaqueChanged()

[read-only] origin : QWaylandSurface::Origin

このプロパティには、QWaylandSurface のバッファの原点が格納されます。サーフェスにバッファがない場合は、QWaylandSurface::OriginTopLeft が格納されます。

アクセス関数:

QWaylandSurface::Origin origin() const

通知シグナル:

void originChanged()

[read-only] sourceGeometry : QRectF

このプロパティは、画面上に描画されるべき、添付されたQWaylandBufferの一部を指定します。座標はバッファの隅を起点としており、bufferScale によってスケーリングされます。

アクセス関数:

QRectF sourceGeometry() const

通知シグナル:

void sourceGeometryChanged()

関連項目: bufferScale 、bufferSize 、およびdestinationSize 。

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

QWaylandSurface::QWaylandSurface()

初期化されていない QWaylandSurface を生成します。

QWaylandSurface::QWaylandSurface(QWaylandCompositor *compositor, QWaylandClient *client, uint id, int version)

指定されたcompositor およびclient に基づき、指定されたid およびversion を使用して、QWaylandSurfaceを構築し、初期化します。

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

QWaylandSurface を破棄します。

[signal] void QWaylandSurface::childAdded(QWaylandSurface *child)

このシグナルは、wl_subsurface(child )がサーフェスに追加されたときに発火します。

QWaylandCompositor *QWaylandSurface::compositor() const

このQWaylandSurface のコンポジターを返します。

[invokable] void QWaylandSurface::destroy()

QWaylandSurface を破棄します。

注:この関数は 、メタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

[signal] void QWaylandSurface::dragStarted(QWaylandDrag *drag)

この信号は、drag がこの表面から発進した際に発信されます。

[invokable] void QWaylandSurface::frameStarted()

送信するためのすべてのフレームコールバックを準備します。

注:この関数は 、メタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

[static] QWaylandSurface *QWaylandSurface::fromResource(wl_resource *resource)

Waylandリソース「resource 」に対応するQWaylandSurface を返します。

[invokable] void QWaylandSurface::initialize(QWaylandCompositor *compositor, QWaylandClient *client, uint id, int version)

指定されたcompositor およびclient 、ならびに指定されたid およびversion を用いて、QWaylandSurface を初期化します。

注:この関数は 、メタオブジェクトシステムを介して、およびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

bool QWaylandSurface::inputRegionContains(const QPoint &p) const

QWaylandSurface の入力領域に点p が含まれている場合、true を返します。それ以外の場合は、false を返します。

bool QWaylandSurface::inputRegionContains(const QPointF &position) const

QWaylandSurface の入力領域に点position が含まれている場合は、true を返します。そうでない場合は、false を返します。

[invokable] bool QWaylandSurface::isDestroyed() const

QWaylandSurface が破棄されている場合はtrueを返します。そうでない場合はfalseを返します。

注:この関数は 、メタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

bool QWaylandSurface::isInitialized() const

QWaylandSurface が初期化されている場合、trueを返します。

QWaylandView *QWaylandSurface::primaryView() const

このQWaylandSurface のプライマリビューを返します。

QWaylandView::advance() およびQWaylandSurface::setPrimaryView()も参照してください 。

struct wl_resource *QWaylandSurface::resource() const

この `QWaylandSurface` に対応する Wayland リソースを返します。

[invokable] void QWaylandSurface::sendFrameCallbacks()

保留中のフレームのコールバックを送信します。

注:この関数は 、メタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

void QWaylandSurface::setPrimaryView(QWaylandView *view)

このQWaylandSurface のプライマリビューをview に設定します(このサーフェスに複数のビューが存在する場合)。プライマリビューとは、クライアントのリフレッシュレートを制御するビューのことです。QWaylandView::advance()が呼び出された際に、バッファ参照の破棄を処理します。詳細については、QWaylandView::advance()のドキュメントを参照してください。

QWaylandWlShellIntegration や QWaylandXdgShellV5Integration などのシェルサーフェス統合では、クライアントからの最大化および全画面表示のリクエストは、その統合がサーフェスのプライマリビューである場合にのみ有効になります。

primaryView() およびQWaylandView::advance()も参照してください 。

bool QWaylandSurface::setRole(QWaylandSurfaceRole *role, wl_resource *errorResource, uint32_t errorCode)

サーフェスにrole を設定します。 roleは、サーフェスが画面上にどのようにマッピングされるかを定義します。roleが設定されていない場合、そのサーフェスは非表示とみなされます。サーフェスにroleが割り当てられると、それがそのサーフェスの恒久的なroleとなります。その後、異なるroleを指定してsetRole() を呼び出すと、errorResource に対してプロトコルエラーが発生し、クライアントにerrorCode が送信されます。この要件を強制することが、サーフェスのroleの主な目的です。

`role ` はポインタ値によって比較されます。名前にかかわらず、QWaylandSurfaceRole の 2 つのオブジェクトはすべて異なるロールと見なされます。

surface ロールは、例えばシェル拡張などで、特定の目的のためにサーフェスが採用される際に、プロトコル実装によって内部的に設定されます。この方法でサーフェスを使用する拡張機能を開発している場合を除き、この関数を呼び出してはなりません。

ロールの割り当てが可能であれば true を返し、そうでない場合は false を返します。

[signal] void QWaylandSurface::surfaceDestroyed()

このシグナルは、対応する wl_surface が破棄されたときに発生します。

[slot] void QWaylandSurface::updateSelection()

コンポジターがクリップボードに保持している選択範囲でサーフェスを更新します。サーフェスがキーボードフォーカスを受けると自動的にこの処理が行われますが、この関数は、キーボードフォーカスを持っていないクライアントを更新する際に役立ちます。

QList<QWaylandView *> QWaylandSurface::views() const

このQWaylandSurface のビューを返します。

wl_client *QWaylandSurface::waylandClient() const

このQWaylandSurface を使用して、wl_client を保持します。

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