QWaylandCompositorExtensionTemplate Class
template <typename T> class QWaylandCompositorExtensionTemplateQWaylandCompositorExtensionTemplate は、QWaylandCompositorExtension をサブクラス化する際に便利なクラスです。詳細...
| ヘッダー: | #include <QWaylandCompositorExtensionTemplate> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor) target_link_libraries(mytarget PRIVATE Qt6::WaylandCompositor) |
| qmake: | QT += waylandcompositor |
| 継承元: | QWaylandCompositorExtension |
| 継承元: | QWaylandIdleInhibitManagerV1、QWaylandIviApplication 、QWaylandQtTextInputMethodManager 、QWaylandTextInputManager 、QWaylandViewporter 、QWaylandXdgDecorationManagerV1 、およびQWaylandXdgOutputManagerV1 |
静的パブリックメンバー
| T * | findIn(QWaylandObject *container) |
詳細な説明
QWaylandCompositorExtensionTemplate は、QWaylandCompositorExtension を継承するテンプレートクラスであり、Qt を使用してカスタム Wayland 拡張機能を構築するための便利なクラスです。
このクラスは、拡張プロトコルの XML 記述に基づいて、Qt Wayland Compositor と、qtwaylandscanner によって生成されたクラスとの接続を提供します。
具体的には、以下の2つの便利な機能を提供します。
- QWaylandCompositorExtension::extensionInterface() の再実装。これは、qtwaylandscanner によって生成された基底クラスに対する
wl_interfaceポインタを返します。 - 指定されたコンテナ内で拡張機能のインスタンスを検索し、見つかった場合はそれを返す静的な `findIn()` 関数。
通常、新しい拡張機能は、`QWaylandCompositorExtensionTemplate` と `qtwaylandscanner` によって生成されたクラスを二重継承します。
QWaylandCompositorExtensionTemplate は、T をサブクラス自体としてパラメータ化する必要があります。
class MyExtension
: public QWaylandCompositorExtensionTemplate<MyExtension>
, QtWaylandServer::my_extensionこの例では、MyExtension は、生成されたインターフェースmy_extension の実装です。
「カスタムシェル」も参照してください 。
メンバ関数のドキュメント
[static] T *QWaylandCompositorExtensionTemplate::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.