forked from qt-creator/qt-creator
Core: Improve dialogParent() to work better with detached windows
Make new windows center on the window the user is currently looking at instead of the mainwindow. Change-Id: Ia6246a4f1935b6d2d66db329c6141f4cb8349916 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -488,7 +488,11 @@ QWidget *ICore::mainWindow()
|
||||
QWidget *ICore::dialogParent()
|
||||
{
|
||||
QWidget *active = QApplication::activeModalWidget();
|
||||
return active ? active : m_mainwindow;
|
||||
if (!active)
|
||||
active = QApplication::activeWindow();
|
||||
if (!active)
|
||||
active = m_mainwindow;
|
||||
return active;
|
||||
}
|
||||
|
||||
QStatusBar *ICore::statusBar()
|
||||
|
Reference in New Issue
Block a user