Commit 178bf93d authored by hjk's avatar hjk

Core: Add ICore::dialogParent() specific for use as dialog parent

Change-Id: I72dca0f95b418a32ac3859f086053f91b9e9ec67
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
parent 54340fd1
......@@ -33,6 +33,7 @@
#include <extensionsystem/pluginmanager.h>
#include <QSysInfo>
#include <QApplication>
/*!
\namespace Core
......@@ -170,9 +171,15 @@
Returns the main application window.
For use as dialog parent, and so on.
For dialog parents use \c dialogParent().
*/
/*!
\fn QWidget *ICore::dialogParent()
Returns a widget pointer suitable to use as parent for QDialogs.
*/
/*!
\fn IContext *ICore::currentContextObject()
......@@ -451,6 +458,12 @@ QWidget *ICore::mainWindow()
return m_mainwindow;
}
QWidget *ICore::dialogParent()
{
QWidget *active = QApplication::activeModalWidget();
return active ? active : m_mainwindow;
}
QStatusBar *ICore::statusBar()
{
return m_mainwindow->statusBar();
......
......@@ -94,6 +94,7 @@ public:
static QString buildCompatibilityString();
static QWidget *mainWindow();
static QWidget *dialogParent();
static QStatusBar *statusBar();
/* Raises and activates the window for the widget. This contains workarounds for X11. */
static void raiseWindow(QWidget *widget);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment