class PageGroupHandler: public QQuickWidget
{
Q_OBJECT
public:
PageGroupHandler();
protected:
bool eventFilter(QObject *obj, QEvent *event);
};
PageGroupHandler::PageGroupHandler()
: QQuickWidget(QUrl("qrc:/custom/qml/PagesGroups/PageManager.qml"))
{
this->installEventFilter(this);
}
bool PageGroupHandler::eventFilter(QObject *obj, QEvent *event)
{
if (obj == this || obj->parent() == this) {
return QObject::eventFilter(obj, event);
}
return true;
}
NOTE: There is no error. I have loaded a qml component, it has some rectangle components, some have mouse event some does not, so when i scroll on it the events works but when there is no scroll area the parent which itself is an scrollarea starts scrolling, its pretty weird.
As I understand when you move mouse, you get that event on most child widget first. So you can just override specific event (e.g. CustomWidget::mouseMoveEvent...) in child widget and NOT call parent implementation (e.g. QWidget::mouseMoveEvent) and parent widget does not receive that event.