mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-01-13 08:40:26 +08:00
Fixed escape key press detection
This commit is contained in:
parent
8cc9cc25ad
commit
34cb2ae917
@ -206,6 +206,11 @@ CFloatingDragPreview::CFloatingDragPreview(QWidget* Content, QWidget* parent) :
|
|||||||
|
|
||||||
connect(qApp, SIGNAL(applicationStateChanged(Qt::ApplicationState)),
|
connect(qApp, SIGNAL(applicationStateChanged(Qt::ApplicationState)),
|
||||||
SLOT(onApplicationStateChanged(Qt::ApplicationState)));
|
SLOT(onApplicationStateChanged(Qt::ApplicationState)));
|
||||||
|
|
||||||
|
// The focused object will receive key press events and therefore we
|
||||||
|
// install the event filter on it to receive escape key press for drag
|
||||||
|
// canceling
|
||||||
|
qApp->focusObject()->installEventFilter(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -220,10 +225,6 @@ CFloatingDragPreview::CFloatingDragPreview(CDockWidget* Content)
|
|||||||
d->ContenSourceContainer = Content->dockContainer();
|
d->ContenSourceContainer = Content->dockContainer();
|
||||||
}
|
}
|
||||||
setWindowTitle(Content->windowTitle());
|
setWindowTitle(Content->windowTitle());
|
||||||
|
|
||||||
// We need to install an event filter for the given Content
|
|
||||||
// widget to receive the escape key press
|
|
||||||
Content->dockAreaWidget()->installEventFilter(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -235,10 +236,6 @@ CFloatingDragPreview::CFloatingDragPreview(CDockAreaWidget* Content)
|
|||||||
d->ContentSourceArea = Content;
|
d->ContentSourceArea = Content;
|
||||||
d->ContenSourceContainer = Content->dockContainer();
|
d->ContenSourceContainer = Content->dockContainer();
|
||||||
setWindowTitle(Content->currentDockWidget()->windowTitle());
|
setWindowTitle(Content->currentDockWidget()->windowTitle());
|
||||||
|
|
||||||
// We need to install an event filter for the given Content
|
|
||||||
// widget to receive the escape key press
|
|
||||||
Content->installEventFilter(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -395,7 +392,6 @@ bool CFloatingDragPreview::eventFilter(QObject *watched, QEvent *event)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace ads
|
} // namespace ads
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user