En esta página

QWaylandQuickShellIntegration Class

Proporciona soporte para la integración de la superficie de la cáscara con QtQuick. Más...

Cabecera: #include <QWaylandQuickShellIntegration>
CMake: find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor)
target_link_libraries(mytarget PRIVATE Qt6::WaylandCompositor)
qmake: QT += waylandcompositor
Hereda: QObject

Descripción detallada

Las implementaciones de la superficie de la cáscara deben heredar de esta clase para proporcionar una integración entre la superficie de la cáscara y QtQuick.

La integración de Shell se instala como un filtro de eventos para un QWaylandQuickShellSurfaceItem. Reimplemente el método de filtro de eventos y devuelva true cuando desee filtrar el evento, de lo contrario devuelva false.

Ejemplo:

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

Véase también QWaylandQuickShellSurfaceItem y QObject::eventFilter().

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