diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2014-12-18 12:12:58 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2014-12-18 12:12:58 +0100 |
commit | e281537f2049af0b96fd87158f2b7212afe8ab5f (patch) | |
tree | 7f9e3b14a2456cc779aa165457192094507dd257 /src/widgets/kernel | |
parent | e0a8b5ce88bc50440dcec2fe3a86d83e2a7dc7b0 (diff) | |
parent | 84569773db68408704193268bc42a200bb25a924 (diff) |
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
src/corelib/global/qglobal.h
src/platformsupport/platformcompositor/qopenglcompositor.cpp
src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp
tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
Change-Id: I5422868500be695584a496dbbbc719d146bc572d
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r-- | src/widgets/kernel/qwidget_p.h | 2 | ||||
-rw-r--r-- | src/widgets/kernel/qwidgetbackingstore.cpp | 31 | ||||
-rw-r--r-- | src/widgets/kernel/qwidgetwindow.cpp | 6 |
3 files changed, 21 insertions, 18 deletions
diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h index 738f017e89..50a8066a41 100644 --- a/src/widgets/kernel/qwidget_p.h +++ b/src/widgets/kernel/qwidget_p.h @@ -619,6 +619,8 @@ public: QOpenGLContext *shareContext() const; + virtual QObject *focusObject() { return 0; } + #ifndef QT_NO_OPENGL virtual GLuint textureId() const { return 0; } virtual QImage grabFramebuffer() { return QImage(); } diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp index 38f02b2ed9..68beb9afca 100644 --- a/src/widgets/kernel/qwidgetbackingstore.cpp +++ b/src/widgets/kernel/qwidgetbackingstore.cpp @@ -957,9 +957,12 @@ void QWidgetBackingStore::sync(QWidget *exposedWidget, const QRegion &exposedReg static void findTextureWidgetsRecursively(QWidget *tlw, QWidget *widget, QPlatformTextureList *widgetTextures) { QWidgetPrivate *wd = QWidgetPrivate::get(widget); - if (wd->renderToTexture) - widgetTextures->appendTexture(wd->textureId(), QRect(widget->mapTo(tlw, QPoint()), widget->size()), - widget->testAttribute(Qt::WA_AlwaysStackOnTop)); + if (wd->renderToTexture) { + QPlatformTextureList::Flags flags = 0; + if (widget->testAttribute(Qt::WA_AlwaysStackOnTop)) + flags |= QPlatformTextureList::StacksOnTop; + widgetTextures->appendTexture(widget, wd->textureId(), QRect(widget->mapTo(tlw, QPoint()), widget->size()), flags); + } for (int i = 0; i < wd->children.size(); ++i) { QWidget *w = qobject_cast<QWidget *>(wd->children.at(i)); @@ -1150,28 +1153,20 @@ void QWidgetBackingStore::doSync() } #ifndef QT_NO_OPENGL - // There is something other dirty than the renderToTexture widgets. - // Now it is time to include the renderToTexture ones among the others. if (widgetTextures && widgetTextures->count()) { for (int i = 0; i < widgetTextures->count(); ++i) { - const QRect rect = widgetTextures->geometry(i); // mapped to the tlw already - dirty += rect; - toClean += rect; + QWidget *w = widgetTextures->widget(i); + if (dirtyRenderToTextureWidgets.contains(w)) { + const QRect rect = widgetTextures->geometry(i); // mapped to the tlw already + dirty += rect; + toClean += rect; + } } } -#endif - - // The dirtyRenderToTextureWidgets list is useless here, so just reset. As - // unintuitive as it is, we need to send paint events to renderToTexture - // widgets always when something (any widget) needs to be updated, even if - // the renderToTexture widget itself is clean, i.e. there was no update() - // call for it. This is because changing any widget will cause a flush and - // so a potentially blocking buffer swap for the window, and skipping paints - // for the renderToTexture widgets would make it impossible to have smoothly - // animated content in them. for (int i = 0; i < dirtyRenderToTextureWidgets.count(); ++i) resetWidget(dirtyRenderToTextureWidgets.at(i)); dirtyRenderToTextureWidgets.clear(); +#endif #ifndef QT_NO_GRAPHICSVIEW if (tlw->d_func()->extra->proxyWidget) { diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp index fa9138344a..f543086969 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -147,6 +147,12 @@ QObject *QWidgetWindow::focusObject() const if (!widget) widget = m_widget; + if (widget) { + QObject *focusObj = QWidgetPrivate::get(widget)->focusObject(); + if (focusObj) + return focusObj; + } + return widget; } |