forked from qt-creator/qt-creator
QmlDesigner: Remove unrequired event filter
This event filter was introduced because other wise actions in QML like CTRL+C or CTRL+UP were intercepted by QWidget::QAction. With Qt 6.2.x this workaround is not required anymore. Change-Id: I43a84ae13cca58840afacabe85c36c5f2235cf39 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -91,31 +91,4 @@ void Quick2PropertyEditorView::registerQmlTypes()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Quick2PropertyEditorView::event(QEvent *e)
|
|
||||||
{
|
|
||||||
static std::vector<QKeySequence> overrideSequences = { QKeySequence(Qt::SHIFT + Qt::Key_Up),
|
|
||||||
QKeySequence(Qt::SHIFT + Qt::Key_Down),
|
|
||||||
QKeySequence(Qt::CTRL + Qt::Key_Up),
|
|
||||||
QKeySequence(Qt::CTRL + Qt::Key_Down)
|
|
||||||
};
|
|
||||||
|
|
||||||
if (e->type() == QEvent::ShortcutOverride) {
|
|
||||||
auto keyEvent = static_cast<QKeyEvent *>(e);
|
|
||||||
|
|
||||||
static const Qt::KeyboardModifiers relevantModifiers = Qt::ShiftModifier
|
|
||||||
| Qt::ControlModifier
|
|
||||||
| Qt::AltModifier
|
|
||||||
| Qt::MetaModifier;
|
|
||||||
|
|
||||||
QKeySequence keySqeuence(keyEvent->key() | (keyEvent->modifiers() & relevantModifiers));
|
|
||||||
for (const QKeySequence &overrideSequence : overrideSequences)
|
|
||||||
if (keySqeuence.matches(overrideSequence)) {
|
|
||||||
keyEvent->accept();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return QQuickWidget::event(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
} //QmlDesigner
|
} //QmlDesigner
|
||||||
|
@@ -38,9 +38,6 @@ public:
|
|||||||
explicit Quick2PropertyEditorView(QWidget *parent = nullptr);
|
explicit Quick2PropertyEditorView(QWidget *parent = nullptr);
|
||||||
|
|
||||||
static void registerQmlTypes();
|
static void registerQmlTypes();
|
||||||
|
|
||||||
protected:
|
|
||||||
bool event(QEvent *e) override;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} //QmlDesigner
|
} //QmlDesigner
|
||||||
|
Reference in New Issue
Block a user