diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2012-10-22 12:47:34 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-07 21:26:08 +0100 |
commit | cd34da54269e6cd7fa5c18242d982736f022a14a (patch) | |
tree | 841d021b924f04dfcb7068fdbd9a428b9ce78c2f /src/widgets/kernel | |
parent | a454ccb89ec2296234ee7328095f27ad7cb2361f (diff) |
Rename all QWindow properties that have "window" in them
windowTitle, windowModality, windowIcon and so on are named that way
to be similar to the ones in QWidget. However QQuickWindow inherits
all of the declared properties, and we would like to have shorter
property names in QML. If you are working with a Window then it's
obvious the title property is the window title. Unfortunately,
there must be patches in many other modules which depend on this one.
In order to avoid the need to merge them all at the same time,
there is also patch https://codereview.qt-project.org/#change,39001
which temporarily adds backwards-compatible accessors, which can be
removed after the other modules are able to build without them.
We should not rename windowState to state, because in QML, state
usually drives the state machine for animation transitions etc.
(although QWindow is not an Item, a user might get confused about it).
Related patches are
https://codereview.qt-project.org/#change,39001
https://codereview.qt-project.org/#change,37764
https://codereview.qt-project.org/#change,37765
https://codereview.qt-project.org/#change,37766
https://codereview.qt-project.org/#change,37762
Change-Id: Ie4424ec15fbdef6b29b137f90a2ae33f173edd21
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 2 | ||||
-rw-r--r-- | src/widgets/kernel/qwidget_qpa.cpp | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 4a5fe0e82b..aeceba1886 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -2331,7 +2331,7 @@ bool QApplicationPrivate::isWindowBlocked(QWindow *window, QWindow **blockingWin return false; } - Qt::WindowModality windowModality = modalWindow->windowModality(); + Qt::WindowModality windowModality = modalWindow->modality(); QWidgetWindow *modalWidgetWindow = qobject_cast<QWidgetWindow *>(modalWindow); if (windowModality == Qt::NonModal) { // determine the modality type if it hasn't been set on the diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp index 2950c19768..b4d9b9d2e3 100644 --- a/src/widgets/kernel/qwidget_qpa.cpp +++ b/src/widgets/kernel/qwidget_qpa.cpp @@ -107,7 +107,7 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO win = topData()->window; } - win->setWindowFlags(data.window_flags); + win->setFlags(data.window_flags); fixPosIncludesFrame(); win->setGeometry(q->geometry()); win->setScreen(QGuiApplication::screens().value(topData()->screenIndex, 0)); @@ -134,7 +134,7 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO QWindowPrivate::WindowFrameInclusive : QWindowPrivate::WindowFrameExclusive; win->create(); - data.window_flags = win->windowFlags(); + data.window_flags = win->flags(); QBackingStore *store = q->backingStore(); @@ -227,7 +227,7 @@ void QWidgetPrivate::setParent_sys(QWidget *newparent, Qt::WindowFlags f) if (parent != newparent) { QObjectPrivate::setParent_helper(newparent); //### why does this have to be done in the _sys function??? if (q->windowHandle()) { - q->windowHandle()->setWindowFlags(f); + q->windowHandle()->setFlags(f); QWidget *parentWithWindow = newparent ? (newparent->windowHandle() ? newparent : newparent->nativeParentWidget()) : 0; if (parentWithWindow) { @@ -342,7 +342,7 @@ void QWidgetPrivate::setWindowTitle_sys(const QString &caption) return; if (QWindow *window = q->windowHandle()) - window->setWindowTitle(caption); + window->setTitle(caption); } @@ -353,14 +353,14 @@ void QWidgetPrivate::setWindowFilePath_sys(const QString &filePath) return; if (QWindow *window = q->windowHandle()) - window->setWindowFilePath(filePath); + window->setFilePath(filePath); } void QWidgetPrivate::setWindowIcon_sys() { Q_Q(QWidget); if (QWindow *window = q->windowHandle()) - window->setWindowIcon(q->windowIcon()); + window->setIcon(q->windowIcon()); } void QWidgetPrivate::setWindowIconText_sys(const QString &iconText) @@ -463,7 +463,7 @@ void QWidget::activateWindow() QWindow *const wnd = window()->windowHandle(); if (wnd) - wnd->requestActivateWindow(); + wnd->requestActivate(); } // Position top level windows at the center, avoid showing @@ -640,7 +640,7 @@ void QWidgetPrivate::setFocus_sys() if (QWindow *nativeWindow = q->window()->windowHandle()) { if (nativeWindow != QGuiApplication::focusWindow() && q->testAttribute(Qt::WA_WState_Created)) { - nativeWindow->requestActivateWindow(); + nativeWindow->requestActivate(); } } } @@ -987,7 +987,7 @@ void QWidgetPrivate::setModal_sys() { Q_Q(QWidget); if (q->windowHandle()) - q->windowHandle()->setWindowModality(q->windowModality()); + q->windowHandle()->setModality(q->windowModality()); } #ifndef QT_NO_CURSOR |