diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-10-09 17:56:51 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-10-09 17:56:52 +0200 |
commit | 881ceeff428c377d02ae3881beccdbb028385075 (patch) | |
tree | 65bd4335d7f67b81b04e33f2cbb17a41cf966dd8 /src/widgets/kernel | |
parent | b3d2c867ed14cd6337d5e32b8750f198b5b7d331 (diff) | |
parent | 106487387d493dab934e19b33bfed55b8df62d67 (diff) |
Merge remote-tracking branch 'origin/5.4' into dev
Change-Id: I05fcd8dc66d9ad0dc76bb7f5bae05c9876bfba14
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r-- | src/widgets/kernel/qopenglwidget.cpp | 8 | ||||
-rw-r--r-- | src/widgets/kernel/qshortcut.cpp | 2 | ||||
-rw-r--r-- | src/widgets/kernel/qsizepolicy.h | 1 | ||||
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 16 | ||||
-rw-r--r-- | src/widgets/kernel/qwidgetbackingstore.cpp | 7 |
5 files changed, 27 insertions, 7 deletions
diff --git a/src/widgets/kernel/qopenglwidget.cpp b/src/widgets/kernel/qopenglwidget.cpp index de402cdb7d..543f59d7d1 100644 --- a/src/widgets/kernel/qopenglwidget.cpp +++ b/src/widgets/kernel/qopenglwidget.cpp @@ -149,7 +149,7 @@ QT_BEGIN_NAMESPACE \endlist - \section1 OpenGL function calls, headers and QOpenGLFunctions + \section1 OpenGL Function Calls, Headers and QOpenGLFunctions When making OpenGL function calls, it is strongly recommended to avoid calling the functions directly. Instead, prefer using QOpenGLFunctions (when making @@ -177,7 +177,7 @@ QT_BEGIN_NAMESPACE feasible. This means that constants and function pointer typedefs from ARB, EXT, OES extensions are automatically available. - \section1 Code examples + \section1 Code Examples To get started, the simplest QOpenGLWidget subclass could like like the following: @@ -282,7 +282,7 @@ QT_BEGIN_NAMESPACE fully controlled by the thread, e.g. an additional framebuffer object, and blitting to the QOpenGLWidget's framebuffer at a suitable time. - \section1 Context sharing + \section1 Context Sharing When multiple QOpenGLWidgets are added as children to the same top-level widget, their contexts will share with each other. This does not apply for @@ -311,7 +311,7 @@ QT_BEGIN_NAMESPACE created later. Some other drivers may behave in unexpected ways when trying to utilize shared resources between different threads. - \section1 Resource initialization and cleanup + \section1 Resource Initialization and Cleanup The QOpenGLWidget's associated OpenGL context is guaranteed to be current whenever initializeGL() and paintGL() are invoked. Do not attempt to create diff --git a/src/widgets/kernel/qshortcut.cpp b/src/widgets/kernel/qshortcut.cpp index a98b2db0fc..3349b45467 100644 --- a/src/widgets/kernel/qshortcut.cpp +++ b/src/widgets/kernel/qshortcut.cpp @@ -271,7 +271,7 @@ static bool correctActionContext(Qt::ShortcutContext context, QAction *a, QWidge // (and reaches this point), then the menu item itself has been disabled. // This occurs at the QPA level on Mac, were we disable all the Cocoa menus // when showing a modal window. - if (a->shortcut().count() <= 1) + if (a->shortcut().count() < 1 || (a->shortcut().count() == 1 && (a->shortcut()[0] & Qt::MODIFIER_MASK) != 0)) continue; #endif QAction *a = menu->menuAction(); diff --git a/src/widgets/kernel/qsizepolicy.h b/src/widgets/kernel/qsizepolicy.h index 276679a017..9730ec1206 100644 --- a/src/widgets/kernel/qsizepolicy.h +++ b/src/widgets/kernel/qsizepolicy.h @@ -85,7 +85,6 @@ public: QSizePolicy() : data(0) { } - // ### Qt 5: merge these two constructors (with type == DefaultType) QSizePolicy(Policy horizontal, Policy vertical, ControlType type = DefaultType) : data(0) { bits.horPolicy = horizontal; diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 190fd3a134..00cf39bdbf 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -10526,6 +10526,22 @@ void QWidgetPrivate::setParent_sys(QWidget *newparent, Qt::WindowFlags f) if (wasCreated && !(f & Qt::Window) && (oldFlags & Qt::Window) && !q->testAttribute(Qt::WA_NativeWindow)) { if (extra && extra->hasWindowContainer) QWindowContainer::toplevelAboutToBeDestroyed(q); + + QWindow *newParentWindow = newparent->windowHandle(); + if (!newParentWindow) + if (QWidget *npw = newparent->nativeParentWidget()) + newParentWindow = npw->windowHandle(); + + Q_FOREACH (QObject *child, q->windowHandle()->children()) { + QWindow *childWindow = qobject_cast<QWindow *>(child); + if (!childWindow) + continue; + + QWidgetWindow *childWW = qobject_cast<QWidgetWindow *>(childWindow); + QWidget *childWidget = childWW ? childWW->widget() : 0; + if (!childWW || (childWidget && childWidget->testAttribute(Qt::WA_NativeWindow))) + childWindow->setParent(newParentWindow); + } q->destroy(); } diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp index d3bc6f52e5..2f2db32852 100644 --- a/src/widgets/kernel/qwidgetbackingstore.cpp +++ b/src/widgets/kernel/qwidgetbackingstore.cpp @@ -1129,12 +1129,17 @@ void QWidgetBackingStore::doSync() // prevent triggering unnecessary backingstore painting when only the // OpenGL content changes. Check if we have such widgets in the special // dirty list. + QVarLengthArray<QWidget *, 16> paintPending; for (int i = 0; i < dirtyRenderToTextureWidgets.count(); ++i) { QWidget *w = dirtyRenderToTextureWidgets.at(i); - w->d_func()->sendPaintEvent(w->rect()); + paintPending << w; resetWidget(w); } dirtyRenderToTextureWidgets.clear(); + for (int i = 0; i < paintPending.count(); ++i) { + QWidget *w = paintPending[i]; + w->d_func()->sendPaintEvent(w->rect()); + } // We might have newly exposed areas on the screen if this function was // called from sync(QWidget *, QRegion)), so we have to make sure those |