QWaylandQuickShellIntegration Class
QtQuick とのシェル・サーフェス統合のサポートを提供します。詳細...
ヘッダー | #include <QWaylandQuickShellIntegration> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor) target_link_libraries(mytarget PRIVATE Qt6::WaylandCompositor) |
qmake: | QT += waylandcompositor |
を継承する: | QObject |
詳細説明
シェルサーフェスとQtQuick を統合するために、シェルサーフェスの実装はこのクラスを継承する必要があります。
シェル統合は、QWaylandQuickShellSurfaceItem のイベントフィルターとしてインストールされます。 イベントフィルターメソッドを再実装し、イベントをフィルターアウトしたい場合はtrue
を返し、そうでない場合はfalse
を返します。
例
classMyShellIntegration :public QWaylandQuickShellIntegration{ Q_OBJECTpublic: MyShellIntegration().QObject*parent =nullptr);protected:booleventFilter(QObject*オブジェクト、 QEvent*イベント) オーバーライド; }; MyShellIntegration::MyShellIntegration(QObject*親) :QWaylandQuickShellIntegration(parent) { }boolMyShellIntegration::eventFilter(QObject*オブジェクト、 QEvent*イベント) QWaylandQuickShellSurfaceItem*shellSurfaceItem = qobject_cast<QWaylandQuickShellSurfaceItem*>(object);if(!shellSurfaceItem)return QWaylandQuickShellIntegration::eventFilter(object,event);if(event->type()==QEvent::MouseMove) { if (event->type() == MouseMove) QMouseEvent*mouseEvent = static_cast<QMouseEvent*>( event->type() == ::MouseMove) {*mouseEvent= static_cast< qDebug() << "Mouse moved on" << shellSurfaceItem << "pos:" << mouseEvent->pos(); return true; }return QWaylandQuickShellIntegration::eventFilter(object,event); }
QWaylandQuickShellSurfaceItem およびQObject::eventFilter()も参照してください 。
© 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.