From e3cf87bb754b10eae4c6d852d912d1b107ee03ed Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Wed, 26 Jun 2013 10:22:54 +0200 Subject: Mac OSX: get the correct key code when the control key is pressed The control key results in modifiers having Qt::MetaModifier, and then the correct character is found in charactersIgnoringModifiers. The rest of the time, [nsevent characters] seems to be correct. If we use charactersIgnoringModifiers too much of the time, then the keycode will be wrong in some cases even though typing is still possible. Task-number: QTBUG-29005 Task-number: QTBUG-31811 Task-number: QTBUG-31977 Change-Id: Ib23b89f03bc9a61fe6d177320fa603c05649e979 Reviewed-by: Eike Ziller Reviewed-by: Frederik Gladhorn --- src/plugins/platforms/cocoa/qnsview.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index ab3f495a60..94b414a882 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -914,6 +914,7 @@ static QTouchDevice *touchDevice = 0; ulong timestamp = [nsevent timestamp] * 1000; ulong nativeModifiers = [nsevent modifierFlags]; Qt::KeyboardModifiers modifiers = [QNSView convertKeyModifiers: nativeModifiers]; + NSString *charactersIgnoringModifiers = [nsevent charactersIgnoringModifiers]; NSString *characters = [nsevent characters]; // [from Qt 4 impl] There is no way to get the scan code from carbon. But we cannot @@ -928,7 +929,10 @@ static QTouchDevice *touchDevice = 0; QChar ch = QChar::ReplacementCharacter; int keyCode = Qt::Key_unknown; if ([characters length] != 0) { - ch = QChar([characters characterAtIndex:0]); + if ((modifiers & Qt::MetaModifier) && ([charactersIgnoringModifiers length] != 0)) + ch = QChar([charactersIgnoringModifiers characterAtIndex:0]); + else + ch = QChar([characters characterAtIndex:0]); keyCode = [self convertKeyCode:ch]; } -- cgit v1.2.3 From 7e33ec97e3370f3802cf1c8684909b86b0b45179 Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Mon, 3 Jun 2013 15:09:12 -0300 Subject: BlackBerry: fix delayed root window posting on OpenGL The delayed root window posting introduced by 77a06e7e6c517003 broke the OpenGL support. In that patch, the posting of the root window is trigerred by QQnxRasterRasterBackingStore's call to QQnxWindow::post(), that obviously does not happen when OpenGL is enabled, therefore requiring the OpenGL context to explicitly post() the root window. Task-number: QTBUG-31934 Change-Id: Ifd302c1dde612a03b79c778ec4586aa70f88260d (cherry picked from commit 6a9333841d9d5233b0457ec6f0da5bdacda8ea5b) Reviewed-by: Nicolas Arnaud-Cormos --- src/plugins/platforms/qnx/qqnxglcontext.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/plugins/platforms/qnx/qqnxglcontext.cpp b/src/plugins/platforms/qnx/qqnxglcontext.cpp index 005b6d272a..ed959467ff 100644 --- a/src/plugins/platforms/qnx/qqnxglcontext.cpp +++ b/src/plugins/platforms/qnx/qqnxglcontext.cpp @@ -315,6 +315,9 @@ void QQnxGLContext::createSurface(QPlatformSurface *surface) } platformWindow->setBufferSize(surfaceSize); + // Post root window, in case it hasn't been posted yet, to make it appear. + platformWindow->screen()->onWindowPost(platformWindow); + // Obtain the native handle for our window screen_window_t handle = platformWindow->nativeHandle(); -- cgit v1.2.3 From 8f8c29b1c88545c8dee41743f50661885b5c1ec2 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Tue, 25 Jun 2013 14:59:58 +0200 Subject: Android: Fix initial window size for raster backend We forgot to set the ShowIsFullScreen property for the raster engine case. OpenGL windows already did the right thing, since the GL backend is based on eglFS. The iOS backend also has this logic. Task-number: QTBUG-31984 Change-Id: I1cf5df32d79f441768126f00632107a7971eb5ad Reviewed-by: Eskil Abrahamsen Blomfeldt --- .../platforms/android/src/qandroidplatformintegration.cpp | 10 ++++++++++ .../platforms/android/src/qandroidplatformintegration.h | 2 ++ 2 files changed, 12 insertions(+) (limited to 'src') diff --git a/src/plugins/platforms/android/src/qandroidplatformintegration.cpp b/src/plugins/platforms/android/src/qandroidplatformintegration.cpp index f0630b5224..91ad2b368f 100644 --- a/src/plugins/platforms/android/src/qandroidplatformintegration.cpp +++ b/src/plugins/platforms/android/src/qandroidplatformintegration.cpp @@ -216,6 +216,16 @@ QPlatformServices *QAndroidPlatformIntegration::services() const return m_androidPlatformServices; } +QVariant QAndroidPlatformIntegration::styleHint(StyleHint hint) const +{ + switch (hint) { + case ShowIsFullScreen: + return true; + default: + return QPlatformIntegration::styleHint(hint); + } +} + static const QLatin1String androidThemeName("android"); QStringList QAndroidPlatformIntegration::themeNames() const { diff --git a/src/plugins/platforms/android/src/qandroidplatformintegration.h b/src/plugins/platforms/android/src/qandroidplatformintegration.h index 8da9fb2ff4..6cc191701d 100644 --- a/src/plugins/platforms/android/src/qandroidplatformintegration.h +++ b/src/plugins/platforms/android/src/qandroidplatformintegration.h @@ -112,6 +112,8 @@ public: QPlatformNativeInterface *nativeInterface() const; QPlatformServices *services() const; + QVariant styleHint(StyleHint hint) const; + QStringList themeNames() const; QPlatformTheme *createPlatformTheme(const QString &name) const; -- cgit v1.2.3 From 440a227054fa9facfcf516e937daa9c593d59161 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 25 Jun 2013 14:59:54 -0700 Subject: Fix win32-icc build: _CHAR16T is not an indication of C++11 support The macro comes from MSVC's yvals.h header and it actually indicates absence of C++11 support in MSVC. It is defined if _HAS_CHAR16_T_LANGUAGE_SUPPORT isn't defined, which is a C++11 feature. Task-number: QTBUG-31701 Change-Id: I155b8e764f786e95a08de660f70094b2bee38937 Reviewed-by: Oswald Buddenhagen --- src/corelib/global/qcompilerdetection.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 548eebd3ad..b685c1fe0d 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -467,7 +467,7 @@ # if __INTEL_COMPILER < 1200 # define Q_NO_TEMPLATE_FRIENDS # endif -# if defined(_CHAR16T) || __cplusplus >= 201103L +# if __cplusplus >= 201103L # define Q_COMPILER_VARIADIC_MACROS # if __INTEL_COMPILER >= 1200 # define Q_COMPILER_AUTO_TYPE -- cgit v1.2.3 From 9e893492ddaceee37eddda776fbd276f46afe0c2 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 25 Jun 2013 11:32:42 -0700 Subject: Fix compilation with ICC 13.1: the MSVC 2005 & 2008 code is bad qvariant_p.h(226): error: name followed by "::" must be a class or namespace name template static Yes test(char (*)[(&C::isNull == 0) + 1]); ^ Change-Id: I42eef44d46ca0fb7aac8f82150e917c4fb912b15 Reviewed-by: Oswald Buddenhagen --- src/corelib/kernel/qvariant_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/kernel/qvariant_p.h b/src/corelib/kernel/qvariant_p.h index 04b9d92f55..4ec049e20d 100644 --- a/src/corelib/kernel/qvariant_p.h +++ b/src/corelib/kernel/qvariant_p.h @@ -224,7 +224,7 @@ class QVariantIsNull public: static const bool Value = (sizeof(test(0)) == sizeof(Yes)); }; -#elif defined(Q_CC_MSVC) && _MSC_VER >= 1400 // MSVC 2005, 2008 version: no decltype, but 'sealed' classes (>=2010 has decltype) +#elif defined(Q_CC_MSVC) && _MSC_VER >= 1400 && !defined(Q_CC_INTEL) // MSVC 2005, 2008 version: no decltype, but 'sealed' classes (>=2010 has decltype) template class HasIsNullMethod { struct Yes { char unused[1]; }; -- cgit v1.2.3 From 4a3edb5aec8afbd19e9a9fa7ba9795681eb7a064 Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Mon, 17 Jun 2013 16:46:39 -0300 Subject: QNX: Fix screen rotation The behavior introduced by qtdeclarative's 475d1ed4f6a2 mandates that an expose event follows a geometry change event. The fix for this uncovered a bug on the raster backing store which caused the rotation to break on QtWidgets. The problem was rooted on the assumption that the QQnxRasterBackingStore::flush() method was only called after paints to the backing store surface, which was discovered to be a false assumption. Flushing the backing store can occur in other circunstances, which are out of scope on the context of the QNX plugin. Task-number: QTBUG-31329 Task-number: QTBUG-31934 Change-Id: Icfc3e85324f5a8745f6b5f189f27f8b763f770c7 (cherry picked from commit 0343b926608a4014ef386b3b21be9a0940d9f8e8) Reviewed-by: Nicolas Arnaud-Cormos Reviewed-by: Vladimir Minenko --- src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp | 7 ++++++- src/plugins/platforms/qnx/qqnxwindow.cpp | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp index 7204e5bce9..6a7a4d0944 100644 --- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp +++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp @@ -81,6 +81,12 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion ®ion, const { qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << this->window(); + // Sometimes this method is called even though there is nothing to be + // flushed, for instance, after an expose event directly follows a + // geometry change event. + if (!m_hasUnflushedPaintOperations) + return; + QQnxWindow *targetWindow = 0; if (window) targetWindow = static_cast(window->handle()); @@ -117,7 +123,6 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion ®ion, const // We assume that the TLW has been flushed previously and that no changes were made to the // backing store inbetween (### does Qt guarantee this?) - Q_ASSERT(!m_hasUnflushedPaintOperations); targetWindow->adjustBufferSize(); targetWindow->blitFrom(platformWindow, offset, region); diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp index 9523685f70..7daab24d3c 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxwindow.cpp @@ -200,6 +200,7 @@ void QQnxWindow::setGeometry(const QRect &rect) // could result in re-entering QQnxWindow::setGeometry() again. QWindowSystemInterface::setSynchronousWindowsSystemEvents(true); QWindowSystemInterface::handleGeometryChange(window(), rect); + QWindowSystemInterface::handleExposeEvent(window(), rect); QWindowSystemInterface::setSynchronousWindowsSystemEvents(false); // Now move all children. -- cgit v1.2.3 From 0fa29e2875043613e5e94e23175be1aed1e5d9cf Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Sat, 22 Jun 2013 10:58:53 +0100 Subject: Avoid crash when QOpenGLContext is destroyed before the VAO Change-Id: I19df59453156a95c5075a065268333a74cec2476 Reviewed-by: James Turner Reviewed-by: Gunnar Sletta Reviewed-by: Giuseppe D'Angelo --- src/gui/opengl/qopenglvertexarrayobject.cpp | 27 +++++++++++++++++++++++++-- src/gui/opengl/qopenglvertexarrayobject.h | 1 + 2 files changed, 26 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gui/opengl/qopenglvertexarrayobject.cpp b/src/gui/opengl/qopenglvertexarrayobject.cpp index e450fe708f..eb7a42f749 100644 --- a/src/gui/opengl/qopenglvertexarrayobject.cpp +++ b/src/gui/opengl/qopenglvertexarrayobject.cpp @@ -118,6 +118,9 @@ public: void destroy(); void bind(); void release(); + void _q_contextAboutToBeDestroyed(); + + Q_DECLARE_PUBLIC(QOpenGLVertexArrayObject) GLuint vao; @@ -141,12 +144,22 @@ public: bool QOpenGLVertexArrayObjectPrivate::create() { + if (vao) { + qWarning("QOpenGLVertexArrayObject::create() VAO is already created"); + return false; + } + + Q_Q(QOpenGLVertexArrayObject); + if (context) + QObject::disconnect(context, SIGNAL(aboutToBeDestroyed()), q, SLOT(_q_contextAboutToBeDestroyed())); + QOpenGLContext *ctx = QOpenGLContext::currentContext(); if (!ctx) { qWarning("QOpenGLVertexArrayObject::create() requires a valid current OpenGL context"); return false; } context = ctx; + QObject::connect(context, SIGNAL(aboutToBeDestroyed()), q, SLOT(_q_contextAboutToBeDestroyed())); #if defined(QT_OPENGL_ES_2) if (ctx->hasExtension("GL_OES_vertex_array_object")) { @@ -197,8 +210,16 @@ void QOpenGLVertexArrayObjectPrivate::destroy() case NotSupported: break; } - vao = 0; #endif + vao = 0; +} + +/*! + \internal +*/ +void QOpenGLVertexArrayObjectPrivate::_q_contextAboutToBeDestroyed() +{ + destroy(); } void QOpenGLVertexArrayObjectPrivate::bind() @@ -327,7 +348,7 @@ QOpenGLVertexArrayObject::~QOpenGLVertexArrayObject() Q_D(QOpenGLVertexArrayObject); QOpenGLContext *oldContext = 0; - if (d->context && d->context != ctx) { + if (d->context && ctx && d->context != ctx) { oldContext = ctx; if (d->context->makeCurrent(oldContext->surface())) { ctx = d->context; @@ -471,3 +492,5 @@ void QOpenGLVertexArrayObject::release() */ QT_END_NAMESPACE + +#include "moc_qopenglvertexarrayobject.cpp" diff --git a/src/gui/opengl/qopenglvertexarrayobject.h b/src/gui/opengl/qopenglvertexarrayobject.h index 569aeea730..8369497660 100644 --- a/src/gui/opengl/qopenglvertexarrayobject.h +++ b/src/gui/opengl/qopenglvertexarrayobject.h @@ -102,6 +102,7 @@ public: private: Q_DISABLE_COPY(QOpenGLVertexArrayObject) Q_DECLARE_PRIVATE(QOpenGLVertexArrayObject) + Q_PRIVATE_SLOT(d_func(), void _q_contextAboutToBeDestroyed()) QOpenGLVertexArrayObject(QOpenGLVertexArrayObjectPrivate &dd); }; -- cgit v1.2.3 From 12d45cdc497967206d631929710836ac804768d6 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Thu, 27 Jun 2013 17:39:44 +0200 Subject: QWindow min/max width/height, contentOrientation are not new in 5.1 so that part of Id03ae17270832a7b5915e4324a508e591c0b6d98 which added the Q_REVISION(1)'s and \since docs was a mistake. Change-Id: I159b68491bd7dc55657d8c978bff527094ef4547 Reviewed-by: Frederik Gladhorn Reviewed-by: Alan Alpert --- src/gui/kernel/qwindow.cpp | 5 ----- src/gui/kernel/qwindow.h | 28 ++++++++++++++-------------- 2 files changed, 14 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index eff057c4cb..392407d86d 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -933,7 +933,6 @@ bool QWindow::isActive() const /*! \property QWindow::contentOrientation \brief the orientation of the window's contents - \since 5.1 This is a hint to the window manager in case it needs to display additional content like popups, dialogs, status bars, or similar @@ -1190,7 +1189,6 @@ void QWindow::setHeight(int arg) /*! \property QWindow::minimumWidth \brief the minimum width of the window's geometry - \since 5.1 */ void QWindow::setMinimumWidth(int w) { @@ -1200,7 +1198,6 @@ void QWindow::setMinimumWidth(int w) /*! \property QWindow::minimumHeight \brief the minimum height of the window's geometry - \since 5.1 */ void QWindow::setMinimumHeight(int h) { @@ -1233,7 +1230,6 @@ void QWindow::setMaximumSize(const QSize &size) /*! \property QWindow::maximumWidth \brief the maximum width of the window's geometry - \since 5.1 */ void QWindow::setMaximumWidth(int w) { @@ -1243,7 +1239,6 @@ void QWindow::setMaximumWidth(int w) /*! \property QWindow::maximumHeight \brief the maximum height of the window's geometry - \since 5.1 */ void QWindow::setMaximumHeight(int h) { diff --git a/src/gui/kernel/qwindow.h b/src/gui/kernel/qwindow.h index efdfd497a6..80120dbb0e 100644 --- a/src/gui/kernel/qwindow.h +++ b/src/gui/kernel/qwindow.h @@ -110,14 +110,14 @@ class Q_GUI_EXPORT QWindow : public QObject, public QSurface Q_PROPERTY(int y READ y WRITE setY NOTIFY yChanged) Q_PROPERTY(int width READ width WRITE setWidth NOTIFY widthChanged) Q_PROPERTY(int height READ height WRITE setHeight NOTIFY heightChanged) - Q_PROPERTY(int minimumWidth READ minimumWidth WRITE setMinimumWidth NOTIFY minimumWidthChanged REVISION 1) - Q_PROPERTY(int minimumHeight READ minimumHeight WRITE setMinimumHeight NOTIFY minimumHeightChanged REVISION 1) - Q_PROPERTY(int maximumWidth READ maximumWidth WRITE setMaximumWidth NOTIFY maximumWidthChanged REVISION 1) - Q_PROPERTY(int maximumHeight READ maximumHeight WRITE setMaximumHeight NOTIFY maximumHeightChanged REVISION 1) + Q_PROPERTY(int minimumWidth READ minimumWidth WRITE setMinimumWidth NOTIFY minimumWidthChanged) + Q_PROPERTY(int minimumHeight READ minimumHeight WRITE setMinimumHeight NOTIFY minimumHeightChanged) + Q_PROPERTY(int maximumWidth READ maximumWidth WRITE setMaximumWidth NOTIFY maximumWidthChanged) + Q_PROPERTY(int maximumHeight READ maximumHeight WRITE setMaximumHeight NOTIFY maximumHeightChanged) Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged) Q_PROPERTY(bool active READ isActive NOTIFY activeChanged REVISION 1) Q_PROPERTY(Visibility visibility READ visibility WRITE setVisibility NOTIFY visibilityChanged REVISION 1) - Q_PROPERTY(Qt::ScreenOrientation contentOrientation READ contentOrientation WRITE reportContentOrientationChange NOTIFY contentOrientationChanged REVISION 1) + Q_PROPERTY(Qt::ScreenOrientation contentOrientation READ contentOrientation WRITE reportContentOrientationChange NOTIFY contentOrientationChanged) Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged REVISION 1) public: @@ -286,10 +286,10 @@ public Q_SLOTS: void setWidth(int arg); void setHeight(int arg); - Q_REVISION(1) void setMinimumWidth(int w); - Q_REVISION(1) void setMinimumHeight(int h); - Q_REVISION(1) void setMaximumWidth(int w); - Q_REVISION(1) void setMaximumHeight(int h); + void setMinimumWidth(int w); + void setMinimumHeight(int h); + void setMaximumWidth(int w); + void setMaximumHeight(int h); void alert(int msec); @@ -304,15 +304,15 @@ Q_SIGNALS: void widthChanged(int arg); void heightChanged(int arg); - Q_REVISION(1) void minimumWidthChanged(int arg); - Q_REVISION(1) void minimumHeightChanged(int arg); - Q_REVISION(1) void maximumWidthChanged(int arg); - Q_REVISION(1) void maximumHeightChanged(int arg); + void minimumWidthChanged(int arg); + void minimumHeightChanged(int arg); + void maximumWidthChanged(int arg); + void maximumHeightChanged(int arg); void visibleChanged(bool arg); Q_REVISION(1) void visibilityChanged(QWindow::Visibility visibility); Q_REVISION(1) void activeChanged(); - Q_REVISION(1) void contentOrientationChanged(Qt::ScreenOrientation orientation); + void contentOrientationChanged(Qt::ScreenOrientation orientation); void focusObjectChanged(QObject *object); -- cgit v1.2.3 From 2f4cd18d3eec3bf90bf1a5bd471ef7a03550de97 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 28 Jun 2013 08:34:52 +0200 Subject: Add Q_REVISION(1) to QWindow::alert(). Task-number: QTBUG-32069 Task-number: QTBUG-30416 Change-Id: Idabf9962def24ecd709be7d981302c91c42ccac4 Reviewed-by: Shawn Rutledge --- src/gui/kernel/qwindow.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/kernel/qwindow.h b/src/gui/kernel/qwindow.h index 80120dbb0e..ca261ff7ce 100644 --- a/src/gui/kernel/qwindow.h +++ b/src/gui/kernel/qwindow.h @@ -291,7 +291,7 @@ public Q_SLOTS: void setMaximumWidth(int w); void setMaximumHeight(int h); - void alert(int msec); + Q_REVISION(1) void alert(int msec); Q_SIGNALS: void screenChanged(QScreen *screen); -- cgit v1.2.3