diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-03-31 18:47:56 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-04-01 09:10:26 +0200 |
commit | 0e6ee136c91432d4ceeeda64e5a5fa88231398d4 (patch) | |
tree | 6060e002af2900007895f6efa757989dd4c190c9 /src/widgets/kernel | |
parent | 418869d9158ea5cd998ba30778b0b7173b48161b (diff) | |
parent | 17294c5e4d15d5776f6e414b03671a4a9ed4993d (diff) |
Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
src/testlib/qtestblacklist.cpp
src/widgets/accessible/qaccessiblewidgets.cpp
Change-Id: If032adb9296428f62384ed835dbf41ee7a0b886c
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 5 | ||||
-rw-r--r-- | src/widgets/kernel/qopenglwidget.cpp | 27 | ||||
-rw-r--r-- | src/widgets/kernel/qwidgetwindow.cpp | 3 |
3 files changed, 29 insertions, 6 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 78c842f7e1..00f590ebc2 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -978,8 +978,7 @@ bool QApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventLis || event->type() == QEvent::LayoutRequest || event->type() == QEvent::Resize || event->type() == QEvent::Move - || event->type() == QEvent::LanguageChange - || event->type() == QEvent::InputMethod)) { + || event->type() == QEvent::LanguageChange)) { for (QPostEventList::const_iterator it = postedEvents->constBegin(); it != postedEvents->constEnd(); ++it) { const QPostEvent &cur = *it; if (cur.receiver != receiver || cur.event == 0 || cur.event->type() != event->type()) @@ -993,8 +992,6 @@ bool QApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventLis ((QMoveEvent *)(cur.event))->p = ((QMoveEvent *)event)->p; } else if (cur.event->type() == QEvent::LanguageChange) { ; - } else if ( cur.event->type() == QEvent::InputMethod ) { - *(QInputMethodEvent *)(cur.event) = *(QInputMethodEvent *)event; } else { continue; } diff --git a/src/widgets/kernel/qopenglwidget.cpp b/src/widgets/kernel/qopenglwidget.cpp index 8faa9f8681..d4d23604a3 100644 --- a/src/widgets/kernel/qopenglwidget.cpp +++ b/src/widgets/kernel/qopenglwidget.cpp @@ -46,6 +46,7 @@ #include <QtGui/private/qopenglextensions_p.h> #include <QtGui/private/qfont_p.h> #include <QtGui/private/qopenglpaintdevice_p.h> +#include <QtGui/private/qopenglcontext_p.h> #include <QtWidgets/private/qwidget_p.h> QT_BEGIN_NAMESPACE @@ -435,6 +436,23 @@ QT_BEGIN_NAMESPACE each frame. To restore the preserved behavior, call setUpdateBehavior() with \c PartialUpdate. + \section1 Alternatives + + Adding a QOpenGLWidget into a window turns on OpenGL-based + compositing for the entire window. In some special cases this may + not be ideal, and the old QGLWidget-style behavior with a separate, + native child window is desired. Desktop applications that understand + the limitations of this approach (for example when it comes to + overlaps, transparency, scroll views and MDI areas), can use + QOpenGLWindow with QWidget::createWindowContainer(). This is a + modern alternative to QGLWidget and is faster than QOpenGLWidget due + to the lack of the additional composition step. It is strongly + recommended to limit the usage of this approach to cases where there + is no other choice. Note that this option is not suitable for most + embedded and mobile platforms, and it is known to have issues on + certain desktop platforms (e.g. OS X) too. The stable, + cross-platform solution is always QOpenGLWidget. + \e{OpenGL is a trademark of Silicon Graphics, Inc. in the United States and other countries.} @@ -775,11 +793,18 @@ void QOpenGLWidgetPrivate::resolveSamples() void QOpenGLWidgetPrivate::invokeUserPaint() { Q_Q(QOpenGLWidget); - QOpenGLFunctions *f = QOpenGLContext::currentContext()->functions(); + + QOpenGLContext *ctx = QOpenGLContext::currentContext(); + Q_ASSERT(ctx && fbo); + + QOpenGLFunctions *f = ctx->functions(); + QOpenGLContextPrivate::get(ctx)->defaultFboRedirect = fbo->handle(); f->glViewport(0, 0, q->width() * q->devicePixelRatio(), q->height() * q->devicePixelRatio()); q->paintGL(); flushPending = true; + + QOpenGLContextPrivate::get(ctx)->defaultFboRedirect = 0; } void QOpenGLWidgetPrivate::render() diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp index 5f0fb430bc..efe7d9415b 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -465,7 +465,8 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event) } if (qApp->activePopupWidget() != activePopupWidget - && qt_replay_popup_mouse_event) { + && qt_replay_popup_mouse_event + && QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::ReplayMousePressOutsidePopup).toBool()) { if (m_widget->windowType() != Qt::Popup) qt_button_down = 0; if (event->type() == QEvent::MouseButtonPress) { |