Added QGuiApplication::activeWindow().
parent
d8d6bfb81e
commit
af4e5576f4
|
|
@ -108,6 +108,7 @@ QClipboard *QGuiApplicationPrivate::qt_clipboard = 0;
|
|||
#endif
|
||||
|
||||
QWindowList QGuiApplicationPrivate::window_list;
|
||||
QWindow *QGuiApplicationPrivate::active_window = 0;
|
||||
|
||||
Q_GLOBAL_STATIC(QMutex, applicationFontMutex)
|
||||
QFont *QGuiApplicationPrivate::app_font = 0;
|
||||
|
|
@ -172,6 +173,11 @@ QGuiApplicationPrivate::QGuiApplicationPrivate(int &argc, char **argv, int flags
|
|||
self = this;
|
||||
}
|
||||
|
||||
QWindow *QGuiApplication::activeWindow()
|
||||
{
|
||||
return QGuiApplicationPrivate::active_window;
|
||||
}
|
||||
|
||||
QWindowList QGuiApplication::topLevelWindows()
|
||||
{
|
||||
return QGuiApplicationPrivate::window_list;
|
||||
|
|
@ -553,9 +559,9 @@ void QGuiApplicationPrivate::processLeaveEvent(QWindowSystemInterfacePrivate::Le
|
|||
QCoreApplication::sendSpontaneousEvent(e->leave.data(), &event);
|
||||
}
|
||||
|
||||
void QGuiApplicationPrivate::processActivatedEvent(QWindowSystemInterfacePrivate::ActivatedWindowEvent *)
|
||||
void QGuiApplicationPrivate::processActivatedEvent(QWindowSystemInterfacePrivate::ActivatedWindowEvent *e)
|
||||
{
|
||||
// QGuiApplication::setActiveWindow(e->activated.data());
|
||||
QGuiApplicationPrivate::active_window = e->activated.data();
|
||||
}
|
||||
|
||||
void QGuiApplicationPrivate::processGeometryChangeEvent(QWindowSystemInterfacePrivate::GeometryChangeEvent *e)
|
||||
|
|
|
|||
|
|
@ -81,6 +81,8 @@ public:
|
|||
|
||||
static QWindowList topLevelWindows();
|
||||
|
||||
static QWindow *activeWindow();
|
||||
|
||||
#ifndef QT_NO_CURSOR
|
||||
static QCursor *overrideCursor();
|
||||
static void setOverrideCursor(const QCursor &);
|
||||
|
|
|
|||
|
|
@ -150,6 +150,7 @@ public:
|
|||
static QPalette *app_pal;
|
||||
|
||||
static QWindowList window_list;
|
||||
static QWindow *active_window;
|
||||
|
||||
#ifndef QT_NO_CURSOR
|
||||
QList<QCursor> cursor_list;
|
||||
|
|
|
|||
|
|
@ -62,6 +62,8 @@ QWindow::QWindow(QWindow *parent)
|
|||
|
||||
QWindow::~QWindow()
|
||||
{
|
||||
if (QGuiApplicationPrivate::active_window == this)
|
||||
QGuiApplicationPrivate::active_window = 0;
|
||||
destroy();
|
||||
}
|
||||
|
||||
|
|
@ -259,6 +261,7 @@ void QWindow::setOpacity(qreal level)
|
|||
void QWindow::requestActivateWindow()
|
||||
{
|
||||
Q_D(QWindow);
|
||||
QGuiApplicationPrivate::active_window = this;
|
||||
if (d->platformWindow) {
|
||||
d->platformWindow->requestActivateWindow();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue