forked from qt-creator/qt-creator
Disable showing/hiding magnifier by pressing Alt modifier
The Alt modifier doesn't work well with mouse wheel as it causes the horizontal wheel to be triggered. Disable the Alt modifier as a shortcut for activating the Magnifier. When Magnifier is shown by activating the toolbar action, the magnification works by simple mouse wheel without any modifier. Fixes: QTCREATORBUG-25612 Change-Id: Idb7c40dbf92ed135a796c9623cc46b6b1e80e9e6 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -168,14 +168,12 @@ QImage GraphicsView::grabView()
|
||||
void GraphicsView::keyReleaseEvent(QKeyEvent *event)
|
||||
{
|
||||
emit panningChanged(event->modifiers() == Qt::ShiftModifier);
|
||||
emit magnifierChanged(event->modifiers() == Qt::AltModifier);
|
||||
QGraphicsView::keyReleaseEvent(event);
|
||||
}
|
||||
|
||||
void GraphicsView::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
emit panningChanged(event->modifiers() == Qt::ShiftModifier);
|
||||
emit magnifierChanged(event->modifiers() == Qt::AltModifier);
|
||||
QGraphicsView::keyPressEvent(event);
|
||||
}
|
||||
|
||||
|
@@ -104,10 +104,6 @@ void Magnifier::wheelEvent(QWheelEvent *e)
|
||||
|
||||
bool Magnifier::eventFilter(QObject * /*obj*/, QEvent *event)
|
||||
{
|
||||
if (event->type() == QEvent::KeyRelease
|
||||
&& static_cast<QKeyEvent *>(event)->key() == Qt::Key_Alt) {
|
||||
setVisible(false);
|
||||
}
|
||||
if (event->type() == QEvent::ApplicationStateChange
|
||||
&& QGuiApplication::applicationState() != Qt::ApplicationActive) {
|
||||
setVisible(false);
|
||||
|
@@ -47,7 +47,7 @@ ActionHandler::ActionHandler(QObject *parent)
|
||||
{Utils::Icons::FITTOVIEW_TOOLBAR, tr("Fit to View"), tr("Fit to View (F11)"), "F11", false},
|
||||
{Utils::Icons::PAN_TOOLBAR, tr("Panning"), tr("Panning (Shift)"), "Shift", true},
|
||||
|
||||
{Utils::Icons::ZOOM_TOOLBAR, tr("Magnifier"), tr("Magnifier Tool (Alt)"), "Alt", true},
|
||||
{Utils::Icons::ZOOM_TOOLBAR, tr("Magnifier"), tr("Magnifier Tool"), "", true},
|
||||
{Utils::Icon(":/scxmleditor/images/navigator.png"), tr("Navigator"), tr("Navigator (Ctrl+E)"), "Ctrl+E", true},
|
||||
|
||||
{Utils::Icons::COPY_TOOLBAR, tr("Copy"), tr("Copy (Ctrl + C)"), "Ctrl+C", false},
|
||||
|
Reference in New Issue
Block a user