QWaylandQuickShellIntegration Class

QtQuick 와의 셸 표면 통합을 지원합니다. 더 보기...

Header: #include <QWaylandQuickShellIntegration>
CMake: find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor)
target_link_libraries(mytarget PRIVATE Qt6::WaylandCompositor)
qmake: QT += waylandcompositor
상속합니다: QObject

자세한 설명

셸 표면 구현은 셸 표면과 QtQuick 사이의 통합을 제공하기 위해 이 클래스를 상속해야 합니다.

셸 통합은 QWaylandQuickShellSurfaceItem 에 대한 이벤트 필터로 설치됩니다. 이벤트 필터 메서드를 다시 구현하고 이벤트를 필터링하려는 경우 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.

예제:

MyShellIntegration 클래스: public QWaylandQuickShellIntegration{ Q_OBJECTpublic: MyShellIntegration(QObject *parent = nullptr);protected: bool eventFilter(QObject*object, QEvent *event) override; }; MyShellIntegration::MyShellIntegration(QObject *부모) : QWaylandQuickShellIntegration(parent) { }bool MyShellIntegration::eventFilter(QObject*object, QEvent *event) { QWaylandQuickShellSurfaceItem *shellSurfaceItem =  qobject_cast<QWaylandQuickShellSurfaceItem *>(object); if (!shellSurfaceItem) return QWaylandQuickShellIntegration::eventFilter(object, event); if (event->type()==. QEvent::MouseMove) { QMouseEvent *mouseEvent =  static_cast<QMouseEvent *>(event);        qDebug() << "Mouse moved on" << shellSurfaceItem << "pos:" << mouseEvent->pos();
       return true; } return QWaylandQuickShellIntegration::eventFilter(object, event); }

QWaylandQuickShellSurfaceItemQObject::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.