このページでは

QWaylandShellSurfaceTemplate Class

template <typename T> class QWaylandShellSurfaceTemplate

QWaylandShellSurfaceTemplate は、カスタムシェルサーフェスクラスを作成するための利便性向上のためのクラスです。詳細...

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

QWaylandIviSurface、QWaylandWlShellSurface 、およびQWaylandXdgSurface

静的パブリックメンバー

T *findIn(QWaylandObject *container)

詳細な説明

QWaylandShellSurfaceTemplate は、QWaylandShellSurface を継承するテンプレートクラスであり、カスタムシェル拡張機能を構築するための便利なクラスです。

このクラスは、拡張プロトコルの XML 記述に基づいて、Qt Wayland Compositor とqtwaylandscanner によって生成されたクラスとの接続を提供します。

具体的には、以下の 2 つの便利な機能を提供します。

  • QWaylandCompositorExtension::extensionInterface() の再実装。これは、qtwaylandscanner によって生成された基底クラスに対するwl_interface ポインタを返します。
  • 指定されたコンテナ内で拡張機能のインスタンスを検索し、見つかった場合にそれを返す静的関数 `findIn()`。

QWaylandCompositorExtensionTemplate と同様の使用パターンが適用され、T にはサブクラス自体が指定されます。

「カスタムシェル」も参照してください 。

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

[static] T *QWaylandShellSurfaceTemplate::findIn(QWaylandObject *container)

そのインターフェースのインスタンスがcontainer に登録されている場合、それが返されます。そうでない場合はnullが返されます。検索は、プロトコル記述内のインターフェース名と一致する、生成されたinterfaceName() に基づいて行われます。

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