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, , , , , , およびQWaylandPresentationTime QWaylandQtTextInputMethodManager QWaylandTextInputManager QWaylandViewporter QWaylandXdgDecorationManagerV1 QWaylandXdgOutputManagerV1 |
静的パブリックメンバー
T * | findIn(QWaylandObject *container) |
詳細説明
QWaylandCompositorExtensionTemplateはQWaylandCompositorExtension を継承したテンプレートクラスで、QtでカスタムWayland拡張機能を構築するための便利なものです。
拡張プロトコルのXML記述に基づき、Qt Wayland Compositor と、qtwaylandscanner
によって生成されるクラスとの接続を提供します。
具体的には2つの利便性を提供します:
- qtwaylandscanner が生成した基底クラスへの
wl_interface
ポインタを返すQWaylandCompositorExtension::extensionInterface() の再実装。 - 提供されたコンテナで拡張機能のインスタンスを検索し、見つかったらこれを返す静的なfindIn() 関数。
通常、新しい拡張機能は QWaylandCompositorExtensionTemplate とqtwaylandscanner
によって生成されたクラスを継承します。
QWaylandCompositorExtensionTemplate はサブクラスをパラメータ化する必要があります:
class MyExtension : public QWaylandCompositorExtensionTemplate<MyExtension> , QtWaylandServer::my_extension
この例では、MyExtension
は生成されたインターフェースmy_extension
の実装です。
Custom Shellも参照してください 。
メンバ関数ドキュメント
[static]
T *QWaylandCompositorExtensionTemplate::findIn(QWaylandObject *container)
インタフェースのインスタンスがcontainer に登録されていれば、これが返される。そうでなければnullが返される。ルックアップは、生成されたinterfaceName()
、プロトコル記述のインターフェイス名にマッチするものに基づいて行われる。
© 2025 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.