From cf366e8b862a616efd7c3d4683d59971f795d476 Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Fri, 24 May 2013 17:55:21 +0200 Subject: Made sure items with preferred width of 0 could also stretch If no stretch factors were specified, we used the preferred size as a stretch factor. Obviously, that didn't work if the preferred size was actually 0. This patch works around this by actually setting the stretch factor to 1.0 if this is the case. This should work fine in most cases, except for the case where there are also other items with a preferred size close to 0. In this case, the item with preferred size 0 will just grow faster than an item with e.g. preferred size 0.1. Task-number: QTBUG-31217 Change-Id: I966455da0bdd00308591c7f7cfbc4e134d423e57 Reviewed-by: Paul Olav Tvete --- src/widgets/graphicsview/qgridlayoutengine.cpp | 2 +- .../qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/widgets/graphicsview/qgridlayoutengine.cpp b/src/widgets/graphicsview/qgridlayoutengine.cpp index b80612bc47..4f43a0a4ac 100644 --- a/src/widgets/graphicsview/qgridlayoutengine.cpp +++ b/src/widgets/graphicsview/qgridlayoutengine.cpp @@ -291,7 +291,7 @@ void QGridLayoutRowData::calculateGeometries(int start, int end, qreal targetSiz int stretch = stretches[start + i]; if (sumStretches == 0) { - if (hasIgnoreFlag) { + if (hasIgnoreFlag || sizes[i] == 0.0) { factors[i] = (stretch < 0) ? 1.0 : 0.0; } else { factors[i] = (stretch < 0) ? sizes[i] : 0.0; diff --git a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp index 41e5ed466c..8c8f27d635 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp @@ -1884,6 +1884,18 @@ void tst_QGraphicsGridLayout::defaultStretchFactors_data() << QSizeF(10,10) << QSizeF(10,10) << QSizeF(10,10) ); + QTest::newRow("preferredsizeIsZero") << (ItemList() + << ItemDesc(0,0) + .preferredSizeHint(QSizeF(0,10)) + << ItemDesc(0,1) + .preferredSizeHint(QSizeF(10,10)) + .maxSize(QSizeF(20, 10)) + ) + << QSizeF(30, 10) + << (SizeList() + << QSizeF(10,10) << QSizeF(20,10) + ); + QTest::newRow("ignoreitem01") << (ItemList() << ItemDesc(0,0) .preferredSizeHint(QSizeF(10,10)) -- cgit v1.2.1 From 60768a0af9f8773a46990e40051ac692521af055 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 27 May 2013 13:41:15 +0200 Subject: Windows: Respect geometry set before native window creation Task-number: QTBUG-31071 Change-Id: Idab21c5996d1dc31b0a6fab4960c3c48a50d4966 Reviewed-by: Friedemann Kleint Reviewed-by: Shawn Rutledge --- src/plugins/platforms/windows/qwindowswindow.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 73c78f0090..8ce6dcc9e7 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -503,10 +503,14 @@ QWindowsWindow::WindowData const QWindowCreationContextPtr context(new QWindowCreationContext(w, rect, data.customMargins, style, exStyle)); QWindowsContext::instance()->setWindowCreationContext(context); - if (context->frameX < 0) - context->frameX = 0; - if (context->frameY < 0) - context->frameY = 0; + QRect screenGeometry; + if (QScreen *screen = w->screen()) + screenGeometry = screen->availableVirtualGeometry(); + + if (context->frameX < screenGeometry.left()) + context->frameX = screenGeometry.left(); + if (context->frameY < screenGeometry.top()) + context->frameY = screenGeometry.top(); if (QWindowsContext::verboseWindows) qDebug().nospace() -- cgit v1.2.1 From 130ee40b5e29267ad4c58280d700e1c72569ba12 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 23 May 2013 14:17:27 +0200 Subject: iOS: take orientation into account when reporting touch positions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This implementation will look at the orientation of the main screen to convert the touch coordinates. This will most likely change in future work, where we might look at a views view controller instead to decide orientation etc. Change-Id: Ic7875c5ecc4f21538f82a4f0467350bdf8ecc0b0 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/qioswindow.mm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm index 13815a22bf..0c3ae8e834 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -150,7 +150,8 @@ - (void)updateTouchList:(NSSet *)touches withState:(Qt::TouchPointState)state { - QRect applicationRect = fromCGRect(self.window.screen.applicationFrame); + QPlatformScreen *screen = QGuiApplication::primaryScreen()->handle(); + QRect applicationRect = fromPortraitToPrimary(fromCGRect(self.window.screen.applicationFrame), screen); foreach (UITouch *uiTouch, m_activeTouches.keys()) { QWindowSystemInterface::TouchPoint &touchPoint = m_activeTouches[uiTouch]; @@ -163,8 +164,10 @@ // Find the touch position relative to the window. Then calculate the screen // position by subtracting the position of the applicationRect (since UIWindow // does not take that into account when reporting its own frame): - QPoint touchPos = fromCGPoint([uiTouch locationInView:nil]); - touchPoint.area = QRectF(touchPos - applicationRect.topLeft(), QSize(0, 0)); + QRect touchInWindow = QRect(fromCGPoint([uiTouch locationInView:nil]), QSize(0, 0)); + QRect touchInScreen = fromPortraitToPrimary(touchInWindow, screen); + QPoint touchPos = touchInScreen.topLeft() - applicationRect.topLeft(); + touchPoint.area = QRectF(touchPos, QSize(0, 0)); touchPoint.normalPosition = QPointF(touchPos.x() / applicationRect.width(), touchPos.y() / applicationRect.height()); } } -- cgit v1.2.1 From 991b817e7521d56862f42aad78568368e16f0f48 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 27 May 2013 13:56:59 +0200 Subject: Avoid double-highdpi scaling for attached painters. updateMatrix will us both redirection matrix and highdpi scale matrix, so make sure we don't multiply it in twice. Change-Id: I7394e504746a8de54b4dc79492264deba320538f Reviewed-by: Richard Moe Gustavsen --- src/gui/painting/qpainter.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index d950c4e45f..cfb9d71f5c 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -293,6 +293,7 @@ bool QPainterPrivate::attachPainterPrivate(QPainter *q, QPaintDevice *pdev) // Update matrix. if (q->d_ptr->state->WxF) { q->d_ptr->state->redirectionMatrix = q->d_ptr->state->matrix; + q->d_ptr->state->redirectionMatrix *= q->d_ptr->hidpiScaleTransform().inverted(); q->d_ptr->state->redirectionMatrix.translate(-offset.x(), -offset.y()); q->d_ptr->state->worldMatrix = QTransform(); q->d_ptr->state->WxF = false; -- cgit v1.2.1 From 9fdb9b269b65b56ac87b938e49053a6549a9ca92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 15 May 2013 13:52:07 +0200 Subject: iOS: Use right DPI for all iPad Minis, not just the WiFi version The 3G versions are iPad2,6 and iPad2,7. Change-Id: I43a00e84535d494550bca8a533a6d16af4be6722 Reviewed-by: Ian Dean Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/ios/qiosscreen.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm index c1613c1af4..106cf1a978 100644 --- a/src/plugins/platforms/ios/qiosscreen.mm +++ b/src/plugins/platforms/ios/qiosscreen.mm @@ -136,7 +136,7 @@ QIOSScreen::QIOSScreen(unsigned int screenIndex) int unscaledDpi = 163; // Regular iPhone DPI if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad - && deviceIdentifier != QStringLiteral("iPad2,5") /* iPad Mini */) { + && !deviceIdentifier.contains(QRegularExpression("^iPad2,[567]$")) /* excluding iPad Mini */) { unscaledDpi = 132; }; -- cgit v1.2.1 From 7f1ad7c7c95ba37c172fa5819b2ba4f78bb3ceb6 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Fri, 24 May 2013 13:51:01 +0200 Subject: Fix transparent toplevels on Mac OS X again.. We're using QWindow::format() to decide opacity or not in a few places, but this used to resolve to QPlatformFormat::format() which would in turn return a default format without alpha set. Instead, return the format requested by the user. Masked windows were always broken as converting a 32-bit image to an Indexed8, doesn't give a grayscale image, but rather a randomly spreadout set of indices based on the colortable generated by the converToFormat function. Task-number: QTBUG-28531 Change-Id: I537288f85c70b1e6194785b9ebcb5ea1f9581cee Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoawindow.h | 1 + src/plugins/platforms/cocoa/qcocoawindow.mm | 5 +++++ src/plugins/platforms/cocoa/qnsview.mm | 19 ++++++++++++------- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h index 60f448044e..91eaea21b6 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.h +++ b/src/plugins/platforms/cocoa/qcocoawindow.h @@ -118,6 +118,7 @@ public: bool setKeyboardGrabEnabled(bool grab); bool setMouseGrabEnabled(bool grab); QMargins frameMargins() const; + QSurfaceFormat format() const; void requestActivateWindow(); diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index c8ef967f20..0dec048a9d 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -253,6 +253,11 @@ QCocoaWindow::~QCocoaWindow() [m_nsWindowDelegate release]; } +QSurfaceFormat QCocoaWindow::format() const +{ + return window()->requestedFormat(); +} + void QCocoaWindow::setGeometry(const QRect &rect) { if (geometry() == rect) diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 0916a1faa8..ee6a9616a6 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -340,15 +340,20 @@ static QTouchDevice *touchDevice = 0; } const QRect &rect = region->boundingRect(); - QImage maskImage(rect.size(), QImage::Format_RGB888); - maskImage.fill(Qt::white); - QPainter p(&maskImage); - p.setRenderHint(QPainter::Antialiasing); + QImage tmp(rect.size(), QImage::Format_RGB32); + tmp.fill(Qt::white); + QPainter p(&tmp); p.setClipRegion(*region); - p.fillRect(rect, QBrush(Qt::black)); + p.fillRect(rect, Qt::black); p.end(); - - maskImage = maskImage.convertToFormat(QImage::Format_Indexed8); + QImage maskImage = QImage(rect.size(), QImage::Format_Indexed8); + for (int y=0; y Date: Thu, 23 May 2013 14:24:50 +0200 Subject: iOS: bugfix function portraitToPrimary() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The old implementation was wrong since it did not use the screen's height (which was already in primary orientation) to calculate what the new y value of the target rect (which was in portrait) should be. Change-Id: Ie5b2241119e244d099e06d85f69953c1d64979aa Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/qiosglobal.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/ios/qiosglobal.mm b/src/plugins/platforms/ios/qiosglobal.mm index 9abb4ba851..537d63ae77 100644 --- a/src/plugins/platforms/ios/qiosglobal.mm +++ b/src/plugins/platforms/ios/qiosglobal.mm @@ -142,7 +142,7 @@ QRect fromPortraitToPrimary(const QRect &rect, QPlatformScreen *screen) // aligned with UIScreen into whatever is the current orientation of QScreen. QRect geometry = screen->geometry(); return geometry.width() < geometry.height() ? rect - : QRect(rect.y(), geometry.width() - rect.width() - rect.x(), rect.height(), rect.width()); + : QRect(rect.y(), geometry.height() - rect.width() - rect.x(), rect.height(), rect.width()); } QT_END_NAMESPACE -- cgit v1.2.1 From 680b6b2192480f908f967927f9c54b56cce6c6cc Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 28 May 2013 09:10:39 +0200 Subject: Android: Compile jar file on Windows Due to the way the DEX_CMD is formatted on Windows this would break every time. Since we actually bundle dx.bat in the repository, there's no need to check for its existence, so the easy fix is just to move the existence check into the code path where it's run from the SDK. Task-number: QTBUG-31405 Change-Id: If1aeb744d3abbd2488153b13aac401436965074e Reviewed-by: Oswald Buddenhagen Reviewed-by: Ray Donnelly --- mkspecs/features/java.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/java.prf b/mkspecs/features/java.prf index 7360103757..411a839ad8 100644 --- a/mkspecs/features/java.prf +++ b/mkspecs/features/java.prf @@ -62,8 +62,8 @@ android:!bundled_jar_file { } else { DEX_CMD = $$SDK_ROOT/platform-tools/dx !exists($$DEX_CMD): DEX_CMD = $$SDK_ROOT/build-tools/$$BUILD_TOOLS_REVISION/dx + !exists($$DEX_CMD): error("The path $$DEX_CMD does not exist. Please set the environment variable ANDROID_BUILD_TOOLS_REVISION to the revision of the build tools installed in your Android SDK.") } - !exists($$DEX_CMD): error("The path $$DEX_CMD does not exist. Please set the environment variable ANDROID_BUILD_TOOLS_REVISION to the revision of the build tools installed in your Android SDK.") QMAKE_LINK_SHLIB_CMD = $$DEX_CMD --dex --output $(TARGET) $$CLASS_DIR } else { QMAKE_LINK_SHLIB_CMD = jar cf $(TARGET) -C $$CLASS_DIR . -- cgit v1.2.1 From 85a6446164531ad400e1e2a62a42353c85571a2c Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 27 May 2013 19:56:12 +0200 Subject: Cocoa: Use actual modifiers when sending ShortcutOverride event Probably a typo since keyCode clearly has no modifiers encoded. Change-Id: I1c7908b06a759baf7b2c3462861a5d61f8c52b9f Reviewed-by: Frederik Gladhorn --- src/plugins/platforms/cocoa/qcocoamenu.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm index 18e17a340d..25ece7349c 100644 --- a/src/plugins/platforms/cocoa/qcocoamenu.mm +++ b/src/plugins/platforms/cocoa/qcocoamenu.mm @@ -177,7 +177,7 @@ static inline QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *getMenuLoader() } QKeyEvent accel_ev(QEvent::ShortcutOverride, (keyCode & (~Qt::KeyboardModifierMask)), - Qt::KeyboardModifiers(keyCode & Qt::KeyboardModifierMask)); + Qt::KeyboardModifiers(modifiers & Qt::KeyboardModifierMask)); accel_ev.ignore(); QCoreApplication::sendEvent(object, &accel_ev); if (accel_ev.isAccepted()) { -- cgit v1.2.1 From 81e981a704116ca7b1b619a2c1e8db837046d2cf Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 28 May 2013 10:17:32 +0200 Subject: Fix QPlatformWindow::initialGeometry() to not touch large windows. Do not touch windows whose geometry (including the unknown frame size) is likely to be larger than the screen. Remove fix-up in the Windows plugin. Task-number: QTBUG-30142 Task-number: QTBUG-31071 Change-Id: I13a8ffb9fb9d8c71d35de75094275388fa427f2c Reviewed-by: Shawn Rutledge Reviewed-by: Gabriel de Dietrich --- src/gui/kernel/qplatformwindow.cpp | 24 +++++++++++++++--------- src/plugins/platforms/windows/qwindowswindow.cpp | 9 --------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp index d23cfde172..4c0d68e7c1 100644 --- a/src/gui/kernel/qplatformwindow.cpp +++ b/src/gui/kernel/qplatformwindow.cpp @@ -510,15 +510,21 @@ QRect QPlatformWindow::initialGeometry(const QWindow *w, } } if (w->isTopLevel() && qt_window_private(const_cast(w))->positionAutomatic) { - const QWindow *tp = w->transientParent(); - if (tp) { - // A transient window should be centered w.r.t. its transient parent. - rect.moveCenter(tp->geometry().center()); - } else { - // Center the window on the screen. (Only applicable on platforms - // which do not provide a better way.) - QPlatformScreen *scr = QPlatformScreen::platformScreenForWindow(w); - rect.moveCenter(scr->availableGeometry().center()); + if (const QPlatformScreen *platformScreen = QPlatformScreen::platformScreenForWindow(w)) { + const QRect availableGeometry = platformScreen->availableGeometry(); + // Center unless the geometry ( + unknown window frame) is too large for the screen). + if (rect.height() < (availableGeometry.height() * 8) / 9 + && rect.width() < (availableGeometry.width() * 8) / 9) { + const QWindow *tp = w->transientParent(); + if (tp) { + // A transient window should be centered w.r.t. its transient parent. + rect.moveCenter(tp->geometry().center()); + } else { + // Center the window on the screen. (Only applicable on platforms + // which do not provide a better way.) + rect.moveCenter(availableGeometry.center()); + } + } } } return rect; diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 8ce6dcc9e7..9d817c2043 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -503,15 +503,6 @@ QWindowsWindow::WindowData const QWindowCreationContextPtr context(new QWindowCreationContext(w, rect, data.customMargins, style, exStyle)); QWindowsContext::instance()->setWindowCreationContext(context); - QRect screenGeometry; - if (QScreen *screen = w->screen()) - screenGeometry = screen->availableVirtualGeometry(); - - if (context->frameX < screenGeometry.left()) - context->frameX = screenGeometry.left(); - if (context->frameY < screenGeometry.top()) - context->frameY = screenGeometry.top(); - if (QWindowsContext::verboseWindows) qDebug().nospace() << "CreateWindowEx: " << w << *this -- cgit v1.2.1 From 72768c089a431eafcc816413c247c8b8d896fdce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 28 May 2013 15:43:05 +0200 Subject: Fixed crashes in QGLTextureDestroyer. QGLTextureDestroyer will try to make the context current on the GUI thread, regardless of whether it is owned by another thread. Use QOpenGLSharedResourceGuard instead which does the right thing and takes shared contexts into account. Task-number: QTBUG-31403 Change-Id: I1377f9284995a7ba5af32c85296eef152fc035c8 Reviewed-by: Gunnar Sletta --- src/opengl/qgl.cpp | 5 +---- src/opengl/qgl_p.h | 21 ++++++--------------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 72c6e035d9..3f496a4ffc 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1579,10 +1579,7 @@ QGLContextPrivate::QGLContextPrivate(QGLContext *context) { group = new QGLContextGroup(context); - if (qApp) { - texture_destroyer = new QGLTextureDestroyer; - texture_destroyer->moveToThread(qApp->thread()); - } + texture_destroyer = new QGLTextureDestroyer; } QGLContextPrivate::~QGLContextPrivate() diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index ff9baf8971..484c3ea2d9 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -335,25 +335,16 @@ QT_END_NAMESPACE Q_DECLARE_METATYPE(GLuint) QT_BEGIN_NAMESPACE -class Q_OPENGL_EXPORT QGLTextureDestroyer : public QObject +class Q_OPENGL_EXPORT QGLTextureDestroyer { - Q_OBJECT public: - QGLTextureDestroyer() : QObject() { - connect(this, SIGNAL(freeTexture(QGLContext *, QPlatformPixmap *, quint32)), - this, SLOT(freeTexture_slot(QGLContext *, QPlatformPixmap *, quint32))); - } - void emitFreeTexture(QGLContext *context, QPlatformPixmap *boundPixmap, GLuint id) { - emit freeTexture(context, boundPixmap, id); + void emitFreeTexture(QGLContext *context, QPlatformPixmap *, GLuint id) { + if (context->contextHandle()) + (new QOpenGLSharedResourceGuard(context->contextHandle(), id, freeTextureFunc))->free(); } -Q_SIGNALS: - void freeTexture(QGLContext *context, QPlatformPixmap *boundPixmap, quint32 id); - -private slots: - void freeTexture_slot(QGLContext *context, QPlatformPixmap *boundPixmap, quint32 id) { - Q_UNUSED(boundPixmap); - QGLShareContextScope scope(context); +private: + static void freeTextureFunc(QOpenGLFunctions *, GLuint id) { glDeleteTextures(1, &id); } }; -- cgit v1.2.1 From 89f219da0c720c326c4c3aa696141e368832ee43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 28 May 2013 09:42:52 +0200 Subject: Disable "QBackingStore::flush() called with non-exposed window" warning This warning is pretty annoying and doesn't necessarily imply that an application is not working properly. Task-number: QTBUG-28613 Change-Id: Id0a2ebd91f9e4d59dce3e3e29637988d8e6175a9 Reviewed-by: Friedemann Kleint Reviewed-by: Gunnar Sletta --- src/gui/painting/qbackingstore.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp index cd3f935c5b..edb5f66c5b 100644 --- a/src/gui/painting/qbackingstore.cpp +++ b/src/gui/painting/qbackingstore.cpp @@ -98,10 +98,12 @@ void QBackingStore::flush(const QRegion ®ion, QWindow *win, const QPoint &off if (!win) win = window(); +#ifdef QBACKINGSTORE_DEBUG if (win && win->isTopLevel() && !qt_window_private(win)->receivedExpose) { qWarning().nospace() << "QBackingStore::flush() called with non-exposed window " << win << ", behavior is undefined"; } +#endif d_ptr->platformBackingStore->flush(win, region, offset); } -- cgit v1.2.1 From 8230a0d38dd055387e5c5ed21dbff22cf93f853e Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 27 May 2013 15:00:20 +0200 Subject: qdoc: QML property lists were not shown For grouped properties, the property list in the summary section was not shown owing to a bug introduced when implementing the abstract base class concept for QML types. This has now been fixed. Task-number: QTBUG-31317 Change-Id: Idc2344539ecf3da53e1be6816f59e01922c5c6fc Reviewed-by: Jerome Pasion --- src/tools/qdoc/codemarker.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tools/qdoc/codemarker.cpp b/src/tools/qdoc/codemarker.cpp index e39ff203a5..c7d9c5b339 100644 --- a/src/tools/qdoc/codemarker.cpp +++ b/src/tools/qdoc/codemarker.cpp @@ -397,8 +397,11 @@ void CodeMarker::insert(FastSection &fastSection, bool irrelevant = false; bool inheritedMember = false; if (!node->relates()) { - if (node->parent() != fastSection.parent_) { // && !node->parent()->isAbstract()) { - if ((node->parent()->subType() != Node::QmlClass) || !node->parent()->isAbstract()) { + InnerNode* p = node->parent(); + if (p->subType() == Node::QmlPropertyGroup) + p = p->parent(); + if (p != fastSection.parent_) { // && !node->parent()->isAbstract()) { + if (p->subType() != Node::QmlClass || !p->isAbstract()) { //if (node->type() != Node::QmlProperty) { inheritedMember = true; } -- cgit v1.2.1 From a4fdd382e4a03e224a19c03c0a5b1d7e889842ff Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 28 May 2013 12:13:08 +0200 Subject: qdoc: "All Overview and HOWTOs" no longer lists internal pages This page is generated by a function in qdoc that was wwrriten especially for this page. It wasn't checking to see of the group member pages were marked with \internal. Now it does. Task-number: QTBUG-31197 Change-Id: If3f0e90f1a3748c47b3975373047b04d011d6748 Reviewed-by: Jerome Pasion --- src/tools/qdoc/ditaxmlgenerator.cpp | 4 ++-- src/tools/qdoc/htmlgenerator.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tools/qdoc/ditaxmlgenerator.cpp b/src/tools/qdoc/ditaxmlgenerator.cpp index eea1845e17..dd87e889bf 100644 --- a/src/tools/qdoc/ditaxmlgenerator.cpp +++ b/src/tools/qdoc/ditaxmlgenerator.cpp @@ -3138,7 +3138,7 @@ void DitaXmlGenerator::generateOverviewList(const Node* relative) // If we encounter a group definition page, we add all // the pages in that group to the list for that group. foreach (Node* member, docNode->members()) { - if (member->type() != Node::Document) + if (member->isInternal() || member->type() != Node::Document) continue; DocNode* page = static_cast(member); if (page) { @@ -3155,7 +3155,7 @@ void DitaXmlGenerator::generateOverviewList(const Node* relative) // If we encounter a page that belongs to a group then // we add that page to the list for that group. const DocNode* gn = qdb_->getGroup(group); - if (gn) + if (gn && !docNode->isInternal()) docNodeMap[gn].insert(sortKey, docNode); } } diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index 2dc4c1e6c6..7e1467f300 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -2644,7 +2644,7 @@ void HtmlGenerator::generateOverviewList(const Node *relative) // If we encounter a group definition page, we add all // the pages in that group to the list for that group. foreach (Node *member, docNode->members()) { - if (member->type() != Node::Document) + if (member->isInternal() || member->type() != Node::Document) continue; DocNode *page = static_cast(member); if (page) { @@ -2661,7 +2661,7 @@ void HtmlGenerator::generateOverviewList(const Node *relative) // If we encounter a page that belongs to a group then // we add that page to the list for that group. const DocNode* gn = qdb_->getGroup(group); - if (gn) + if (gn && !docNode->isInternal()) docNodeMap[gn].insert(sortKey, docNode); } } -- cgit v1.2.1 From 1faafdbe4a9ef79c9afec8d9a5e8c126a1384d9a Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 28 May 2013 16:09:59 +0200 Subject: Cocoa: Hide empty menus from the menubar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-31378 Change-Id: I33ab2979a26166fb07e836c85dfc8089af5e1fda Reviewed-by: Tor Arne Vestbø Reviewed-by: Shawn Rutledge --- src/plugins/platforms/cocoa/qcocoamenubar.mm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.mm b/src/plugins/platforms/cocoa/qcocoamenubar.mm index b112e40549..e280cf4581 100644 --- a/src/plugins/platforms/cocoa/qcocoamenubar.mm +++ b/src/plugins/platforms/cocoa/qcocoamenubar.mm @@ -136,6 +136,17 @@ void QCocoaMenuBar::syncMenu(QPlatformMenu *menu) QCocoaMenu *cocoaMenu = static_cast(menu); Q_FOREACH (QCocoaMenuItem *item, cocoaMenu->items()) cocoaMenu->syncMenuItem(item); + + // If the NSMenu has no visble items, or only separators, we should hide it + // on the menubar. This can happen after syncing the menu items since they + // can be moved to other menus. + BOOL shouldHide = YES; + for (NSMenuItem *item in [cocoaMenu->nsMenu() itemArray]) + if (![item isSeparatorItem] && ![item isHidden]) { + shouldHide = NO; + break; + } + [cocoaMenu->nsMenuItem() setHidden:shouldHide]; } void QCocoaMenuBar::handleReparent(QWindow *newParentWindow) -- cgit v1.2.1 From a09a867de081b4e335ce36b7377ce33abcd3e142 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 28 May 2013 16:10:52 +0200 Subject: Cocoa: Allow delayed title setting in menu items MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is what happens in uic generated code. Therefore, we should not mark an item as text-synced until it's got its text set. Task-number: QTBUG-31378 Change-Id: I7bb7db8abad922b50546c7669d285369ebf01394 Reviewed-by: Friedemann Kleint Reviewed-by: Tor Arne Vestbø Reviewed-by: Shawn Rutledge --- src/plugins/platforms/cocoa/qcocoamenuitem.mm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoamenuitem.mm b/src/plugins/platforms/cocoa/qcocoamenuitem.mm index 1255f75eb7..1e2b593a08 100644 --- a/src/plugins/platforms/cocoa/qcocoamenuitem.mm +++ b/src/plugins/platforms/cocoa/qcocoamenuitem.mm @@ -241,7 +241,8 @@ NSMenuItem *QCocoaMenuItem::sync() mergeItem = [loader quitMenuItem]; break; default: - m_textSynced = true; + if (!m_text.isEmpty()) + m_textSynced = true; break; } break; @@ -264,7 +265,7 @@ NSMenuItem *QCocoaMenuItem::sync() m_native = nil; // create item below m_merged = false; } - } else { + } else if (!m_text.isEmpty()) { m_textSynced = true; // NoRole, and that was set explicitly. So, nothing to do anymore. } -- cgit v1.2.1 From 75cdce283f03fb26a34750bc075f62e8bc35232a Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 28 May 2013 18:18:29 +0200 Subject: QMenu: Remove last references to QMacWindowFader MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was never ported to Qt 5, and 10.7 has simple API for that. Task-number: QTBUG-31336 Change-Id: Ie00c4ed3af9cd098c9e63eba1c654f1801aa83aa Reviewed-by: Tor Arne Vestbø Reviewed-by: Shawn Rutledge --- src/plugins/platforms/cocoa/qcocoawindow.mm | 3 +++ src/plugins/platforms/cocoa/qt_mac_p.h | 15 -------------- src/widgets/widgets/qmenu.cpp | 31 +++-------------------------- src/widgets/widgets/qmenu_p.h | 2 +- 4 files changed, 7 insertions(+), 44 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 0dec048a9d..f8d0eafcb3 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -823,6 +823,9 @@ NSWindow * QCocoaWindow::createNSWindow() if (QSysInfo::QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) { // Make popup winows show on the same desktop as the parent full-screen window. [window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenAuxiliary]; + + if ((type & Qt::Popup) == Qt::Popup) + [window setAnimationBehavior:NSWindowAnimationBehaviorUtilityWindow]; } #endif window->m_cocoaPlatformWindow = this; diff --git a/src/plugins/platforms/cocoa/qt_mac_p.h b/src/plugins/platforms/cocoa/qt_mac_p.h index 0906431986..808ca9194b 100644 --- a/src/plugins/platforms/cocoa/qt_mac_p.h +++ b/src/plugins/platforms/cocoa/qt_mac_p.h @@ -111,21 +111,6 @@ public: } }; -// Class for chaining to gether a bunch of fades. It pretty much is only used for qmenu fading. -class QMacWindowFader -{ - QWidgetList m_windowsToFade; - float m_duration; - Q_DISABLE_COPY(QMacWindowFader) -public: - QMacWindowFader(); // PLEASE DON'T CALL THIS. - static QMacWindowFader *currentFader(); - void registerWindowToFade(QWidget *window); - void setFadeDuration(float durationInSecs) { m_duration = durationInSecs; } - float fadeDuration() const { return m_duration; } - void performFade(); -}; - class Q_WIDGETS_EXPORT QMacCocoaAutoReleasePool { private: diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index 33d2e01ed7..7c72c5c456 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -420,25 +420,17 @@ void QMenuPrivate::hideUpToMenuBar() if (QMenu *m = qobject_cast(caused)) { caused = m->d_func()->causedPopup.widget; if (!m->d_func()->tornoff) - hideMenu(m, fadeMenus); + hideMenu(m); if (!fadeMenus) // Mac doesn't clear the action until after hidden. m->d_func()->setCurrentAction(0); } else { caused = 0; } } -#if defined(Q_WS_MAC) - if (fadeMenus) { - QEventLoop eventLoop; - QTimer::singleShot(int(MenuFadeTimeInSec * 1000), &eventLoop, SLOT(quit())); - QMacWindowFader::currentFader()->performFade(); - eventLoop.exec(); - } -#endif } setCurrentAction(0); } -void QMenuPrivate::hideMenu(QMenu *menu, bool justRegister) +void QMenuPrivate::hideMenu(QMenu *menu) { if (!menu) return; @@ -462,27 +454,10 @@ void QMenuPrivate::hideMenu(QMenu *menu, bool justRegister) eventLoop.exec(); } - // Fade out. - if (menu->style()->styleHint(QStyle::SH_Menu_FadeOutOnHide)) { - // ### Qt 4.4: - // Should be something like: q->transitionWindow(Qt::FadeOutTransition, MenuFadeTimeInSec); - // Hopefully we'll integrate qt/research/windowtransitions into main before 4.4. - // Talk to Richard, Trenton or Bjoern. -#if defined(Q_WS_MAC) - if (justRegister) { - QMacWindowFader::currentFader()->setFadeDuration(MenuFadeTimeInSec); - QMacWindowFader::currentFader()->registerWindowToFade(menu); - } else { - macWindowFade(qt_mac_window_for(menu), MenuFadeTimeInSec); - } - -#endif // Q_WS_MAC - } aboutToHide = false; menu->blockSignals(false); #endif // QT_NO_EFFECTS - if (!justRegister) - menu->close(); + menu->close(); } void QMenuPrivate::popupAction(QAction *action, int delay, bool activateFirst) diff --git a/src/widgets/widgets/qmenu_p.h b/src/widgets/widgets/qmenu_p.h index 15f3c92127..71a3fca237 100644 --- a/src/widgets/widgets/qmenu_p.h +++ b/src/widgets/widgets/qmenu_p.h @@ -189,7 +189,7 @@ public: virtual QList > calcCausedStack() const; QMenuCaused causedPopup; void hideUpToMenuBar(); - void hideMenu(QMenu *menu, bool justRegister = false); + void hideMenu(QMenu *menu); //index mappings inline QAction *actionAt(int i) const { return q_func()->actions().at(i); } -- cgit v1.2.1 From c3bec846ac89bb79fbdfa5e2bedb3495b0055b09 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 28 May 2013 21:40:01 +0200 Subject: remove bizarre perl detection magic the code makes no sense, and was added with the QNX port without comment. there is already a detection a few lines up. Change-Id: I18ec18604c37c7c42f2649a658dd22324d481dd3 Reviewed-by: Andreas Holzammer Reviewed-by: Harald Fernengel Reviewed-by: Rafael Roquetto --- configure | 6 ------ 1 file changed, 6 deletions(-) diff --git a/configure b/configure index d11a50554f..079f2e7415 100755 --- a/configure +++ b/configure @@ -2344,12 +2344,6 @@ for e in gawk nawk awk; do fi done -# find perl -PERL="/usr/bin/perl" -if "$WHICH" perl >/dev/null 2>&1 && ( perl /dev/null ) >/dev/null 2>&1; then - PERL=`$WHICH perl` -fi - ### skip this if the user just needs help... if [ "$OPT_HELP" != "yes" ]; then -- cgit v1.2.1 From 389b6f51613a2d34b132b3955e8595bc594a336a Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Tue, 28 May 2013 13:47:32 +0200 Subject: qdoc: Handle collision nodes when building index files Currently qdoc skips collision nodes (and their children) when reading index files. This means that cross-linking between modules does not work for nodes that are defined under a collision page node. Most notably, the QML global object 'Qt' cannot be linked to from outside Qml module as it collides with Qt namespace. This change fixes the issue by skipping collision nodes and only processing their children when writing index files. In addition, we need to adjust the function that searches for nodes to the possibility that there may be multiple nodes with the same name but different type. Task-number: QTBUG-31096 Change-Id: Ic71d714f85539d8537021c73d8f1a527006a6f23 Reviewed-by: Martin Smith --- src/tools/qdoc/node.cpp | 9 ++++++--- src/tools/qdoc/qdocindexfiles.cpp | 7 ++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/tools/qdoc/node.cpp b/src/tools/qdoc/node.cpp index e627cf859e..2184e302ae 100644 --- a/src/tools/qdoc/node.cpp +++ b/src/tools/qdoc/node.cpp @@ -862,9 +862,12 @@ Node* InnerNode::findChildNodeByNameAndType(const QString& name, Type type) if (type == Function) return primaryFunctionMap.value(name); else { - Node *node = childMap.value(name); - if (node && node->type() == type) - return node; + QList nodes = childMap.values(name); + for (int i=0; itype() == type) + return node; + } } return 0; } diff --git a/src/tools/qdoc/qdocindexfiles.cpp b/src/tools/qdoc/qdocindexfiles.cpp index daba2cc78a..5f2ebdfd07 100644 --- a/src/tools/qdoc/qdocindexfiles.cpp +++ b/src/tools/qdoc/qdocindexfiles.cpp @@ -1183,8 +1183,13 @@ void QDocIndexFiles::generateIndexSections(QXmlStreamWriter& writer, It is just a place holder for a collection of QML property nodes. Recurse to its children, which are the QML property nodes. + + Do the same thing for collision nodes - we want children + of collision nodes in the index, but leaving out the + parent collision page will make searching for nodes easier. */ - if (child->subType() == Node::QmlPropertyGroup) { + if (child->subType() == Node::QmlPropertyGroup || + child->subType() == Node::Collision) { const InnerNode* pgn = static_cast(child); foreach (Node* c, pgn->childNodes()) { generateIndexSections(writer, c, generateInternalNodes); -- cgit v1.2.1 From aa1b4c0943187d82e0c313b93559e99226a9c75a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 2 May 2013 17:04:08 +0200 Subject: Disable precision timers when running MSVC2012 code on pre-Windows 8. Precision timers can cause the event loop to lock up when running MSVC2012 code on pre-Windows 8. Task-number: QTBUG-27266 Change-Id: Idd73731e82843d0d140859bab825bc1a54eccf1a Reviewed-by: Gunnar Sletta --- src/corelib/kernel/qeventdispatcher_win.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp index ae291f13cd..d1bd8fbe95 100644 --- a/src/corelib/kernel/qeventdispatcher_win.cpp +++ b/src/corelib/kernel/qeventdispatcher_win.cpp @@ -52,6 +52,8 @@ #include "qelapsedtimer.h" #include "qcoreapplication_p.h" +#include "qsysinfo.h" + #include #include @@ -305,8 +307,14 @@ static void resolveTimerAPI() #endif triedResolve = true; #if !defined(Q_OS_WINCE) +# if defined(_MSC_VER) && _MSC_VER >= 1700 + if (QSysInfo::WindowsVersion >= QSysInfo::WV_WINDOWS8) { // QTBUG-27266, Disable when running MSVC2012-built code on pre-Windows 8 +# else + { +# endif qtimeSetEvent = (ptimeSetEvent)QSystemLibrary::resolve(QLatin1String("winmm"), "timeSetEvent"); qtimeKillEvent = (ptimeKillEvent)QSystemLibrary::resolve(QLatin1String("winmm"), "timeKillEvent"); + } #else qtimeSetEvent = (ptimeSetEvent)QSystemLibrary::resolve(QLatin1String("Mmtimer"), "timeSetEvent"); qtimeKillEvent = (ptimeKillEvent)QSystemLibrary::resolve(QLatin1String("Mmtimer"), "timeKillEvent"); -- cgit v1.2.1 From 853a0b764e08d5f910072b6f3fd3ff3f9dc5c0c4 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 29 May 2013 12:54:15 +0200 Subject: fix PlatformToolSet tag location in vcxproj files The PlatformToolSet tag belongs into the PropertyGroup with the label "Configuration". The former location in an anonymous PropertyGroup tricked Visual Studio into displaying the right PlatformToolSet but using its default value. If VS 2010 and VS 2012 are freshly installed on the same machine, the default toolset for VS 2012 is VS 2010. Task-number: QTBUG-30822 Change-Id: If00a532e92b0812c552b1cac52ff77a1e7039146 Reviewed-by: Oswald Buddenhagen Reviewed-by: Joerg Bornemann --- qmake/generators/win32/msbuild_objectmodel.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index 67446b2efe..44fbf20f81 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -182,6 +182,7 @@ const char _Optimization[] = "Optimization"; const char _OptimizeReferences[] = "OptimizeReferences"; const char _OutputDirectory[] = "OutputDirectory"; const char _OutputFile[] = "OutputFile"; +const char _PlatformToolSet[] = "PlatformToolSet"; const char _PrecompiledHeader[] = "PrecompiledHeader"; const char _PrecompiledHeaderFile[] = "PrecompiledHeaderFile"; const char _PrecompiledHeaderOutputFile[] = "PrecompiledHeaderOutputFile"; @@ -467,10 +468,6 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProjectSingleConfig &tool) << attrTag("Condition", condition) << valueTag(tool.Configuration.IntermediateDirectory); } - if (tool.Configuration.CompilerVersion >= NET2012) { - xml << tagValue("PlatformToolSet", - platformToolSetVersion(tool.Configuration.CompilerVersion)); - } if ( !tool.Configuration.PrimaryOutput.isEmpty() ) { xml<< tag("TargetName") << attrTag("Condition", condition) @@ -668,10 +665,6 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool) << attrTag("Condition", condition) << valueTag(config.IntermediateDirectory); } - if (config.CompilerVersion >= NET2012) { - xml << tagValue("PlatformToolSet", - platformToolSetVersion(config.CompilerVersion)); - } if (!config.PrimaryOutput.isEmpty()) { xml << tag("TargetName") << attrTag("Condition", condition) @@ -1649,6 +1642,7 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCConfiguration &tool) xml << tag("PropertyGroup") << attrTag("Condition", generateCondition(tool)) << attrTag("Label", "Configuration") + << attrTagS(_PlatformToolSet, platformToolSetVersion(tool.CompilerVersion)) << attrTagS(_OutputDirectory, tool.OutputDirectory) << attrTagT(_ATLMinimizesCRunTimeLibraryUsage, tool.ATLMinimizesCRunTimeLibraryUsage) << attrTagT(_BuildBrowserInformation, tool.BuildBrowserInformation) @@ -2057,7 +2051,6 @@ QString VCXProjectWriter::platformToolSetVersion(const DotNET version) case NET2012: return "v110"; } - Q_ASSERT(!"This MSVC version does not support the PlatformToolSet tag!"); return QString(); } -- cgit v1.2.1 From 1df7a6a50a794721edb1bc63d268378f4f0ed7c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Thu, 23 May 2013 12:44:20 +0200 Subject: Move QBasicDrag and QSimpleDrag to QtGui. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These are useful as default implementations of QPlatformIntegration::drag(), instead of having it return 0 which will lead to crashes in Qt Quick 2 and widgets applications that use drag and drop. Task-number: QTBUG-31288 Change-Id: I70efa139306ced5d879def0f74e3a72d3bcd64f7 Reviewed-by: Jørgen Lind --- src/gui/kernel/kernel.pri | 4 + src/gui/kernel/qplatformintegration.cpp | 7 +- src/gui/kernel/qshapedpixmapdndwindow.cpp | 106 ++++++ src/gui/kernel/qshapedpixmapdndwindow_p.h | 75 +++++ src/gui/kernel/qsimpledrag.cpp | 366 +++++++++++++++++++++ src/gui/kernel/qsimpledrag_p.h | 122 +++++++ src/platformsupport/dnd/dnd.pri | 6 - src/platformsupport/dnd/qshapedpixmapdndwindow.cpp | 106 ------ src/platformsupport/dnd/qshapedpixmapdndwindow_p.h | 75 ----- src/platformsupport/dnd/qsimpledrag.cpp | 366 --------------------- src/platformsupport/dnd/qsimpledrag_p.h | 122 ------- src/platformsupport/platformsupport.pro | 1 - src/plugins/platforms/cocoa/qcocoadrag.h | 2 +- src/plugins/platforms/qnx/qqnxintegration.cpp | 2 +- src/plugins/platforms/xcb/qxcbdrag.cpp | 4 +- src/plugins/platforms/xcb/qxcbdrag.h | 2 +- 16 files changed, 684 insertions(+), 682 deletions(-) create mode 100644 src/gui/kernel/qshapedpixmapdndwindow.cpp create mode 100644 src/gui/kernel/qshapedpixmapdndwindow_p.h create mode 100644 src/gui/kernel/qsimpledrag.cpp create mode 100644 src/gui/kernel/qsimpledrag_p.h delete mode 100644 src/platformsupport/dnd/dnd.pri delete mode 100644 src/platformsupport/dnd/qshapedpixmapdndwindow.cpp delete mode 100644 src/platformsupport/dnd/qshapedpixmapdndwindow_p.h delete mode 100644 src/platformsupport/dnd/qsimpledrag.cpp delete mode 100644 src/platformsupport/dnd/qsimpledrag_p.h diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri index 91374fe2dd..3c019fc5b5 100644 --- a/src/gui/kernel/kernel.pri +++ b/src/gui/kernel/kernel.pri @@ -31,6 +31,8 @@ HEADERS += \ kernel/qplatformclipboard.h \ kernel/qplatformnativeinterface.h \ kernel/qplatformmenu.h \ + kernel/qshapedpixmapdndwindow_p.h \ + kernel/qsimpledrag_p.h \ kernel/qsurfaceformat.h \ kernel/qguiapplication.h \ kernel/qguiapplication_p.h \ @@ -89,6 +91,8 @@ SOURCES += \ kernel/qplatformclipboard.cpp \ kernel/qplatformnativeinterface.cpp \ kernel/qsessionmanager.cpp \ + kernel/qshapedpixmapdndwindow.cpp \ + kernel/qsimpledrag.cpp \ kernel/qsurfaceformat.cpp \ kernel/qguiapplication.cpp \ kernel/qwindow.cpp \ diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp index e82e30df80..e4f45ebb6e 100644 --- a/src/gui/kernel/qplatformintegration.cpp +++ b/src/gui/kernel/qplatformintegration.cpp @@ -49,6 +49,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE @@ -99,7 +100,11 @@ QPlatformClipboard *QPlatformIntegration::clipboard() const */ QPlatformDrag *QPlatformIntegration::drag() const { - return 0; + static QSimpleDrag *drag = 0; + if (!drag) { + drag = new QSimpleDrag; + } + return drag; } #endif diff --git a/src/gui/kernel/qshapedpixmapdndwindow.cpp b/src/gui/kernel/qshapedpixmapdndwindow.cpp new file mode 100644 index 0000000000..b3e64b01d0 --- /dev/null +++ b/src/gui/kernel/qshapedpixmapdndwindow.cpp @@ -0,0 +1,106 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qshapedpixmapdndwindow_p.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +QShapedPixmapWindow::QShapedPixmapWindow() + : QWindow(), + m_backingStore(0) +{ + QSurfaceFormat format; + format.setAlphaBufferSize(8); + setFormat(format); + setSurfaceType(RasterSurface); + setFlags(Qt::ToolTip | Qt::FramelessWindowHint | + Qt::X11BypassWindowManagerHint | Qt::WindowTransparentForInput); + create(); + m_backingStore = new QBackingStore(this); +} + +void QShapedPixmapWindow::render() +{ + QRect rect(QPoint(), geometry().size()); + + m_backingStore->beginPaint(rect); + + QPaintDevice *device = m_backingStore->paintDevice(); + + { + QPainter p(device); + p.setCompositionMode(QPainter::CompositionMode_Source); + p.drawPixmap(0, 0, m_pixmap); + } + + m_backingStore->endPaint(); + m_backingStore->flush(rect); +} + +void QShapedPixmapWindow::setPixmap(const QPixmap &pixmap) +{ + m_pixmap = pixmap; +} + +void QShapedPixmapWindow::setHotspot(const QPoint &hotspot) +{ + m_hotSpot = hotspot; +} + +void QShapedPixmapWindow::updateGeometry() +{ + QRect rect(QCursor::pos() - m_hotSpot, m_pixmap.size()); + if (m_pixmap.isNull()) + m_backingStore->resize(QSize(1,1)); + else if (m_backingStore->size() != m_pixmap.size()) + m_backingStore->resize(m_pixmap.size()); + setGeometry(rect); +} + +void QShapedPixmapWindow::exposeEvent(QExposeEvent *) +{ + render(); +} + +QT_END_NAMESPACE diff --git a/src/gui/kernel/qshapedpixmapdndwindow_p.h b/src/gui/kernel/qshapedpixmapdndwindow_p.h new file mode 100644 index 0000000000..20674b6b19 --- /dev/null +++ b/src/gui/kernel/qshapedpixmapdndwindow_p.h @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QSHAPEDPIXMAPDNDWINDOW_H +#define QSHAPEDPIXMAPDNDWINDOW_H + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QShapedPixmapWindow : public QWindow +{ + Q_OBJECT +public: + QShapedPixmapWindow(); + + void render(); + + void setPixmap(const QPixmap &pixmap); + void setHotspot(const QPoint &hotspot); + + void updateGeometry(); + +protected: + void exposeEvent(QExposeEvent *); + +private: + QBackingStore *m_backingStore; + QPixmap m_pixmap; + QPoint m_hotSpot; +}; + +QT_END_NAMESPACE + +#endif // QSHAPEDPIXMAPDNDWINDOW_H diff --git a/src/gui/kernel/qsimpledrag.cpp b/src/gui/kernel/qsimpledrag.cpp new file mode 100644 index 0000000000..f6912a2d57 --- /dev/null +++ b/src/gui/kernel/qsimpledrag.cpp @@ -0,0 +1,366 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qsimpledrag_p.h" + +#include "qbitmap.h" +#include "qdrag.h" +#include "qpixmap.h" +#include "qevent.h" +#include "qfile.h" +#include "qtextcodec.h" +#include "qguiapplication.h" +#include "qpoint.h" +#include "qbuffer.h" +#include "qimage.h" +#include "qregexp.h" +#include "qdir.h" +#include "qimagereader.h" +#include "qimagewriter.h" + +#include +#include + +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +#ifndef QT_NO_DRAGANDDROP + +static QWindow* topLevelAt(const QPoint &pos) +{ + QWindowList list = QGuiApplication::topLevelWindows(); + for (int i = list.count()-1; i >= 0; --i) { + QWindow *w = list.at(i); + if (w->isVisible() && w->geometry().contains(pos) && !qobject_cast(w)) + return w; + } + return 0; +} + +/*! + \class QBasicDrag + \brief QBasicDrag is a base class for implementing platform drag and drop. + \since 5.0 + \internal + \ingroup qpa + + QBasicDrag implements QPlatformDrag::drag() by running a local event loop in which + it tracks mouse movements and moves the drag icon (QShapedPixmapWindow) accordingly. + It provides new virtuals allowing for querying whether the receiving window + (within the Qt application or outside) accepts the drag and sets the state accordingly. +*/ + +QBasicDrag::QBasicDrag() : + m_restoreCursor(false), m_eventLoop(0), + m_executed_drop_action(Qt::IgnoreAction), m_can_drop(false), + m_drag(0), m_drag_icon_window(0) +{ +} + +QBasicDrag::~QBasicDrag() +{ + delete m_drag_icon_window; +} + +void QBasicDrag::enableEventFilter() +{ + qApp->installEventFilter(this); +} + +void QBasicDrag::disableEventFilter() +{ + qApp->removeEventFilter(this); +} + +bool QBasicDrag::eventFilter(QObject *o, QEvent *e) +{ + if (!m_drag) { + if (e->type() == QEvent::KeyRelease && static_cast(e)->key() == Qt::Key_Escape) { + disableEventFilter(); + exitDndEventLoop(); + return true; // block the key release + } + return false; + } + + if (!qobject_cast(o)) + return false; + + switch (e->type()) { + case QEvent::ShortcutOverride: + // prevent accelerators from firing while dragging + e->accept(); + return true; + + case QEvent::KeyPress: + case QEvent::KeyRelease: + { + QKeyEvent *ke = static_cast(e); + if (ke->key() == Qt::Key_Escape && e->type() == QEvent::KeyPress) { + cancel(); + disableEventFilter(); + exitDndEventLoop(); + + } + return true; // Eat all key events + } + + case QEvent::MouseMove: + move(static_cast(e)); + return true; // Eat all mouse events + + case QEvent::MouseButtonRelease: + disableEventFilter(); + if (canDrop()) { + drop(static_cast(e)); + } else { + cancel(); + } + exitDndEventLoop(); + return true; // Eat all mouse events + + case QEvent::MouseButtonPress: + case QEvent::MouseButtonDblClick: + case QEvent::Wheel: + return true; + default: + break; + } + return false; +} + +Qt::DropAction QBasicDrag::drag(QDrag *o) +{ + m_drag = o; + m_executed_drop_action = Qt::IgnoreAction; + m_can_drop = false; + m_restoreCursor = true; +#ifndef QT_NO_CURSOR + qApp->setOverrideCursor(Qt::DragCopyCursor); + updateCursor(m_executed_drop_action); +#endif + startDrag(); + m_eventLoop = new QEventLoop; + m_eventLoop->exec(); + delete m_eventLoop; + m_eventLoop = 0; + m_drag = 0; + endDrag(); + return m_executed_drop_action; +} + +void QBasicDrag::restoreCursor() +{ + if (m_restoreCursor) { +#ifndef QT_NO_CURSOR + QGuiApplication::restoreOverrideCursor(); +#endif + m_restoreCursor = false; + } +} + +void QBasicDrag::startDrag() +{ + // ### TODO Check if its really necessary to have m_drag_icon_window + // when QDrag is used without a pixmap - QDrag::setPixmap() + if (!m_drag_icon_window) + m_drag_icon_window = new QShapedPixmapWindow(); + + m_drag_icon_window->setPixmap(m_drag->pixmap()); + m_drag_icon_window->setHotspot(m_drag->hotSpot()); + m_drag_icon_window->updateGeometry(); + m_drag_icon_window->setVisible(true); + + enableEventFilter(); +} + +void QBasicDrag::endDrag() +{ +} + +void QBasicDrag::cancel() +{ + disableEventFilter(); + restoreCursor(); + m_drag_icon_window->setVisible(false); +} + +void QBasicDrag::move(const QMouseEvent *) +{ + if (m_drag) + m_drag_icon_window->updateGeometry(); +} + +void QBasicDrag::drop(const QMouseEvent *) +{ + disableEventFilter(); + restoreCursor(); + m_drag_icon_window->setVisible(false); +} + +void QBasicDrag::exitDndEventLoop() +{ + if (m_eventLoop && m_eventLoop->isRunning()) + m_eventLoop->exit(); +} + +void QBasicDrag::updateCursor(Qt::DropAction action) +{ +#ifndef QT_NO_CURSOR + Qt::CursorShape cursorShape = Qt::ForbiddenCursor; + if (canDrop()) { + switch (action) { + case Qt::CopyAction: + cursorShape = Qt::DragCopyCursor; + break; + case Qt::LinkAction: + cursorShape = Qt::DragLinkCursor; + break; + default: + cursorShape = Qt::DragMoveCursor; + break; + } + } + + QCursor *cursor = qApp->overrideCursor(); + QPixmap pixmap = m_drag->dragCursor(action); + if (!cursor) { + qApp->changeOverrideCursor((pixmap.isNull()) ? QCursor(cursorShape) : QCursor(pixmap)); + } else { + if (!pixmap.isNull()) { + if ((cursor->pixmap().cacheKey() != pixmap.cacheKey())) { + qApp->changeOverrideCursor(QCursor(pixmap)); + } + } else { + if (cursorShape != cursor->shape()) { + qApp->changeOverrideCursor(QCursor(cursorShape)); + } + } + } +#endif + updateAction(action); +} + +/*! + \class QSimpleDrag + \brief QSimpleDrag implements QBasicDrag for Drag and Drop operations within the Qt Application itself. + \since 5.0 + \internal + \ingroup qpa + + The class checks whether the receiving window is a window of the Qt application + and sets the state accordingly. It does not take windows of other applications + into account. +*/ + +QSimpleDrag::QSimpleDrag() : m_current_window(0) +{ +} + +QMimeData *QSimpleDrag::platformDropData() +{ + if (drag()) + return drag()->mimeData(); + return 0; +} + +void QSimpleDrag::startDrag() +{ + QBasicDrag::startDrag(); + m_current_window = topLevelAt(QCursor::pos()); + if (m_current_window) { + QPlatformDragQtResponse response = QWindowSystemInterface::handleDrag(m_current_window, drag()->mimeData(), QCursor::pos(), drag()->supportedActions()); + setCanDrop(response.isAccepted()); + updateCursor(response.acceptedAction()); + } else { + setCanDrop(false); + updateCursor(Qt::IgnoreAction); + } + setExecutedDropAction(Qt::IgnoreAction); +} + +void QSimpleDrag::cancel() +{ + QBasicDrag::cancel(); + if (drag()) + QWindowSystemInterface::handleDrag(m_current_window, 0, QPoint(), Qt::IgnoreAction); + m_current_window = 0; +} + +void QSimpleDrag::move(const QMouseEvent *me) +{ + QBasicDrag::move(me); + QWindow *window = topLevelAt(me->globalPos()); + if (!window) + return; + + const QPoint pos = me->globalPos() - window->geometry().topLeft(); + const QPlatformDragQtResponse qt_response = + QWindowSystemInterface::handleDrag(window, drag()->mimeData(), pos, drag()->supportedActions()); + + updateCursor(qt_response.acceptedAction()); + setCanDrop(qt_response.isAccepted()); +} + +void QSimpleDrag::drop(const QMouseEvent *me) +{ + QBasicDrag::drop(me); + QWindow *window = topLevelAt(me->globalPos()); + if (!window) + return; + + const QPoint pos = me->globalPos() - window->geometry().topLeft(); + const QPlatformDropQtResponse response = + QWindowSystemInterface::handleDrop(window, drag()->mimeData(),pos, drag()->supportedActions()); + if (response.isAccepted()) { + setExecutedDropAction(response.acceptedAction()); + } else { + setExecutedDropAction(Qt::IgnoreAction); + } +} + +#endif // QT_NO_DRAGANDDROP + +QT_END_NAMESPACE diff --git a/src/gui/kernel/qsimpledrag_p.h b/src/gui/kernel/qsimpledrag_p.h new file mode 100644 index 0000000000..36ea4c1ec5 --- /dev/null +++ b/src/gui/kernel/qsimpledrag_p.h @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QSIMPLEDRAG_H +#define QSIMPLEDRAG_H + +#include + +#include + +QT_BEGIN_NAMESPACE + +#ifndef QT_NO_DRAGANDDROP + +class QMouseEvent; +class QWindow; +class QEventLoop; +class QDropData; +class QShapedPixmapWindow; + +class Q_GUI_EXPORT QBasicDrag : public QPlatformDrag, public QObject +{ +public: + virtual ~QBasicDrag(); + + virtual Qt::DropAction drag(QDrag *drag); + + virtual bool eventFilter(QObject *o, QEvent *e); + +protected: + QBasicDrag(); + + virtual void startDrag(); + virtual void cancel(); + virtual void move(const QMouseEvent *me); + virtual void drop(const QMouseEvent *me); + virtual void endDrag(); + + QShapedPixmapWindow *shapedPixmapWindow() const { return m_drag_icon_window; } + void updateCursor(Qt::DropAction action); + + bool canDrop() const { return m_can_drop; } + void setCanDrop(bool c) { m_can_drop = c; } + + Qt::DropAction executedDropAction() const { return m_executed_drop_action; } + void setExecutedDropAction(Qt::DropAction da) { m_executed_drop_action = da; } + + QDrag *drag() const { return m_drag; } + +private: + void enableEventFilter(); + void disableEventFilter(); + void restoreCursor(); + void exitDndEventLoop(); + + bool m_restoreCursor; + QEventLoop *m_eventLoop; + Qt::DropAction m_executed_drop_action; + bool m_can_drop; + QDrag *m_drag; + QShapedPixmapWindow *m_drag_icon_window; +}; + +class Q_GUI_EXPORT QSimpleDrag : public QBasicDrag +{ +public: + QSimpleDrag(); + virtual QMimeData *platformDropData(); + +protected: + virtual void startDrag(); + virtual void cancel(); + virtual void move(const QMouseEvent *me); + virtual void drop(const QMouseEvent *me); + +private: + QWindow *m_current_window; +}; + +#endif // QT_NO_DRAGANDDROP + +QT_END_NAMESPACE + +#endif diff --git a/src/platformsupport/dnd/dnd.pri b/src/platformsupport/dnd/dnd.pri deleted file mode 100644 index 47feb81ef2..0000000000 --- a/src/platformsupport/dnd/dnd.pri +++ /dev/null @@ -1,6 +0,0 @@ -HEADERS += \ - $$PWD/qsimpledrag_p.h \ - $$PWD/qshapedpixmapdndwindow_p.h -SOURCES += \ - $$PWD/qsimpledrag.cpp \ - $$PWD/qshapedpixmapdndwindow.cpp diff --git a/src/platformsupport/dnd/qshapedpixmapdndwindow.cpp b/src/platformsupport/dnd/qshapedpixmapdndwindow.cpp deleted file mode 100644 index b3e64b01d0..0000000000 --- a/src/platformsupport/dnd/qshapedpixmapdndwindow.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qshapedpixmapdndwindow_p.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -QShapedPixmapWindow::QShapedPixmapWindow() - : QWindow(), - m_backingStore(0) -{ - QSurfaceFormat format; - format.setAlphaBufferSize(8); - setFormat(format); - setSurfaceType(RasterSurface); - setFlags(Qt::ToolTip | Qt::FramelessWindowHint | - Qt::X11BypassWindowManagerHint | Qt::WindowTransparentForInput); - create(); - m_backingStore = new QBackingStore(this); -} - -void QShapedPixmapWindow::render() -{ - QRect rect(QPoint(), geometry().size()); - - m_backingStore->beginPaint(rect); - - QPaintDevice *device = m_backingStore->paintDevice(); - - { - QPainter p(device); - p.setCompositionMode(QPainter::CompositionMode_Source); - p.drawPixmap(0, 0, m_pixmap); - } - - m_backingStore->endPaint(); - m_backingStore->flush(rect); -} - -void QShapedPixmapWindow::setPixmap(const QPixmap &pixmap) -{ - m_pixmap = pixmap; -} - -void QShapedPixmapWindow::setHotspot(const QPoint &hotspot) -{ - m_hotSpot = hotspot; -} - -void QShapedPixmapWindow::updateGeometry() -{ - QRect rect(QCursor::pos() - m_hotSpot, m_pixmap.size()); - if (m_pixmap.isNull()) - m_backingStore->resize(QSize(1,1)); - else if (m_backingStore->size() != m_pixmap.size()) - m_backingStore->resize(m_pixmap.size()); - setGeometry(rect); -} - -void QShapedPixmapWindow::exposeEvent(QExposeEvent *) -{ - render(); -} - -QT_END_NAMESPACE diff --git a/src/platformsupport/dnd/qshapedpixmapdndwindow_p.h b/src/platformsupport/dnd/qshapedpixmapdndwindow_p.h deleted file mode 100644 index 20674b6b19..0000000000 --- a/src/platformsupport/dnd/qshapedpixmapdndwindow_p.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QSHAPEDPIXMAPDNDWINDOW_H -#define QSHAPEDPIXMAPDNDWINDOW_H - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QShapedPixmapWindow : public QWindow -{ - Q_OBJECT -public: - QShapedPixmapWindow(); - - void render(); - - void setPixmap(const QPixmap &pixmap); - void setHotspot(const QPoint &hotspot); - - void updateGeometry(); - -protected: - void exposeEvent(QExposeEvent *); - -private: - QBackingStore *m_backingStore; - QPixmap m_pixmap; - QPoint m_hotSpot; -}; - -QT_END_NAMESPACE - -#endif // QSHAPEDPIXMAPDNDWINDOW_H diff --git a/src/platformsupport/dnd/qsimpledrag.cpp b/src/platformsupport/dnd/qsimpledrag.cpp deleted file mode 100644 index f2ff177055..0000000000 --- a/src/platformsupport/dnd/qsimpledrag.cpp +++ /dev/null @@ -1,366 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qsimpledrag_p.h" - -#include "qbitmap.h" -#include "qdrag.h" -#include "qpixmap.h" -#include "qevent.h" -#include "qfile.h" -#include "qtextcodec.h" -#include "qguiapplication.h" -#include "qpoint.h" -#include "qbuffer.h" -#include "qimage.h" -#include "qregexp.h" -#include "qdir.h" -#include "qimagereader.h" -#include "qimagewriter.h" - -#include -#include - -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -#ifndef QT_NO_DRAGANDDROP - -static QWindow* topLevelAt(const QPoint &pos) -{ - QWindowList list = QGuiApplication::topLevelWindows(); - for (int i = list.count()-1; i >= 0; --i) { - QWindow *w = list.at(i); - if (w->isVisible() && w->geometry().contains(pos) && !qobject_cast(w)) - return w; - } - return 0; -} - -/*! - \class QBasicDrag - \brief QBasicDrag is a base class for implementing platform drag and drop. - \since 5.0 - \internal - \ingroup qpa - - QBasicDrag implements QPlatformDrag::drag() by running a local event loop in which - it tracks mouse movements and moves the drag icon (QShapedPixmapWindow) accordingly. - It provides new virtuals allowing for querying whether the receiving window - (within the Qt application or outside) accepts the drag and sets the state accordingly. -*/ - -QBasicDrag::QBasicDrag() : - m_restoreCursor(false), m_eventLoop(0), - m_executed_drop_action(Qt::IgnoreAction), m_can_drop(false), - m_drag(0), m_drag_icon_window(0) -{ -} - -QBasicDrag::~QBasicDrag() -{ - delete m_drag_icon_window; -} - -void QBasicDrag::enableEventFilter() -{ - qApp->installEventFilter(this); -} - -void QBasicDrag::disableEventFilter() -{ - qApp->removeEventFilter(this); -} - -bool QBasicDrag::eventFilter(QObject *o, QEvent *e) -{ - if (!m_drag) { - if (e->type() == QEvent::KeyRelease && static_cast(e)->key() == Qt::Key_Escape) { - disableEventFilter(); - exitDndEventLoop(); - return true; // block the key release - } - return false; - } - - if (!qobject_cast(o)) - return false; - - switch (e->type()) { - case QEvent::ShortcutOverride: - // prevent accelerators from firing while dragging - e->accept(); - return true; - - case QEvent::KeyPress: - case QEvent::KeyRelease: - { - QKeyEvent *ke = static_cast(e); - if (ke->key() == Qt::Key_Escape && e->type() == QEvent::KeyPress) { - cancel(); - disableEventFilter(); - exitDndEventLoop(); - - } - return true; // Eat all key events - } - - case QEvent::MouseMove: - move(static_cast(e)); - return true; // Eat all mouse events - - case QEvent::MouseButtonRelease: - disableEventFilter(); - if (canDrop()) { - drop(static_cast(e)); - } else { - cancel(); - } - exitDndEventLoop(); - return true; // Eat all mouse events - - case QEvent::MouseButtonPress: - case QEvent::MouseButtonDblClick: - case QEvent::Wheel: - return true; - default: - break; - } - return false; -} - -Qt::DropAction QBasicDrag::drag(QDrag *o) -{ - m_drag = o; - m_executed_drop_action = Qt::IgnoreAction; - m_can_drop = false; - m_restoreCursor = true; -#ifndef QT_NO_CURSOR - qApp->setOverrideCursor(Qt::DragCopyCursor); - updateCursor(m_executed_drop_action); -#endif - startDrag(); - m_eventLoop = new QEventLoop; - m_eventLoop->exec(); - delete m_eventLoop; - m_eventLoop = 0; - m_drag = 0; - endDrag(); - return m_executed_drop_action; -} - -void QBasicDrag::restoreCursor() -{ - if (m_restoreCursor) { -#ifndef QT_NO_CURSOR - QGuiApplication::restoreOverrideCursor(); -#endif - m_restoreCursor = false; - } -} - -void QBasicDrag::startDrag() -{ - // ### TODO Check if its really necessary to have m_drag_icon_window - // when QDrag is used without a pixmap - QDrag::setPixmap() - if (!m_drag_icon_window) - m_drag_icon_window = new QShapedPixmapWindow(); - - m_drag_icon_window->setPixmap(m_drag->pixmap()); - m_drag_icon_window->setHotspot(m_drag->hotSpot()); - m_drag_icon_window->updateGeometry(); - m_drag_icon_window->setVisible(true); - - enableEventFilter(); -} - -void QBasicDrag::endDrag() -{ -} - -void QBasicDrag::cancel() -{ - disableEventFilter(); - restoreCursor(); - m_drag_icon_window->setVisible(false); -} - -void QBasicDrag::move(const QMouseEvent *) -{ - if (m_drag) - m_drag_icon_window->updateGeometry(); -} - -void QBasicDrag::drop(const QMouseEvent *) -{ - disableEventFilter(); - restoreCursor(); - m_drag_icon_window->setVisible(false); -} - -void QBasicDrag::exitDndEventLoop() -{ - if (m_eventLoop && m_eventLoop->isRunning()) - m_eventLoop->exit(); -} - -void QBasicDrag::updateCursor(Qt::DropAction action) -{ -#ifndef QT_NO_CURSOR - Qt::CursorShape cursorShape = Qt::ForbiddenCursor; - if (canDrop()) { - switch (action) { - case Qt::CopyAction: - cursorShape = Qt::DragCopyCursor; - break; - case Qt::LinkAction: - cursorShape = Qt::DragLinkCursor; - break; - default: - cursorShape = Qt::DragMoveCursor; - break; - } - } - - QCursor *cursor = qApp->overrideCursor(); - QPixmap pixmap = m_drag->dragCursor(action); - if (!cursor) { - qApp->changeOverrideCursor((pixmap.isNull()) ? QCursor(cursorShape) : QCursor(pixmap)); - } else { - if (!pixmap.isNull()) { - if ((cursor->pixmap().cacheKey() != pixmap.cacheKey())) { - qApp->changeOverrideCursor(QCursor(pixmap)); - } - } else { - if (cursorShape != cursor->shape()) { - qApp->changeOverrideCursor(QCursor(cursorShape)); - } - } - } -#endif - updateAction(action); -} - -/*! - \class QSimpleDrag - \brief QSimpleDrag implements QBasicDrag for Drag and Drop operations within the Qt Application itself. - \since 5.0 - \internal - \ingroup qpa - - The class checks whether the receiving window is a window of the Qt application - and sets the state accordingly. It does not take windows of other applications - into account. -*/ - -QSimpleDrag::QSimpleDrag() : m_current_window(0) -{ -} - -QMimeData *QSimpleDrag::platformDropData() -{ - if (drag()) - return drag()->mimeData(); - return 0; -} - -void QSimpleDrag::startDrag() -{ - QBasicDrag::startDrag(); - m_current_window = topLevelAt(QCursor::pos()); - if (m_current_window) { - QPlatformDragQtResponse response = QWindowSystemInterface::handleDrag(m_current_window, drag()->mimeData(), QCursor::pos(), drag()->supportedActions()); - setCanDrop(response.isAccepted()); - updateCursor(response.acceptedAction()); - } else { - setCanDrop(false); - updateCursor(Qt::IgnoreAction); - } - setExecutedDropAction(Qt::IgnoreAction); -} - -void QSimpleDrag::cancel() -{ - QBasicDrag::cancel(); - if (drag()) - QWindowSystemInterface::handleDrag(m_current_window, 0, QPoint(), Qt::IgnoreAction); - m_current_window = 0; -} - -void QSimpleDrag::move(const QMouseEvent *me) -{ - QBasicDrag::move(me); - QWindow *window = topLevelAt(me->globalPos()); - if (!window) - return; - - const QPoint pos = me->globalPos() - window->geometry().topLeft(); - const QPlatformDragQtResponse qt_response = - QWindowSystemInterface::handleDrag(window, drag()->mimeData(), pos, drag()->supportedActions()); - - updateCursor(qt_response.acceptedAction()); - setCanDrop(qt_response.isAccepted()); -} - -void QSimpleDrag::drop(const QMouseEvent *me) -{ - QBasicDrag::drop(me); - QWindow *window = topLevelAt(me->globalPos()); - if (!window) - return; - - const QPoint pos = me->globalPos() - window->geometry().topLeft(); - const QPlatformDropQtResponse response = - QWindowSystemInterface::handleDrop(window, drag()->mimeData(),pos, drag()->supportedActions()); - if (response.isAccepted()) { - setExecutedDropAction(response.acceptedAction()); - } else { - setExecutedDropAction(Qt::IgnoreAction); - } -} - -#endif // QT_NO_DRAGANDDROP - -QT_END_NAMESPACE diff --git a/src/platformsupport/dnd/qsimpledrag_p.h b/src/platformsupport/dnd/qsimpledrag_p.h deleted file mode 100644 index 10237b36d7..0000000000 --- a/src/platformsupport/dnd/qsimpledrag_p.h +++ /dev/null @@ -1,122 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QSIMPLEDRAG_H -#define QSIMPLEDRAG_H - -#include - -#include - -QT_BEGIN_NAMESPACE - -#ifndef QT_NO_DRAGANDDROP - -class QMouseEvent; -class QWindow; -class QEventLoop; -class QDropData; -class QShapedPixmapWindow; - -class QBasicDrag : public QPlatformDrag, public QObject -{ -public: - virtual ~QBasicDrag(); - - virtual Qt::DropAction drag(QDrag *drag); - - virtual bool eventFilter(QObject *o, QEvent *e); - -protected: - QBasicDrag(); - - virtual void startDrag(); - virtual void cancel(); - virtual void move(const QMouseEvent *me); - virtual void drop(const QMouseEvent *me); - virtual void endDrag(); - - QShapedPixmapWindow *shapedPixmapWindow() const { return m_drag_icon_window; } - void updateCursor(Qt::DropAction action); - - bool canDrop() const { return m_can_drop; } - void setCanDrop(bool c) { m_can_drop = c; } - - Qt::DropAction executedDropAction() const { return m_executed_drop_action; } - void setExecutedDropAction(Qt::DropAction da) { m_executed_drop_action = da; } - - QDrag *drag() const { return m_drag; } - -private: - void enableEventFilter(); - void disableEventFilter(); - void restoreCursor(); - void exitDndEventLoop(); - - bool m_restoreCursor; - QEventLoop *m_eventLoop; - Qt::DropAction m_executed_drop_action; - bool m_can_drop; - QDrag *m_drag; - QShapedPixmapWindow *m_drag_icon_window; -}; - -class QSimpleDrag : public QBasicDrag -{ -public: - QSimpleDrag(); - virtual QMimeData *platformDropData(); - -protected: - virtual void startDrag(); - virtual void cancel(); - virtual void move(const QMouseEvent *me); - virtual void drop(const QMouseEvent *me); - -private: - QWindow *m_current_window; -}; - -#endif // QT_NO_DRAGANDDROP - -QT_END_NAMESPACE - -#endif diff --git a/src/platformsupport/platformsupport.pro b/src/platformsupport/platformsupport.pro index 4cb1f2c1bf..da87f395fd 100644 --- a/src/platformsupport/platformsupport.pro +++ b/src/platformsupport/platformsupport.pro @@ -9,7 +9,6 @@ PRECOMPILED_HEADER = ../corelib/global/qt_pch.h include(cfsocketnotifier/cfsocketnotifier.pri) include(cglconvenience/cglconvenience.pri) -include(dnd/dnd.pri) include(eglconvenience/eglconvenience.pri) include(eventdispatchers/eventdispatchers.pri) include(fbconvenience/fbconvenience.pri) diff --git a/src/plugins/platforms/cocoa/qcocoadrag.h b/src/plugins/platforms/cocoa/qcocoadrag.h index 6e29fd1a78..80259df600 100644 --- a/src/plugins/platforms/cocoa/qcocoadrag.h +++ b/src/plugins/platforms/cocoa/qcocoadrag.h @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include diff --git a/src/plugins/platforms/qnx/qqnxintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp index 072f60dff8..feb05e3093 100644 --- a/src/plugins/platforms/qnx/qqnxintegration.cpp +++ b/src/plugins/platforms/qnx/qqnxintegration.cpp @@ -89,7 +89,7 @@ #include #endif -#include +#include #include #include diff --git a/src/plugins/platforms/xcb/qxcbdrag.cpp b/src/plugins/platforms/xcb/qxcbdrag.cpp index db736cef4e..4961e0377c 100644 --- a/src/plugins/platforms/xcb/qxcbdrag.cpp +++ b/src/plugins/platforms/xcb/qxcbdrag.cpp @@ -57,8 +57,8 @@ #include -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/plugins/platforms/xcb/qxcbdrag.h b/src/plugins/platforms/xcb/qxcbdrag.h index 5678c2d303..5648f70d9e 100644 --- a/src/plugins/platforms/xcb/qxcbdrag.h +++ b/src/plugins/platforms/xcb/qxcbdrag.h @@ -43,7 +43,7 @@ #define QXCBDRAG_H #include -#include +#include #include #include #include -- cgit v1.2.1 From de3d449dcff4ee00fea72b3697055f5459fb13ec Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 28 May 2013 14:23:57 +0200 Subject: Windows: Suppress mouse events synthesized by OS. Change the hint for QPlatformIntegration::SynthesizeMouseFromTouchEvents to false for Windows and suppress the events synthesized by OS. The synthesized events cause touch events to generate 2 clicks in Quick2. Leave code as is for Windows CE. Task-number: QTBUG-31386 Change-Id: Ia0987342dcdd55c8540810da5e4b90518a501ce6 Reviewed-by: Alan Alpert Reviewed-by: Shawn Rutledge --- src/plugins/platforms/windows/qwindowsintegration.cpp | 4 ++++ src/plugins/platforms/windows/qwindowsmousehandler.cpp | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index 73df3ec032..814892b43a 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -552,11 +552,15 @@ QVariant QWindowsIntegration::styleHint(QPlatformIntegration::StyleHint hint) co break; case QPlatformIntegration::UseRtlExtensions: return QVariant(d->m_context.useRTLExtensions()); +#ifdef Q_OS_WINCE case QPlatformIntegration::SynthesizeMouseFromTouchEvents: // We do not want Qt to synthesize mouse events as Windows also does that. // Alternatively, Windows-generated touch mouse events can be identified and // ignored by checking GetMessageExtraInfo() for MI_WP_SIGNATURE (0xFF515700). return false; +#endif // Q_OS_WINCE + default: + break; } return QPlatformIntegration::styleHint(hint); } diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.cpp b/src/plugins/platforms/windows/qwindowsmousehandler.cpp index fd00a07d6c..5c096b7eca 100644 --- a/src/plugins/platforms/windows/qwindowsmousehandler.cpp +++ b/src/plugins/platforms/windows/qwindowsmousehandler.cpp @@ -157,9 +157,19 @@ bool QWindowsMouseHandler::translateMouseEvent(QWindow *window, HWND hwnd, QtWindows::WindowsEventType et, MSG msg, LRESULT *result) { + enum { signatureMask = 0xffffff00, miWpSignature = 0xff515700 }; + if (et == QtWindows::MouseWheelEvent) return translateMouseWheelEvent(window, hwnd, msg, result); +#ifndef Q_OS_WINCE + // Check for events synthesized from touch. Lower byte is touch index, 0 means pen. + const LPARAM extraInfo = GetMessageExtraInfo(); + const bool fromTouch = (extraInfo & signatureMask) == miWpSignature && (extraInfo & 0xff); + if (fromTouch) + return false; +#endif // !Q_OS_WINCE + const QPoint winEventPosition(GET_X_LPARAM(msg.lParam), GET_Y_LPARAM(msg.lParam)); if (et & QtWindows::NonClientEventFlag) { const QPoint globalPosition = winEventPosition; -- cgit v1.2.1 From 20d08a96c8240a9fda1a359d98be42f69ed9592e Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 17 Apr 2013 14:26:37 +0300 Subject: Fix tst_qtendian autotest build for WEC7. MSVC2008 compiler fo ARM targets fail to compile qToUnaligned when using sizeof(T) inside memcpy fynction. The compiler fails at least when the code is reached through the following macros and templates: -> tst_QtEndian::toLittleEndian -> qToLittleEndian(T src, uchar *dest) -> qToUnaligned(const T src, uchar *dest) The above sequence produces internal compiler error with MSVC2008/ARM builds when called from tst_endian. As a workaround sizeof(T) is called outside memcpy function. Change-Id: Ib4d382c2cebecb6e54bb99fc8fad72db93825fcd Reviewed-by: Oswald Buddenhagen --- src/corelib/global/qendian.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/corelib/global/qendian.h b/src/corelib/global/qendian.h index c9c4d23aab..9b939feea0 100644 --- a/src/corelib/global/qendian.h +++ b/src/corelib/global/qendian.h @@ -78,7 +78,10 @@ template inline void qbswap(const T src, uchar *dest) // If you want to avoid the memcopy, you must write specializations for this function template inline void qToUnaligned(const T src, uchar *dest) { - memcpy(dest, &src, sizeof(T)); + // Using sizeof(T) inside memcpy function produces internal compiler error with + // MSVC2008/ARM in tst_endian -> use extra indirection to resolve size of T. + const size_t size = sizeof(T); + memcpy(dest, &src, size); } /* T qFromLittleEndian(const uchar *src) -- cgit v1.2.1 From 12ae86119cf389dab368bbc8a9d49b29b0b155cd Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Wed, 29 May 2013 17:42:30 +0200 Subject: Mac style: Remove yet another reference to widgets Change-Id: I545cfe22c6307864cdb18093a37e09a8ad042347 Reviewed-by: J-P Nurmi Reviewed-by: Jens Bache-Wiig --- src/widgets/styles/qmacstyle_mac.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index b7f39d45dd..a8fba4fb68 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -3366,7 +3366,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter if (const QStyleOptionToolButton *tb = qstyleoption_cast(opt)) { QStyleOptionToolButton myTb = *tb; myTb.state &= ~State_AutoRaise; - if (w && qobject_cast(w->parentWidget())) { + if (QStyleHelper::hasAncestor(opt->styleObject, QAccessible::ToolBar)) { QRect cr = tb->rect; int shiftX = 0; int shiftY = 0; @@ -3405,7 +3405,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter if (tb->toolButtonStyle != Qt::ToolButtonIconOnly) { needText = true; if (tb->toolButtonStyle == Qt::ToolButtonTextUnderIcon) { - QMainWindow *mw = qobject_cast(w->window()); + QMainWindow *mw = w ? qobject_cast(w->window()) : 0; if (mw && mw->unifiedTitleAndToolBarOnMac()) { pr.setHeight(pixmap.size().height() / pixmap.devicePixelRatio()); cr.adjust(0, pr.bottom() + 1, 0, 1); -- cgit v1.2.1 From 9e36747786b31c9494f99af5e1f7c977b51b7ce7 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Mon, 6 May 2013 14:07:10 +0200 Subject: Use [NSEvent characters] to retrieve the input character. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is how it was done in Qt 4. An issue with the current approach was that it did not consider modifiers when setting a Qt::Key_* value, which would assign the same Qt keycode for: a = a(65) Alt + a = ā(65) [here it should return a unicode value for 'ā'] This is inconsistent with the other platform plugins. Also in the combination with a dead keys it was returning nothing in the output. Task-number: QTBUG-29005 (cherry picked from commit 6730413fcac1d7eb39af3683b87f965c5823cb6c) Change-Id: Ic28eb55b3a9798ecb6012cc2e3fb18589b8b0392 Reviewed-by: Shawn Rutledge --- src/plugins/platforms/cocoa/qnsview.mm | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index ee6a9616a6..5c5da830ac 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -897,7 +897,6 @@ 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 @@ -909,19 +908,11 @@ static QTouchDevice *touchDevice = 0; EventRef eventRef = EventRef([nsevent eventRef]); GetEventParameter(eventRef, kEventParamKeyCode, typeUInt32, 0, sizeof(nativeVirtualKey), 0, &nativeVirtualKey); - QChar ch; - int keyCode; - if ([charactersIgnoringModifiers length] > 0) { // convert the first character into a key code - if ((modifiers & Qt::ControlModifier) && ([characters length] != 0)) { - ch = QChar([characters characterAtIndex:0]); - } else { - ch = QChar([charactersIgnoringModifiers characterAtIndex:0]); - } + QChar ch = QChar::ReplacementCharacter; + int keyCode = Qt::Key_unknown; + if ([characters length] != 0) { + ch = QChar([characters characterAtIndex:0]); keyCode = [self convertKeyCode:ch]; - } else { - // might be a dead key - ch = QChar::ReplacementCharacter; - keyCode = Qt::Key_unknown; } // we will send a key event unless the input method sets m_sendKeyEvent to false @@ -931,7 +922,7 @@ static QTouchDevice *touchDevice = 0; if (eventType == QEvent::KeyPress) { // ignore text for the U+F700-U+F8FF range. This is used by Cocoa when // delivering function keys (e.g. arrow keys, backspace, F1-F35, etc.) - if ([charactersIgnoringModifiers length] == 1 && (ch.unicode() < 0xf700 || ch.unicode() > 0xf8ff)) + if (ch.unicode() < 0xf700 || ch.unicode() > 0xf8ff) text = QCFString::toQString(characters); if (m_composingText.isEmpty()) -- cgit v1.2.1 From 530c475d90a530fbf91b10d64f4b9978a13f389e Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Fri, 31 May 2013 10:35:49 +0200 Subject: Fix typo in QSettings docs. Change-Id: I96dc2d57f5cc52c162ba0fd38d20141683847423 Reviewed-by: Oswald Buddenhagen Reviewed-by: Jerome Pasion --- src/corelib/io/qsettings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index a0904fea24..5b4d4ec0d8 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -2527,7 +2527,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, character in keys. In addition, if you save a top-level setting (a key with no slashes in it, e.g., "someKey"), it will appear in the INI file's "General" section. To avoid - overwriting other keys, if you save something using the a key + overwriting other keys, if you save something using a key such as "General/someKey", the key will be located in the "%General" section, \e not in the "General" section. -- cgit v1.2.1 From 681da4feb3bdc91b84469d298a16b8b83dcffaf4 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 30 May 2013 15:52:40 +0200 Subject: Android: Fix Windows build with recent SDK Since the dx tool has moved in the SDK, we need to update our copy of it to also search in the new location for dx.jar. Task-number: QTBUG-31405 Change-Id: If093a9f51f33c5d8666919f516a3b336322a7169 Reviewed-by: Ray Donnelly Reviewed-by: Oswald Buddenhagen Reviewed-by: Paul Olav Tvete --- mkspecs/features/data/android/dx.bat | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mkspecs/features/data/android/dx.bat b/mkspecs/features/data/android/dx.bat index af143c52b5..c4ad0e3ebc 100644 --- a/mkspecs/features/data/android/dx.bat +++ b/mkspecs/features/data/android/dx.bat @@ -46,6 +46,12 @@ if exist "%frameworkdir%\%jarfile%" goto JarFileOk if exist "%frameworkdir%\%jarfile%" goto JarFileOk set "frameworkdir=%androidsdk%\framework" +if exist "%frameworkdir%\%jarfile%" goto JarFileOk + set "frameworkdir=%androidsdk%\build-tools\%ANDROID_BUILD_TOOLS_REVISION%\lib" + +if exist "%frameworkdir%\%jarfile%" goto JarFileOk + set "frameworkdir=%androidsdk%\build-tools\17.0.0\lib" + :JarFileOk set jarpath=%frameworkdir%\%jarfile% -- cgit v1.2.1 From d12c045a9587a1d46669fe4e554945ec3b2238ef Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 30 May 2013 15:37:14 +0200 Subject: qdoc: excludedirs works again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was comparing an absolute path to a relative path. These could never be the same. Instead of the relative path, it now gets the canonical absolute path, so the comparison succeeds when it should. Task-number: QTBUG-31404 Change-Id: I9c482d4649d493ce6d4f9a522cb61f2c8a5eb21f Reviewed-by: Topi Reiniö Reviewed-by: Jerome Pasion --- src/tools/qdoc/config.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/qdoc/config.cpp b/src/tools/qdoc/config.cpp index 107af96607..273cb60d7d 100644 --- a/src/tools/qdoc/config.cpp +++ b/src/tools/qdoc/config.cpp @@ -1089,7 +1089,7 @@ QStringList Config::getFilesHere(const QString& uncleanDir, const QSet &excludedDirs, const QSet &excludedFiles) { - QString dir = location.isEmpty() ? QDir::cleanPath(uncleanDir) : Location::canonicalRelativePath(uncleanDir); + QString dir = location.isEmpty() ? QDir::cleanPath(uncleanDir) : QDir(uncleanDir).canonicalPath(); QStringList result; if (excludedDirs.contains(dir)) return result; -- cgit v1.2.1 From ca73ed25d45c15ed30daacb02adce51d7c8339fc Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 31 May 2013 08:31:53 +0200 Subject: docs: DirView example uses QFileSystemModel not QDirModel Change-Id: Ie172b1458401c4627314ff0db6992647388bf382 Reviewed-by: Jerome Pasion --- examples/widgets/doc/src/dirview.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/widgets/doc/src/dirview.qdoc b/examples/widgets/doc/src/dirview.qdoc index b9698ea498..7687737cef 100644 --- a/examples/widgets/doc/src/dirview.qdoc +++ b/examples/widgets/doc/src/dirview.qdoc @@ -32,7 +32,7 @@ \brief This example demonstrates the usage of a tree view. \brief The Dir View example shows a tree view onto the local filing system. It uses the - QDirModel class to provide file and directory information. + QFileSystemModel class to provide file and directory information. \image dirview-example.png */ -- cgit v1.2.1 From 5c555e3a296af3f2510fdc95caa864f020e69263 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 28 May 2013 20:28:54 +0200 Subject: factor out writeFile() function Change-Id: I8e3e1665d7628c3210d000c46dfffa9f1af71009 Reviewed-by: Joerg Bornemann --- bin/syncqt.pl | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/bin/syncqt.pl b/bin/syncqt.pl index ce07af4895..8ce091053f 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -382,6 +382,32 @@ sub fileContents { return $filecontents; } +###################################################################### +# Syntax: writeFile(filename, contents) +# Params: filename, string, filename of file to write +# contents, string, new contents for the file +# +# Purpose: Write file with given contents. If new contents match old +# ones, do no change the file's timestamp. +# Returns: 1 if the file's contents changed. +###################################################################### +sub writeFile { + my ($filename, $contents, $lib, $what) = @_; + my $oldcontents = fileContents($filename); + $oldcontents =~ s/\r//g; # remove \r's , so comparison is ok on all platforms + if ($oldcontents ne $contents) { + open(O, "> " . $filename) || die "Could not open $filename for writing: $!\n"; + print O $contents; + close O; + if ($lib && $verbose_level) { + my $action = ($oldcontents eq "") ? "created" : "updated"; + print "$lib: $action $what\n"; + } + return 1; + } + return 0; +} + ###################################################################### # Syntax: fileCompare(file1, file2) # Params: file1, string, filename of first file @@ -1076,23 +1102,7 @@ foreach my $lib (@modules_to_sync) { $headers_pri_contents .= "SYNCQT.PRIVATE_HEADER_FILES = $pri_install_pfiles\n"; $headers_pri_contents .= "SYNCQT.QPA_HEADER_FILES = $pri_install_qpafiles\n"; my $headers_pri_file = "$out_basedir/include/$lib/headers.pri"; - if(-e $headers_pri_file) { - open HEADERS_PRI_FILE, "<$headers_pri_file"; - local $/; - binmode HEADERS_PRI_FILE; - my $old_headers_pri_contents = ; - close HEADERS_PRI_FILE; - $old_headers_pri_contents =~ s/\r//g; # remove \r's , so comparison is ok on all platforms - $headers_pri_file = 0 if($old_headers_pri_contents eq $headers_pri_contents); - } - if($headers_pri_file) { - my $headers_pri_dir = dirname($headers_pri_file); - make_path($headers_pri_dir, $lib, $verbose_level); - open HEADERS_PRI_FILE, ">$headers_pri_file"; - print HEADERS_PRI_FILE $headers_pri_contents; - close HEADERS_PRI_FILE; - print "$lib: created headers.pri file\n" if($verbose_level); - } + writeFile($headers_pri_file, $headers_pri_contents, $lib, "headers.pri file"); } } unless($showonly || !$create_uic_class_map) { -- cgit v1.2.1 From 5d8b8eed90c52afbd54d7c057657dc12d1e8e61a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 17 May 2013 19:53:25 +0200 Subject: move module version header generation back to syncqt there is no particular reason for it being done by qmake. avoids that the logic is distributed over two source files, and allows us to generate these headers at pre-build time already, including not forwarding to a yet unexisting file (which would have a yet unknown location). Change-Id: I9c78ab425cf6f01d076c86fd1ee602626f231487 Reviewed-by: Joerg Bornemann --- bin/syncqt.pl | 13 +++++++++++++ mkspecs/features/qt_module_headers.prf | 29 ----------------------------- 2 files changed, 13 insertions(+), 29 deletions(-) diff --git a/bin/syncqt.pl b/bin/syncqt.pl index 8ce091053f..f31466ad33 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -1094,6 +1094,19 @@ foreach my $lib (@modules_to_sync) { syncHeader($lib, $VHeader, $vheader, 0); $pri_install_files .= fixPaths($vheader, $dir) . " "; $pri_install_classes .= fixPaths($VHeader, $dir) . " "; + my @versions = split(/\./, $module_version); + my $modulehexstring = sprintf("0x%02X%02X%02X", $versions[0], $versions[1], $versions[2]); + my $vhdrcont = + "/* This file was generated by syncqt. */\n". + "#ifndef QT_".uc($lib)."_VERSION_H\n". + "#define QT_".uc($lib)."_VERSION_H\n". + "\n". + "#define ".uc($lib)."_VERSION_STR \"".$module_version."\"\n". + "\n". + "#define ".uc($lib)."_VERSION ".$modulehexstring."\n". + "\n". + "#endif // QT_".uc($lib)."_VERSION_H\n"; + writeFile($vheader, $vhdrcont, $lib, "version header"); #handle the headers.pri for each module my $headers_pri_contents = ""; diff --git a/mkspecs/features/qt_module_headers.prf b/mkspecs/features/qt_module_headers.prf index 298ca102bc..3c50e041c7 100644 --- a/mkspecs/features/qt_module_headers.prf +++ b/mkspecs/features/qt_module_headers.prf @@ -31,9 +31,6 @@ minimal_syncqt: return() #load up the headers info include($$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME/headers.pri, "", true) -lctarget = $$lower($$MODULE_INCNAME) -uctarget = $$upper($$MODULE_INCNAME) - defineTest(shouldMasterInclude) { bn = $$basename(1) contains(bn, .*_.*):return(false) @@ -46,32 +43,6 @@ defineTest(shouldMasterInclude) { autogen_warning = \ "/* This file was generated by qmake with the info from /$$relative_path($$_PRO_FILE_, $$MODULE_BASE_DIR). */" -# Create module version header -MODULE_VERSION_HEADER = $$find(SYNCQT.HEADER_FILES, (^|/)$${lctarget}version\\.h$) -count(MODULE_VERSION_HEADER, 1) { - MODULE_VERSION_HEADER = $$absolute_path($$MODULE_VERSION_HEADER, $$_PRO_FILE_PWD_) - - !build_pass { - majorhexstr = $$format_number($$section(VERSION, ., 0, 0), width=2 zeropad obase=16) - minorhexstr = $$format_number($$section(VERSION, ., 1, 1), width=2 zeropad obase=16) - patchhexstr = $$format_number($$section(VERSION, ., 2, 2), width=2 zeropad obase=16) - modulehexstring = 0x$${majorhexstr}$${minorhexstr}$${patchhexstr} - MODULE_VERSION_HEADER_CONT = \ - $$autogen_warning \ - "$${LITERAL_HASH}ifndef QT_$${uctarget}_VERSION_H" \ - "$${LITERAL_HASH}define QT_$${uctarget}_VERSION_H" \ - "" \ - "$${LITERAL_HASH}define $${uctarget}_VERSION_STR \"$$VERSION\"" \ - "" \ - "$${LITERAL_HASH}define $${uctarget}_VERSION $$modulehexstring" \ - "" \ - "$${LITERAL_HASH}endif // QT_$${uctarget}_VERSION_H" - write_file($$MODULE_VERSION_HEADER, MODULE_VERSION_HEADER_CONT)|error("Aborting.") - } - - HEADERS += $$MODULE_VERSION_HEADER -} - # Create a module master header MODULE_MASTER_HEADER = $$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME/$$MODULE_INCNAME !build_pass { -- cgit v1.2.1 From 8d69232b28165079aed1d754f9bdd8c7c4336b16 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 28 May 2013 11:07:13 +0200 Subject: let configure create the forwarding qconfig.h again this avoids that syncqt needs to forward to a yet unexisting file (which will have a yet unknown location, when syncqt is run at packaging time already). the %inject_headers syncqt config variable remains, so it can be told not to purge "foreign" files. Change-Id: I127ff6e0b7d5702fb0acaee9a5b7940b482d3608 Reviewed-by: Joerg Bornemann --- bin/syncqt.pl | 10 +--------- configure | 17 +++++++++++++++++ src/corelib/global/global.pri | 5 +++++ sync.profile | 1 - tools/configure/configureapp.cpp | 31 +++++++++++++++++++++++++++++++ 5 files changed, 54 insertions(+), 10 deletions(-) diff --git a/bin/syncqt.pl b/bin/syncqt.pl index f31466ad33..1da3878695 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -893,15 +893,8 @@ foreach my $lib (@modules_to_sync) { #calc files and "copy" them foreach my $subdir (@subdirs) { my @headers = findFiles($subdir, "^[-a-z0-9_]*\\.h\$" , 0); - if (defined $inject_headers{$subdir}) { - foreach my $if (@{$inject_headers{$subdir}}) { - @headers = grep(!/^\Q$if\E$/, @headers); #in case we configure'd previously - push @headers, "*".$if; - } - } my $header_dirname = ""; foreach my $header (@headers) { - my $shadow = ($header =~ s/^\*//); $header = 0 if($header =~ /^ui_.*.h/); foreach (@ignore_headers) { $header = 0 if($header eq $_); @@ -923,7 +916,6 @@ foreach my $lib (@modules_to_sync) { } my $iheader = $subdir . "/" . $header; - $iheader =~ s/^\Q$basedir\E/$out_basedir/ if ($shadow); my @classes = $public_header && !$minimal ? classNames($iheader) : (); if($showonly) { print "$header [$lib]\n"; @@ -964,7 +956,7 @@ foreach my $lib (@modules_to_sync) { } foreach(@headers) { #sync them - $header_copies++ if(syncHeader($lib, $_, $iheader, $copy_headers && !$shadow, $ts)); + $header_copies++ if (syncHeader($lib, $_, $iheader, $copy_headers, $ts)); } if($public_header) { diff --git a/configure b/configure index 079f2e7415..43e7f8851e 100755 --- a/configure +++ b/configure @@ -6424,6 +6424,23 @@ else fi fi +# create a forwarding header +mkdir -p "$outpath/include/QtCore" || exit +echo '#include "../../src/corelib/global/qconfig.h"' > $outpath/include/QtCore/qconfig.h.new +if cmp -s "$outpath/include/QtCore/qconfig.h.new" "$outpath/include/QtCore/qconfig.h"; then + rm -f "$outpath/include/QtCore/qconfig.h.new" +else + mv "$outpath/include/QtCore/qconfig.h.new" "$outpath/include/QtCore/qconfig.h" || exit +fi + +# create a camelcase forwarding header +echo '#include "qconfig.h"' > $outpath/include/QtCore/QtConfig.new +if cmp -s "$outpath/include/QtCore/QtConfig.new" "$outpath/include/QtCore/QtConfig"; then + rm -f "$outpath/include/QtCore/QtConfig.new" +else + mv "$outpath/include/QtCore/QtConfig.new" "$outpath/include/QtCore/QtConfig" || exit +fi + #------------------------------------------------------------------------------- # save configuration into qconfig.pri #------------------------------------------------------------------------------- diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri index 6ac32cd35d..4084d4f2ad 100644 --- a/src/corelib/global/global.pri +++ b/src/corelib/global/global.pri @@ -29,6 +29,11 @@ SOURCES += \ # qlibraryinfo.cpp includes qconfig.cpp INCLUDEPATH += $$QT_BUILD_TREE/src/corelib/global +# configure creates these, not syncqt, so we need to manually inject them +targ_headers.files += \ + $$OUT_PWD/global/qconfig.h \ + $$QT_BUILD_TREE/include/QtCore/QtConfig + # Only used on platforms with CONFIG += precompile_header PRECOMPILED_HEADER = global/qt_pch.h diff --git a/sync.profile b/sync.profile index e07b285dbb..3d89d9d71f 100644 --- a/sync.profile +++ b/sync.profile @@ -24,7 +24,6 @@ %classnames = ( "qglobal.h" => "QtGlobal", "qendian.h" => "QtEndian", - "qconfig.h" => "QtConfig", "qplugin.h" => "QtPlugin", "qalgorithms.h" => "QtAlgorithms", "qcontainerfwd.h" => "QtContainerFwd", diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index a83f451b81..9620129509 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -3351,6 +3351,37 @@ void Configure::generateConfigfiles() tmpFile.close(); } + QTemporaryFile tmpFile2; + if (tmpFile2.open()) { + tmpStream.setDevice(&tmpFile2); + tmpStream << "#include \"../../src/corelib/global/qconfig.h\"" << endl; + + tmpStream.flush(); + tmpFile2.flush(); + + outName = buildPath + "/include/QtCore/qconfig.h"; + ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL); + QFile::remove(outName); + + tmpFile2.copy(outName); + tmpFile2.close(); + } + QTemporaryFile tmpFile2a; + if (tmpFile2a.open()) { + tmpStream.setDevice(&tmpFile2a); + tmpStream << "#include \"qconfig.h\"" << endl; + + tmpStream.flush(); + tmpFile2a.flush(); + + outName = buildPath + "/include/QtCore/QtConfig"; + ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL); + QFile::remove(outName); + + tmpFile2a.copy(outName); + tmpFile2a.close(); + } + QTemporaryFile tmpFile3; if (tmpFile3.open()) { tmpStream.setDevice(&tmpFile3); -- cgit v1.2.1 From f4e529070998090598a66b2c0f66275d8479c5be Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 28 May 2013 11:57:01 +0200 Subject: remove pointless quoting of MODULE_*INCLUDES assignments it would only cause trouble further down the line. Change-Id: Ied9ba8a1ecf36b77e1091c73564bd7601ea6a6b4 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_module_pris.prf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf index 9e40a67b51..77adc02259 100644 --- a/mkspecs/features/qt_module_pris.prf +++ b/mkspecs/features/qt_module_pris.prf @@ -52,9 +52,9 @@ else: \ else: \ module_config = !no_module_headers:!minimal_syncqt { - MODULE_INCLUDES = "\$\$QT_MODULE_INCLUDE_BASE \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME" - MODULE_PRIVATE_INCLUDES = "\$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION \ - \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME" + MODULE_INCLUDES = \$\$QT_MODULE_INCLUDE_BASE \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME + MODULE_PRIVATE_INCLUDES = \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION \ + \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME } MODULE_PRI_CONT = \ "QT.$${MODULE}.VERSION = $${VERSION}" \ -- cgit v1.2.1 From 0519129c5977280dfa2f8a47ca4aa93fe9fee84b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 28 May 2013 19:09:24 +0200 Subject: split out dependencies from module master header this will allow us the create the dependency list in a different way than the rest of the master header. Change-Id: Ib083fbbf6194cd9a161d669f860aaf32fd96d9d4 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_module_headers.prf | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/mkspecs/features/qt_module_headers.prf b/mkspecs/features/qt_module_headers.prf index 3c50e041c7..65e9a888f3 100644 --- a/mkspecs/features/qt_module_headers.prf +++ b/mkspecs/features/qt_module_headers.prf @@ -43,17 +43,26 @@ defineTest(shouldMasterInclude) { autogen_warning = \ "/* This file was generated by qmake with the info from /$$relative_path($$_PRO_FILE_, $$MODULE_BASE_DIR). */" +# Create a module master depends header +MODULE_MASTER_DEPS_HEADER = $$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME/$${MODULE_INCNAME}Depends +!build_pass { + MODULE_MASTER_DEPS_HEADER_CONT = $$autogen_warning + for(dep, MODULE_DEPENDS) { + depname = $$eval(QT.$${dep}.name) + MODULE_MASTER_DEPS_HEADER_CONT += "$${LITERAL_HASH}include <$$depname/$$depname>" + } + write_file($$MODULE_MASTER_DEPS_HEADER, MODULE_MASTER_DEPS_HEADER_CONT)|error("Aborting.") +} +SYNCQT.HEADER_FILES += $$MODULE_MASTER_DEPS_HEADER + # Create a module master header MODULE_MASTER_HEADER = $$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME/$$MODULE_INCNAME !build_pass { MODULE_MASTER_HEADER_CONT = \ $$autogen_warning \ "$${LITERAL_HASH}ifndef QT_$${ucmodule}_MODULE_H" \ - "$${LITERAL_HASH}define QT_$${ucmodule}_MODULE_H" - for(dep, MODULE_DEPENDS) { - depname = $$eval(QT.$${dep}.name) - MODULE_MASTER_HEADER_CONT += "$${LITERAL_HASH}include <$$depname/$$depname>" - } + "$${LITERAL_HASH}define QT_$${ucmodule}_MODULE_H" \ + "$${LITERAL_HASH}include <$$MODULE_INCNAME/$${MODULE_INCNAME}Depends>" for(hdr, SYNCQT.HEADER_FILES): \ shouldMasterInclude($$hdr): \ MODULE_MASTER_HEADER_CONT += "$${LITERAL_HASH}include \"$$replace(hdr, .*/, )\"" -- cgit v1.2.1 From 96557bc389794abdcb15305c2a439f344ec2f0c3 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 28 May 2013 20:57:07 +0200 Subject: move module master header generation back to syncqt now that we split out the part that depends on the project file, we can do it cleanly here. this way we can generate these headers at pre-build time already. and for git builds, perl is probably faster than qmake at this task. Change-Id: I343255c6de22329471a3ae2c2aac9ebeb160a501 Reviewed-by: Joerg Bornemann --- bin/syncqt.pl | 42 ++++++++++++++++++++++++++++++++++ mkspecs/features/qt_module_headers.prf | 25 -------------------- 2 files changed, 42 insertions(+), 25 deletions(-) diff --git a/bin/syncqt.pl b/bin/syncqt.pl index 1da3878695..497e8deb2c 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -171,6 +171,30 @@ sub checkRelative { return 1; } +###################################################################### +# Syntax: shouldMasterInclude(iheader) +# Params: iheader, string, filename to verify inclusion +# +# Purpose: Determines if header should be in the master include file. +# Returns: 0 if file contains "#pragma qt_no_master_include" or not +# able to open, else 1. +###################################################################### +sub shouldMasterInclude { + my ($iheader) = @_; + return 0 if (basename($iheader) =~ /_/); + return 0 if (basename($iheader) =~ /qconfig/); + if (open(F, "<$iheader")) { + while () { + chomp; + return 0 if (/^\#pragma qt_no_master_include$/); + } + close(F); + } else { + return 0; + } + return 1; +} + ###################################################################### # Syntax: classNames(iheader) # Params: iheader, string, filename to parse for classname "symlinks" @@ -828,6 +852,12 @@ foreach my $lib (@modules_to_sync) { my $pri_install_pfiles = ""; my $pri_install_qpafiles = ""; + my $libcapitals = uc($lib); + my $master_contents = + "#ifndef QT_".$libcapitals."_MODULE_H\n" . + "#define QT_".$libcapitals."_MODULE_H\n" . + "#include <$lib/${lib}Depends>\n"; + #remove the old files if($remove_stale) { my %injections = (); @@ -960,6 +990,9 @@ foreach my $lib (@modules_to_sync) { } if($public_header) { + #put it into the master file + $master_contents .= "#include \"$public_header\"\n" if (shouldMasterInclude($iheader)); + #deal with the install directives if($public_header) { my $pri_install_iheader = fixPaths($iheader, $dir); @@ -1018,6 +1051,11 @@ foreach my $lib (@modules_to_sync) { } } + # close the master include: + $master_contents .= + "#include \"".lc($lib)."version.h\"\n" . + "#endif\n"; + unless ($showonly || $minimal) { # create deprecated headers my $first = 1; @@ -1100,6 +1138,10 @@ foreach my $lib (@modules_to_sync) { "#endif // QT_".uc($lib)."_VERSION_H\n"; writeFile($vheader, $vhdrcont, $lib, "version header"); + my $master_include = "$out_basedir/include/$lib/$lib"; + $pri_install_files .= fixPaths($master_include, $dir) . " "; + writeFile($master_include, $master_contents, $lib, "master header"); + #handle the headers.pri for each module my $headers_pri_contents = ""; $headers_pri_contents .= "SYNCQT.HEADER_FILES = $pri_install_files\n"; diff --git a/mkspecs/features/qt_module_headers.prf b/mkspecs/features/qt_module_headers.prf index 65e9a888f3..7591bffb19 100644 --- a/mkspecs/features/qt_module_headers.prf +++ b/mkspecs/features/qt_module_headers.prf @@ -31,15 +31,6 @@ minimal_syncqt: return() #load up the headers info include($$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME/headers.pri, "", true) -defineTest(shouldMasterInclude) { - bn = $$basename(1) - contains(bn, .*_.*):return(false) - contains(bn, ^qconfig.*):return(false) - lines = $$cat($$_PRO_FILE_PWD_/$$1, lines) - contains(lines, $${LITERAL_HASH}pragma qt_no_master_include):return(false) - return(true) -} - autogen_warning = \ "/* This file was generated by qmake with the info from /$$relative_path($$_PRO_FILE_, $$MODULE_BASE_DIR). */" @@ -55,20 +46,4 @@ MODULE_MASTER_DEPS_HEADER = $$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME/$${MOD } SYNCQT.HEADER_FILES += $$MODULE_MASTER_DEPS_HEADER -# Create a module master header -MODULE_MASTER_HEADER = $$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME/$$MODULE_INCNAME -!build_pass { - MODULE_MASTER_HEADER_CONT = \ - $$autogen_warning \ - "$${LITERAL_HASH}ifndef QT_$${ucmodule}_MODULE_H" \ - "$${LITERAL_HASH}define QT_$${ucmodule}_MODULE_H" \ - "$${LITERAL_HASH}include <$$MODULE_INCNAME/$${MODULE_INCNAME}Depends>" - for(hdr, SYNCQT.HEADER_FILES): \ - shouldMasterInclude($$hdr): \ - MODULE_MASTER_HEADER_CONT += "$${LITERAL_HASH}include \"$$replace(hdr, .*/, )\"" - MODULE_MASTER_HEADER_CONT += "$${LITERAL_HASH}endif" - write_file($$MODULE_MASTER_HEADER, MODULE_MASTER_HEADER_CONT)|error("Aborting.") -} -SYNCQT.HEADER_FILES += $$MODULE_MASTER_HEADER - CONFIG += qt_install_headers -- cgit v1.2.1 From 0a1b89bff5015c8389807f55c1b39d360af55e9a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 28 May 2013 21:34:05 +0200 Subject: run syncqt only for builds from git the logic in the configures was even trying to express that, only that nowadays we always ship syncqt, so the tests were kinda pointless. this frees us from the perl dependency for non-developer builds of packaged modules (except for webkit, which needs almost every scripting language on earth anyway). obviously, this requires that the packaging scripts run syncqt in the source dir before tarring up the sources. note that for repositories other than qtbase, the -version argument needs to be passed to syncqt. Task-number: QTBUG-29465 Change-Id: Ic929ab17a5de4b30fbf48b3aa9bfa3b4d2ef37d6 Reviewed-by: Joerg Bornemann --- configure | 21 +++++++++++++-------- mkspecs/features/qt_build_paths.prf | 3 +++ mkspecs/features/qt_module_headers.prf | 8 ++++++-- mkspecs/features/qt_module_pris.prf | 15 ++++++++++++++- qmake/Makefile.unix | 4 ++-- qmake/Makefile.win32 | 2 +- tools/configure/configureapp.cpp | 7 +++++-- 7 files changed, 44 insertions(+), 16 deletions(-) diff --git a/configure b/configure index 43e7f8851e..1e15220ca1 100755 --- a/configure +++ b/configure @@ -2389,13 +2389,6 @@ fi if [ "$OPT_SHADOW" = "yes" ]; then echo "Preparing build tree..." - if [ -z "$PERL" ]; then - echo - echo "You need perl in your PATH to make a shadow build." - echo "Cannot proceed." - exit 1 - fi - [ -d "$outpath/bin" ] || mkdir -p "$outpath/bin" # save a pre-existing mkspecs/modules dir @@ -3895,7 +3888,14 @@ fi # ----------------------------------------------------------------------------- # symlink includes -if [ -n "$PERL" ] && [ -x "$relpath/bin/syncqt.pl" ]; then +if [ -e "$relpath/.git" ]; then + if [ -z "$PERL" ]; then + echo + echo "You need perl in your PATH to make a build from GIT." + echo "Cannot proceed." + exit 1 + fi + "$relpath/bin/syncqt.pl" -minimal -module QtCore "$relpath" || exit 1 fi @@ -4028,6 +4028,11 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ]; echo "BUILD_PATH = $adjoutpath" >> "$mkfile" echo "SOURCE_PATH = $adjrelpath" >> "$mkfile" + if [ -e "$relpath/.git" ]; then + echo 'INC_PATH = $(BUILD_PATH)/include' >> "$mkfile" + else + echo 'INC_PATH = $(SOURCE_PATH)/include' >> "$mkfile" + fi echo "QMAKESPEC = $adjqmakespec" >> "$mkfile" echo "QT_VERSION = $QT_VERSION" >> "$mkfile" echo "EXTRA_CFLAGS = $EXTRA_CFLAGS" >> "$mkfile" diff --git a/mkspecs/features/qt_build_paths.prf b/mkspecs/features/qt_build_paths.prf index 03b43e3153..25fc2c3033 100644 --- a/mkspecs/features/qt_build_paths.prf +++ b/mkspecs/features/qt_build_paths.prf @@ -16,6 +16,9 @@ isEmpty(MODULE_BASE_DIR): MODULE_BASE_DIR = $$MODULE_PROFILE_DIR isEmpty(MODULE_BASE_OUTDIR): MODULE_BASE_OUTDIR = $$shadowed($$MODULE_BASE_DIR) isEmpty(MODULE_QMAKE_OUTDIR): MODULE_QMAKE_OUTDIR = $$MODULE_BASE_OUTDIR +exists($$MODULE_PROFILE_DIR/.git): \ + CONFIG += git_build + !prefix_build { QTDIR = $$[QT_HOST_PREFIX] # Permit modules to enforce being built outside QTDIR ... diff --git a/mkspecs/features/qt_module_headers.prf b/mkspecs/features/qt_module_headers.prf index 7591bffb19..fd6cf6b943 100644 --- a/mkspecs/features/qt_module_headers.prf +++ b/mkspecs/features/qt_module_headers.prf @@ -11,7 +11,7 @@ load(qt_build_paths) -!build_pass { +!build_pass:git_build { qtPrepareTool(QMAKE_SYNCQT, syncqt) minimal_syncqt { QMAKE_SYNCQT += -minimal $$QMAKE_SYNCQT_OPTIONS @@ -29,7 +29,11 @@ load(qt_build_paths) minimal_syncqt: return() #load up the headers info -include($$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME/headers.pri, "", true) +git_build: \ + INC_PATH = $$MODULE_BASE_OUTDIR +else: \ + INC_PATH = $$MODULE_BASE_DIR +include($$INC_PATH/include/$$MODULE_INCNAME/headers.pri, "", true) autogen_warning = \ "/* This file was generated by qmake with the info from /$$relative_path($$_PRO_FILE_, $$MODULE_BASE_DIR). */" diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf index 77adc02259..653f753815 100644 --- a/mkspecs/features/qt_module_pris.prf +++ b/mkspecs/features/qt_module_pris.prf @@ -56,6 +56,18 @@ else: \ MODULE_PRIVATE_INCLUDES = \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION \ \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME } + !git_build:!equals(_PRO_FILE_PWD_, $$OUT_PWD) { + pub_inc = $$replace(MODULE_INCLUDES, ^\\\$\\\$QT_MODULE_INCLUDE_BASE, $$MODULE_BASE_DIR/include) + priv_inc = $$replace(MODULE_PRIVATE_INCLUDES, ^\\\$\\\$QT_MODULE_INCLUDE_BASE, $$MODULE_BASE_DIR/include) + force_independent { + MODULE_FWD_PRI_CONT_SUFFIX = \ + "QT.$${MODULE}.includes += $$pub_inc" \ + "QT.$${MODULE}.private_includes += $$priv_inc" + } else { + MODULE_INCLUDES += $$pub_inc + MODULE_PRIVATE_INCLUDES += $$priv_inc + } + } MODULE_PRI_CONT = \ "QT.$${MODULE}.VERSION = $${VERSION}" \ "QT.$${MODULE}.MAJOR_VERSION = $$section(VERSION, ., 0, 0)" \ @@ -97,7 +109,8 @@ else: \ "QT_MODULE_HOST_LIB_BASE = $$MODULE_BASE_OUTDIR/lib" \ "QT_MODULE_LIBEXEC_BASE = $$MODULE_BASE_OUTDIR/libexec" \ "QT_MODULE_PLUGIN_BASE = $$MODULE_BASE_OUTDIR/plugins" \ - "include($$MODULE_PRI)" + "include($$MODULE_PRI)" \ + $$MODULE_FWD_PRI_CONT_SUFFIX write_file($$MODULE_FWD_PRI, MODULE_FWD_PRI_CONT)|error("Aborting.") touch($$MODULE_FWD_PRI, $$MODULE_PRI) MODULE_PRI_FILES += $$MODULE_FWD_PRI diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix index 7293f4c869..9b7bfa6f8b 100644 --- a/qmake/Makefile.unix +++ b/qmake/Makefile.unix @@ -85,8 +85,8 @@ DEPEND_SRC = \ CPPFLAGS = -g $(EXTRA_CPPFLAGS) \ -I$(QMKSRC) -I$(QMKLIBSRC) -I$(QMKSRC)/generators -I$(QMKSRC)/generators/unix -I$(QMKSRC)/generators/win32 \ -I$(QMKSRC)/generators/mac -I$(QMKSRC)/generators/integrity \ - -I$(BUILD_PATH)/include -I$(BUILD_PATH)/include/QtCore \ - -I$(BUILD_PATH)/include/QtCore/$(QT_VERSION) -I$(BUILD_PATH)/include/QtCore/$(QT_VERSION)/QtCore \ + -I$(INC_PATH) -I$(INC_PATH)/QtCore \ + -I$(INC_PATH)/QtCore/$(QT_VERSION) -I$(INC_PATH)/QtCore/$(QT_VERSION)/QtCore \ -I$(BUILD_PATH)/src/corelib/global -DHAVE_QCONFIG_CPP \ -I$(QMAKESPEC) \ -I$(SOURCE_PATH)/tools/shared \ diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32 index 63cdf50563..7dbef61413 100644 --- a/qmake/Makefile.win32 +++ b/qmake/Makefile.win32 @@ -34,7 +34,7 @@ CFLAGS_BARE = -c -Fo./ \ -W3 -nologo -O1 \ $(CFLAGS_EXTRA) \ -I$(QMKSRC) -I$(QMKSRC)\library -I$(QMKSRC)\generators -I$(QMKSRC)\generators\unix -I$(QMKSRC)\generators\win32 -I$(QMKSRC)\generators\mac -I$(QMKSRC)\generators\integrity \ - -I$(BUILD_PATH)\include -I$(BUILD_PATH)\include\QtCore -I$(BUILD_PATH)\include\QtCore\$(QT_VERSION) -I$(BUILD_PATH)\include\QtCore\$(QT_VERSION)\QtCore \ + -I$(INC_PATH) -I$(INC_PATH)\QtCore -I$(INC_PATH)\QtCore\$(QT_VERSION) -I$(INC_PATH)\QtCore\$(QT_VERSION)\QtCore \ -I$(BUILD_PATH)\src\corelib\global -DHAVE_QCONFIG_CPP \ -I$(SOURCE_PATH)\mkspecs\$(QMAKESPEC) \ -I$(SOURCE_PATH)\tools\shared \ diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 9620129509..ad2854880a 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1987,7 +1987,7 @@ QString Configure::defaultTo(const QString &option) return "auto"; if (option == "SYNCQT" - && (!QFile::exists(sourcePath + "/bin/syncqt.pl"))) + && (!QFile::exists(sourcePath + "/.git"))) return "no"; // Do not actually build the examples in production builds with -prefix, unless requested @@ -3810,7 +3810,10 @@ void Configure::buildQmake() QTextStream stream(&out); stream << "#AutoGenerated by configure.exe" << endl << "BUILD_PATH = " << QDir::toNativeSeparators(buildPath) << endl - << "SOURCE_PATH = " << QDir::toNativeSeparators(sourcePath) << endl; + << "SOURCE_PATH = " << QDir::toNativeSeparators(sourcePath) << endl + << "INC_PATH = " << QDir::toNativeSeparators( + (QFile::exists(sourcePath + "/.git") ? buildPath : sourcePath) + + "/include") << endl; stream << "QT_VERSION = " << dictionary["VERSION"] << endl; if (dictionary[ "QMAKESPEC" ] == QString("win32-g++")) { stream << "QMAKESPEC = $(SOURCE_PATH)\\mkspecs\\win32-g++" << endl -- cgit v1.2.1 From 9a9abf8a8a19faaf805c9ca4e09c9e2e3ae0c122 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 29 May 2013 15:04:06 +0200 Subject: Only process vcproj files if we do a -fully-process A top-level vcproj (really a .sln file) only makes sense when sub- projects are generated too, since the solutions generator will ignore all non-generated projects. Originally-by: Marius Storm-Olsen Change-Id: Iff09279d5760b5114a4cfb9b58ad677f2f69fa58 Reviewed-by: Joerg Bornemann --- tools/configure/configureapp.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index ad2854880a..98b59ab6fd 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1841,7 +1841,7 @@ bool Configure::displayHelp() desc("BUILD_QMAKE", "no", "-no-qmake", "Do not compile qmake."); desc("BUILD_QMAKE", "yes", "-qmake", "Compile qmake.\n"); - desc("PROCESS", "partial", "-process", "Generate top-level Makefiles/Project files."); + desc("PROCESS", "partial", "-process", "Generate only top-level Makefile."); desc("PROCESS", "full", "-fully-process", "Generate Makefiles/Project files for the entire Qt\ntree."); desc("PROCESS", "no", "-dont-process", "Do not generate Makefiles/Project files.\n"); @@ -3954,7 +3954,8 @@ void Configure::generateMakefiles() { QString dirName; bool generate = true; - bool doDsp = (dictionary["VCPROJFILES"] == "yes"); + bool doDsp = (dictionary["VCPROJFILES"] == "yes" + && dictionary["PROCESS"] == "full"); while (generate) { QString pwd = QDir::currentPath(); QString dirPath = buildPath + dirName; -- cgit v1.2.1 From 101c47242b955b4fe3da8f3de57450815b9d4aec Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Mon, 3 Jun 2013 12:44:46 +0200 Subject: Update LICENSE.PREVIEW.COMMERCIAL license Change-Id: I87b9c77327e2e32db77efb027172ccd21659e032 Reviewed-by: Iikka Eklund --- LICENSE.PREVIEW.COMMERCIAL | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE.PREVIEW.COMMERCIAL b/LICENSE.PREVIEW.COMMERCIAL index e90ad1acb5..15e61fc19e 100644 --- a/LICENSE.PREVIEW.COMMERCIAL +++ b/LICENSE.PREVIEW.COMMERCIAL @@ -14,8 +14,8 @@ TECHNOLOGY PREVIEW LICENSE AGREEMENT: The Americas Agreement version 2.4 This Technology Preview License Agreement ("Agreement")is a legal agreement -between Digia USA, Inc. ("Digia"), with its registered office at 32 W. -Loockerman Street, Suite 201, City of Dover, County of Kent, Delaware 19904, +between Digia USA, Inc. ("Digia"), with its registered office at 2350 +Mission College Blvd., Suite 1020, Santa Clara, California 95054, U.S.A. and you (either an individual or a legal entity) ("Licensee") for the Licensed Software (as defined below). -- cgit v1.2.1 From 51a35f5c021836bf31276749c638addefac12ebb Mon Sep 17 00:00:00 2001 From: Andy Nichols Date: Fri, 31 May 2013 14:57:52 +0200 Subject: eglfs: prevent expose/geometrychange loop This prevents EGLFS from getting stuck after exposing the first frame, by constantly generating new Expose and GeometryChange events which are synchronously processed. Change-Id: Id3b09821ea31e9c1ddab7c520e782a4e42844a08 Reviewed-by: Paul Olav Tvete --- src/plugins/platforms/eglfs/qeglfswindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp index cd92a07f00..98c54e0ee0 100644 --- a/src/plugins/platforms/eglfs/qeglfswindow.cpp +++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp @@ -68,11 +68,11 @@ QEglFSWindow::~QEglFSWindow() void QEglFSWindow::create() { - setWindowState(Qt::WindowFullScreen); - if (m_window) return; + setWindowState(Qt::WindowFullScreen); + if (window()->type() == Qt::Desktop) { QRect rect(QPoint(), QEglFSHooks::hooks()->screenSize()); QPlatformWindow::setGeometry(rect); -- cgit v1.2.1 From fb7e0e24c4181e9e97d85a3a80c3e2ef5a40770a Mon Sep 17 00:00:00 2001 From: Andy Nichols Date: Sat, 1 Jun 2013 17:57:34 +0200 Subject: eglfs: Fix bug determining physical screen size In the situation that the screenSize EGLFS hook had been defined, but not the physicalScreenSize, the uninitialized contents of fb_var_screeninfo vinfo would be used to calculate the fall-back physical screen size. Since this value is undefined, devices like the Raspberry Pi would end unable to render DPI dependent fonts. Change-Id: Ic9f67c1c646cc7b328b695b76a84d78577fefcd8 Reviewed-by: Paul Olav Tvete --- src/plugins/platforms/eglfs/qeglfshooks_stub.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp index 91a97ff977..c334f46c2c 100644 --- a/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp +++ b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp @@ -99,6 +99,7 @@ QSizeF QEglFSHooks::physicalScreenSize() const struct fb_var_screeninfo vinfo; int w = -1; int h = -1; + QSize screenResolution; if (framebuffer != -1) { if (ioctl(framebuffer, FBIOGET_VSCREENINFO, &vinfo) == -1) { @@ -106,12 +107,15 @@ QSizeF QEglFSHooks::physicalScreenSize() const } else { w = vinfo.width; h = vinfo.height; + screenResolution = QSize(vinfo.xres, vinfo.yres); } + } else { + screenResolution = screenSize(); } const int defaultPhysicalDpi = 100; - size.setWidth(w <= 0 ? vinfo.xres * Q_MM_PER_INCH / defaultPhysicalDpi : qreal(w)); - size.setHeight(h <= 0 ? vinfo.yres * Q_MM_PER_INCH / defaultPhysicalDpi : qreal(h)); + size.setWidth(w <= 0 ? screenResolution.width() * Q_MM_PER_INCH / defaultPhysicalDpi : qreal(w)); + size.setHeight(h <= 0 ? screenResolution.height() * Q_MM_PER_INCH / defaultPhysicalDpi : qreal(h)); if (w <= 0 || h <= 0) { qWarning("EGLFS: Unable to query physical screen size, defaulting to %d dpi.\n" -- cgit v1.2.1 From 55f01addb201c153ba5049a11f8ddfc0aa7544c7 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 4 Jun 2013 08:39:03 +0200 Subject: Adapt QtPrintSupport related uic rules It's no more on QtWidgets. Task-number: QTBUG-31508 Change-Id: Iba117a4103c2b32173816a4ecb5faa187f169b32 Reviewed-by: Friedemann Kleint --- src/tools/uic/qclass_lib_map.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/uic/qclass_lib_map.h b/src/tools/uic/qclass_lib_map.h index 6859cd0cd4..cedefb801a 100644 --- a/src/tools/uic/qclass_lib_map.h +++ b/src/tools/uic/qclass_lib_map.h @@ -587,8 +587,8 @@ QT_CLASS_LIB(QFontDialog, QtWidgets, qfontdialog.h) QT_CLASS_LIB(QInputDialog, QtWidgets, qinputdialog.h) QT_CLASS_LIB(QMessageBox, QtWidgets, qmessagebox.h) QT_CLASS_LIB(QPageSetupDialog, QtWidgets, qpagesetupdialog.h) -QT_CLASS_LIB(QPrintDialog, QtWidgets, qprintdialog.h) -QT_CLASS_LIB(QPrintPreviewDialog, QtWidgets, qprintpreviewdialog.h) +QT_CLASS_LIB(QPrintDialog, QtPrintSupport, qprintdialog.h) +QT_CLASS_LIB(QPrintPreviewDialog, QtPrintSupport, qprintpreviewdialog.h) QT_CLASS_LIB(QProgressDialog, QtWidgets, qprogressdialog.h) QT_CLASS_LIB(QWizard, QtWidgets, qwizard.h) QT_CLASS_LIB(QWizardPage, QtWidgets, qwizard.h) @@ -944,7 +944,7 @@ QT_CLASS_LIB(QMenuBar, QtWidgets, qmenubar.h) QT_CLASS_LIB(QMenuItem, QtWidgets, qmenudata.h) QT_CLASS_LIB(QPlainTextEdit, QtWidgets, qplaintextedit.h) QT_CLASS_LIB(QPlainTextDocumentLayout, QtWidgets, qplaintextedit.h) -QT_CLASS_LIB(QPrintPreviewWidget, QtWidgets, qprintpreviewwidget.h) +QT_CLASS_LIB(QPrintPreviewWidget, QtPrintSupport, qprintpreviewwidget.h) QT_CLASS_LIB(QProgressBar, QtWidgets, qprogressbar.h) QT_CLASS_LIB(QPushButton, QtWidgets, qpushbutton.h) QT_CLASS_LIB(QRadioButton, QtWidgets, qradiobutton.h) -- cgit v1.2.1 From 53698f3e7c9451774b60e3f65988654e24c8968e Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 4 Jun 2013 20:34:49 +0200 Subject: fix non-git non-shadow non-prefix non-qtbase builds these builds usually assume all headers in the qtbase build (== source == install) dir, so the path for adding our pre-generated per-module include paths needs to be triggered explicitly. Change-Id: I57ec441d58cdf8186907ee6c36dce08daa206c49 Reviewed-by: Kai Koehne Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_module_pris.prf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf index 653f753815..11f56198d1 100644 --- a/mkspecs/features/qt_module_pris.prf +++ b/mkspecs/features/qt_module_pris.prf @@ -56,7 +56,8 @@ else: \ MODULE_PRIVATE_INCLUDES = \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION \ \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME } - !git_build:!equals(_PRO_FILE_PWD_, $$OUT_PWD) { + !git_build:if(!equals(_PRO_FILE_PWD_, $$OUT_PWD) \ + |if(!prefix_build:!equals(MODULE_BASE_DIR, $$[QT_HOST_PREFIX]))) { pub_inc = $$replace(MODULE_INCLUDES, ^\\\$\\\$QT_MODULE_INCLUDE_BASE, $$MODULE_BASE_DIR/include) priv_inc = $$replace(MODULE_PRIVATE_INCLUDES, ^\\\$\\\$QT_MODULE_INCLUDE_BASE, $$MODULE_BASE_DIR/include) force_independent { -- cgit v1.2.1 From 07337def652a13002ccc98d77bb1a13372bba26f Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 4 Jun 2013 20:59:08 +0200 Subject: don't add absent private include paths to non-git builds all private headers are created by syncqt (and are thus in the source dir), so we can simply override the normal (build dir based) paths instead of extending them. Change-Id: I9c1f3344c401b481b3f3d2295515f1aabffaa9a0 Reviewed-by: Thiago Macieira --- mkspecs/features/qt_module_pris.prf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf index 11f56198d1..666989f75e 100644 --- a/mkspecs/features/qt_module_pris.prf +++ b/mkspecs/features/qt_module_pris.prf @@ -63,10 +63,10 @@ else: \ force_independent { MODULE_FWD_PRI_CONT_SUFFIX = \ "QT.$${MODULE}.includes += $$pub_inc" \ - "QT.$${MODULE}.private_includes += $$priv_inc" + "QT.$${MODULE}.private_includes = $$priv_inc" } else { MODULE_INCLUDES += $$pub_inc - MODULE_PRIVATE_INCLUDES += $$priv_inc + MODULE_PRIVATE_INCLUDES = $$priv_inc } } MODULE_PRI_CONT = \ -- cgit v1.2.1 From 930dc240d1938dac8d6512b947cb143fc91c3d21 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 28 May 2013 11:11:56 +0200 Subject: remove pointless symlink fallback for qconfig.h syncqt does that nowadays. Change-Id: Iffc465cce86a7c6370afaa543ba9b9ed8d478eea Reviewed-by: Joerg Bornemann --- configure | 3 --- 1 file changed, 3 deletions(-) diff --git a/configure b/configure index 1e15220ca1..d7c96749f4 100755 --- a/configure +++ b/configure @@ -6424,9 +6424,6 @@ else [ -f "$outpath/src/corelib/global/qconfig.h" ] && chmod +w "$outpath/src/corelib/global/qconfig.h" mv "$outpath/src/corelib/global/qconfig.h.new" "$outpath/src/corelib/global/qconfig.h" chmod -w "$outpath/src/corelib/global/qconfig.h" - if [ ! -f "$outpath/include/QtCore/qconfig.h" ]; then - ln -s "$outpath/src/corelib/global/qconfig.h" "$outpath/include/QtCore/qconfig.h" - fi fi # create a forwarding header -- cgit v1.2.1 From 04830dbcb2c1b92bd949ac7fd56d293b02e91fef Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 5 Jun 2013 14:26:03 +0200 Subject: Strip the -L dirs when processing GL dirs for the CMake files. The generated cmake files expect only the names of libraries, so the existence of directories causes erroneous fatal errors when attempting to use Qt5Gui, if pkg-config returns a -L entry from pkg-config --libs egl Change-Id: Iec50b4be68ab643c3c02abce2435a98e69955138 Reviewed-by: Oswald Buddenhagen Reviewed-by: Stephen Kelly Reviewed-by: Iikka Eklund --- mkspecs/features/cmake_functions.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/cmake_functions.prf b/mkspecs/features/cmake_functions.prf index 08295da75f..f48ef43b88 100644 --- a/mkspecs/features/cmake_functions.prf +++ b/mkspecs/features/cmake_functions.prf @@ -54,7 +54,7 @@ defineReplace(cmakeProcessLibs) { variable = $$1 out = for(v, variable) { - if(!equals(v, -framework)) { + if(!equals(v, -framework):!equals(v, -L.*)) { v ~= s,^-l,, v ~= s,^-lib,, v ~= s,.lib$,, -- cgit v1.2.1 From 119882714f87ffeb6945fdb2d02997ae125ff50c Mon Sep 17 00:00:00 2001 From: Romain Perier Date: Thu, 30 May 2013 08:33:25 +0200 Subject: Cocoa:Fixed crash when sharing QMenu between two QMenuBar instances Don't insert a NSMenuItem into a NSMenu if this one already belongs to another NSMenu, this is forbidden in the Cocoa framework and raises an Exception. The solution consists in tagging the menu as sharable and moving it from one menubar to another when the window gets focus. Task-number: QTBUG-31342 Change-Id: Ic3bfadd4704f363ac26122ae15547543a0f6d44d Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoamenu.h | 5 ++ src/plugins/platforms/cocoa/qcocoamenu.mm | 13 +++++- src/plugins/platforms/cocoa/qcocoamenubar.h | 2 + src/plugins/platforms/cocoa/qcocoamenubar.mm | 68 +++++++++++++++++++--------- 4 files changed, 66 insertions(+), 22 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoamenu.h b/src/plugins/platforms/cocoa/qcocoamenu.h index 9100b9b15f..7224ee2ff8 100644 --- a/src/plugins/platforms/cocoa/qcocoamenu.h +++ b/src/plugins/platforms/cocoa/qcocoamenu.h @@ -49,6 +49,8 @@ QT_BEGIN_NAMESPACE +class QCocoaMenuBar; + class QCocoaMenu : public QPlatformMenu { public: @@ -87,6 +89,8 @@ public: QList items() const; QList merged() const; + void setMenuBar(QCocoaMenuBar *menuBar); + QCocoaMenuBar *menuBar() const; private: QCocoaMenuItem *itemOrNull(int index) const; void insertNative(QCocoaMenuItem *item, QCocoaMenuItem *beforeItem); @@ -97,6 +101,7 @@ private: NSObject *m_delegate; bool m_enabled; quintptr m_tag; + QCocoaMenuBar *m_menuBar; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm index 25ece7349c..d4cf83a380 100644 --- a/src/plugins/platforms/cocoa/qcocoamenu.mm +++ b/src/plugins/platforms/cocoa/qcocoamenu.mm @@ -215,7 +215,8 @@ QT_BEGIN_NAMESPACE QCocoaMenu::QCocoaMenu() : m_enabled(true), - m_tag(0) + m_tag(0), + m_menuBar(0) { m_delegate = [[QT_MANGLE_NAMESPACE(QCocoaMenuDelegate) alloc] initWithMenu:this]; m_nativeItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""]; @@ -534,4 +535,14 @@ void QCocoaMenu::syncModalState(bool modal) } } +void QCocoaMenu::setMenuBar(QCocoaMenuBar *menuBar) +{ + m_menuBar = menuBar; +} + +QCocoaMenuBar *QCocoaMenu::menuBar() const +{ + return m_menuBar; +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.h b/src/plugins/platforms/cocoa/qcocoamenubar.h index 8086676cc5..7a1bda74a4 100644 --- a/src/plugins/platforms/cocoa/qcocoamenubar.h +++ b/src/plugins/platforms/cocoa/qcocoamenubar.h @@ -75,6 +75,8 @@ private: static QCocoaMenuBar *findGlobalMenubar(); bool shouldDisable(QCocoaWindow *active) const; + void insertNativeMenu(QCocoaMenu *menu, QCocoaMenu *beforeMenu); + void removeNativeMenu(QCocoaMenu *menu); QList m_menus; NSMenu *m_nativeMenu; diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.mm b/src/plugins/platforms/cocoa/qcocoamenubar.mm index e280cf4581..73331db40d 100644 --- a/src/plugins/platforms/cocoa/qcocoamenubar.mm +++ b/src/plugins/platforms/cocoa/qcocoamenubar.mm @@ -83,9 +83,24 @@ QCocoaMenuBar::~QCocoaMenuBar() } } -void QCocoaMenuBar::insertMenu(QPlatformMenu *platformMenu, QPlatformMenu *before) +void QCocoaMenuBar::insertNativeMenu(QCocoaMenu *menu, QCocoaMenu *beforeMenu) { QCocoaAutoReleasePool pool; + + if (beforeMenu) { + NSUInteger nativeIndex = [m_nativeMenu indexOfItem:beforeMenu->nsMenuItem()]; + [m_nativeMenu insertItem: menu->nsMenuItem() atIndex: nativeIndex]; + } else { + [m_nativeMenu addItem: menu->nsMenuItem()]; + } + + menu->setMenuBar(this); + syncMenu(static_cast(menu)); + [m_nativeMenu setSubmenu: menu->nsMenu() forItem: menu->nsMenuItem()]; +} + +void QCocoaMenuBar::insertMenu(QPlatformMenu *platformMenu, QPlatformMenu *before) +{ QCocoaMenu *menu = static_cast(platformMenu); QCocoaMenu *beforeMenu = static_cast(before); #ifdef QT_COCOA_ENABLE_MENU_DEBUG @@ -96,39 +111,36 @@ void QCocoaMenuBar::insertMenu(QPlatformMenu *platformMenu, QPlatformMenu *befor qWarning() << Q_FUNC_INFO << "This menu already belongs to the menubar, remove it first"; return; } - if (beforeMenu) { - if (!m_menus.contains(beforeMenu)) { - qWarning() << Q_FUNC_INFO << "The before menu does not belong to the menubar"; - return; - } - m_menus.insert(m_menus.indexOf(beforeMenu), menu); - NSUInteger nativeIndex = [m_nativeMenu indexOfItem:beforeMenu->nsMenuItem()]; - [m_nativeMenu insertItem: menu->nsMenuItem() atIndex: nativeIndex]; - } else { - m_menus.append(menu); - [m_nativeMenu addItem: menu->nsMenuItem()]; + + if (beforeMenu && !m_menus.contains(beforeMenu)) { + qWarning() << Q_FUNC_INFO << "The before menu does not belong to the menubar"; + return; } - platformMenu->setParent(this); - syncMenu(platformMenu); - [m_nativeMenu setSubmenu: menu->nsMenu() forItem: menu->nsMenuItem()]; + m_menus.insert(beforeMenu ? m_menus.indexOf(beforeMenu) : m_menus.size(), menu); + if (!menu->menuBar()) + insertNativeMenu(menu, beforeMenu); } -void QCocoaMenuBar::removeMenu(QPlatformMenu *platformMenu) +void QCocoaMenuBar::removeNativeMenu(QCocoaMenu *menu) { QCocoaAutoReleasePool pool; + if (menu->menuBar() == this) + menu->setMenuBar(0); + NSUInteger realIndex = [m_nativeMenu indexOfItem:menu->nsMenuItem()]; + [m_nativeMenu removeItemAtIndex: realIndex]; +} + +void QCocoaMenuBar::removeMenu(QPlatformMenu *platformMenu) +{ QCocoaMenu *menu = static_cast(platformMenu); if (!m_menus.contains(menu)) { qWarning() << Q_FUNC_INFO << "Trying to remove a menu that does not belong to the menubar"; return; } m_menus.removeOne(menu); - - if (platformMenu->parent() == this) - platformMenu->setParent(0); - NSUInteger realIndex = [m_nativeMenu indexOfItem:menu->nsMenuItem()]; - [m_nativeMenu removeItemAtIndex: realIndex]; + removeNativeMenu(menu); } void QCocoaMenuBar::syncMenu(QPlatformMenu *menu) @@ -207,6 +219,20 @@ void QCocoaMenuBar::updateMenuBarImmediately() m->syncModalState(disableForModal); } + // reparent shared menu items if necessary. + // We browse the list in reverse order to be sure that the next items are redrawn before the current ones, + // in this way we are sure that "beforeMenu" (see below) is part of the native menu before "m" is redraw + for (int i = mb->m_menus.size() - 1; i >= 0; i--) { + QCocoaMenu *m = mb->m_menus.at(i); + QCocoaMenuBar *menuBar = m->menuBar(); + if (menuBar != mb) { + QCocoaMenu *beforeMenu = i < (mb->m_menus.size() - 1) ? mb->m_menus.at(i + 1) : 0; + if (menuBar) + menuBar->removeNativeMenu(m); + mb->insertNativeMenu(m, beforeMenu); + } + } + QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = getMenuLoader(); [loader ensureAppMenuInMenu:mb->nsMenu()]; -- cgit v1.2.1 From 25a4405c69a032bbe817935be1f1f0929e98da63 Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Tue, 4 Jun 2013 16:11:06 +0200 Subject: Doc: Rearranged page titles in the of HTML pages. Before: QtMultimedia 5.1: Camera After: Camera | QtMultimedia 5.1 "Camera" is page name and "QtMultimedia 5.1" is the assembled project name. -Regular page title is the same. -It's a readability issue to not see the page title right away -New arrangement conforms to Qt Project and blog name format: " | <Domain>" -Tested with the tw-parser and it looks compatible with the qt-project.org site Change-Id: Iae0eec9e66b5e21285bdad1e525923f60c72e56b Reviewed-by: Sami Makkonen <sami.makkonen@digia.com> Reviewed-by: Nico Vertriest <nico.vertriest@digia.com> Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> --- src/tools/qdoc/htmlgenerator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index 7e1467f300..3d6f04decf 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -1755,12 +1755,12 @@ void HtmlGenerator::generateHeader(const QString& title, if (shortVersion.count(QChar('.')) == 2) shortVersion.truncate(shortVersion.lastIndexOf(QChar('.'))); if (!project.isEmpty()) - shortVersion = project + QLatin1Char(' ') + shortVersion + QLatin1String(": "); + shortVersion = QLatin1String(" | ") + project + QLatin1Char(' ') + shortVersion; else - shortVersion = QLatin1String("Qt ") + shortVersion + QLatin1String(": "); + shortVersion = QLatin1String(" | ") + QLatin1String("Qt ") + shortVersion ; // Generating page title - out() << " <title>" << shortVersion << protectEnc(title) << "\n"; + out() << " " << protectEnc(title) << shortVersion << "\n"; // Include style sheet and script links. out() << headerStyles; -- cgit v1.2.1 From c889e2848398c7beca9d31544e9cbdba88ebe5bb Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Mon, 3 Jun 2013 12:23:50 +0200 Subject: Doc: Fixed typo in QDialog. Task-number: QTBUG-31493 Change-Id: I7bb7b249a0336dd949f8c74bcc22c0b7c39d0885 Reviewed-by: Geir Vattekar --- src/widgets/dialogs/qdialog.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp index a76c88dc5e..2cda99a269 100644 --- a/src/widgets/dialogs/qdialog.cpp +++ b/src/widgets/dialogs/qdialog.cpp @@ -150,12 +150,11 @@ void QDialogPrivate::deletePlatformHelper() provide a \l{#return}{return value}, and they can have \l{#default}{default buttons}. QDialogs can also have a QSizeGrip in their lower-right corner, using setSizeGripEnabled(). - Note that QDialog (an any other widget that has type Qt::Dialog) uses - the parent widget slightly differently from other classes in Qt. A - dialog is always a top-level widget, but if it has a parent, its - default location is centered on top of the parent's top-level widget - (if it is not top-level itself). It will also share the parent's - taskbar entry. + Note that QDialog (and any other widget that has type \c Qt::Dialog) uses + the parent widget slightly differently from other classes in Qt. A dialog is + always a top-level widget, but if it has a parent, its default location is + centered on top of the parent's top-level widget (if it is not top-level + itself). It will also share the parent's taskbar entry. Use the overload of the QWidget::setParent() function to change the ownership of a QDialog widget. This function allows you to -- cgit v1.2.1 From 476dba9a9f3842041f465da92764646976b96551 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 5 Jun 2013 16:11:50 +0200 Subject: Use QWindow::geometry() for size when sending resize before expose. Task-number: QTBUG-30996 Change-Id: I9c3589ea67b563f6e588568ee54cc8bbd084f87c Reviewed-by: Gunnar Sletta --- src/gui/kernel/qguiapplication.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 2a1d7e3bcc..29a7e87d46 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -2251,8 +2251,8 @@ void QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::E if (!p->receivedExpose) { if (p->resizeEventPending) { // as a convenience for plugins, send a resize event before the first expose event if they haven't done so - QSize size = p->geometry.size(); - QResizeEvent e(size, size); + // window->geometry() should have a valid size as soon as a handle exists. + QResizeEvent e(window->geometry().size(), p->geometry.size()); QGuiApplication::sendSpontaneousEvent(window, &e); p->resizeEventPending = false; -- cgit v1.2.1 From 1828ab8557e824ec22b0c425dd417df3a0794a8c Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 5 Jun 2013 16:14:42 +0200 Subject: Windows: Send a geometry change after Window creation. Task-number: QTBUG-30996 Change-Id: I03b5e1fdbbdd779f86541291c13e9eb6840ff3c6 Reviewed-by: Gunnar Sletta --- src/plugins/platforms/windows/qwindowsintegration.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index 814892b43a..fc2ba454df 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -433,6 +433,9 @@ QPlatformWindow *QWindowsIntegration::createPlatformWindow(QWindow *window) cons return 0; if (requested.flags != obtained.flags) window->setFlags(obtained.flags); + // Trigger geometry change signals of QWindow. + if ((obtained.flags & Qt::Desktop) != Qt::Desktop && requested.geometry != obtained.geometry) + QWindowSystemInterface::handleGeometryChange(window, obtained.geometry); return new QWindowsWindow(window, obtained); } -- cgit v1.2.1 From 21356b3ec34f4e83719389775b83825fbd8b02e6 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 5 Jun 2013 11:20:07 +0200 Subject: RecalcAdvances and DoKerning should agree on when to use design metrics QFontEngineFT::recalcAdvances uses design metrics if hinting is disabled or slight. QFontEngine::doKerning only follows the QFontEngine::DesignMetrics flag. This means in some instances the advances will be calculated in subpixels but kerned in full pixels. This patch makes QFontEngineFT decide if it should request design metrics from QFontEngine::doKerning or not. Change-Id: Ia0236efde2d7269623f690a6074afbe26e07c458 Reviewed-by: Konstantin Ritt Reviewed-by: Pierre Rossi --- src/gui/text/qfontengine_ft.cpp | 18 +++++++++++++++--- src/gui/text/qfontengine_ft_p.h | 1 + 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 10225febcb..4545645dc6 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -1316,6 +1316,12 @@ void QFontEngineFT::doKerning(QGlyphLayout *g, QFontEngine::ShaperFlags flags) c unlockFace(); } } + + if (shouldUseDesignMetrics(flags) && !(fontDef.styleStrategy & QFont::ForceIntegerMetrics)) + flags |= DesignMetrics; + else + flags &= ~DesignMetrics; + QFontEngine::doKerning(g, flags); } @@ -1571,12 +1577,18 @@ bool QFontEngineFT::stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs return true; } +bool QFontEngineFT::shouldUseDesignMetrics(QFontEngine::ShaperFlags flags) const +{ + if (!FT_IS_SCALABLE(freetype->face)) + return false; + + return default_hint_style == HintNone || default_hint_style == HintLight || (flags & DesignMetrics); +} + void QFontEngineFT::recalcAdvances(QGlyphLayout *glyphs, QFontEngine::ShaperFlags flags) const { FT_Face face = 0; - bool design = (default_hint_style == HintNone || - default_hint_style == HintLight || - (flags & DesignMetrics)) && FT_IS_SCALABLE(freetype->face); + bool design = shouldUseDesignMetrics(flags); for (int i = 0; i < glyphs->numGlyphs; i++) { Glyph *g = cacheEnabled ? defaultGlyphSet.getGlyph(glyphs->glyphs[i]) : 0; // Since we are passing Format_None to loadGlyph, use same default format logic as loadGlyph diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h index 434eb76c33..e09fa6f94f 100644 --- a/src/gui/text/qfontengine_ft_p.h +++ b/src/gui/text/qfontengine_ft_p.h @@ -325,6 +325,7 @@ private: friend class QFontEngineMultiFontConfig; int loadFlags(QGlyphSet *set, GlyphFormat format, int flags, bool &hsubpixel, int &vfactor) const; + bool shouldUseDesignMetrics(ShaperFlags flags) const; GlyphFormat defaultFormat; FT_Matrix matrix; -- cgit v1.2.1 From 9ef24ff8ed487d49cf441c65c69ea7ebfe8acfb3 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Fri, 7 Jun 2013 13:03:34 +0200 Subject: test: Mark tst_qopengl as insignificant on Win7 + Angle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This only marks tst_qopengl as insignificant on Windows 7 32bit with the Angle configuration. Task-number: QTBUG-31611 Change-Id: I1876b6fdc32fef93edf34c2bd61d03cc9ba11135 Reviewed-by: Friedemann Kleint Reviewed-by: Tony Sarajärvi --- tests/auto/gui/qopengl/qopengl.pro | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/auto/gui/qopengl/qopengl.pro b/tests/auto/gui/qopengl/qopengl.pro index 91eeda34c3..34af962d36 100644 --- a/tests/auto/gui/qopengl/qopengl.pro +++ b/tests/auto/gui/qopengl/qopengl.pro @@ -8,3 +8,5 @@ TARGET = tst_qopengl QT += gui gui-private core-private testlib SOURCES += tst_qopengl.cpp + +win32-msvc2010:contains(QT_CONFIG, angle):CONFIG += insignificant_test # QTBUG-31611 -- cgit v1.2.1 From ebea15cb33da8063a630867e38eacf7857b0b936 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 7 Jun 2013 15:52:26 -0700 Subject: QEventLoop: Remove the test that checked throwing from an event handler In Qt 5, we declared that throwing from event handlers is undefined behavior. So stop testing this. We will try our best to capture and pass along std::bad_alloc, but even that might not work, depending on compiler settings. In particular, after the upgrade to MinGW/GCC 4.8 with DW2, this test stopped working. Task-number: QTBUG-31615 Change-Id: Ibf5fb2ce0c48b983549096bf7aac434b6ed3ac2e Reviewed-by: Lars Knoll --- .../corelib/kernel/qeventloop/tst_qeventloop.cpp | 67 ---------------------- 1 file changed, 67 deletions(-) diff --git a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp index 2250d0bb5e..25e5f03566 100644 --- a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp +++ b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp @@ -159,23 +159,6 @@ public slots: } }; -#ifndef QT_NO_EXCEPTIONS -class QEventLoopTestException { }; - -class ExceptionThrower : public QObject -{ - Q_OBJECT -public: - ExceptionThrower() : QObject() { } -public slots: - void throwException() - { - QEventLoopTestException e; - throw e; - } -}; -#endif - class tst_QEventLoop : public QObject { Q_OBJECT @@ -183,9 +166,6 @@ private slots: // This test *must* run first. See the definition for why. void processEvents(); void exec(); -#if !defined(QT_NO_EXCEPTIONS) && !defined(Q_OS_WINCE_WM) - void throwInExec(); -#endif void reexec(); void execAfterExit(); void wakeUp(); @@ -322,53 +302,6 @@ void tst_QEventLoop::exec() } } -#if !defined(QT_NO_EXCEPTIONS) && !defined(Q_OS_WINCE_WM) -// Exceptions need to be enabled for this test -// Q_OS_WINCE_WM case: this platform doesn't support propagating exceptions through the event loop -// Windows Mobile cannot handle cross library exceptions -// qobject.cpp will try to rethrow the exception after handling -// which causes gwes.exe to crash -void tst_QEventLoop::throwInExec() -{ -// exceptions compiled in, runtime tests follow. -#if defined(Q_OS_LINUX) - // C++ exceptions can't be passed through glib callbacks. Skip the test if - // we're using the glib event loop. - QByteArray dispatcher = QAbstractEventDispatcher::instance()->metaObject()->className(); - if (dispatcher.contains("Glib")) { - QSKIP( - qPrintable(QString( - "Throwing exceptions in exec() won't work if %1 event dispatcher is used.\n" - "Try running with QT_NO_GLIB=1 in environment." - ).arg(QString::fromLatin1(dispatcher))) - ); - } -#endif - - { - // QEventLoop::exec() is exception safe - QEventLoop eventLoop; - int caughtExceptions = 0; - - try { - ExceptionThrower exceptionThrower; - QTimer::singleShot(EXEC_TIMEOUT, &exceptionThrower, SLOT(throwException())); - (void) eventLoop.exec(); - } catch (...) { - ++caughtExceptions; - } - try { - ExceptionThrower exceptionThrower; - QTimer::singleShot(EXEC_TIMEOUT, &exceptionThrower, SLOT(throwException())); - (void) eventLoop.exec(); - } catch (...) { - ++caughtExceptions; - } - QCOMPARE(caughtExceptions, 2); - } -} -#endif - void tst_QEventLoop::reexec() { QEventLoop loop; -- cgit v1.2.1 From 69fa0012c748f9024ac21b5d6a9f1be1abb805a5 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 6 Jun 2013 11:58:19 +0200 Subject: use qtconcurrent instead of qtgui in test code this works with -no-gui, and doesn't interfere with our upcoming ANGLE hackery. Change-Id: I2985cc0acd1fbf185b8967ffe58606b1b7dd9d1e Reviewed-by: Friedemann Kleint Reviewed-by: Olivier Goffart --- tests/auto/tools/moc/no-keywords.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/tools/moc/no-keywords.h b/tests/auto/tools/moc/no-keywords.h index e04e36b678..ffd5928370 100644 --- a/tests/auto/tools/moc/no-keywords.h +++ b/tests/auto/tools/moc/no-keywords.h @@ -47,7 +47,7 @@ #define slots Baz #define emit Yoyodyne -#include +#include #include #include #include -- cgit v1.2.1 From 150408e37d58c64509e7183014593c51f370415b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 7 Jun 2013 15:55:30 +0200 Subject: don't process ANGLE and zlib headers like real qt modules we run syncqt on them only to get normal forwarding headers and the headers.pri file. the module master include header and the module version header are useless, and scanning for qt class names just wastes time. Change-Id: I58e8d1eb36cea5c31cbd46ce673438316d1963dc Reviewed-by: Joerg Bornemann --- bin/syncqt.pl | 11 ++++++++--- sync.profile | 8 ++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/bin/syncqt.pl b/bin/syncqt.pl index 497e8deb2c..cc91a11de0 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -837,7 +837,9 @@ foreach my $lib (@modules_to_sync) { die "No such module: $lib" unless(defined $modules{$lib}); #iteration info - my @dirs = split(/;/, $modules{$lib}); + my $module = $modules{$lib}; + my $is_qt = !($module =~ s/^!//); + my @dirs = split(/;/, $module); my $dir = $dirs[0]; my $pathtoheaders = ""; @@ -946,7 +948,7 @@ foreach my $lib (@modules_to_sync) { } my $iheader = $subdir . "/" . $header; - my @classes = $public_header && !$minimal ? classNames($iheader) : (); + my @classes = $public_header && (!$minimal && $is_qt) ? classNames($iheader) : (); if($showonly) { print "$header [$lib]\n"; foreach(@classes) { @@ -1056,7 +1058,7 @@ foreach my $lib (@modules_to_sync) { "#include \"".lc($lib)."version.h\"\n" . "#endif\n"; - unless ($showonly || $minimal) { + unless ($showonly || $minimal || !$is_qt) { # create deprecated headers my $first = 1; while (my ($header, $include) = each %{$deprecatedheaders{$lib}}) { @@ -1141,7 +1143,9 @@ foreach my $lib (@modules_to_sync) { my $master_include = "$out_basedir/include/$lib/$lib"; $pri_install_files .= fixPaths($master_include, $dir) . " "; writeFile($master_include, $master_contents, $lib, "master header"); + } + unless ($showonly || $minimal) { #handle the headers.pri for each module my $headers_pri_contents = ""; $headers_pri_contents .= "SYNCQT.HEADER_FILES = $pri_install_files\n"; @@ -1174,6 +1178,7 @@ unless($showonly || !$create_uic_class_map) { if($check_includes) { foreach my $lib (@modules_to_sync) { + next if ($modules{$lib} =~ /^!/); #calc subdirs my @subdirs = listSubdirs(map { s/^\^//; $_ } split(/;/, $modules{$lib})); diff --git a/sync.profile b/sync.profile index 3d89d9d71f..91503d425f 100644 --- a/sync.profile +++ b/sync.profile @@ -11,10 +11,10 @@ "QtDBus" => "$basedir/src/dbus", "QtConcurrent" => "$basedir/src/concurrent", "QtPlatformSupport" => "$basedir/src/platformsupport", - "KHR" => "$basedir/src/3rdparty/angle/include/KHR", - "GLES2" => "$basedir/src/3rdparty/angle/include/GLES2", - "EGL" => "$basedir/src/3rdparty/angle/include/EGL", - "QtZlib" => "$basedir/src/3rdparty/zlib", + "KHR" => "!$basedir/src/3rdparty/angle/include/KHR", + "GLES2" => "!$basedir/src/3rdparty/angle/include/GLES2", + "EGL" => "!$basedir/src/3rdparty/angle/include/EGL", + "QtZlib" => "!$basedir/src/3rdparty/zlib", "QtOpenGLExtensions" => "$basedir/src/openglextensions", ); %moduleheaders = ( # restrict the module headers to those found in relative path -- cgit v1.2.1 From 366d276f8c534819b0624ea86e36c7f2eb020f24 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 5 Jun 2013 13:20:37 +0200 Subject: allow modules to extend their MODULE_{,PRIVATE_}INCLUDES Change-Id: I5e401edbe891846579cf6d9ff84427d16783923b Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_module_pris.prf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf index 666989f75e..9eb9b02e14 100644 --- a/mkspecs/features/qt_module_pris.prf +++ b/mkspecs/features/qt_module_pris.prf @@ -56,6 +56,8 @@ else: \ MODULE_PRIVATE_INCLUDES = \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION \ \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME } + MODULE_INCLUDES += $$MODULE_AUX_INCLUDES + MODULE_PRIVATE_INCLUDES += $$MODULE_PRIVATE_AUX_INCLUDES !git_build:if(!equals(_PRO_FILE_PWD_, $$OUT_PWD) \ |if(!prefix_build:!equals(MODULE_BASE_DIR, $$[QT_HOST_PREFIX]))) { pub_inc = $$replace(MODULE_INCLUDES, ^\\\$\\\$QT_MODULE_INCLUDE_BASE, $$MODULE_BASE_DIR/include) -- cgit v1.2.1 From b35ea875a12e89661f370df7e91c4791234aaa44 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 5 Jun 2013 13:24:23 +0200 Subject: put ANGLE includes in a QtANGLE subdir otherwise even non-angle builds with pre-generated headers will get them into their include path, which is Not Good (tm). Change-Id: Ie98354297baf3564ef82b3d4a32e5763e625b8f2 Reviewed-by: Friedemann Kleint Reviewed-by: Joerg Bornemann --- src/angle/angle.pro | 2 +- src/angle/src/libEGL/libEGL.pro | 2 +- src/angle/src/libGLESv2/libGLESv2.pro | 4 ++-- src/gui/Qt5GuiConfigExtras.cmake.in | 6 ++++-- src/gui/gui.pro | 6 ++++++ sync.profile | 6 +++--- 6 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/angle/angle.pro b/src/angle/angle.pro index 721caf880a..83510698d3 100644 --- a/src/angle/angle.pro +++ b/src/angle/angle.pro @@ -6,5 +6,5 @@ SUBDIRS += src # 2) If we made a 'QtANGLE' module, the include directory would be flattened which won't work since # we need to support "#include " CONFIG += minimal_syncqt -QMAKE_SYNCQT_OPTIONS = -module KHR -module EGL -module GLES2 -version none +QMAKE_SYNCQT_OPTIONS = -module QtANGLE/KHR -module QtANGLE/EGL -module QtANGLE/GLES2 -version none load(qt_module_headers) diff --git a/src/angle/src/libEGL/libEGL.pro b/src/angle/src/libEGL/libEGL.pro index c0d021ccab..1a338ef0d2 100644 --- a/src/angle/src/libEGL/libEGL.pro +++ b/src/angle/src/libEGL/libEGL.pro @@ -40,5 +40,5 @@ egl_headers.files = \ $$ANGLE_DIR/include/EGL/egl.h \ $$ANGLE_DIR/include/EGL/eglext.h \ $$ANGLE_DIR/include/EGL/eglplatform.h -egl_headers.path = $$[QT_INSTALL_HEADERS]/EGL +egl_headers.path = $$[QT_INSTALL_HEADERS]/QtANGLE/EGL INSTALLS += egl_headers diff --git a/src/angle/src/libGLESv2/libGLESv2.pro b/src/angle/src/libGLESv2/libGLESv2.pro index d12202f33b..ba1f226143 100644 --- a/src/angle/src/libGLESv2/libGLESv2.pro +++ b/src/angle/src/libGLESv2/libGLESv2.pro @@ -235,12 +235,12 @@ for (vs, CLEAR_SHADERS) { load(qt_installs) khr_headers.files = $$ANGLE_DIR/include/KHR/khrplatform.h -khr_headers.path = $$[QT_INSTALL_HEADERS]/KHR +khr_headers.path = $$[QT_INSTALL_HEADERS]/QtANGLE/KHR gles2_headers.files = \ $$ANGLE_DIR/include/GLES2/gl2.h \ $$ANGLE_DIR/include/GLES2/gl2ext.h \ $$ANGLE_DIR/include/GLES2/gl2platform.h -gles2_headers.path = $$[QT_INSTALL_HEADERS]/GLES2 +gles2_headers.path = $$[QT_INSTALL_HEADERS]/QtANGLE/GLES2 INSTALLS += khr_headers gles2_headers diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in index f1bc441009..4a6f6250f5 100644 --- a/src/gui/Qt5GuiConfigExtras.cmake.in +++ b/src/gui/Qt5GuiConfigExtras.cmake.in @@ -2,13 +2,15 @@ !!IF !isEmpty(CMAKE_ANGLE_EGL_DLL_RELEASE) !!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE) -set(Qt5Gui_EGL_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR\") +set(Qt5Gui_EGL_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR/QtANGLE\") !!ELSE -set(Qt5Gui_EGL_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR\") +set(Qt5Gui_EGL_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR/QtANGLE\") !!ENDIF _qt5_Gui_check_file_exists(${Qt5Gui_EGL_INCLUDE_DIRS}) +list(APPEND Qt5Gui_INCLUDE_DIRS ${Qt5Gui_EGL_INCLUDE_DIRS}) +set_property(TARGET Qt5::Gui APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Qt5Gui_EGL_INCLUDE_DIRS}) set(Qt5Gui_OPENGL_INCLUDE_DIRS ${Qt5Gui_EGL_INCLUDE_DIRS}) macro(_populate_qt5gui_gl_target_properties TargetName Configuration LIB_LOCATION IMPLIB_LOCATION) diff --git a/src/gui/gui.pro b/src/gui/gui.pro index e2dd5efcde..3203b41362 100644 --- a/src/gui/gui.pro +++ b/src/gui/gui.pro @@ -12,6 +12,12 @@ MODULE_PLUGIN_TYPES = \ platforms \ imageformats +# This is here only because the platform plugin is no module, obviously. +win32:contains(QT_CONFIG, angle) { + MODULE_AUX_INCLUDES = \ + \$\$QT_MODULE_INCLUDE_BASE/QtANGLE +} + load(qt_module) # Code coverage with TestCocoon diff --git a/sync.profile b/sync.profile index 91503d425f..74e29a7acf 100644 --- a/sync.profile +++ b/sync.profile @@ -11,9 +11,9 @@ "QtDBus" => "$basedir/src/dbus", "QtConcurrent" => "$basedir/src/concurrent", "QtPlatformSupport" => "$basedir/src/platformsupport", - "KHR" => "!$basedir/src/3rdparty/angle/include/KHR", - "GLES2" => "!$basedir/src/3rdparty/angle/include/GLES2", - "EGL" => "!$basedir/src/3rdparty/angle/include/EGL", + "QtANGLE/KHR" => "!$basedir/src/3rdparty/angle/include/KHR", + "QtANGLE/GLES2" => "!$basedir/src/3rdparty/angle/include/GLES2", + "QtANGLE/EGL" => "!$basedir/src/3rdparty/angle/include/EGL", "QtZlib" => "!$basedir/src/3rdparty/zlib", "QtOpenGLExtensions" => "$basedir/src/openglextensions", ); -- cgit v1.2.1 From f533941179b92af5a6c4db85233496ac5b9a5f31 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 7 Jun 2013 14:06:24 +0200 Subject: update some comments relating to forwarding module pri files Change-Id: I3486f949fee2ac977e3cde669188790e5f4b3167 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_config.prf | 6 +++--- mkspecs/features/qt_module_pris.prf | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mkspecs/features/qt_config.prf b/mkspecs/features/qt_config.prf index 77d2c0ffc7..cbbd136270 100644 --- a/mkspecs/features/qt_config.prf +++ b/mkspecs/features/qt_config.prf @@ -15,9 +15,9 @@ QMAKE_QT_CONFIG = $$[QT_HOST_DATA/get]/mkspecs/qconfig.pri for(dir, QMAKE_MODULE_PATH) { debug(1, "Loading modules from $${dir}") for(mod, $$list($$files($$dir/qt_*.pri))) { - # For installed Qt these paths will be common for all modules - # For development these will vary per module, and syncqt will override the value in the - # qt_.pri forwarding file + # For installed Qt these paths will be common for all modules. + # For uninstalled prefix builds these will vary per module, via the + # forwarding module pri files. Keep qt_module_pris.prf in sync with this! QT_MODULE_INCLUDE_BASE = $$[QT_INSTALL_HEADERS] QT_MODULE_LIB_BASE = $$[QT_INSTALL_LIBS] QT_MODULE_HOST_LIB_BASE = $$[QT_HOST_LIBS] diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf index 9eb9b02e14..a80b44f2f6 100644 --- a/mkspecs/features/qt_module_pris.prf +++ b/mkspecs/features/qt_module_pris.prf @@ -120,7 +120,7 @@ else: \ } else { # prefix_build - # This is needed for the direct include() below. + # This is needed for the direct include() below. Mirrors qt_config.prf QT_MODULE_BIN_BASE = $$[QT_INSTALL_BINS] QT_MODULE_INCLUDE_BASE = $$[QT_INSTALL_HEADERS] QT_MODULE_IMPORT_BASE = $$[QT_INSTALL_IMPORTS] -- cgit v1.2.1 From 81b942f0d15d2e73f017cea507ed01c1c29b7952 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Sat, 8 Jun 2013 11:50:45 +0200 Subject: use correct variable for library base path Change-Id: I6d621db2c4d5365a9c9a7284026b464e663a4cc6 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_android_deps.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/qt_android_deps.prf b/mkspecs/features/qt_android_deps.prf index c258d55687..96337da9de 100644 --- a/mkspecs/features/qt_android_deps.prf +++ b/mkspecs/features/qt_android_deps.prf @@ -13,7 +13,7 @@ # of the module on JNI-based libraries etc. Used for deployment of an Android # app. -ANDROID_DEPENDS_DIR = $$MODULE_QMAKE_OUTDIR/lib/ +ANDROID_DEPENDS_DIR = $$MODULE_BASE_OUTDIR/lib/ DEPENDENCY_FILE = $$ANDROID_DEPENDS_DIR$$TARGET-android-dependencies.xml !build_pass { -- cgit v1.2.1 From f3331e14e68089035cc302e11c6e60153f806026 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Sat, 8 Jun 2013 11:58:54 +0200 Subject: reshuffle path setup rename MODULE_PROFILE_DIR to MODULE_BASE_INDIR. force MODULE_BASE_OUTDIR to be always the shadow of the above. rename MODULE_BASE_DIR to MODULE_SYNCQT_DIR (the former is still recognized for backwards compat with webkit). the idea behind these changes is making the variable names and override possibilities reflect their actual use. Change-Id: Ica4062d7231a0ce13241670e0d0f43e6b1b97160 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_build_paths.prf | 9 +++++---- mkspecs/features/qt_module_headers.prf | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/mkspecs/features/qt_build_paths.prf b/mkspecs/features/qt_build_paths.prf index 25fc2c3033..9163ac30b2 100644 --- a/mkspecs/features/qt_build_paths.prf +++ b/mkspecs/features/qt_build_paths.prf @@ -11,12 +11,13 @@ # Find the module's source root dir. isEmpty(_QMAKE_CONF_): error("Project has no top-level .qmake.conf file.") -MODULE_PROFILE_DIR = $$dirname(_QMAKE_CONF_) -isEmpty(MODULE_BASE_DIR): MODULE_BASE_DIR = $$MODULE_PROFILE_DIR -isEmpty(MODULE_BASE_OUTDIR): MODULE_BASE_OUTDIR = $$shadowed($$MODULE_BASE_DIR) +MODULE_BASE_INDIR = $$dirname(_QMAKE_CONF_) +MODULE_BASE_OUTDIR = $$shadowed($$MODULE_BASE_INDIR) +!isEmpty(MODULE_BASE_DIR): MODULE_SYNCQT_DIR = $$MODULE_BASE_DIR # compat for webkit +isEmpty(MODULE_SYNCQT_DIR): MODULE_SYNCQT_DIR = $$MODULE_BASE_INDIR isEmpty(MODULE_QMAKE_OUTDIR): MODULE_QMAKE_OUTDIR = $$MODULE_BASE_OUTDIR -exists($$MODULE_PROFILE_DIR/.git): \ +exists($$MODULE_BASE_INDIR/.git): \ CONFIG += git_build !prefix_build { diff --git a/mkspecs/features/qt_module_headers.prf b/mkspecs/features/qt_module_headers.prf index fd6cf6b943..ca26eb674b 100644 --- a/mkspecs/features/qt_module_headers.prf +++ b/mkspecs/features/qt_module_headers.prf @@ -21,7 +21,7 @@ load(qt_build_paths) QMAKE_SYNCQT += -module $$MODULE_INCNAME -version $$VERSION } QMAKE_SYNCQT += \ - -outdir $$MODULE_BASE_OUTDIR $$MODULE_BASE_DIR + -outdir $$MODULE_BASE_OUTDIR $$MODULE_SYNCQT_DIR !silent: message($$QMAKE_SYNCQT) system($$QMAKE_SYNCQT)|error("Failed to run: $$QMAKE_SYNCQT") } @@ -32,11 +32,11 @@ minimal_syncqt: return() git_build: \ INC_PATH = $$MODULE_BASE_OUTDIR else: \ - INC_PATH = $$MODULE_BASE_DIR + INC_PATH = $$MODULE_BASE_INDIR include($$INC_PATH/include/$$MODULE_INCNAME/headers.pri, "", true) autogen_warning = \ - "/* This file was generated by qmake with the info from /$$relative_path($$_PRO_FILE_, $$MODULE_BASE_DIR). */" + "/* This file was generated by qmake with the info from /$$relative_path($$_PRO_FILE_, $$MODULE_BASE_INDIR). */" # Create a module master depends header MODULE_MASTER_DEPS_HEADER = $$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME/$${MODULE_INCNAME}Depends -- cgit v1.2.1 From 4fd568fa0633b17b4a8e24736a4766e81afff4f3 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 7 Jun 2013 16:23:25 +0200 Subject: redo include path logic for pre-generated headers make the include dir in the source tree the "main" include path, as that's where the majority of the headers is. then selectively add the shadowed dirs. Change-Id: I03ad13cfcf77175c141b94d41b1221740d851faf Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_module_pris.prf | 48 +++++++++++++++++++---------- src/tools/bootstrap-dbus/bootstrap-dbus.pro | 3 +- src/tools/bootstrap/bootstrap.pro | 5 +-- 3 files changed, 37 insertions(+), 19 deletions(-) diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf index a80b44f2f6..81b37f0e92 100644 --- a/mkspecs/features/qt_module_pris.prf +++ b/mkspecs/features/qt_module_pris.prf @@ -10,8 +10,17 @@ # load(qt_build_paths) +# Pre-generated headers in the source tree and +# - shadow build or +# - non-shadow non-prefix build of a module which is not qtbase (because the build-time +# generated headers all end up in qtbase). +!git_build:if(!equals(_PRO_FILE_PWD_, $$OUT_PWD) \ + |if(!prefix_build:!equals(MODULE_BASE_INDIR, $$[QT_HOST_PREFIX]))): \ + CONFIG += split_incpath +force_independent|split_incpath: \ + CONFIG += need_fwd_pri MODULE_FWD_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_lib_$${MODULE}.pri -force_independent: \ +need_fwd_pri: \ MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules-inst/qt_lib_$${MODULE}.pri else: \ MODULE_PRI = $$MODULE_FWD_PRI @@ -56,20 +65,22 @@ else: \ MODULE_PRIVATE_INCLUDES = \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION \ \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME } + split_incpath: \ + MODULE_SHADOW_INCLUDES = $$replace(MODULE_INCLUDES, ^\\\$\\\$QT_MODULE_INCLUDE_BASE, \ + $$MODULE_BASE_OUTDIR/include) MODULE_INCLUDES += $$MODULE_AUX_INCLUDES MODULE_PRIVATE_INCLUDES += $$MODULE_PRIVATE_AUX_INCLUDES - !git_build:if(!equals(_PRO_FILE_PWD_, $$OUT_PWD) \ - |if(!prefix_build:!equals(MODULE_BASE_DIR, $$[QT_HOST_PREFIX]))) { - pub_inc = $$replace(MODULE_INCLUDES, ^\\\$\\\$QT_MODULE_INCLUDE_BASE, $$MODULE_BASE_DIR/include) - priv_inc = $$replace(MODULE_PRIVATE_INCLUDES, ^\\\$\\\$QT_MODULE_INCLUDE_BASE, $$MODULE_BASE_DIR/include) - force_independent { - MODULE_FWD_PRI_CONT_SUFFIX = \ - "QT.$${MODULE}.includes += $$pub_inc" \ - "QT.$${MODULE}.private_includes = $$priv_inc" - } else { - MODULE_INCLUDES += $$pub_inc - MODULE_PRIVATE_INCLUDES = $$priv_inc - } + internal_module { + MODULE_PRIVATE_INCLUDES = $$MODULE_INCLUDES $$MODULE_PRIVATE_INCLUDES + MODULE_INCLUDES = + MODULE_PRIVATE_SHADOW_INCLUDES = $$MODULE_SHADOW_INCLUDES + MODULE_SHADOW_INCLUDES = + } + split_incpath { + !isEmpty(MODULE_SHADOW_INCLUDES): \ + MODULE_FWD_PRI_CONT_SUFFIX += "QT.$${MODULE}.includes += $$MODULE_SHADOW_INCLUDES" + !isEmpty(MODULE_PRIVATE_SHADOW_INCLUDES): \ + MODULE_FWD_PRI_CONT_SUFFIX += "QT.$${MODULE}.private_includes += $$MODULE_PRIVATE_SHADOW_INCLUDES" } MODULE_PRI_CONT = \ "QT.$${MODULE}.VERSION = $${VERSION}" \ @@ -100,12 +111,17 @@ else: \ write_file($$MODULE_PRI, MODULE_PRI_CONT)|error("Aborting.") MODULE_PRI_FILES = $$MODULE_PRI - force_independent { + need_fwd_pri { + + split_incpath: \ + MODULE_BASE_INCDIR = $$MODULE_BASE_INDIR + else: \ + MODULE_BASE_INCDIR = $$MODULE_BASE_OUTDIR # Create a forwarding module .pri file MODULE_FWD_PRI_CONT = \ "QT_MODULE_BIN_BASE = $$MODULE_BASE_OUTDIR/bin" \ - "QT_MODULE_INCLUDE_BASE = $$MODULE_BASE_OUTDIR/include" \ + "QT_MODULE_INCLUDE_BASE = $$MODULE_BASE_INCDIR/include" \ "QT_MODULE_IMPORT_BASE = $$MODULE_BASE_OUTDIR/imports" \ "QT_MODULE_QML_BASE = $$MODULE_BASE_OUTDIR/qml" \ "QT_MODULE_LIB_BASE = $$MODULE_BASE_OUTDIR/lib" \ @@ -118,7 +134,7 @@ else: \ touch($$MODULE_FWD_PRI, $$MODULE_PRI) MODULE_PRI_FILES += $$MODULE_FWD_PRI - } else { # prefix_build + } else { # This is needed for the direct include() below. Mirrors qt_config.prf QT_MODULE_BIN_BASE = $$[QT_INSTALL_BINS] diff --git a/src/tools/bootstrap-dbus/bootstrap-dbus.pro b/src/tools/bootstrap-dbus/bootstrap-dbus.pro index 6af70efda7..62f9f96a9b 100644 --- a/src/tools/bootstrap-dbus/bootstrap-dbus.pro +++ b/src/tools/bootstrap-dbus/bootstrap-dbus.pro @@ -7,8 +7,9 @@ CONFIG += no_module_headers internal_module force_bootstrap DEFINES += \ QT_NO_CAST_FROM_ASCII +MODULE_INCLUDES = \ + \$\$QT_MODULE_INCLUDE_BASE/QtDBus MODULE_PRIVATE_INCLUDES = \ - \$\$QT_MODULE_INCLUDE_BASE/QtDBus \ \$\$QT_MODULE_INCLUDE_BASE/QtDBus/$$QT_VERSION \ \$\$QT_MODULE_INCLUDE_BASE/QtDBus/$$QT_VERSION/QtDBus diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro index 972f57260e..bf19828634 100644 --- a/src/tools/bootstrap/bootstrap.pro +++ b/src/tools/bootstrap/bootstrap.pro @@ -30,12 +30,13 @@ DEFINES += \ DEFINES -= QT_EVAL -MODULE_PRIVATE_INCLUDES = \ +MODULE_INCLUDES = \ \$\$QT_MODULE_INCLUDE_BASE \ \$\$QT_MODULE_INCLUDE_BASE/QtCore \ + \$\$QT_MODULE_INCLUDE_BASE/QtXml +MODULE_PRIVATE_INCLUDES = \ \$\$QT_MODULE_INCLUDE_BASE/QtCore/$$QT_VERSION \ \$\$QT_MODULE_INCLUDE_BASE/QtCore/$$QT_VERSION/QtCore \ - \$\$QT_MODULE_INCLUDE_BASE/QtXml \ \$\$QT_MODULE_INCLUDE_BASE/QtXml/$$QT_VERSION \ \$\$QT_MODULE_INCLUDE_BASE/QtXml/$$QT_VERSION/QtXml -- cgit v1.2.1 From 45d8bf327eee744570933211f611cf4410ae7e29 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Mon, 10 Jun 2013 14:45:40 +0200 Subject: Doc: Mark QOpenGLFunctions_4_1_Core as a wrapper class The class documentation missing the \wrapper command, making QDoc complain a lot. Change-Id: Iad8fa3d2facadfb3393642dc08ff4dc416bdccc7 Reviewed-by: Martin Smith Reviewed-by: Jerome Pasion --- src/gui/opengl/qopenglfunctions_4_1_core.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/opengl/qopenglfunctions_4_1_core.cpp b/src/gui/opengl/qopenglfunctions_4_1_core.cpp index b36cb0de94..474397bb1f 100644 --- a/src/gui/opengl/qopenglfunctions_4_1_core.cpp +++ b/src/gui/opengl/qopenglfunctions_4_1_core.cpp @@ -57,6 +57,7 @@ QT_BEGIN_NAMESPACE \class QOpenGLFunctions_4_1_Core \inmodule QtGui \since 5.1 + \wrapper \brief The QOpenGLFunctions_4_1_Core class provides all functions for this version and profile of OpenGL. \sa QAbstractOpenGLFunctions -- cgit v1.2.1 From 074c5c94f6018d08abac9bad5151f9300284feb4 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Mon, 10 Jun 2013 13:17:18 +0200 Subject: Doc: Fixed snippet issues in QDoc documentation QDoc uses .qdoc files as snippets in other .qdoc files. These snippet .qdoc files are also parsed, which is not the intent. This change resolves the issue by renaming the files to have a different extension. Task-number: QTBUG-31574 Change-Id: I399c8b714478b9c4b8fbe2db53f601e6a1386cea Reviewed-by: Jerome Pasion --- src/tools/qdoc/doc/examples/cpp.qdoc | 126 --------------------- src/tools/qdoc/doc/examples/cpp.qdoc.sample | 126 +++++++++++++++++++++ src/tools/qdoc/doc/examples/qml.qdoc | 116 ------------------- src/tools/qdoc/doc/examples/qml.qdoc.sample | 116 +++++++++++++++++++ .../qdoc/doc/qdoc-guide/qtwritingstyle-cpp.qdoc | 14 +-- .../qdoc/doc/qdoc-guide/qtwritingstyle-qml.qdoc | 8 +- 6 files changed, 253 insertions(+), 253 deletions(-) delete mode 100644 src/tools/qdoc/doc/examples/cpp.qdoc create mode 100644 src/tools/qdoc/doc/examples/cpp.qdoc.sample delete mode 100644 src/tools/qdoc/doc/examples/qml.qdoc create mode 100644 src/tools/qdoc/doc/examples/qml.qdoc.sample diff --git a/src/tools/qdoc/doc/examples/cpp.qdoc b/src/tools/qdoc/doc/examples/cpp.qdoc deleted file mode 100644 index 08286b956a..0000000000 --- a/src/tools/qdoc/doc/examples/cpp.qdoc +++ /dev/null @@ -1,126 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//![class] -/*! - \class QCache - \brief The QCache class is a template class that provides a cache. - - \ingroup tools - \ingroup shared - - \reentrant - - QCache\ defines a cache that stores objects of type T - associated with keys of type Key. For example, here's the - definition of a cache that stores objects of type Employee - associated with an integer key: - - \snippet code/doc_src_qcache.cpp 0 - - Here's how to insert an object in the cache: - - \snippet code/doc_src_qcache.cpp 1 - - ... detailed description ommitted - - \sa QPixmapCache, QHash, QMap -*/ -//![class] - -//![function] -/*! - \fn QString &QString::remove(int position, int n) - - Removes \a n characters from the string, starting at the given \a - position index, and returns a reference to the string. - - If the specified \a position index is within the string, but \a - position + \a n is beyond the end of the string, the string is - truncated at the specified \a position. - - \snippet qstring/main.cpp 37 - - \sa insert(), replace() -*/ -QString &QString::remove(int pos, int len) -//! [function] - -//! [return] -/*! - Returns \c true if a QScroller object was already created for \a target; \c false otherwise. - - \sa scroller() -*/ -bool QScroller::hasScroller(QObject *target) -//! [return] - -//! [property] -/*! - \property QVariantAnimation::duration - \brief the duration of the animation - - This property describes the duration in milliseconds of the - animation. The default duration is 250 milliseconds. - - \sa QAbstractAnimation::duration() - */ -int QVariantAnimation::duration() const -//! [property] - -//! [signals] -/*! - \fn QAbstractTransition::triggered() - - This signal is emitted when the transition has been triggered (after - onTransition() has been called). -*/ -//! [signals] - -//! [enums] -/*! - \enum QSql::TableType - - This enum type describes types of SQL tables. - - \value Tables All the tables visible to the user. - \value SystemTables Internal tables used by the database. - \value Views All the views visible to the user. - \value AllTables All of the above. -*/ -//! [enums] - -//! [overloaded notifier] -/*! -\property QSpinBox::value -\brief the value of the spin box - -setValue() will emit valueChanged() if the new value is different -from the old one. The \l{QSpinBox::}{value} property has a second notifier -signal which includes the spin box's prefix and suffix. -*/ -//! [overloaded notifier] diff --git a/src/tools/qdoc/doc/examples/cpp.qdoc.sample b/src/tools/qdoc/doc/examples/cpp.qdoc.sample new file mode 100644 index 0000000000..08286b956a --- /dev/null +++ b/src/tools/qdoc/doc/examples/cpp.qdoc.sample @@ -0,0 +1,126 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//![class] +/*! + \class QCache + \brief The QCache class is a template class that provides a cache. + + \ingroup tools + \ingroup shared + + \reentrant + + QCache\ defines a cache that stores objects of type T + associated with keys of type Key. For example, here's the + definition of a cache that stores objects of type Employee + associated with an integer key: + + \snippet code/doc_src_qcache.cpp 0 + + Here's how to insert an object in the cache: + + \snippet code/doc_src_qcache.cpp 1 + + ... detailed description ommitted + + \sa QPixmapCache, QHash, QMap +*/ +//![class] + +//![function] +/*! + \fn QString &QString::remove(int position, int n) + + Removes \a n characters from the string, starting at the given \a + position index, and returns a reference to the string. + + If the specified \a position index is within the string, but \a + position + \a n is beyond the end of the string, the string is + truncated at the specified \a position. + + \snippet qstring/main.cpp 37 + + \sa insert(), replace() +*/ +QString &QString::remove(int pos, int len) +//! [function] + +//! [return] +/*! + Returns \c true if a QScroller object was already created for \a target; \c false otherwise. + + \sa scroller() +*/ +bool QScroller::hasScroller(QObject *target) +//! [return] + +//! [property] +/*! + \property QVariantAnimation::duration + \brief the duration of the animation + + This property describes the duration in milliseconds of the + animation. The default duration is 250 milliseconds. + + \sa QAbstractAnimation::duration() + */ +int QVariantAnimation::duration() const +//! [property] + +//! [signals] +/*! + \fn QAbstractTransition::triggered() + + This signal is emitted when the transition has been triggered (after + onTransition() has been called). +*/ +//! [signals] + +//! [enums] +/*! + \enum QSql::TableType + + This enum type describes types of SQL tables. + + \value Tables All the tables visible to the user. + \value SystemTables Internal tables used by the database. + \value Views All the views visible to the user. + \value AllTables All of the above. +*/ +//! [enums] + +//! [overloaded notifier] +/*! +\property QSpinBox::value +\brief the value of the spin box + +setValue() will emit valueChanged() if the new value is different +from the old one. The \l{QSpinBox::}{value} property has a second notifier +signal which includes the spin box's prefix and suffix. +*/ +//! [overloaded notifier] diff --git a/src/tools/qdoc/doc/examples/qml.qdoc b/src/tools/qdoc/doc/examples/qml.qdoc deleted file mode 100644 index d913c6f164..0000000000 --- a/src/tools/qdoc/doc/examples/qml.qdoc +++ /dev/null @@ -1,116 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//![qmltype] - \qmltype TextEdit - \instantiates QQuickTextEdit - \inqmlmodule QtQuick 2 - \ingroup qtquick-visual - \ingroup qtquick-input - \inherits Item - \brief Displays multiple lines of editable formatted text - - The TextEdit item displays a block of editable, formatted text. - - It can display both plain and rich text. For example: - - \qml - TextEdit { - width: 240 - text: "Hello World!" - font.family: "Helvetica" - font.pointSize: 20 - color: "blue" - focus: true - } - \endqml - - \image declarative-textedit.gif - - ... omitted detailed description - - \sa Text, TextInput, {examples/quick/text/textselection}{Text Selection example} -//![qmltype] - -//![function] -/* - \qmlmethod QtQuick2::ListModel::remove(int index, int count = 1) - - Deletes the content at \a index from the model. - - \sa clear() -*/ -void QQuickListModel::remove(QQmlV8Function *args) -//! [function] - -//! [return] -/* - Returns \c true if a QScroller object was already created for \a target; \c false otherwise. - - \sa scroller() -*/ -bool QScroller::hasScroller(QObject *target) -//! [return] - -//! [property] -/* - \property QVariantAnimation::duration - \brief the duration of the animation - - This property describes the duration in milliseconds of the - animation. The default duration is 250 milliseconds. - - \sa QAbstractAnimation::duration() - */ -int QVariantAnimation::duration() const -//! [property] - -//! [signals] -/* - This signal is emitted when the user clicks the button. A click is defined - as a press followed by a release. The corresponding handler is - \c onClicked. -*/ -signal clicked() -//! [signals] - -//! [enums] -/*! -\qmlproperty enumeration QtQuick2::Text::font.weight - -Sets the font's weight. - -The weight can be one of: -\list -\li Font.Light -\li Font.Normal - the default -\li Font.DemiBold -\li Font.Bold -\li Font.Black -\endlist -*/ -//! [enums] diff --git a/src/tools/qdoc/doc/examples/qml.qdoc.sample b/src/tools/qdoc/doc/examples/qml.qdoc.sample new file mode 100644 index 0000000000..d913c6f164 --- /dev/null +++ b/src/tools/qdoc/doc/examples/qml.qdoc.sample @@ -0,0 +1,116 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//![qmltype] + \qmltype TextEdit + \instantiates QQuickTextEdit + \inqmlmodule QtQuick 2 + \ingroup qtquick-visual + \ingroup qtquick-input + \inherits Item + \brief Displays multiple lines of editable formatted text + + The TextEdit item displays a block of editable, formatted text. + + It can display both plain and rich text. For example: + + \qml + TextEdit { + width: 240 + text: "Hello World!" + font.family: "Helvetica" + font.pointSize: 20 + color: "blue" + focus: true + } + \endqml + + \image declarative-textedit.gif + + ... omitted detailed description + + \sa Text, TextInput, {examples/quick/text/textselection}{Text Selection example} +//![qmltype] + +//![function] +/* + \qmlmethod QtQuick2::ListModel::remove(int index, int count = 1) + + Deletes the content at \a index from the model. + + \sa clear() +*/ +void QQuickListModel::remove(QQmlV8Function *args) +//! [function] + +//! [return] +/* + Returns \c true if a QScroller object was already created for \a target; \c false otherwise. + + \sa scroller() +*/ +bool QScroller::hasScroller(QObject *target) +//! [return] + +//! [property] +/* + \property QVariantAnimation::duration + \brief the duration of the animation + + This property describes the duration in milliseconds of the + animation. The default duration is 250 milliseconds. + + \sa QAbstractAnimation::duration() + */ +int QVariantAnimation::duration() const +//! [property] + +//! [signals] +/* + This signal is emitted when the user clicks the button. A click is defined + as a press followed by a release. The corresponding handler is + \c onClicked. +*/ +signal clicked() +//! [signals] + +//! [enums] +/*! +\qmlproperty enumeration QtQuick2::Text::font.weight + +Sets the font's weight. + +The weight can be one of: +\list +\li Font.Light +\li Font.Normal - the default +\li Font.DemiBold +\li Font.Bold +\li Font.Black +\endlist +*/ +//! [enums] diff --git a/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-cpp.qdoc b/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-cpp.qdoc index 4ad1f19f67..2095c4e7cb 100644 --- a/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-cpp.qdoc +++ b/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-cpp.qdoc @@ -41,7 +41,7 @@ Note that the documentation must be in the implementation files such as \c .cpp. Class documentation is generated using the \l{class-command}{\\class} command and the name of the class as the first argument. -\snippet examples/cpp.qdoc class +\snippet examples/cpp.qdoc.sample class \l{Context commands} add information about the class, such as its module or which version the class was added. @@ -79,7 +79,7 @@ Typically, function documentation immediately precedes the implementation of the function in the \c .cpp file. For function documentation that is not immediately above the implementation, the \l{fn-command}{\\fn} is needed. -\snippet examples/cpp.qdoc function +\snippet examples/cpp.qdoc.sample function The function documentation starts with a verb, indicating the operation the function performs. This also applies to constructors and destructors. @@ -102,7 +102,7 @@ The \l{a-command}{\\a} command marks the parameter in the documentation. The return type documentation should link to the type documentation or be marked with the \l{c-command}{\\c} command in the case of boolean values. -\snippet examples/cpp.qdoc return +\snippet examples/cpp.qdoc.sample return \section1 Properties @@ -110,7 +110,7 @@ The property documentation resides immediately above the read function's implementation. The \l{topic-commands}{topic command} for properties is \l{property-command}{\\property}. -\snippet examples/cpp.qdoc property +\snippet examples/cpp.qdoc.sample property Property documentation usually starts with "This property...", but these are alternate expressions: @@ -142,7 +142,7 @@ The \l{topic-commands}{topic command} for signals, notifiers, and slots is \l{fn-command}{\\fn}. Signal documentation state when they are triggered or emitted. -\snippet examples/cpp.qdoc signals +\snippet examples/cpp.qdoc.sample signals Signal documentation typically begin with "This signal is triggered when...". Here are alternate styles: @@ -164,7 +164,7 @@ notifiers together. To refer to a specifc version of a notifier or signal, simply refer to the property and mention that there are different versions of the notifier. -\snippet examples/cpp.qdoc overloaded notifier +\snippet examples/cpp.qdoc.sample overloaded notifier \section1 Enums, Namespaces, and other Types @@ -181,7 +181,7 @@ continues with the type description. For enumerations, the \l{value-command}{\\value} command is for listing the values. QDoc creates a table of values for the enum. -\snippet examples/cpp.qdoc enums +\snippet examples/cpp.qdoc.sample enums */ diff --git a/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-qml.qdoc b/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-qml.qdoc index 2d67e62f94..7ca0abed71 100644 --- a/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-qml.qdoc +++ b/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-qml.qdoc @@ -60,7 +60,7 @@ does not exist. The class documentation may be marked as The \l{qmltype-command}{\\qmltype} command is for QML type documentation. -\snippet examples/qml.qdoc qmltype +\snippet examples/qml.qdoc.sample qmltype The \l{instantiates-command}{\\instantiates} accepts the C++ class which implements the QML type as the argument. For types implemented in QML, this @@ -108,7 +108,7 @@ with the \l{qmlsignal-command}{\\qmlsignal} command. Signal documentation must include the condition for emitting the signal, mention the corresponding signal handler, and document whether the signal accepts a parameter. -\snippet examples/qml.qdoc signals +\snippet examples/qml.qdoc.sample signals These are the possible documentation styles for signals: \list @@ -127,7 +127,7 @@ documentation must reside immediately above the function declaration. The function documentation starts with a verb, indicating the operation the function performs. -\snippet examples/qml.qdoc function +\snippet examples/qml.qdoc.sample function Some common verbs for function documentation: \list @@ -153,7 +153,7 @@ QML enumerations are documented as QML properties with the \l{qmlproperty-command}{\\qmlproperty} command. The type of the property is \c enumeration. -\snippet examples/qml.qdoc enums +\snippet examples/qml.qdoc.sample enums The QDoc comment lists the values of the enumeration. If the enumeration is implemented in C++, the documentation may link to the corresponding C++ -- cgit v1.2.1 From b2a0a1437000c6cd78de4bf960993732457a8e92 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Tue, 28 May 2013 13:09:20 +0200 Subject: Fix issue when QKeyEvent::text() was returning empty string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The code that sets 'text' variable was executed only for KeyPress events. This patch moves 'text' initialization higher up where it will be run for both - KeyPress and KeyRelease events. Task-number: QTBUG-31285 Change-Id: I140de9ef5d29beedad276d348bed964ecdf46f9d Reviewed-by: Tor Arne Vestbø Reviewed-by: Andy Shaw --- src/plugins/platforms/cocoa/qnsview.mm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 5c5da830ac..10fb293ec0 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -917,13 +917,13 @@ static QTouchDevice *touchDevice = 0; // we will send a key event unless the input method sets m_sendKeyEvent to false m_sendKeyEvent = true; - QString text; + // ignore text for the U+F700-U+F8FF range. This is used by Cocoa when + // delivering function keys (e.g. arrow keys, backspace, F1-F35, etc.) + if (ch.unicode() < 0xf700 || ch.unicode() > 0xf8ff) + text = QCFString::toQString(characters); + if (eventType == QEvent::KeyPress) { - // ignore text for the U+F700-U+F8FF range. This is used by Cocoa when - // delivering function keys (e.g. arrow keys, backspace, F1-F35, etc.) - if (ch.unicode() < 0xf700 || ch.unicode() > 0xf8ff) - text = QCFString::toQString(characters); if (m_composingText.isEmpty()) m_sendKeyEvent = !QWindowSystemInterface::tryHandleShortcutEvent(m_window, timestamp, keyCode, modifiers, text); -- cgit v1.2.1 From a90d93285a0b95013020644f29c5d932aa989d37 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 6 Jun 2013 13:50:23 +0200 Subject: Windows save file dialog: Set default suffix only once. IFileDialog::SetDefaultExtension() needs to be called for the dialog to automatically update the suffix when the user chooses a new file type. Calling it IFileDialogEvents::OnTypeChanged as introduced by 42760e43eaa64e834809ef5fb01a83cfb75f4f04 causes it to use the previous suffix when switching. Call in setNameFilters() using the first available suffix instead. Task-number: QTBUG-31381 Task-number: QTBUG-30748 Change-Id: Idd532e4190c752aa80abce963dd0389be7d22a34 Reviewed-by: Andy Shaw Reviewed-by: Oliver Wolff Reviewed-by: Joerg Bornemann --- .../platforms/windows/qwindowsdialoghelpers.cpp | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp index 33b4eb4771..f7ccb00233 100644 --- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp +++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp @@ -825,7 +825,7 @@ public: inline void updateDirectory() { setDirectory(m_data.directory()); } inline QString directory() const; virtual void exec(HWND owner = 0); - inline void setNameFilters(const QStringList &f); + virtual void setNameFilters(const QStringList &f); inline void selectNameFilter(const QString &filter); inline void updateSelectedNameFilter() { selectNameFilter(m_data.selectedNameFilter()); } inline QString selectedNameFilter() const; @@ -1335,12 +1335,11 @@ class QWindowsNativeSaveFileDialog : public QWindowsNativeFileDialogBase { Q_OBJECT public: - explicit QWindowsNativeSaveFileDialog(const QWindowsFileDialogSharedData &data); + explicit QWindowsNativeSaveFileDialog(const QWindowsFileDialogSharedData &data) + : QWindowsNativeFileDialogBase(data) {} + virtual void setNameFilters(const QStringList &f); virtual QStringList selectedFiles() const; virtual QStringList dialogResult() const; - -private slots: - void slotFilterSelected(const QString &); }; // Return the first suffix from the name filter "Foo files (*.foo;*.bar)" -> "foo". @@ -1358,20 +1357,21 @@ static inline QString suffixFromFilter(const QString &filter) return endPos >= 0 ? filter.mid(suffixPos, endPos - suffixPos) : QString(); } -QWindowsNativeSaveFileDialog::QWindowsNativeSaveFileDialog(const QWindowsFileDialogSharedData &data) - : QWindowsNativeFileDialogBase(data) +void QWindowsNativeSaveFileDialog::setNameFilters(const QStringList &f) { - connect(this, &QWindowsNativeFileDialogBase::filterSelected, - this, &QWindowsNativeSaveFileDialog::slotFilterSelected); -} - -void QWindowsNativeSaveFileDialog::slotFilterSelected(const QString &filter) -{ - // Cause the dialog to append the suffix of the current filter unless a default - // suffix is set (Note: Qt 4.8 sets the selected filter's suffix before - // calling GetSaveFileName()). - if (!hasDefaultSuffix()) - setDefaultSuffixSys(suffixFromFilter(filter)); + QWindowsNativeFileDialogBase::setNameFilters(f); + // QTBUG-31381, QTBUG-30748: IFileDialog will update the suffix of the selected name + // filter only if a default suffix is set (see docs). Set the first available + // suffix unless we have a defaultSuffix. + if (!hasDefaultSuffix()) { + foreach (const QString &filter, f) { + const QString suffix = suffixFromFilter(filter); + if (!suffix.isEmpty()) { + setDefaultSuffixSys(suffix); + break; + } + } + } // m_hasDefaultSuffix } QStringList QWindowsNativeSaveFileDialog::dialogResult() const -- cgit v1.2.1 From d7b79ff3ef714ca0c433763a0563a069575271cb Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed Date: Mon, 13 May 2013 18:34:08 +0200 Subject: mkspecs/qml_plugin: adding -nonrelocatable flag to qmldump call nonrelocatable adds the full uri to the exported type information which is the correct thing to do for the qt plugins (and 99% of the cases). This way import bla.x 1.0 works correctly in the code model. Change-Id: Ia06873dd8b2ea4627e3297a98e8df87275ceaf73 Reviewed-by: Alan Alpert Reviewed-by: Kai Koehne Reviewed-by: Oswald Buddenhagen --- mkspecs/features/qml_plugin.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/qml_plugin.prf b/mkspecs/features/qml_plugin.prf index 70c3bd6b66..28fbb392a7 100644 --- a/mkspecs/features/qml_plugin.prf +++ b/mkspecs/features/qml_plugin.prf @@ -86,7 +86,7 @@ load(qt_common) qtAddToolEnv(QMLPLUGINDUMP, importpath) TARGETPATHBASE = $$replace(TARGETPATH, \\.\\d+\$, ) qmltypes.target = qmltypes - qmltypes.commands = $$QMLPLUGINDUMP $$replace(TARGETPATHBASE, /, .) $$IMPORT_VERSION > $$QMLTYPEFILE + qmltypes.commands = $$QMLPLUGINDUMP -nonrelocatable $$replace(TARGETPATHBASE, /, .) $$IMPORT_VERSION > $$QMLTYPEFILE qmltypes.depends = $$QMAKE_RESOLVED_TARGET } else { qmltypes.CONFIG += recursive -- cgit v1.2.1 From e1109df7a92812233935489bc9fbae524536130a Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 7 Jun 2013 13:22:51 +0200 Subject: Remove the use of CMAKE_FIND_ROOT_PATH. This is actually a list in CMake, not a value to be prepended to paths. Specify the QT_SYSROOT instead to root the location of include directories. CMake will soon get a CMAKE_SYSROOT variable which will replace this. Change-Id: I239f69f127f3676a3835aa4f29638f44ef209819 Reviewed-by: Volker Krause Reviewed-by: Stephen Kelly Reviewed-by: Oswald Buddenhagen --- mkspecs/features/cmake_functions.prf | 2 +- src/corelib/Qt5CTestMacros.cmake | 4 ---- src/gui/Qt5GuiConfigExtras.cmake.in | 12 +++++++----- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/mkspecs/features/cmake_functions.prf b/mkspecs/features/cmake_functions.prf index f48ef43b88..a67fd9af9b 100644 --- a/mkspecs/features/cmake_functions.prf +++ b/mkspecs/features/cmake_functions.prf @@ -45,7 +45,7 @@ defineReplace(cmakePortablePaths) { variable = $$1 out = for(v, variable) { - out += ${CMAKE_FIND_ROOT_PATH}$$cmakeTargetPath($$v) + out += $$[QT_SYSROOT]$$cmakeTargetPath($$v) } return ($$join(out, ";")) } diff --git a/src/corelib/Qt5CTestMacros.cmake b/src/corelib/Qt5CTestMacros.cmake index 51537a3904..126a348b47 100644 --- a/src/corelib/Qt5CTestMacros.cmake +++ b/src/corelib/Qt5CTestMacros.cmake @@ -38,10 +38,6 @@ foreach(module ${CMAKE_MODULES_UNDER_TEST}) ) endforeach() -if(CMAKE_CROSSCOMPILING AND CMAKE_FIND_ROOT_PATH) - list(APPEND BUILD_OPTIONS_LIST "-DCMAKE_CXX_LINK_FLAGS=--sysroot=\"${CMAKE_FIND_ROOT_PATH}\"") -endif() - macro(expect_pass _dir) string(REPLACE "(" "_" testname "${_dir}") string(REPLACE ")" "_" testname "${testname}") diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in index 4a6f6250f5..83e77280d5 100644 --- a/src/gui/Qt5GuiConfigExtras.cmake.in +++ b/src/gui/Qt5GuiConfigExtras.cmake.in @@ -57,7 +57,7 @@ find_path(_qt5gui_OPENGL_INCLUDE_DIR $$CMAKE_GL_HEADER_NAME PATHS $$CMAKE_GL_INCDIRS NO_DEFAULT_PATH) if (NOT _qt5gui_OPENGL_INCLUDE_DIR) - message(FATAL_ERROR \"Failed to find \\\"$$CMAKE_GL_HEADER_NAME\\\" in \\\"$$CMAKE_GL_INCDIRS\\\", using the CMAKE_FIND_ROOT_PATH \\\"${CMAKE_FIND_ROOT_PATH}\\\".\") + message(FATAL_ERROR \"Failed to find \\\"$$CMAKE_GL_HEADER_NAME\\\" in \\\"$$CMAKE_GL_INCDIRS\\\".\") endif() _qt5_Gui_check_file_exists(${_qt5gui_OPENGL_INCLUDE_DIR}) @@ -87,7 +87,7 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs) if (\"${ARGN}\" STREQUAL \"OPTIONAL\") break() else() - message(FATAL_ERROR \"Failed to find \\\"${_lib}\\\" in \\\"${LibDir}\\\", using the CMAKE_FIND_ROOT_PATH \\\"${CMAKE_FIND_ROOT_PATH}\\\".\") + message(FATAL_ERROR \"Failed to find \\\"${_lib}\\\" in \\\"${LibDir}\\\".\") endif() endif() add_library(Qt5::Gui_${_cmake_lib_name} SHARED IMPORTED) @@ -116,9 +116,11 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs) endif() list(APPEND Qt5Gui_${Name}_LIBRARIES Qt5::Gui_${_cmake_lib_name}) endforeach() - foreach(_dir ${IncDirs}) - _qt5_Gui_check_file_exists(${_dir}) - endforeach() + if (NOT CMAKE_CROSSCOMPILING) + foreach(_dir ${IncDirs}) + _qt5_Gui_check_file_exists(${_dir}) + endforeach() + endif() endmacro() -- cgit v1.2.1 From f2ea45363dae1ad67386d0aeb0697e716cc10aee Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 10 Jun 2013 11:25:24 +0200 Subject: qdoc: QGLFrameBufferObject::bindDefault() was marked \internal The \internal is removed. Task-number: QTBUG-31638 Change-Id: Ib1b65783599fe50e907373e3223a0774f17ac65e Reviewed-by: Jerome Pasion Reviewed-by: Gunnar Sletta --- src/opengl/qglframebufferobject.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index 1c802cabcb..8210b218ec 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -1122,7 +1122,6 @@ QPaintEngine *QGLFramebufferObject::paintEngine() const /*! \fn bool QGLFramebufferObject::bindDefault() - \internal Switches rendering back to the default, windowing system provided framebuffer. -- cgit v1.2.1 From 1937012b3e09e5f0b9a1c056e05e6109e3bd8d55 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 10 Jun 2013 11:19:21 +0200 Subject: Don't test existence of private header directories for mac frameworks These directories are not currently part of the Qt installation for mac frameworks. Task-number: QTBUG-31641 Change-Id: Ifef372cc2ebb692f9ae5a7b1f8dba5f683d1e7eb Reviewed-by: Oswald Buddenhagen Reviewed-by: Stephen Kelly --- mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in index f6fd61602f..c55b728f1b 100644 --- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in +++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in @@ -104,7 +104,11 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS) !!ENDIF - foreach(_dir ${_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS} ${Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS}) + foreach(_dir ${_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS} +!!IF isEmpty(CMAKE_BUILD_IS_FRAMEWORK) + ${Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS} +!!ENDIF + ) _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${_dir}) endforeach() -- cgit v1.2.1 From 900cccfd459fcbdbc4aa3d313afe12cfbf68fd87 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 10 Jun 2013 13:50:44 +0200 Subject: Fix drawing of 0-width polylines from outside the devicerect. This was broken by a previous fix which aimed to fix gaps in polylines with tiny line segments. The result was that we skipped updating the origin point when stroke() didn't produce pixels which accidentally included the case of the line being completely outside the deviceRect. I fixed this by returning the value of clipLine in drawLine to the caller so we could still update the origin for this case. Task-number: QTBUG-31579 Change-Id: Iac29436f042da7658bbeaf9370351dc6f2c95065 Reviewed-by: Lars Knoll --- src/gui/painting/qcosmeticstroker.cpp | 42 ++++++++++++++++++++++------------- src/gui/painting/qcosmeticstroker_p.h | 2 +- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp index 0f3cde3efd..39f64224f0 100644 --- a/src/gui/painting/qcosmeticstroker.cpp +++ b/src/gui/painting/qcosmeticstroker.cpp @@ -133,10 +133,15 @@ struct NoDasher { }; +/* + * The return value is the result of the clipLine() call performed at the start + * of each of the two functions, aka "false" means completely outside the devices + * rect. + */ template -static void drawLine(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); +static bool drawLine(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); template -static void drawLineAA(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); +static bool drawLineAA(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); inline void drawPixel(QCosmeticStroker *stroker, int x, int y, int coverage) { @@ -602,17 +607,20 @@ void QCosmeticStroker::drawPath(const QVectorPath &path) caps |= CapEnd; QCosmeticStroker::Point last = this->lastPixel; - stroke(this, p.x(), p.y(), p2.x(), p2.y(), caps); + bool unclipped = stroke(this, p.x(), p.y(), p2.x(), p2.y(), caps); /* fix for gaps in polylines with fastpen and aliased in a sequence of points with small distances: if current point p2 has been dropped - out, keep last non dropped point p. */ - if (fastPenAliased) { - if (last.x != lastPixel.x || last.y != lastPixel.y || - points == begin + 2 || points == end - 2 ) { - { - p = p2; - } + out, keep last non dropped point p. + + However, if the line was completely outside the devicerect, we + still need to update p to avoid drawing the line after this one from + a bad starting position. + */ + if (fastPenAliased && unclipped) { + if (last.x != lastPixel.x || last.y != lastPixel.y + || points == begin + 2 || points == end - 2) { + p = p2; } } else { p = p2; @@ -720,10 +728,10 @@ static inline void capAdjust(int caps, int &x1, int &x2, int &y, int yinc) the drawing shifts from horizontal to vertical or back. */ template -static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) +static bool drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) { if (stroker->clipLine(rx1, ry1, rx2, ry2)) - return; + return false; const int half = stroker->legacyRounding ? 31 : 0; int x1 = toF26Dot6(rx1) + half; @@ -813,7 +821,7 @@ static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, } else { // horizontal if (!dx) - return; + return true; QCosmeticStroker::Direction dir = QCosmeticStroker::LeftToRight; @@ -886,14 +894,15 @@ static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, } } stroker->lastPixel = last; + return true; } template -static void drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) +static bool drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) { if (stroker->clipLine(rx1, ry1, rx2, ry2)) - return; + return false; int x1 = toF26Dot6(rx1); int y1 = toF26Dot6(ry1); @@ -967,7 +976,7 @@ static void drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx } else { // horizontal if (!dx) - return; + return true; int yinc = F16Dot16FixedDiv(dy, dx); @@ -1029,6 +1038,7 @@ static void drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx drawPixel(stroker, x, (y>>16) + 1, alpha * alphaEnd >> 6); } } + return true; } QT_END_NAMESPACE diff --git a/src/gui/painting/qcosmeticstroker_p.h b/src/gui/painting/qcosmeticstroker_p.h index 05c8a2b0cf..5fc3559da4 100644 --- a/src/gui/painting/qcosmeticstroker_p.h +++ b/src/gui/painting/qcosmeticstroker_p.h @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE class QCosmeticStroker; -typedef void (*StrokeLine)(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); +typedef bool (*StrokeLine)(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); class QCosmeticStroker { -- cgit v1.2.1 From 425af59f534ed8a0f4bc7a77a1f83e4d1e2e2bdc Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Mon, 10 Jun 2013 11:56:14 +0200 Subject: Disable long press on Android Remove the mapping from press-and-hold to right-mouse-button press. This logic was implemented in the android plugin, and there was no way to disable it for applications that needed to handle long presses in a different way. Add an environment variable to enable the mapping for those who really need it, but do not advertise it. (We want to add a proper API for this in 5.2) Task-number: QTBUG-31644 Change-Id: Ia5ae75d6147485b73c78b7c3fa88d11af5d84c06 Reviewed-by: BogDan Vatra --- src/plugins/platforms/android/src/androidjniinput.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/platforms/android/src/androidjniinput.cpp b/src/plugins/platforms/android/src/androidjniinput.cpp index da6156a330..29ccfe0125 100644 --- a/src/plugins/platforms/android/src/androidjniinput.cpp +++ b/src/plugins/platforms/android/src/androidjniinput.cpp @@ -163,6 +163,10 @@ namespace QtAndroidInput static void longPress(JNIEnv */*env*/, jobject /*thiz*/, jint /*winId*/, jint x, jint y) { + //### TODO: add proper API for Qt 5.2 + static bool rightMouseFromLongPress = qgetenv("QT_NECESSITAS_COMPATIBILITY_LONG_PRESS").toInt(); + if (!rightMouseFromLongPress) + return; m_ignoreMouseEvents = true; QPoint globalPos(x,y); QWindow *tlw = topLevelWindowAt(globalPos); -- cgit v1.2.1 From 85b4f0d2d3ffd326548ca8f0e15ac27f5fd8d77d Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 11 Jun 2013 11:09:34 +0200 Subject: Avoid floating point exceptions in rasterizeLine. Task-number: QTBUG-16757 Change-Id: I3ef988f1e039c12529d62197d85a62f201e4ae12 Reviewed-by: Lars Knoll --- src/gui/painting/qrasterizer.cpp | 61 +++++++++++++++++++++++++++++----------- 1 file changed, 45 insertions(+), 16 deletions(-) diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp index a6be7c6c78..197d49369e 100644 --- a/src/gui/painting/qrasterizer.cpp +++ b/src/gui/painting/qrasterizer.cpp @@ -734,6 +734,35 @@ static inline QPointF snapTo26Dot6Grid(const QPointF &p) qFloorF(p.y() * 64) * (1 / qreal(64))); } +/* + The rasterize line function relies on some div by zero which should + result in +/-inf values. However, when floating point exceptions are + enabled, this will cause crashes, so we return high numbers instead. + As the returned value is used in further arithmetic, returning + FLT_MAX/DBL_MAX will also cause values, so instead return a value + that is well outside the int-range. + */ +static inline qreal qSafeDivide(qreal x, qreal y) +{ + if (y == 0) + return x > 0 ? 1e20 : -1e20; + return x / y; +} + +/* Conversion to int fails if the value is too large to fit into INT_MAX or + too small to fit into INT_MIN, so we need this slightly safer conversion + when floating point exceptions are enabled + */ +static inline int qSafeFloatToQ16Dot16(qreal x) +{ + qreal tmp = x * 65536.; + if (tmp > qreal(INT_MAX)) + return INT_MAX; + else if (tmp < qreal(INT_MIN)) + return -INT_MAX; + return int(tmp); +} + void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width, bool squareCap) { if (a == b || width == 0 || d->clipRect.isEmpty()) @@ -946,23 +975,23 @@ void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width, const QPointF bottomLeftEdge = bottom - left; const QPointF bottomRightEdge = bottom - right; - const qreal topLeftSlope = topLeftEdge.x() / topLeftEdge.y(); - const qreal bottomLeftSlope = bottomLeftEdge.x() / bottomLeftEdge.y(); + const qreal topLeftSlope = qSafeDivide(topLeftEdge.x(), topLeftEdge.y()); + const qreal bottomLeftSlope = qSafeDivide(bottomLeftEdge.x(), bottomLeftEdge.y()); - const qreal topRightSlope = topRightEdge.x() / topRightEdge.y(); - const qreal bottomRightSlope = bottomRightEdge.x() / bottomRightEdge.y(); + const qreal topRightSlope = qSafeDivide(topRightEdge.x(), topRightEdge.y()); + const qreal bottomRightSlope = qSafeDivide(bottomRightEdge.x(), bottomRightEdge.y()); - const Q16Dot16 topLeftSlopeFP = FloatToQ16Dot16(topLeftSlope); - const Q16Dot16 topRightSlopeFP = FloatToQ16Dot16(topRightSlope); + const Q16Dot16 topLeftSlopeFP = qSafeFloatToQ16Dot16(topLeftSlope); + const Q16Dot16 topRightSlopeFP = qSafeFloatToQ16Dot16(topRightSlope); - const Q16Dot16 bottomLeftSlopeFP = FloatToQ16Dot16(bottomLeftSlope); - const Q16Dot16 bottomRightSlopeFP = FloatToQ16Dot16(bottomRightSlope); + const Q16Dot16 bottomLeftSlopeFP = qSafeFloatToQ16Dot16(bottomLeftSlope); + const Q16Dot16 bottomRightSlopeFP = qSafeFloatToQ16Dot16(bottomRightSlope); - const Q16Dot16 invTopLeftSlopeFP = FloatToQ16Dot16(1 / topLeftSlope); - const Q16Dot16 invTopRightSlopeFP = FloatToQ16Dot16(1 / topRightSlope); + const Q16Dot16 invTopLeftSlopeFP = qSafeFloatToQ16Dot16(qSafeDivide(1, topLeftSlope)); + const Q16Dot16 invTopRightSlopeFP = qSafeFloatToQ16Dot16(qSafeDivide(1, topRightSlope)); - const Q16Dot16 invBottomLeftSlopeFP = FloatToQ16Dot16(1 / bottomLeftSlope); - const Q16Dot16 invBottomRightSlopeFP = FloatToQ16Dot16(1 / bottomRightSlope); + const Q16Dot16 invBottomLeftSlopeFP = qSafeFloatToQ16Dot16(qSafeDivide(1, bottomLeftSlope)); + const Q16Dot16 invBottomRightSlopeFP = qSafeFloatToQ16Dot16(qSafeDivide(1, bottomRightSlope)); if (d->antialiased) { const Q16Dot16 iTopFP = IntToQ16Dot16(int(topBound)); @@ -1137,10 +1166,10 @@ void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width, int iBottom = bottom.y() < 0.5f? -1 : int(bottom.y() - 0.5f); int iMiddle = qMin(iLeft, iRight); - Q16Dot16 leftIntersectAf = FloatToQ16Dot16(top.x() + 0.5f + (iTop + 0.5f - top.y()) * topLeftSlope); - Q16Dot16 leftIntersectBf = FloatToQ16Dot16(left.x() + 0.5f + (iLeft + 1.5f - left.y()) * bottomLeftSlope); - Q16Dot16 rightIntersectAf = FloatToQ16Dot16(top.x() - 0.5f + (iTop + 0.5f - top.y()) * topRightSlope); - Q16Dot16 rightIntersectBf = FloatToQ16Dot16(right.x() - 0.5f + (iRight + 1.5f - right.y()) * bottomRightSlope); + Q16Dot16 leftIntersectAf = qSafeFloatToQ16Dot16(top.x() + 0.5f + (iTop + 0.5f - top.y()) * topLeftSlope); + Q16Dot16 leftIntersectBf = qSafeFloatToQ16Dot16(left.x() + 0.5f + (iLeft + 1.5f - left.y()) * bottomLeftSlope); + Q16Dot16 rightIntersectAf = qSafeFloatToQ16Dot16(top.x() - 0.5f + (iTop + 0.5f - top.y()) * topRightSlope); + Q16Dot16 rightIntersectBf = qSafeFloatToQ16Dot16(right.x() - 0.5f + (iRight + 1.5f - right.y()) * bottomRightSlope); int ny; int y = iTop; -- cgit v1.2.1 From 70cb5db4f219dd3e0e5fdffc4309c35b0195a017 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 11 Jun 2013 10:41:33 +0200 Subject: Fix gcc warnings about unused-value Fix multiple gcc warnings about statements in accessibleDebug arguments have no effect. Change-Id: I34bf05d911707f0b50592bf76442a3805c560d56 Reviewed-by: Friedemann Kleint Reviewed-by: Frederik Gladhorn --- src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h index d4f141c5d8..5b8d08d3c8 100644 --- a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h +++ b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h @@ -63,7 +63,7 @@ QT_BEGIN_NAMESPACE bool debug_accessibility(); # define accessibleDebug !debug_accessibility() ? (void)0 : qDebug #else -# define accessibleDebug +# define accessibleDebug while (false) qDebug #endif #ifndef QT_NO_DEBUG_OUTPUT -- cgit v1.2.1 From c47b66589341a07abb42ca913247cef51bfe624f Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Tue, 11 Jun 2013 14:07:00 +0200 Subject: Qdoc: replaced example file qt.qdocconf with qtgui.qdocconf Task-number: QTBUG-31574 Change-Id: Idf8509395dd5f16c696473d1eeb91fb86f2b97e7 Reviewed-by: Martin Smith --- src/tools/qdoc/doc/files/qtgui.qdocconf | 50 +++++++++++++++++++++++++++++++++ src/tools/qdoc/doc/qdoc-manual.qdoc | 50 ++++++++++----------------------- 2 files changed, 65 insertions(+), 35 deletions(-) create mode 100644 src/tools/qdoc/doc/files/qtgui.qdocconf diff --git a/src/tools/qdoc/doc/files/qtgui.qdocconf b/src/tools/qdoc/doc/files/qtgui.qdocconf new file mode 100644 index 0000000000..5073dd7f0f --- /dev/null +++ b/src/tools/qdoc/doc/files/qtgui.qdocconf @@ -0,0 +1,50 @@ +include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) + +project = QtGui +description = Qt GUI Reference Documentation +url = http://qt-project.org/doc/qt-$QT_VER/qtgui +version = $QT_VERSION + +examplesinstallpath = gui + +qhp.projects = QtGui + +qhp.QtGui.file = qtgui.qhp +qhp.QtGui.namespace = org.qt-project.qtgui.$QT_VERSION_TAG +qhp.QtGui.virtualFolder = qtgui +qhp.QtGui.indexTitle = Qt GUI +qhp.QtGui.indexRoot = + +qhp.QtGui.filterAttributes = qtgui $QT_VERSION qtrefdoc +qhp.QtGui.customFilters.Qt.name = Qtgui $QT_VERSION +qhp.QtGui.customFilters.Qt.filterAttributes = qtgui $QT_VERSION + +qhp.QtGui.subprojects = classes +qhp.QtGui.subprojects.classes.title = C++ Classes +qhp.QtGui.subprojects.classes.indexTitle = Qt GUI C++ Classes +qhp.QtGui.subprojects.classes.selectors = class fake:headerfile +qhp.QtGui.subprojects.classes.sortPages = true + +tagfile = ../../../doc/qtgui/qtgui.tags + +depends += \ + qtcore \ + qtnetwork \ + qtopengl \ + qtsvg \ + qtqml \ + qtquick \ + qtwidgets \ + qtdoc + +headerdirs += .. + +sourcedirs += .. \ + ../../../examples/gui/doc/src + +exampledirs += ../../../examples/gui \ + snippets + +imagedirs += images \ + ../../../examples/gui/doc/images \ + ../../../doc/src/images \ diff --git a/src/tools/qdoc/doc/qdoc-manual.qdoc b/src/tools/qdoc/doc/qdoc-manual.qdoc index b715b200bf..4a4b1db6ff 100644 --- a/src/tools/qdoc/doc/qdoc-manual.qdoc +++ b/src/tools/qdoc/doc/qdoc-manual.qdoc @@ -66,7 +66,7 @@ \li \l {HTML Specific Configuration Variables} \li \l {Supporting Derived Projects} \li \l {Example Manifest Files} - \li \l {qt.qdocconf} + \li \l {qtgui.qdocconf} \li \l {minimum.qdocconf} \li \l {Generating DITA XML Output} \endlist @@ -7179,13 +7179,13 @@ \list \li A minimum configuration file: \l minimum.qdocconf - \li The Qt configuration file: \l qt.qdocconf + \li The Qt configuration file: \l qtgui.qdocconf \endlist */ /*! \page 21-1-minimum-qdocconf.html - \previouspage qt.qdocconf + \previouspage qtgui.qdocconf \contentspage QDoc Manual \nextpage Generating DITA XML Output @@ -7195,14 +7195,14 @@ */ /*! - \page 21-2-qt-qdocconf.html + \page 21-2-qtgui-qdocconf.html \previouspage Supporting Derived Projects \contentspage QDoc Manual \nextpage minimum.qdocconf - \title qt.qdocconf + \title qtgui.qdocconf - \quotefile files/qt.qdocconf + \quotefile files/qtgui.qdocconf */ /*! @@ -7548,10 +7548,9 @@ The general syntax is \tt {extraimages.\e{format} = \e image}. The file extension is optional. - For example, in \l qt.qdocconf we use a couple of images within - the HTML.postheader variable which value is pure HTML. For that - reason, these images are specified using the \c extraimages - variable: + For example, if additional images are used within the HTML.postheader + value, then these images must also be specified using the \c + extraimages variable: \code extraimages.HTML = qt-logo @@ -7819,7 +7818,7 @@ Currently, C++ is the only language that QDoc understands. It is also the default language, and doesn't really need to be - specified. But for example in \l qt.qdocconf: + specified. \code language = Cpp @@ -7889,7 +7888,7 @@ The \c outputdir variable specifies the directory where QDoc will put the generated documentation. - In qt.qdocconf: + For example: \code outputdir = $QTDIR/doc/html @@ -7972,8 +7971,6 @@ The \c sourcedirs variable specifies the directories containing the \c .cpp or \c .qdoc files used in the documentation. - For example in \l qt.qdocconf - \code sourcedirs = $QTDIR/src \ $QTDIR/doc/src \ @@ -8157,7 +8154,7 @@ The \c versionsym variable specifies a C++ preprocessor symbol that defines the version number of the documented software. - For example in \l qt.qdocconf: + For example: \code versionsym = QT_VERSION_STR @@ -8270,7 +8267,7 @@ Cpp.ignoredirectives} variables, non-standard constructs (typically macros) can result in erroneous documentation. - In \l qt.qdocconf: + For example: \code Cpp.ignoredirectives = Q_DECLARE_INTERFACE \ @@ -8324,8 +8321,6 @@ Cpp.ignoredirectives} variables, non-standard constructs (typically macros) can result in erroneous documentation. - In \l qt.qdocconf: - \code Cpp.ignoretokens = QAXFACTORY_EXPORT \ QM_EXPORT_CANVAS \ @@ -8389,18 +8384,12 @@ quotation marks. Note that if the value spans several lines, each line needs to be enclosed by quotation marks. - For example in \l qt.qdocconf: - \code HTML.footer = "


\n" \ ... "
" \endcode - The complete variable entry in \l qt.qdocconf provides the - standard footer of the \l {http://doc.qt.digia.com/4.0/index.html} - {Qt Reference Documentation}. - \target HTML.postheader-variable \section1 HTML.postheader @@ -8414,8 +8403,6 @@ marks. Note that if the value spans several lines, each line needs to be enclosed by quotation marks. - For example in \l qt.qdocconf: - \code HTML.postheader = "" \endcode - The complete variable entry in \l qt.qdocconf provides the - standard header of the \l {http://doc.qt.digia.com/} {Qt Reference Documentation}. \target HTML.style-variable @@ -8440,8 +8425,6 @@ marks. Note that if the value spans several lines, each line needs to be enclosed by quotation marks. - For example in \l qt.qdocconf: - \code HTML.style = "h3.fn,span.fn" \ "{ margin-left: 1cm; text-indent: -1cm; }\n" \ @@ -8473,7 +8456,7 @@ \endcode QDoc expects to find stylesheets in the directory containing the - \l qt.qdocconf file, and it will copy those specified to the output + \l qtgui.qdocconf file, and it will copy those specified to the output directory alongside the HTML pages. */ @@ -8565,7 +8548,7 @@ This feature makes use of the comprehensive indexes generated by QDoc when it creates the Qt reference documentation. - For example, \l qt.qdocconf (the configuration file for Qt) + For example, \l qtgui.qdocconf (the configuration file for Qt) contains the following variable definitions: \code @@ -8585,9 +8568,6 @@ In a mini-project, you can use an index file by defining an \l indexes configuration variable in your \c .qdocconf file. - For example, you can create a \c qtcreator.qdocconf file to help you - check the Qt Creator documentation: - \code project = QtCreator description = Qt Creator Manual -- cgit v1.2.1 From 80d24a737ac4f93eaabaab79e0c60c9da97d6eed Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Mon, 10 Jun 2013 16:56:42 -0400 Subject: Update support status for older Mac OS X platforms. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ifdf487fbae8acbffb32b6db5f8dd93e9eb213d77 Reviewed-by: Gabriel de Dietrich Reviewed-by: Tor Arne Vestbø --- src/corelib/global/qglobal.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 4598f60d5e..6f63a0d9d3 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1050,9 +1050,9 @@ bool qSharedBuild() Q_DECL_NOTHROW \value MV_10_0 Mac OS X 10.0 (unsupported) \value MV_10_1 Mac OS X 10.1 (unsupported) \value MV_10_2 Mac OS X 10.2 (unsupported) - \value MV_10_3 Mac OS X 10.3 - \value MV_10_4 Mac OS X 10.4 - \value MV_10_5 Mac OS X 10.5 + \value MV_10_3 Mac OS X 10.3 (unsupported) + \value MV_10_4 Mac OS X 10.4 (unsupported) + \value MV_10_5 Mac OS X 10.5 (unsupported) \value MV_10_6 Mac OS X 10.6 \value MV_10_7 Mac OS X 10.7 \value MV_10_8 Mac OS X 10.8 -- cgit v1.2.1 From 3b5954e405cfbc3dcf1564d0e9e397825c5c1e5a Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 3 Jun 2013 18:28:03 +0200 Subject: Cocoa: Remove compilation warning Change-Id: Ib530e7ef4643de07aec91c4af0de8bbedef9882a Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm index c40ae3d81d..3ec6ad7a20 100644 --- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm +++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm @@ -113,6 +113,7 @@ static void cleanupCocoaApplicationDelegate() - (void)updateScreens:(NSNotification *)notification { + Q_UNUSED(notification); if (QCocoaIntegration *ci = dynamic_cast(QGuiApplicationPrivate::platformIntegration())) ci->updateScreens(); } -- cgit v1.2.1 From 7ee15bfbb815df87ae0526f105a13a591b192c76 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 3 Jun 2013 18:29:56 +0200 Subject: Cocoa: Make sure we update internal window fullscreen state We update the internal/synched state by assigning it its QWindow's state. Since that one is not a flag, it can only be in one state at a time, meaning that we may lose the maximized state (but we've been losing it for some time). Task-number: QTBUG-30139 Change-Id: Idf30713c6ae912cafe3bbdd7be18214cf4de34f7 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/cocoa/qcocoawindow.h | 2 ++ src/plugins/platforms/cocoa/qcocoawindow.mm | 6 ++++++ src/plugins/platforms/cocoa/qnsview.mm | 13 +++++++++---- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h index 91eaea21b6..b82d096bb5 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.h +++ b/src/plugins/platforms/cocoa/qcocoawindow.h @@ -136,6 +136,8 @@ public: bool windowShouldClose(); bool windowIsPopupType(Qt::WindowType type = Qt::Widget) const; + void setSynchedWindowStateFromWindow(); + NSInteger windowLevel(Qt::WindowFlags flags); NSUInteger windowStyleMask(Qt::WindowFlags flags); void setWindowShadow(Qt::WindowFlags flags); diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index f8d0eafcb3..d9043979d6 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -725,6 +725,12 @@ bool QCocoaWindow::windowShouldClose() return accepted; } +void QCocoaWindow::setSynchedWindowStateFromWindow() +{ + if (QWindow *w = window()) + m_synchedWindowState = w->windowState(); +} + bool QCocoaWindow::windowIsPopupType(Qt::WindowType type) const { if (type == Qt::Widget) diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 10fb293ec0..529a0ccfe7 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -290,10 +290,15 @@ static QTouchDevice *touchDevice = 0; #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 if (QSysInfo::QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) { - if (notificationName == NSWindowDidEnterFullScreenNotification) { - QWindowSystemInterface::handleWindowStateChanged(m_window, Qt::WindowFullScreen); - } else if (notificationName == NSWindowDidExitFullScreenNotification) { - QWindowSystemInterface::handleWindowStateChanged(m_window, Qt::WindowNoState); + if (notificationName == NSWindowDidEnterFullScreenNotification + || notificationName == NSWindowDidExitFullScreenNotification) { + Qt::WindowState newState = notificationName == NSWindowDidEnterFullScreenNotification ? + Qt::WindowFullScreen : Qt::WindowNoState; + QWindowSystemInterface::handleWindowStateChanged(m_window, newState); + // We want to read the window state back from the window, + // but the event we just sent may be asynchronous. + QWindowSystemInterface::flushWindowSystemEvents(); + m_platformWindow->setSynchedWindowStateFromWindow(); } } #endif -- cgit v1.2.1 From b8c007ede01360594ec5399532f2229e82715cc3 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 3 Jun 2013 18:33:03 +0200 Subject: Cocoa: Update window state when maximizing from the title bar There's no NSWindow notification we can listen to, but we can override behavior from its delegate. Change-Id: I61cebf4119f83c770fe4e7f45ff0d4e8bf9d0df9 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/cocoa/qnsview.h | 1 + src/plugins/platforms/cocoa/qnsview.mm | 10 ++++++++++ src/plugins/platforms/cocoa/qnswindowdelegate.h | 1 + src/plugins/platforms/cocoa/qnswindowdelegate.mm | 8 ++++++++ 4 files changed, 20 insertions(+) diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h index 85f72a4dbb..d28e38886b 100644 --- a/src/plugins/platforms/cocoa/qnsview.h +++ b/src/plugins/platforms/cocoa/qnsview.h @@ -82,6 +82,7 @@ QT_END_NAMESPACE - (void)drawRect:(NSRect)dirtyRect; - (void)updateGeometry; - (void)windowNotification : (NSNotification *) windowNotification; +- (void)notifyWindowWillZoom:(BOOL)willZoom; - (void)viewDidHide; - (void)viewDidUnhide; diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 529a0ccfe7..ec53fc6a7e 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -306,6 +306,16 @@ static QTouchDevice *touchDevice = 0; } } +- (void)notifyWindowWillZoom:(BOOL)willZoom +{ + Qt::WindowState newState = willZoom ? Qt::WindowMaximized : Qt::WindowNoState; + QWindowSystemInterface::handleWindowStateChanged(m_window, newState); + // We want to read the window state back from the window, + // but the event we just sent may be asynchronous. + QWindowSystemInterface::flushWindowSystemEvents(); + m_platformWindow->setSynchedWindowStateFromWindow(); +} + - (void)viewDidHide { m_platformWindow->obscureWindow(); diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.h b/src/plugins/platforms/cocoa/qnswindowdelegate.h index 9a616ba8e8..06e11fffbb 100644 --- a/src/plugins/platforms/cocoa/qnswindowdelegate.h +++ b/src/plugins/platforms/cocoa/qnswindowdelegate.h @@ -57,6 +57,7 @@ - (void)windowDidMove:(NSNotification *)notification; - (void)windowWillMove:(NSNotification *)notification; - (BOOL)windowShouldClose:(NSNotification *)notification; +- (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)newFrame; @end diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.mm b/src/plugins/platforms/cocoa/qnswindowdelegate.mm index 8e17936a78..10536bd5f4 100644 --- a/src/plugins/platforms/cocoa/qnswindowdelegate.mm +++ b/src/plugins/platforms/cocoa/qnswindowdelegate.mm @@ -90,4 +90,12 @@ return YES; } +- (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)newFrame +{ + Q_UNUSED(newFrame); + if (m_cocoaWindow && m_cocoaWindow->m_qtView) + [m_cocoaWindow->m_qtView notifyWindowWillZoom:![window isZoomed]]; + return YES; +} + @end -- cgit v1.2.1 From bfab741cb7ed24d2decfab4cffdcdbf14f6317ca Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 4 Jun 2013 13:54:07 +0200 Subject: Cocoa: Make sure internal minimized state is up to date Refactors some code from previous changes addressing the same issue for maximized and fullscreen states. Change-Id: I8a27274a90e6610b424ea7af3269369a1d724c48 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/cocoa/qnsview.h | 1 + src/plugins/platforms/cocoa/qnsview.mm | 30 ++++++++++++++++-------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h index d28e38886b..92215b9e67 100644 --- a/src/plugins/platforms/cocoa/qnsview.h +++ b/src/plugins/platforms/cocoa/qnsview.h @@ -81,6 +81,7 @@ QT_END_NAMESPACE - (void)invalidateWindowShadowIfNeeded; - (void)drawRect:(NSRect)dirtyRect; - (void)updateGeometry; +- (void)notifyWindowStateChanged:(Qt::WindowState)newState; - (void)windowNotification : (NSNotification *) windowNotification; - (void)notifyWindowWillZoom:(BOOL)willZoom; - (void)viewDidHide; diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index ec53fc6a7e..ab3f495a60 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -251,6 +251,15 @@ static QTouchDevice *touchDevice = 0; } } +- (void)notifyWindowStateChanged:(Qt::WindowState)newState +{ + QWindowSystemInterface::handleWindowStateChanged(m_window, newState); + // We want to read the window state back from the window, + // but the event we just sent may be asynchronous. + QWindowSystemInterface::flushWindowSystemEvents(); + m_platformWindow->setSynchedWindowStateFromWindow(); +} + - (void)windowNotification : (NSNotification *) windowNotification { //qDebug() << "windowNotification" << QCFString::toQString([windowNotification name]); @@ -269,10 +278,11 @@ static QTouchDevice *touchDevice = 0; if (!m_platformWindow->windowIsPopupType()) QWindowSystemInterface::handleWindowActivated(0); } - } else if (notificationName == NSWindowDidMiniaturizeNotification) { - QWindowSystemInterface::handleWindowStateChanged(m_window, Qt::WindowMinimized); - } else if (notificationName == NSWindowDidDeminiaturizeNotification) { - QWindowSystemInterface::handleWindowStateChanged(m_window, Qt::WindowNoState); + } else if (notificationName == NSWindowDidMiniaturizeNotification + || notificationName == NSWindowDidDeminiaturizeNotification) { + Qt::WindowState newState = notificationName == NSWindowDidMiniaturizeNotification ? + Qt::WindowMinimized : Qt::WindowNoState; + [self notifyWindowStateChanged:newState]; } else if ([notificationName isEqualToString: @"NSWindowDidOrderOffScreenNotification"]) { m_platformWindow->obscureWindow(); } else if ([notificationName isEqualToString: @"NSWindowDidOrderOnScreenAndFinishAnimatingNotification"]) { @@ -294,11 +304,7 @@ static QTouchDevice *touchDevice = 0; || notificationName == NSWindowDidExitFullScreenNotification) { Qt::WindowState newState = notificationName == NSWindowDidEnterFullScreenNotification ? Qt::WindowFullScreen : Qt::WindowNoState; - QWindowSystemInterface::handleWindowStateChanged(m_window, newState); - // We want to read the window state back from the window, - // but the event we just sent may be asynchronous. - QWindowSystemInterface::flushWindowSystemEvents(); - m_platformWindow->setSynchedWindowStateFromWindow(); + [self notifyWindowStateChanged:newState]; } } #endif @@ -309,11 +315,7 @@ static QTouchDevice *touchDevice = 0; - (void)notifyWindowWillZoom:(BOOL)willZoom { Qt::WindowState newState = willZoom ? Qt::WindowMaximized : Qt::WindowNoState; - QWindowSystemInterface::handleWindowStateChanged(m_window, newState); - // We want to read the window state back from the window, - // but the event we just sent may be asynchronous. - QWindowSystemInterface::flushWindowSystemEvents(); - m_platformWindow->setSynchedWindowStateFromWindow(); + [self notifyWindowStateChanged:newState]; } - (void)viewDidHide -- cgit v1.2.1 From d8f4abec711d7af4013209fd8b0c9edcedb44ab6 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Wed, 5 Jun 2013 15:47:55 +0200 Subject: Cocoa: Make QWidget::showNormal() work on minimized windows Cocoa sets the NSWindow hidden when it's minimized, and we don't propagate that further to QWindow or QWidget (QWidget's 'visible' documentation is quite ambiguous about that state). The obvious fix is to check for QWindow's visibility. However, this might need to be corrected later if we truly want the visible state to be in sync. Task-number: QTBUG-31117 Change-Id: I457452eff75e6ea746a0ef5351104f8bbb65f98b Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/cocoa/qcocoawindow.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index d9043979d6..19c4faf369 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -486,7 +486,7 @@ void QCocoaWindow::setWindowFlags(Qt::WindowFlags flags) void QCocoaWindow::setWindowState(Qt::WindowState state) { - if ([m_nsWindow isVisible]) + if (window()->isVisible()) syncWindowState(state); // Window state set for hidden windows take effect when show() is called. } -- cgit v1.2.1 From e2765098db18a7570b04fe3e30ded728aa97120a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 11 Jun 2013 16:23:24 +0200 Subject: don't claim that we need perl for shadow builds any more amends 0a1b89bff, which took care only of the unix version. Change-Id: Idb82881a9c47e67c973500721fd499bcf41a848b Reviewed-by: Joerg Bornemann --- tools/configure/configureapp.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 98b59ab6fd..f92fad1d69 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -151,12 +151,6 @@ Configure::Configure(int& argc, char** argv) const QString installPath = buildPath; #endif if (sourceDir != buildDir) { //shadow builds! - if (QStandardPaths::findExecutable(QStringLiteral("perl.exe")).isEmpty()) { - cout << "Error: Creating a shadow build of Qt requires" << endl - << "perl to be in the PATH environment"; - exit(0); // Exit cleanly for Ctrl+C - } - cout << "Preparing build tree..." << endl; QDir(buildPath).mkpath("bin"); -- cgit v1.2.1 From aa3f1cc8c6a15e29b592a46252a78c571262928d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 10 Jun 2013 11:37:55 +0200 Subject: fix QMAKE_COMPILER fallback for clang specs in the actual specs, we also set 'gcc' for clang. Change-Id: Ifc6b27d56596f34c944205795d665f545d090f80 Reviewed-by: Joerg Bornemann Reviewed-by: Jake Petroules --- mkspecs/features/spec_post.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/spec_post.prf b/mkspecs/features/spec_post.prf index 46a512bf17..c9e9f8b2f6 100644 --- a/mkspecs/features/spec_post.prf +++ b/mkspecs/features/spec_post.prf @@ -42,7 +42,7 @@ isEmpty(QMAKE_COMPILER) { else:*-llvm*: \ QMAKE_COMPILER = gcc llvm else:*-clang*: \ - QMAKE_COMPILER = clang llvm + QMAKE_COMPILER = gcc clang llvm else:*-msvc*: \ QMAKE_COMPILER = msvc else: \ -- cgit v1.2.1 From 7f6c864157d63091e351fd0f11c1b2408969a670 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 11 Jun 2013 15:38:52 +0200 Subject: remove overquoting of extra compiler commands the commands are already quoted appropriately for the shell. Change-Id: I746bb5fba2cd6548c5dc7ef81087c69a200ecbb8 Reviewed-by: Joerg Bornemann --- mkspecs/features/resources.prf | 4 ++-- mkspecs/features/uic.prf | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mkspecs/features/resources.prf b/mkspecs/features/resources.prf index ed44d9c308..5092362b44 100644 --- a/mkspecs/features/resources.prf +++ b/mkspecs/features/resources.prf @@ -18,8 +18,8 @@ resource_combine { QMAKE_RESOURCE_FLAGS += -name ${QMAKE_FILE_BASE} } } -rcc.commands = "$$QMAKE_RCC" $$QMAKE_RESOURCE_FLAGS "${QMAKE_FILE_IN}" -o "${QMAKE_FILE_OUT}" -rcc.depend_command = "$$QMAKE_RCC" -list $$QMAKE_RESOURCE_FLAGS "${QMAKE_FILE_IN}" +rcc.commands = $$QMAKE_RCC $$QMAKE_RESOURCE_FLAGS "${QMAKE_FILE_IN}" -o "${QMAKE_FILE_OUT}" +rcc.depend_command = $$QMAKE_RCC -list $$QMAKE_RESOURCE_FLAGS "${QMAKE_FILE_IN}" rcc.CONFIG += add_inputs_as_makefile_deps rcc.input = RESOURCES rcc.variable_out = SOURCES diff --git a/mkspecs/features/uic.prf b/mkspecs/features/uic.prf index 36ec185f7b..6d85443200 100644 --- a/mkspecs/features/uic.prf +++ b/mkspecs/features/uic.prf @@ -4,7 +4,7 @@ isEmpty(UI_DIR):UI_DIR = . isEmpty(QMAKE_MOD_UIC):QMAKE_MOD_UIC = ui_ uic.commands = $$QMAKE_UIC ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT} -uic.depend_command = "$$QMAKE_UIC" -d "${QMAKE_FILE_IN}" +uic.depend_command = $$QMAKE_UIC -d "${QMAKE_FILE_IN}" uic.output = $$UI_DIR/$${QMAKE_MOD_UIC}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)} uic.input = FORMS uic.variable_out = GENERATED_FILES -- cgit v1.2.1 From 6bf5ef044f12bd4ac2bcb608365162334cb50252 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 11 Jun 2013 15:45:44 +0200 Subject: remove overquoting of extra compiler arguments qmake automatically escapes the ${expandos}. Change-Id: If74b6d2f2c68ff50785fdcbb66351122a273051f Reviewed-by: Joerg Bornemann --- mkspecs/features/resources.prf | 6 +++--- mkspecs/features/uic.prf | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mkspecs/features/resources.prf b/mkspecs/features/resources.prf index 5092362b44..34a04b4ee2 100644 --- a/mkspecs/features/resources.prf +++ b/mkspecs/features/resources.prf @@ -18,11 +18,11 @@ resource_combine { QMAKE_RESOURCE_FLAGS += -name ${QMAKE_FILE_BASE} } } -rcc.commands = $$QMAKE_RCC $$QMAKE_RESOURCE_FLAGS "${QMAKE_FILE_IN}" -o "${QMAKE_FILE_OUT}" -rcc.depend_command = $$QMAKE_RCC -list $$QMAKE_RESOURCE_FLAGS "${QMAKE_FILE_IN}" +rcc.commands = $$QMAKE_RCC $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT} +rcc.depend_command = $$QMAKE_RCC -list $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN} rcc.CONFIG += add_inputs_as_makefile_deps rcc.input = RESOURCES rcc.variable_out = SOURCES rcc.name = RCC ${QMAKE_FILE_IN} -silent:rcc.commands = @echo rcc "${QMAKE_FILE_IN}" && $$rcc.commands +silent:rcc.commands = @echo rcc ${QMAKE_FILE_IN} && $$rcc.commands QMAKE_EXTRA_COMPILERS += rcc diff --git a/mkspecs/features/uic.prf b/mkspecs/features/uic.prf index 6d85443200..83e579cb3a 100644 --- a/mkspecs/features/uic.prf +++ b/mkspecs/features/uic.prf @@ -4,7 +4,7 @@ isEmpty(UI_DIR):UI_DIR = . isEmpty(QMAKE_MOD_UIC):QMAKE_MOD_UIC = ui_ uic.commands = $$QMAKE_UIC ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT} -uic.depend_command = $$QMAKE_UIC -d "${QMAKE_FILE_IN}" +uic.depend_command = $$QMAKE_UIC -d ${QMAKE_FILE_IN} uic.output = $$UI_DIR/$${QMAKE_MOD_UIC}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)} uic.input = FORMS uic.variable_out = GENERATED_FILES -- cgit v1.2.1 From 2d9cd8eef8652873e73d5cde6b6545eea9a17612 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 12 Jun 2013 09:37:46 +0200 Subject: Fix xkbcommon.pri not to override QMAKE_CFLAGS Task-number: QTBUG-31585 Change-Id: I6628a8eececc34aef4cd358ad2c8b246d8845602 Reviewed-by: Jani Heikkinen Reviewed-by: Andy Shaw --- src/3rdparty/xkbcommon.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/xkbcommon.pri b/src/3rdparty/xkbcommon.pri index 99536576f7..d437c6b8b6 100644 --- a/src/3rdparty/xkbcommon.pri +++ b/src/3rdparty/xkbcommon.pri @@ -1,4 +1,4 @@ -QMAKE_CFLAGS = -std=gnu99 -w +QMAKE_CFLAGS += -std=gnu99 -w INCLUDEPATH += $$PWD/xkbcommon $$PWD/xkbcommon/src $$PWD/xkbcommon/src/xkbcomp DEFINES += DFLT_XKB_CONFIG_ROOT='\\"/usr/share/X11/xkb\\"' -- cgit v1.2.1 From eab6700ec0f637fd79a5dd1cb541ee6426a699d6 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 12 Jun 2013 12:46:13 +0200 Subject: Fix crash for pressing Ctrl+C in a message box This fixes a regression introduced with e34dccc9e Task-number: QTBUG-31635 Change-Id: I7c991f3b98f5c51e5fb3c12db04d3ace7be87010 Reviewed-by: Friedemann Kleint Reviewed-by: Mitch Curtis --- src/widgets/dialogs/qmessagebox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp index 4ec828ac83..995d279e13 100644 --- a/src/widgets/dialogs/qmessagebox.cpp +++ b/src/widgets/dialogs/qmessagebox.cpp @@ -1392,7 +1392,7 @@ void QMessageBox::keyPressEvent(QKeyEvent *e) #if !defined(QT_NO_TEXTEDIT) if (e == QKeySequence::Copy) { - if (d->detailsText->isVisible() && d->detailsText->copy()) { + if (d->detailsText && d->detailsText->isVisible() && d->detailsText->copy()) { e->setAccepted(true); return; } -- cgit v1.2.1 From 443253cf1191c5157f4a5338a6fc45993ea86061 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 10 Jun 2013 14:41:16 +0200 Subject: Let QTemporaryDir::stressTest() run in temporary directory. Task-number: QTBUG-31618 Change-Id: I60aaa4f57710816cd0e22ea9b097c7e85466fd0c Reviewed-by: David Faure (KDE) --- tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp b/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp index 8515f8a698..713d0c5c17 100644 --- a/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp +++ b/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp @@ -279,17 +279,18 @@ void tst_QTemporaryDir::openOnRootDrives() void tst_QTemporaryDir::stressTest() { const int iterations = 1000; + QTemporaryDir rootDir; + QVERIFY(rootDir.isValid()); QSet names; + const QString pattern = rootDir.path() + QStringLiteral("/XXXXXX"); for (int i = 0; i < iterations; ++i) { - QTemporaryDir dir; + QTemporaryDir dir(pattern); dir.setAutoRemove(false); - QVERIFY2(dir.isValid(), qPrintable(QString::number(i))); + QVERIFY2(dir.isValid(), qPrintable(QString::fromLatin1("Failed to create #%1 under %2.").arg(i).arg(QDir::toNativeSeparators(pattern)))); QVERIFY(!names.contains(dir.path())); names.insert(dir.path()); } - for (QSet::const_iterator it = names.constBegin(); it != names.constEnd(); ++it) - QDir(*it).removeRecursively(); } void tst_QTemporaryDir::rename() -- cgit v1.2.1 From b6f24423716b82686c86d33828b7139ac717afdd Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Wed, 12 Jun 2013 15:08:28 +0200 Subject: Fix another type of crash when dragging QDockWidget in and out QDockWidgetPrivate::mouseMoveEvent calls q->move() which can result in a call to QDockWidgetPrivate::endDrag(), which will delete the state struct. Therefore mouseMoveEvent needs to check whether it's null or not before accessing it. Task-number: QTBUG-31672 Change-Id: I91a31620f16a80b31b65b2742e7937ae8960f0fd Reviewed-by: Gabriel de Dietrich Reviewed-by: Friedemann Kleint --- src/widgets/widgets/qdockwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp index a3c331aa2b..5217e57333 100644 --- a/src/widgets/widgets/qdockwidget.cpp +++ b/src/widgets/widgets/qdockwidget.cpp @@ -873,7 +873,7 @@ bool QDockWidgetPrivate::mouseMoveEvent(QMouseEvent *event) QPoint pos = event->globalPos() - state->pressPos; q->move(pos); - if (!state->ctrlDrag) + if (state && !state->ctrlDrag) mwlayout->hover(state->widgetItem, event->globalPos()); ret = true; -- cgit v1.2.1 From 0bc96d1d6ba29c6e0a4c39cc526d9515036b7453 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 12 Jun 2013 12:52:31 +0200 Subject: Widgets: Do not create QWindow in createTLExtra(). QWidget::setWindowIcon() and similar call createTLExtra() which creates a QWindow without setting the native attributes on the parent, which can cause crashes when setParent_sys() decides to delete the window. Task-number: QTBUG-31672 Change-Id: I4c40ee12741be88b2281df90329ffb698d4009eb Reviewed-by: Shawn Rutledge --- src/widgets/kernel/qwidget.cpp | 5 ++++- src/widgets/kernel/qwidget_qpa.cpp | 4 +--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index cfccce7c41..f67a93c7b5 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -1546,10 +1546,11 @@ void QWidgetPrivate::createTLExtra() x->inTopLevelResize = false; x->inRepaint = false; x->embedded = 0; + x->window = 0; + x->screenIndex = 0; #ifdef Q_WS_MAC x->wasMaximized = false; #endif // Q_WS_MAC - createTLSysExtra(); #ifdef QWIDGET_EXTRA_DEBUG static int count = 0; qDebug() << "tlextra" << ++count; @@ -10109,6 +10110,8 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) break; } case Qt::WA_NativeWindow: { d->createTLExtra(); + if (on) + d->createTLSysExtra(); #ifndef QT_NO_IM QWidget *focusWidget = d->effectiveFocusWidget(); if (on && !internalWinId() && hasFocus() diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp index 3b6c9ca448..dafe7dc42a 100644 --- a/src/widgets/kernel/qwidget_qpa.cpp +++ b/src/widgets/kernel/qwidget_qpa.cpp @@ -890,9 +890,7 @@ void QWidgetPrivate::deleteSysExtra() void QWidgetPrivate::createTLSysExtra() { Q_Q(QWidget); - extra->topextra->screenIndex = 0; - extra->topextra->window = 0; - if (q->testAttribute(Qt::WA_NativeWindow) || q->isWindow()) { + if (!extra->topextra->window && (q->testAttribute(Qt::WA_NativeWindow) || q->isWindow())) { extra->topextra->window = new QWidgetWindow(q); if (extra->minw || extra->minh) extra->topextra->window->setMinimumSize(QSize(extra->minw, extra->minh)); -- cgit v1.2.1 From 3e2cd8ef6f1ce4f46719890134c8bba9dbdb19ba Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 11 Jun 2013 16:58:49 +0200 Subject: fix QFileSystemEngine::createDirectory race condition During a call to QDir::mkpath(), the same path could be created by another process, in which case the OS mkdir will fail with EEXIST. But the docs for mkpath() state that it's not an error if it already exists, whereas for mkdir() it is an error. So QFileSystemEngine::createDirectory should accept the EEXIST error silently if it occurs while creating the sequence of parent directories and the final leaf directory, but should fail if EEXIST happens when it was called from QDir::mkdir(), which is when the createParents parameter is false. We assume the operating system mkdir() and CreateDirectory() are atomic, so there should be no race condition in QDir::mkdir(). It's not necessary for mkpath() to call stat() at each level, only to check whether an existing entry is a directory or a file. Also added to the autotest to verify that if the path is an existing file, creating a dir with the same name will fail in either mkdir or mkpath. Task-number: QTBUG-30046 Change-Id: I926352f10654fdf3b322c8685bb85ad8b8844874 Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qfilesystemengine_unix.cpp | 11 ++++++----- src/corelib/io/qfilesystemengine_win.cpp | 13 ++++++------- tests/auto/corelib/io/qdir/tst_qdir.cpp | 18 +++++++++++++++++- 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index b18e32b29a..a7517b4c7f 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -510,11 +510,12 @@ bool QFileSystemEngine::createDirectory(const QFileSystemEntry &entry, bool crea } if (slash) { const QByteArray chunk = QFile::encodeName(dirName.left(slash)); - QT_STATBUF st; - if (QT_STAT(chunk.constData(), &st) != -1) { - if ((st.st_mode & S_IFMT) != S_IFDIR) - return false; - } else if (QT_MKDIR(chunk.constData(), 0777) != 0) { + if (QT_MKDIR(chunk.constData(), 0777) != 0) { + if (errno == EEXIST) { + QT_STATBUF st; + if (QT_STAT(chunk.constData(), &st) == 0 && (st.st_mode & S_IFMT) == S_IFDIR) + continue; + } return false; } } diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp index bee7689535..fdbd6e01e4 100644 --- a/src/corelib/io/qfilesystemengine_win.cpp +++ b/src/corelib/io/qfilesystemengine_win.cpp @@ -1044,14 +1044,13 @@ bool QFileSystemEngine::createDirectory(const QFileSystemEntry &entry, bool crea } if (slash) { QString chunk = dirName.left(slash); - bool existed = false; - if (!isDirPath(chunk, &existed)) { - if (!existed) { - if (!mkDir(chunk)) - return false; - } else { - return false; + if (!mkDir(chunk)) { + if (GetLastError() == ERROR_ALREADY_EXISTS) { + bool existed = false; + if (isDirPath(chunk, &existed) && existed) + continue; } + return false; } } } diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp index d44ef167b5..fbb21e4e9a 100644 --- a/tests/auto/corelib/io/qdir/tst_qdir.cpp +++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp @@ -311,12 +311,28 @@ void tst_QDir::mkdir() void tst_QDir::makedirReturnCode() { QString dirName = QString::fromLatin1("makedirReturnCode"); - QDir::current().rmdir(dirName); // cleanup a previous run. + QFile f(QDir::current().filePath(dirName)); + + // cleanup a previous run. + f.remove(); + QDir::current().rmdir(dirName); + QDir dir(dirName); QVERIFY(!dir.exists()); QVERIFY(QDir::current().mkdir(dirName)); QVERIFY(!QDir::current().mkdir(dirName)); // calling mkdir on an existing dir will fail. QVERIFY(QDir::current().mkpath(dirName)); // calling mkpath on an existing dir will pass + + // Remove the directory and create a file with the same path + QDir::current().rmdir(dirName); + QVERIFY(!f.exists()); + f.open(QIODevice::WriteOnly); + f.write("test"); + f.close(); + QVERIFY(f.exists()); + QVERIFY(!QDir::current().mkdir(dirName)); // calling mkdir on an existing file will fail. + QVERIFY(!QDir::current().mkpath(dirName)); // calling mkpath on an existing file will fail. + f.remove(); } void tst_QDir::rmdir_data() -- cgit v1.2.1 From 703cca8bb7607201aff5a2f833d66dc80a7d0e4d Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 12 Jun 2013 14:57:11 +0200 Subject: Adjust the cmake files to find the dlls in the bin dir. Change-Id: I840f963c3648d123b31f79aa2c8902c0ad74e982 Reviewed-by: Oswald Buddenhagen Reviewed-by: Stephen Kelly --- mkspecs/features/create_cmake.prf | 11 +++++ .../features/data/cmake/Qt5BasicConfig.cmake.in | 54 +++++++++++++--------- src/gui/Qt5GuiConfigExtras.cmake.in | 7 +-- 3 files changed, 46 insertions(+), 26 deletions(-) diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf index 3dae3895de..7a200056ae 100644 --- a/mkspecs/features/create_cmake.prf +++ b/mkspecs/features/create_cmake.prf @@ -60,6 +60,17 @@ contains(CMAKE_BIN_DIR, "^\\.\\./.*") { CMAKE_BIN_DIR_IS_ABSOLUTE = True } +!isEmpty(DLLDESTDIR):!static:!staticlib { + CMAKE_DLL_DIR = $$cmakeRelativePath($$[QT_INSTALL_BINS], $$[QT_INSTALL_PREFIX]) + contains(CMAKE_DLL_DIR, "^\\.\\./.*") { + CMAKE_DLL_DIR = $$[QT_INSTALL_BINS]/ + CMAKE_DLL_DIR_IS_ABSOLUTE = True + } +} else { + CMAKE_DLL_DIR = $$CMAKE_LIB_DIR + CMAKE_DLL_DIR_IS_ABSOLUTE = $$CMAKE_LIB_DIR_IS_ABSOLUTE +} + CMAKE_HOST_DATA_DIR = $$cmakeRelativePath($$[QT_HOST_DATA], $$[QT_INSTALL_PREFIX]) contains(CMAKE_HOST_DATA_DIR, "^\\.\\./.*") { CMAKE_HOST_DATA_DIR = $$[QT_HOST_DATA]/ diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in index c55b728f1b..1a2bd4a94d 100644 --- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in +++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in @@ -46,10 +46,10 @@ endmacro() macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATION IMPLIB_LOCATION) set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration}) -!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) - set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}${LIB_LOCATION}\") +!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) + set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\") !!ELSE - set(imported_location \"IMPORTED_LOCATION_${Configuration}\" \"$${CMAKE_LIB_DIR}${LIB_LOCATION}\") + set(imported_location \"IMPORTED_LOCATION_${Configuration}\" \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\") !!ENDIF _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location}) set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES @@ -187,22 +187,26 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD) !!IF isEmpty(CMAKE_DEBUG_TYPE) -!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) !!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) +!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) -!!ELSE - if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" AND EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) -!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD -!!ELSE -!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) +!!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) +!!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE + _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" ) +!!ELSE // CMAKE_STATIC_WINDOWS_BUILD + if (EXISTS +!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) + \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" !!ELSE - if (EXISTS \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" AND EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) -!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD + \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" !!ENDIF -!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) - _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" ) + AND EXISTS +!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) + \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) !!ELSE + \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) +!!ENDIF _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD endif() @@ -220,22 +224,26 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD) !!IF isEmpty(CMAKE_RELEASE_TYPE) -!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) !!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) +!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) -!!ELSE - if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" AND EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) -!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD -!!ELSE -!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) +!!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) +!!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE + _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" ) +!!ELSE // CMAKE_STATIC_WINDOWS_BUILD + if (EXISTS +!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) + \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" !!ELSE - if (EXISTS \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" AND EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) -!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD + \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" !!ENDIF -!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) - _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" ) + AND EXISTS +!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) + \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) !!ELSE + \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) +!!ENDIF _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD endif() diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in index 83e77280d5..6ad1d679e1 100644 --- a/src/gui/Qt5GuiConfigExtras.cmake.in +++ b/src/gui/Qt5GuiConfigExtras.cmake.in @@ -16,11 +16,12 @@ set(Qt5Gui_OPENGL_INCLUDE_DIRS ${Qt5Gui_EGL_INCLUDE_DIRS}) macro(_populate_qt5gui_gl_target_properties TargetName Configuration LIB_LOCATION IMPLIB_LOCATION) set_property(TARGET Qt5::${TargetName} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration}) -!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) - set(imported_location \"${_qt5Gui_install_prefix}/$${CMAKE_LIB_DIR}${LIB_LOCATION}\") +!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) + set(imported_location \"${_qt5Gui_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\") !!ELSE - set(imported_location \"$${CMAKE_LIB_DIR}${LIB_LOCATION}\") + set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\") !!ENDIF + !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) set(imported_implib \"${_qt5Gui_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\") !!ELSE -- cgit v1.2.1 From 19ed991e56dbdec0c530a7626e5e20ebdff3a78e Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Fri, 14 Jun 2013 11:51:17 +0200 Subject: Doc: Remove Tweet Search demo from the list of highlighted examples Don't highlight the example until it's updated to use a new version of the Twitter API. Task-number: QTBUG-31745 Change-Id: If7f9ac3391c549f48cfebcdbe6bdcd12eb4a3e13 Reviewed-by: Jerome Pasion --- doc/global/manifest-meta.qdocconf | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/global/manifest-meta.qdocconf b/doc/global/manifest-meta.qdocconf index d4b2f9f066..9dd6cbfb43 100644 --- a/doc/global/manifest-meta.qdocconf +++ b/doc/global/manifest-meta.qdocconf @@ -36,7 +36,6 @@ manifestmeta.filters = highlighted webkit1 webkit2 manifestmeta.highlighted.names = "QtQuick/Qt Quick Demo - Same Game" \ "QtQuick/Qt Quick Demo - Photo Surface" \ - "QtQuick/Qt Quick Demo - Tweet Search" \ "QtQuick/Qt Quick Demo - Maroon*" \ "QtQuick/Qt Quick Demo - Calqlatr" \ "QtQuick/Qt Quick Particles Examples - Emitters" \ -- cgit v1.2.1 From dd050d35d77e2f6ac37bd1266a843df55848022f Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Thu, 13 Jun 2013 17:43:56 +0200 Subject: network requests: do not access 1st byte of empty byte array ... because otherwise this would crash. Apparently there are cases where the header name is empty. Task-number: QTBUG-31667 Change-Id: I31b3e964502c05b7614c23876bb3752fa75ab22d Reviewed-by: Richard J. Moore Reviewed-by: Shane Kearns --- src/network/access/qnetworkrequest.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp index 3a3e24b80b..00d5b81413 100644 --- a/src/network/access/qnetworkrequest.cpp +++ b/src/network/access/qnetworkrequest.cpp @@ -752,7 +752,8 @@ static QByteArray headerValue(QNetworkRequest::KnownHeaders header, const QVaria static QNetworkRequest::KnownHeaders parseHeaderName(const QByteArray &headerName) { - // headerName is not empty here + if (headerName.isEmpty()) + return QNetworkRequest::KnownHeaders(-1); switch (tolower(headerName.at(0))) { case 'c': -- cgit v1.2.1 From cf98d1e60764e22e2e3f168708818106af99c498 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Thu, 13 Jun 2013 17:50:39 +0200 Subject: OSX color dialog can be accepted repeatedly QNSColorPanelDelegate::finishOffWithCode sets mResultSet = true and it needs to be set false again the next time the dialog is shown. Task-number: QTBUG-31566 Change-Id: If1d4bb9d4e76273c6423f5bf2ae37790e8a9704e Reviewed-by: Liang Qi --- src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm index a0dac445be..514ea0482f 100644 --- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm @@ -274,6 +274,7 @@ static NSButton *macCreateButton(const char *text, NSView *superview) - (void)showModelessPanel { mDialogIsExecuting = false; + mResultSet = false; [mColorPanel makeKeyAndOrderFront:mColorPanel]; } -- cgit v1.2.1 From e083aede62a23af8330bb572366e79e2f42e0cec Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 14 Jun 2013 12:39:02 +0200 Subject: Cocoa color dialog cannot be modal, but should show anyway Silently failing doesn't seem the right way to handle this. Updated docs for DontUseNativeDialog option: it's not just for the Mac anymore. Ensure that the Qt dialog and Mac panel will never be shown at the same time. Change-Id: Ia9e80754df6c7622d9039c8dd050ac4de771a030 Task-number: QTBUG-29161 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm | 10 ++++------ src/widgets/dialogs/qcolordialog.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm index 514ea0482f..901aa667f5 100644 --- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm @@ -368,10 +368,8 @@ void QCocoaColorDialogHelper::exec() bool QCocoaColorDialogHelper::show(Qt::WindowFlags, Qt::WindowModality windowModality, QWindow *parent) { - if (windowModality == Qt::WindowModal) { - // Cocoa's shared color panel cannot be shown as a sheet - return false; - } + if (windowModality == Qt::WindowModal) + windowModality = Qt::ApplicationModal; return showCocoaColorPanel(windowModality, parent); } @@ -434,9 +432,9 @@ bool QCocoaColorDialogHelper::showCocoaColorPanel(Qt::WindowModality windowModal createNSColorPanelDelegate(); QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *delegate = static_cast(mDelegate); [delegate->mColorPanel setShowsAlpha:options()->testOption(QColorDialogOptions::ShowAlphaChannel)]; - if (windowModality == Qt::NonModal) + if (windowModality != Qt::WindowModal) [delegate showModelessPanel]; - // no need to show a Qt::ApplicationModal dialog here, since it will be done in _q_platformRunNativeAppModalPanel() + // no need to show a Qt::WindowModal dialog here, because it's necessary to call exec() in that case return true; } diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp index d6254076c5..79a71599c0 100644 --- a/src/widgets/dialogs/qcolordialog.cpp +++ b/src/widgets/dialogs/qcolordialog.cpp @@ -1776,6 +1776,8 @@ void QColorDialog::setOptions(ColorDialogOptions options) d->options->setOptions(QColorDialogOptions::ColorDialogOptions(int(options))); d->buttons->setVisible(!(options & NoButtons)); d->showAlpha(options & ShowAlphaChannel); + if (options & DontUseNativeDialog) + d->nativeDialogInUse = false; } QColorDialog::ColorDialogOptions QColorDialog::options() const @@ -1794,8 +1796,8 @@ QColorDialog::ColorDialogOptions QColorDialog::options() const \value ShowAlphaChannel Allow the user to select the alpha component of a color. \value NoButtons Don't display \uicontrol{OK} and \uicontrol{Cancel} buttons. (Useful for "live dialogs".) - \value DontUseNativeDialog Use Qt's standard color dialog on the Mac instead of Apple's - native color panel. + \value DontUseNativeDialog Use Qt's standard color dialog instead of the operating system + native color dialog. \sa options, setOption(), testOption(), windowModality() */ -- cgit v1.2.1 From 69554e458669c941130c2dc03d42a59ffd00e39e Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 14 Jun 2013 12:39:42 +0200 Subject: OSX: Disable window restoration for the Mac color panel because if it is automatically restored it's out of the application's control, so the user's interaction will be ignored. Change I8ce3cd94f5ae81d7877a346743ca4e0e188baa02 did this for normal windows by default, but the dialog helpers generate windows which aren't affected by that. Task-number: QTBUG-31750 Change-Id: I636bd87b664a489a2dc8693dad5370a715b1cf7b Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm index 901aa667f5..594ad65a18 100644 --- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm @@ -98,6 +98,11 @@ static NSButton *macCreateButton(const char *text, NSView *superview) mDialogIsExecuting = false; mResultSet = false; +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 + if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) + [mColorPanel setRestorable:NO]; +#endif + if (mHelper->options()->testOption(QColorDialogOptions::NoButtons)) { mStolenContentView = 0; mOkButton = 0; -- cgit v1.2.1 From 13e01fda195bcf55e3fb1862c9467ac9cbbf33c1 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 13 Jun 2013 17:28:52 +0200 Subject: assemble the tool commands at use time, after all the precise syntax depends on what exactly the command is used for, so we need to resolve it at the last moment. see followup commits. This logically reverts commits 6f4ff81380862ad0e788151b35d742f548241d5a and 731e6bece5cebe205ca47c1c078c7ac18984ba1c. Change-Id: If285c91d7521069be86d32593b5c2ae2027b3038 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_functions.prf | 8 ++++---- mkspecs/features/qt_tool.prf | 11 ++++++----- mkspecs/features/testcase.prf | 2 +- qtbase.pro | 4 ++-- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index 9ec22d57db..4b96c48aa5 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -191,7 +191,7 @@ defineTest(qtAddRpathLink) { # variable, default defineTest(qtPrepareTool) { - $$1 = $$eval(QT_TOOL.$${2}.command) + $$1 = $$eval(QT_TOOL.$${2}.binary) isEmpty($$1) { $$1 = $$[QT_HOST_BINS]/$$2 exists($$eval($$1).pl) { @@ -204,9 +204,9 @@ defineTest(qtPrepareTool) { $$1 = $$BUNDLENAME } } - $$1 = $$shell_path($$eval($$1)) } - export($$1) + $$1 = $$shell_path($$eval($$1)) + qtAddTargetEnv($$1, QT_TOOL.$${2}.depends) } defineTest(qtAddToolEnv) { @@ -233,7 +233,7 @@ defineTest(qtAddToolEnv) { } defineTest(qtAddTargetEnv) { - deps = $$replace(QT, -private$, ) + deps = $$replace($$2, -private$, ) deps = $$resolve_depends(deps, "QT.", ".depends" ".private_depends" ".run_depends") !isEmpty(deps) { for(dep, deps): \ diff --git a/mkspecs/features/qt_tool.prf b/mkspecs/features/qt_tool.prf index 0a588807c8..9a6b9634e0 100644 --- a/mkspecs/features/qt_tool.prf +++ b/mkspecs/features/qt_tool.prf @@ -19,17 +19,17 @@ CONFIG += console !build_pass:if(!host_build|!force_bootstrap|force_independent) { isEmpty(MODULE):MODULE = $$TARGET - MODULE_DEPENDS = $$replace(QT, -private$, ) + !host_build|!force_bootstrap: MODULE_DEPENDS = $$replace(QT, -private$, ) load(qt_build_paths) load(resolve_target) - cmd = $$shell_path($$QMAKE_RESOLVED_TARGET) - !host_build|!force_bootstrap: qtAddTargetEnv(cmd) TOOL_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_tool_$${MODULE}.pri - TOOL_PRI_CONT = "QT_TOOL.$${MODULE}.command = $$val_escape(cmd)" + TOOL_PRI_CONT = \ + "QT_TOOL.$${MODULE}.binary = $$QMAKE_RESOLVED_TARGET" \ + "QT_TOOL.$${MODULE}.depends =$$join(MODULE_DEPENDS, " ", " ")" write_file($$TOOL_PRI, TOOL_PRI_CONT)|error("Aborting.") # Then, inject the new tool into the current cache state @@ -39,6 +39,7 @@ CONFIG += console unset(added) } include($$TOOL_PRI) - cache(QT_TOOL.$${MODULE}.command, transient) + for(var, $$list(binary depends)): \ + cache(QT_TOOL.$${MODULE}.$$var, transient) } diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf index 15febe2dd5..e31d1f4539 100644 --- a/mkspecs/features/testcase.prf +++ b/mkspecs/features/testcase.prf @@ -43,7 +43,7 @@ else: check.commands += $(DESTDIR_TARGET) check.commands += $(TESTARGS) # Add environment for non-installed builds -qtAddTargetEnv(check.commands) +qtAddTargetEnv(check.commands, QT) # If the test is marked as insignificant, discard the exit code insignificant_test:check.commands = -$${check.commands} diff --git a/qtbase.pro b/qtbase.pro index 02dc11eac2..6ab032e30f 100644 --- a/qtbase.pro +++ b/qtbase.pro @@ -88,7 +88,7 @@ prefix_build|!equals(PWD, $$OUT_PWD) { TOOL_PRI = $$OUT_PWD/mkspecs/modules/qt_tool_syncqt.pri - TOOL_PRI_CONT = "QT_TOOL.syncqt.command = $$val_escape(cmd)" + TOOL_PRI_CONT = "QT_TOOL.syncqt.binary = $$val_escape(cmd)" write_file($$TOOL_PRI, TOOL_PRI_CONT)|error("Aborting.") # Then, inject the new tool into the current cache state @@ -97,7 +97,7 @@ prefix_build|!equals(PWD, $$OUT_PWD) { cache(QMAKE_INTERNAL_INCLUDED_FILES, add transient, added) } include($$TOOL_PRI) - cache(QT_TOOL.syncqt.command, transient) + cache(QT_TOOL.syncqt.binary, transient) } -- cgit v1.2.1 From c932f2cc1352417a760378f59579569673a82b1d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 13 Jun 2013 17:37:53 +0200 Subject: fix command over-escaping in vcproj files the vs ide executes the commands verbatim, so they must not be make-escaped. Task-number: QTBUG-31289 Change-Id: Ie73fd5c4da5527c2d10bc94ccdf60f8a1ca21351 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_functions.prf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index 4b96c48aa5..abce52c328 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -224,8 +224,10 @@ defineTest(qtAddToolEnv) { else: infix = val = "(set $$name=$$join(value, ;)$$infix) &" } - contains(MAKEFILE_GENERATOR, MS.*): val ~= s,%,%%,g - else: val ~= s,\\\$,\$\$,g + !contains(TEMPLATE, vc.*) { + contains(MAKEFILE_GENERATOR, MS.*): val ~= s,%,%%,g + else: val ~= s,\\\$,\$\$,g + } $$1 = "$$val $$eval($$1)" } } -- cgit v1.2.1 From 9d48f14a3cdaee24fb41d192c648b1263edeb70d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 13 Jun 2013 17:41:36 +0200 Subject: always $-escape make commands nmake needs %-escaping in addition to $-escaping, not instead. this has little practical impact, so it went unnoticed. Change-Id: I144b6142eec0151d83a22e0ac5ead7b0415cdafa Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_functions.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index abce52c328..ca8391b65a 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -226,7 +226,7 @@ defineTest(qtAddToolEnv) { } !contains(TEMPLATE, vc.*) { contains(MAKEFILE_GENERATOR, MS.*): val ~= s,%,%%,g - else: val ~= s,\\\$,\$\$,g + val ~= s,\\\$,\$\$,g } $$1 = "$$val $$eval($$1)" } -- cgit v1.2.1 From 17c38b25f432767e533d1612df3bcee0d15a4de8 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 13 Jun 2013 18:12:07 +0200 Subject: fix rcc & uic .depend_commands unlike the .command, the .depend_command is not executed by make via its chosen shell, but qmake itself via the system's native shell. consequently, it needs different path separators and no make-escaping. Task-number: QTBUG-31289 Change-Id: I480f815753632db6e8d4725f463f8a1fc59680a6 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_functions.prf | 33 ++++++++++++++++++++++++++------- mkspecs/features/resources.prf | 4 ++-- mkspecs/features/uic.prf | 4 ++-- 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index ca8391b65a..63ae62c42e 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -189,7 +189,7 @@ defineTest(qtAddRpathLink) { export(QMAKE_RPATHLINKDIR) } -# variable, default +# variable, default, [suffix for variable for system() use] defineTest(qtPrepareTool) { $$1 = $$eval(QT_TOOL.$${2}.binary) isEmpty($$1) { @@ -205,16 +205,25 @@ defineTest(qtPrepareTool) { } } } + !isEmpty(3) { + $$1$$3 = $$system_path($$eval($$1)) + qtAddTargetEnv($$1$$3, QT_TOOL.$${2}.depends, system) + } $$1 = $$shell_path($$eval($$1)) qtAddTargetEnv($$1, QT_TOOL.$${2}.depends) } +# target variable, list of env var names, [non-empty: prepare for system(), not make] defineTest(qtAddToolEnv) { + isEmpty(3): \ + ds = $$QMAKE_DIR_SEP + else: \ + ds = $$DIR_SEPARATOR for(env, 2) { value = $$eval($${env}.value) !isEmpty(value) { name = $$eval($${env}.name) - equals(QMAKE_DIR_SEP, /) { + equals(ds, /) { contains($${env}.CONFIG, prepend): infix = \${$$name:+:\$$$name} else: infix = val = "$$name=$$join(value, :)$$infix" @@ -224,7 +233,7 @@ defineTest(qtAddToolEnv) { else: infix = val = "(set $$name=$$join(value, ;)$$infix) &" } - !contains(TEMPLATE, vc.*) { + isEmpty(3): !contains(TEMPLATE, vc.*) { contains(MAKEFILE_GENERATOR, MS.*): val ~= s,%,%%,g val ~= s,\\\$,\$\$,g } @@ -234,12 +243,17 @@ defineTest(qtAddToolEnv) { export($$1) } +# target variable, dependency var name, [non-empty: prepare for system(), not make] defineTest(qtAddTargetEnv) { deps = $$replace($$2, -private$, ) deps = $$resolve_depends(deps, "QT.", ".depends" ".private_depends" ".run_depends") !isEmpty(deps) { - for(dep, deps): \ - deppath += $$shell_path($$eval(QT.$${dep}.libs)) + for(dep, deps) { + isEmpty(3): \ + deppath += $$shell_path($$eval(QT.$${dep}.libs)) + else: \ + deppath += $$system_path($$eval(QT.$${dep}.libs)) + } equals(QMAKE_HOST.os, Windows) { deppath.name = PATH } else:contains(QMAKE_HOST.os, Linux|FreeBSD) { @@ -258,13 +272,18 @@ defineTest(qtAddTargetEnv) { pluginpath.value = for(qmod, QMAKEMODULES) { qmod = $$section(qmod, /, 0, -3)/plugins - exists($$qmod): pluginpath.value += $$shell_path($$qmod) + exists($$qmod) { + isEmpty(3): \ + pluginpath.value += $$shell_path($$qmod) + else: \ + pluginpath.value += $$system_path($$qmod) + } } pluginpath.name = QT_PLUGIN_PATH QT_TOOL_ENV += deppath pluginpath } - qtAddToolEnv($$1, $$QT_TOOL_ENV) + qtAddToolEnv($$1, $$QT_TOOL_ENV, $$3) } defineReplace(pkgConfigExecutable) { diff --git a/mkspecs/features/resources.prf b/mkspecs/features/resources.prf index 34a04b4ee2..68ca4d1442 100644 --- a/mkspecs/features/resources.prf +++ b/mkspecs/features/resources.prf @@ -1,4 +1,4 @@ -qtPrepareTool(QMAKE_RCC, rcc) +qtPrepareTool(QMAKE_RCC, rcc, _DEP) isEmpty(RCC_DIR):RCC_DIR = . isEmpty(QMAKE_MOD_RCC):QMAKE_MOD_RCC = qrc @@ -19,7 +19,7 @@ resource_combine { } } rcc.commands = $$QMAKE_RCC $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT} -rcc.depend_command = $$QMAKE_RCC -list $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN} +rcc.depend_command = $$QMAKE_RCC_DEP -list $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN} rcc.CONFIG += add_inputs_as_makefile_deps rcc.input = RESOURCES rcc.variable_out = SOURCES diff --git a/mkspecs/features/uic.prf b/mkspecs/features/uic.prf index 83e579cb3a..c6a64050e0 100644 --- a/mkspecs/features/uic.prf +++ b/mkspecs/features/uic.prf @@ -1,10 +1,10 @@ -qtPrepareTool(QMAKE_UIC, uic) +qtPrepareTool(QMAKE_UIC, uic, _DEP) isEmpty(UI_DIR):UI_DIR = . isEmpty(QMAKE_MOD_UIC):QMAKE_MOD_UIC = ui_ uic.commands = $$QMAKE_UIC ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT} -uic.depend_command = $$QMAKE_UIC -d ${QMAKE_FILE_IN} +uic.depend_command = $$QMAKE_UIC_DEP -d ${QMAKE_FILE_IN} uic.output = $$UI_DIR/$${QMAKE_MOD_UIC}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)} uic.input = FORMS uic.variable_out = GENERATED_FILES -- cgit v1.2.1 From d135a311a34e693d761a3607663b0879be9bbf65 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 14 Jun 2013 09:50:46 +0200 Subject: make Makefiles not depend on .qmake.super this avoids that an empty rebuild after a complete build re-runs qmake everywhere again. according to 1f83f0cf2a this is the behavior i originally intended, but somehow it got lost when switching to the new interpreter. Change-Id: Id5158d7e272fdee4f4a041fb7c828295a0a86684 Reviewed-by: Joerg Bornemann --- qmake/library/qmakeevaluator.cpp | 4 ++-- qmake/library/qmakeevaluator.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp index c60119615f..6fb9c05ae5 100644 --- a/qmake/library/qmakeevaluator.cpp +++ b/qmake/library/qmakeevaluator.cpp @@ -1222,7 +1222,7 @@ bool QMakeEvaluator::loadSpec() m_qmakespec = QDir::cleanPath(qmakespec); if (!m_superfile.isEmpty() - && evaluateFile(m_superfile, QMakeHandler::EvalConfigFile, LoadProOnly) != ReturnTrue) { + && evaluateFile(m_superfile, QMakeHandler::EvalConfigFile, LoadProOnly|LoadHidden) != ReturnTrue) { return false; } if (!loadSpecInternal()) @@ -1813,7 +1813,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateFile( m_current = m_locationStack.pop(); pro->deref(); #ifdef PROEVALUATOR_FULL - if (ok == ReturnTrue) { + if (ok == ReturnTrue && !(flags & LoadHidden)) { ProStringList &iif = m_valuemapStack.first()[ProKey("QMAKE_INTERNAL_INCLUDED_FILES")]; ProString ifn(fileName); if (!iif.contains(ifn)) diff --git a/qmake/library/qmakeevaluator.h b/qmake/library/qmakeevaluator.h index 59e3295f69..09617ba019 100644 --- a/qmake/library/qmakeevaluator.h +++ b/qmake/library/qmakeevaluator.h @@ -102,7 +102,8 @@ public: LoadPreFiles = 1, LoadPostFiles = 2, LoadAll = LoadPreFiles|LoadPostFiles, - LoadSilent = 0x10 + LoadSilent = 0x10, + LoadHidden = 0x20 }; Q_DECLARE_FLAGS(LoadFlags, LoadFlag) -- cgit v1.2.1 From a5ecb0bcfd0295723ef6c58136397b9455ec482c Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 13 Jun 2013 16:46:50 +0200 Subject: Android Mute and FastForward keys mapped wrong KEYCODE_MEDIA_FAST_FORWARD is mapped to Qt::Key_Forward, which undoes Back. I believe the best match in Qt would be Qt::Key_AudioForward which is also mapped by XCB from XF86XK_AudioForward /* fast-forward audio track */ KEYCODE_MUTE is mapped to Qt::Key_Volume_Mute, but the mute button is for muting the microphone, the volume mute is called KEYCODE_VOLUME_MUTE. Change-Id: Id0b78c9bde78faef1f5d31019693e6c466941d70 Reviewed-by: BogDan Vatra --- src/corelib/global/qnamespace.h | 2 ++ src/corelib/global/qnamespace.qdoc | 1 + src/plugins/platforms/android/src/androidjniinput.cpp | 11 +++++++---- src/plugins/platforms/xcb/qxcbkeyboard.cpp | 2 ++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 74949b86f0..25c47d5d34 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -980,6 +980,8 @@ public: Key_TouchpadOn = 0x01000111, Key_TouchpadOff = 0x01000112, + Key_MicMute = 0x01000113, + Key_MediaLast = 0x0100ffff, // Keypad navigation keys diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 9eb0c6b8f2..f9248eb68d 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -1621,6 +1621,7 @@ \value Key_TouchpadToggle \value Key_TouchpadOn \value Key_TouchpadOff + \value Key_MicMute \value Key_MediaLast \value Key_unknown diff --git a/src/plugins/platforms/android/src/androidjniinput.cpp b/src/plugins/platforms/android/src/androidjniinput.cpp index 29ccfe0125..75cb617ca8 100644 --- a/src/plugins/platforms/android/src/androidjniinput.cpp +++ b/src/plugins/platforms/android/src/androidjniinput.cpp @@ -333,7 +333,7 @@ namespace QtAndroidInput return Qt::Key_BracketLeft; case 0x0000005a: // KEYCODE_MEDIA_FAST_FORWARD - return Qt::Key_Forward; + return Qt::Key_AudioForward; case 0x00000057: return Qt::Key_MediaNext; @@ -344,7 +344,7 @@ namespace QtAndroidInput case 0x00000058: return Qt::Key_MediaPrevious; - case 0x00000059: + case 0x00000059: // KEYCODE_MEDIA_REWIND return Qt::Key_AudioRewind; case 0x00000056: @@ -356,8 +356,8 @@ namespace QtAndroidInput case 0x00000045: return Qt::Key_Minus; - case 0x0000005b: - return Qt::Key_VolumeMute; + case 0x0000005b: // KEYCODE_MUTE + return Qt::Key_MicMute; case 0x0000004e: return Qt::Key_NumLock; @@ -405,6 +405,9 @@ namespace QtAndroidInput case 0x00000019: return Qt::Key_VolumeDown; + case 0x000000a4: // KEYCODE_VOLUME_MUTE + return Qt::Key_VolumeMute; + case 0x00000018: return Qt::Key_VolumeUp; diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp index 155b327315..db53e7471e 100644 --- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp +++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp @@ -248,6 +248,7 @@ #define XF86XK_TouchpadToggle 0x1008FFA9 #define XF86XK_TouchpadOn 0x1008FFB0 #define XF86XK_TouchpadOff 0x1008FFB1 +#define XF86XK_AudioMicMute 0x1008FFB2 // end of XF86keysyms.h @@ -543,6 +544,7 @@ static const unsigned int KeyTbl[] = { XF86XK_TouchpadToggle, Qt::Key_TouchpadToggle, XF86XK_TouchpadOn, Qt::Key_TouchpadOn, XF86XK_TouchpadOff, Qt::Key_TouchpadOff, + XF86XK_AudioMicMute, Qt::Key_MicMute, XF86XK_Launch0, Qt::Key_Launch2, // ### Qt 6: remap properly XF86XK_Launch1, Qt::Key_Launch3, XF86XK_Launch2, Qt::Key_Launch4, -- cgit v1.2.1 From cf8647d6aa0f65a51dc9366d407b2218f561970d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 18 Jun 2013 14:18:10 +0200 Subject: Remove unused member QFactoryLoaderPrivate::keyList. Task-number: QTBUG-31476 Change-Id: Ife9b25ede67837152d94cd500a1d7c6dc6cd8ab8 Reviewed-by: Lars Knoll --- src/corelib/plugin/qfactoryloader.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp index 289fda7afc..943fb35ab6 100644 --- a/src/corelib/plugin/qfactoryloader.cpp +++ b/src/corelib/plugin/qfactoryloader.cpp @@ -72,7 +72,6 @@ public: QByteArray iid; QList libraryList; QMap keyMap; - QStringList keyList; QString suffix; Qt::CaseSensitivity cs; QStringList loadedPaths; @@ -172,10 +171,8 @@ void QFactoryLoader::update() metaDataOk = true; QJsonArray k = object.value(QLatin1String("Keys")).toArray(); - for (int i = 0; i < k.size(); ++i) { - QString s = k.at(i).toString(); - keys += s; - } + for (int i = 0; i < k.size(); ++i) + keys += d->cs ? k.at(i).toString() : k.at(i).toString().toLower(); } if (qt_debug_component()) qDebug() << "Got keys from plugin meta data" << keys; @@ -192,9 +189,7 @@ void QFactoryLoader::update() // library was built with a future Qt version, // whereas the new one has a Qt version that fits // better - QString key = keys.at(k); - if (!d->cs) - key = key.toLower(); + const QString &key = keys.at(k); QLibraryPrivate *previous = d->keyMap.value(key); int prev_qt_version = 0; if (previous) { @@ -203,7 +198,6 @@ void QFactoryLoader::update() int qt_version = (int)library->metaData.value(QLatin1String("version")).toDouble(); if (!previous || (prev_qt_version > QT_VERSION && qt_version <= QT_VERSION)) { d->keyMap[key] = library; - d->keyList += keys.at(k); } } } -- cgit v1.2.1 From 732dcfe7fdfa7534ab0de4674ae17f191167a57a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 18 Jun 2013 14:48:21 +0200 Subject: QFactoryLoader: Release unused libraries. Task-number: QTBUG-31476 Change-Id: Ib2eb076afaa21ab1fdc12944f80483e3de260d4b Reviewed-by: Lars Knoll --- src/corelib/plugin/qfactoryloader.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp index 943fb35ab6..1288643e32 100644 --- a/src/corelib/plugin/qfactoryloader.cpp +++ b/src/corelib/plugin/qfactoryloader.cpp @@ -183,7 +183,7 @@ void QFactoryLoader::update() continue; } - d->libraryList += library; + int keyUsageCount = 0; for (int k = 0; k < keys.count(); ++k) { // first come first serve, unless the first // library was built with a future Qt version, @@ -198,8 +198,13 @@ void QFactoryLoader::update() int qt_version = (int)library->metaData.value(QLatin1String("version")).toDouble(); if (!previous || (prev_qt_version > QT_VERSION && qt_version <= QT_VERSION)) { d->keyMap[key] = library; + ++keyUsageCount; } } + if (keyUsageCount || keys.isEmpty()) + d->libraryList += library; + else + library->release(); } } #else -- cgit v1.2.1 From 021264a239c7c5f30263a59a73f08e482142b291 Mon Sep 17 00:00:00 2001 From: Venu Date: Fri, 14 Jun 2013 17:35:29 +0200 Subject: Tagged all those examples that work on an Android device MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change enables the developers to list all the tagged examples on the Qt Creator welcome screen using the "android" tag. Task-number: QTBUG-30173 Change-Id: Ic09183eb441497506b2d35f0d83ecd5d73d724f5 Reviewed-by: Jerome Pasion Reviewed-by: Topi Reiniö Reviewed-by: Christian Stromme --- doc/global/manifest-meta.qdocconf | 101 +++++++++++++++++++++++++++++++++++++- 1 file changed, 100 insertions(+), 1 deletion(-) diff --git a/doc/global/manifest-meta.qdocconf b/doc/global/manifest-meta.qdocconf index 9dd6cbfb43..a86f3a14e4 100644 --- a/doc/global/manifest-meta.qdocconf +++ b/doc/global/manifest-meta.qdocconf @@ -32,7 +32,7 @@ # manifestmeta.global.names = * # manifestmeta.global.tags = qt5 -manifestmeta.filters = highlighted webkit1 webkit2 +manifestmeta.filters = highlighted webkit1 webkit2 android manifestmeta.highlighted.names = "QtQuick/Qt Quick Demo - Same Game" \ "QtQuick/Qt Quick Demo - Photo Surface" \ @@ -69,3 +69,102 @@ manifestmeta.webkit2.names = "QtWebKitExamples/Flickr View Example" \ "QtWebKitExamples/YouTube View Example" manifestmeta.webkit2.tags = webkit2 + +manifestmeta.android.names = "QtQuick/Qt Quick Demo - Maroon*" \ + "QtQuick/Qt Quick Demo - Calqlatr" \ + "QtWidgets/Application Chooser Example" \ + "QtWidgets/Stickman Example" \ + "QtWidgets/Move Blocks Example" \ + "QtWidgets/Border Layout Example" \ + "QtWidgets/Dynamic Layouts Example" \ + "QtWidgets/Flow Layout Example" \ + "QtWidgets/MDI Example" \ + "QtWidgets/Dock Widgets Example" \ + "QtWidgets/Recent Files Example" \ + "QtWidgets/Menus Example" \ + "QtWidgets/Concentric Circles Example" \ + "QtWidgets/Gradients" \ + "QtWidgets/Font Sampler Example" \ + "QtWidgets/Path Stroking" \ + "QtWidgets/Transformations Example" \ + "QtWidgets/Syntax Highlighter Example" \ + "QtWidgets/Calendar Example" \ + "QtWidgets/Movie Example" \ + "QtWidgets/Validators Example" \ + "QtWidgets/Analog Clock Example" \ + "QtWidgets/Calculator Example" \ + "QtWidgets/Mouse Button Tester" \ + "QtWidgets/Character Map Example" \ + "QtWidgets/Wiggly Example" \ + "QtWidgets/Digital Clock Example" \ + "QtWidgets/Elided Label Example" \ + "QtWidgets/Image Viewer Example" \ + "QtWidgets/Sliders Example" \ + "QtWidgets/Tetrix Example" \ + "QtWidgets/Group Box Example" \ + "QtWidgets/Spin Boxes Example" \ + "QtWidgets/Undo Framework" \ + "QtWidgets/Regular Expressions Example" \ + "QtWidgets/Colliding Mice Example" \ + "QtWidgets/Basic Graphics Layouts Example" \ + "QtWidgets/Boxes" \ + "QtWidgets/40000 Chips" \ + "QtWidgets/Diagram Scene Example" \ + "QtWidgets/Drag and Drop Robot Example" \ + "QtWidgets/Elastic Nodes Example" \ + "QtWidgets/Pad Navigator Example" \ + "QtWidgets/Anchor Layout Example" \ + "QtWidgets/Weather Anchor Layout Example" \ + "QtConcurrent/Image Scaling Example" \ + "QtConcurrent/QtConcurrent Progress Dialog Example" \ + "QtNetwork/Torrent Example" \ + "QtNetwork/Network Chat Example" \ + "QtSQL/Master Detail Example" \ + "QtOpenGL/Cube OpenGL ES 2.0 example" \ + "QtOpenGL/Textures Example" \ + "QtLinguist/Arrow Pad Example" \ + "QtGui/Raster Window Example" \ + "QtGui/Analog Clock Window Example" \ + "QtMultimedia/Video Widget Example" \ + "QtMultimedia/Media Player Example" \ + "QtSVG/Text Object Example" \ + "QtQML/Qt Quick Examples - XMLHttpRequest" \ + "QtQuick/Qt Quick Particles Examples - *" \ + "QtQuick/Qt Quick Examples - Touch Interaction" \ + "QtQuick/Scene Graph - *" \ + "QtQuick/Qt Quick Examples - Image Elements" \ + "QtQuick/Qt Quick Examples - Key Interaction" \ + "QtQuick/Qt Quick Examples - Text" \ + "QtQuick/Qt Quick Examples - Animation" \ + "QtQuick/Qt Quick Examples - Shader Effects" \ + "QtQuick/Qt Quick Examples - Canvas" \ + "QtWidgets/Interview" \ + "QtWidgets/Spreadsheet" \ + "QtWidgets/Pixelator Example" \ + "QtWidgets/Class Wizard Example" \ + "QtWidgets/Animated Tiles Example" \ + "QtWidgets/Basic Layouts Example" \ + "QtWidgets/Application Example" \ + "QtWidgets/Affine Transformations" \ + "QtWidgets/Image Composition Example" \ + "QtWidgets/Basic Drawing Example" \ + "QtWidgets/Vector Deformation" \ + "QtWidgets/Painter Paths Example" \ + "QtWidgets/Text Edit" \ + "QtWidgets/Style Sheet Example" \ + "QtWidgets/Code Editor Example" \ + "QtWidgets/Window Flags Example" \ + "QtWidgets/Scribble Example" \ + "QtWidgets/Shaped Clock Example" \ + "QtWidgets/Line Edits Example" \ + "QtWidgets/Calendar Widget Example" \ + "QtWidgets/Completer Example" \ + "QtWidgets/I18N Example" \ + "QtQML/Extending QML - Grouped Properties Example" \ + "QtQML/Extending QML - Methods Example" \ + "QtQML/Extending QML - Signal Support Example" \ + "QtQML/Extending QML - Attached Properties Example" \ + "QtQuick/Qt Quick Examples - Window and Screen" \ + "QtWidgets/Address Book Example" + +manifestmeta.android.tags = android -- cgit v1.2.1 From f5e0ec5e16506166ba6a83d0e024a65a219035b8 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Wed, 19 Jun 2013 11:14:51 +0200 Subject: update QtNetwork changelog for 5.1.0 Change-Id: I6392fd125657c4a4a3abb4607fa31bb0d8c0fdd6 Reviewed-by: Richard J. Moore --- dist/changes-5.1.0 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dist/changes-5.1.0 b/dist/changes-5.1.0 index cb96c2debe..bc0db0b9c8 100644 --- a/dist/changes-5.1.0 +++ b/dist/changes-5.1.0 @@ -88,7 +88,16 @@ QtGui QtNetwork --------- - - + - QNetworkAccessManager / QNetworkReply: + * Add a new encrypted() signal so that applications can perform + additional checks on the certificate chain. + - QSslSocket: + * Support for sending intermediate certificates when QSslSocket is used + as a server, and when using client certificates. + - HTTPS internals: + * SSL sessions are re-used by default. + - QHostInfo: + * Allow QHostInfo::lookupHost() with no receiver to warm the DNS cache. QtWidgets --------- -- cgit v1.2.1 From 172fa29dffef0eb55378f62b3ea1c18810639b3f Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 19 Jun 2013 18:07:40 +0200 Subject: fix LD_LIBRARY_PATH manipulation in uic calls not being make-escaped the evaluator has the bug that function arguments are inherited. work around that by passing an explicitly empty 3rd parameter to qtAddTargetEnv(). proper fix upcoming in less critical branch. Change-Id: Ic45cc890abaa6271985590d4ebe02c96bff6dec4 Reviewed-by: Kai Koehne Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_functions.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index 63ae62c42e..699c42ee1f 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -210,7 +210,7 @@ defineTest(qtPrepareTool) { qtAddTargetEnv($$1$$3, QT_TOOL.$${2}.depends, system) } $$1 = $$shell_path($$eval($$1)) - qtAddTargetEnv($$1, QT_TOOL.$${2}.depends) + qtAddTargetEnv($$1, QT_TOOL.$${2}.depends, ) } # target variable, list of env var names, [non-empty: prepare for system(), not make] -- cgit v1.2.1 From 07a727f8b8ca2ebdb77d2e7edd3b79508683845e Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Thu, 20 Jun 2013 12:05:27 +0200 Subject: Android: handle keyboard connect/disconnect Even though the documentation says that "This should never normally happen", we do get a "navigation" change when an external keyboard is connected or disconnected. Thanks to BogDan for finding the solution. Task-number: QTBUG-31806 Change-Id: Id92639800e617821976f842f93e09517529e14ef Reviewed-by: BogDan Vatra --- src/android/java/AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/android/java/AndroidManifest.xml b/src/android/java/AndroidManifest.xml index 48fb23ab28..2a6f52b315 100644 --- a/src/android/java/AndroidManifest.xml +++ b/src/android/java/AndroidManifest.xml @@ -1,7 +1,7 @@ - + -- cgit v1.2.1 From ad43d9a09779cf57410d0ae68513a8dc59187183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 19 Jun 2013 14:21:40 +0200 Subject: Fix missing focus events for mapped child windows Its a bit brutal Task-number: QTBUG-31776 Change-Id: I2d8b530646d1e2b2ba86f0e82d76f928c9a2bb11 Reviewed-by: Gunnar Sletta --- src/plugins/platforms/xcb/qxcbwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 6291396e6e..e1bc7d36eb 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -1367,10 +1367,10 @@ void QXcbWindow::requestActivateWindow() event.data.data32[4] = 0; Q_XCB_CALL(xcb_send_event(xcb_connection(), 0, m_screen->root(), XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (const char *)&event)); - } else { - Q_XCB_CALL(xcb_set_input_focus(xcb_connection(), XCB_INPUT_FOCUS_PARENT, m_window, connection()->time())); } + Q_XCB_CALL(xcb_set_input_focus(xcb_connection(), XCB_INPUT_FOCUS_PARENT, m_window, connection()->time())); + connection()->sync(); } -- cgit v1.2.1 From 531b7d303e96c8fbc54aad0775b99e04599f8642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Thu, 20 Jun 2013 09:53:22 +0200 Subject: Fix missing shortcuts for WindowContainers Change-Id: Iee2d97e1ff2b1f0c56b1dde4f3ce22a427fbe554 Reviewed-by: Gunnar Sletta --- src/widgets/kernel/qapplication.cpp | 49 +++++++++++++++++++++++-------------- src/widgets/kernel/qshortcut.cpp | 27 ++++++++++++++++++++ 2 files changed, 58 insertions(+), 18 deletions(-) diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index edd7cafd83..0da9460794 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -2840,6 +2840,37 @@ bool QApplication::notify(QObject *receiver, QEvent *e) break; } + switch (e->type()) { + case QEvent::KeyPress: + { + bool isWidget = receiver->isWidgetType(); + bool isWindow = receiver->isWindowType(); + bool isGraphicsWidget = false; +#ifndef QT_NO_GRAPHICSVIEW + isGraphicsWidget = !isWidget && !isWindow && qobject_cast(receiver); +#endif + if (!isWidget && !isGraphicsWidget && !isWindow) { + return d->notify_helper(receiver, e); + } + + QKeyEvent* key = static_cast(e); +#ifndef QT_NO_SHORTCUT + // Try looking for a Shortcut before sending key events + if (qApp->d_func()->shortcutMap.tryShortcutEvent(receiver, key)) + return true; +#endif + qt_in_tab_key_event = (key->key() == Qt::Key_Backtab + || key->key() == Qt::Key_Tab + || key->key() == Qt::Key_Left + || key->key() == Qt::Key_Up + || key->key() == Qt::Key_Right + || key->key() == Qt::Key_Down); + + } + default: + break; + } + bool res = false; if (!receiver->isWidgetType()) { res = d->notify_helper(receiver, e); @@ -2853,25 +2884,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e) #ifndef QT_NO_GRAPHICSVIEW isGraphicsWidget = !isWidget && qobject_cast(receiver); #endif - if (!isWidget && !isGraphicsWidget) { - res = d->notify_helper(receiver, e); - break; - } - QKeyEvent* key = static_cast(e); - if (key->type()==QEvent::KeyPress) { -#ifndef QT_NO_SHORTCUT - // Try looking for a Shortcut before sending key events - if ((res = qApp->d_func()->shortcutMap.tryShortcutEvent(receiver, key))) - return res; -#endif - qt_in_tab_key_event = (key->key() == Qt::Key_Backtab - || key->key() == Qt::Key_Tab - || key->key() == Qt::Key_Left - || key->key() == Qt::Key_Up - || key->key() == Qt::Key_Right - || key->key() == Qt::Key_Down); - } bool def = key->isAccepted(); QPointer pr = receiver; while (receiver) { diff --git a/src/widgets/kernel/qshortcut.cpp b/src/widgets/kernel/qshortcut.cpp index c5cdce3d60..471b054a99 100644 --- a/src/widgets/kernel/qshortcut.cpp +++ b/src/widgets/kernel/qshortcut.cpp @@ -51,6 +51,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE @@ -86,6 +87,20 @@ bool qWidgetShortcutContextMatcher(QObject *object, Qt::ShortcutContext context) if (QApplication::activePopupWidget()) active_window = QApplication::activePopupWidget(); + if (!active_window) { + QWindow *qwindow = QGuiApplication::focusWindow(); + if (qwindow && qwindow->isActive()) { + while (qwindow) { + QWidgetWindow *widgetWindow = qobject_cast(qwindow); + if (widgetWindow) { + active_window = widgetWindow->widget(); + break; + } + qwindow = qwindow->parent(); + } + } + } + if (!active_window) return false; @@ -106,6 +121,18 @@ bool qWidgetShortcutContextMatcher(QObject *object, Qt::ShortcutContext context) w = s->parentWidget(); } + if (!w) { + QWindow *qwindow = qobject_cast(object); + while (qwindow) { + QWidgetWindow *widget_window = qobject_cast(qwindow); + if (widget_window) { + w = widget_window->widget(); + break; + } + qwindow = qwindow->parent(); + } + } + if (!w) return false; -- cgit v1.2.1 From 91ca90d89601468e3891d85449567b05bf64ecad Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 21 Jun 2013 14:50:06 +0200 Subject: CMake: Fix test for value starting with -L Change-Id: I02ba45beca09c2eb1b1fbdc2a8f6efbc783bd72d Reviewed-by: Oswald Buddenhagen --- mkspecs/features/cmake_functions.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/cmake_functions.prf b/mkspecs/features/cmake_functions.prf index a67fd9af9b..2dc72a7a2f 100644 --- a/mkspecs/features/cmake_functions.prf +++ b/mkspecs/features/cmake_functions.prf @@ -54,7 +54,7 @@ defineReplace(cmakeProcessLibs) { variable = $$1 out = for(v, variable) { - if(!equals(v, -framework):!equals(v, -L.*)) { + if(!equals(v, -framework):!contains(v, -L.*)) { v ~= s,^-l,, v ~= s,^-lib,, v ~= s,.lib$,, -- cgit v1.2.1 From a4f7bb8733e048fbc6741189b7ceeb3e79af7f38 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 19 Jun 2013 12:24:57 +0200 Subject: Widgets: Set qt_button_down for each press. Do not rely on release events. Task-number: QTBUG-31333 Change-Id: I09a056fed8892715c04ca78a42ae191e5a9a3b42 Reviewed-by: Joerg Bornemann Reviewed-by: Shawn Rutledge --- src/widgets/kernel/qwidgetwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp index c19b617091..18dd3156c6 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -446,7 +446,7 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event) if (!widget) widget = m_widget; - if (event->type() == QEvent::MouseButtonPress && !qt_button_down) + if (event->type() == QEvent::MouseButtonPress) qt_button_down = widget; QWidget *receiver = QApplicationPrivate::pickMouseReceiver(m_widget, event->windowPos().toPoint(), &mapped, event->type(), event->buttons(), -- cgit v1.2.1 From d3190572cc9b10d7ae2d8a5066ef44c35056b34a Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Fri, 21 Jun 2013 00:29:07 +1000 Subject: Use BSD licensing for QtOpenGLExtensions instead of LGPL BSD licensing should be used for QtOpenGLExtensions instead of LGPL as it is a static library that is linked into applications. Using LGPL would impose additional requirements for application developers to provide object files to end users to be able to relink the application with a modified or updated QtOpenGLExtensions static library. Task-number: QTBUG-29918 Change-Id: I0bb80f8ba5158be0a71fe4c5e1c37787ce21337d Reviewed-by: Sean Harmer Reviewed-by: Lars Knoll --- src/openglextensions/qopenglextensions.cpp | 51 +++++++++++++++--------------- src/openglextensions/qopenglextensions.h | 51 +++++++++++++++--------------- util/glgen/qopenglextensions.cpp.header | 51 +++++++++++++++--------------- util/glgen/qopenglextensions.h.header | 51 +++++++++++++++--------------- 4 files changed, 100 insertions(+), 104 deletions(-) diff --git a/src/openglextensions/qopenglextensions.cpp b/src/openglextensions/qopenglextensions.cpp index 2119a86ccf..58bd31a339 100644 --- a/src/openglextensions/qopenglextensions.cpp +++ b/src/openglextensions/qopenglextensions.cpp @@ -5,35 +5,34 @@ ** ** This file is part of the QtGui module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. ** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/openglextensions/qopenglextensions.h b/src/openglextensions/qopenglextensions.h index 7d6c21e4e5..78bbf4b0cb 100644 --- a/src/openglextensions/qopenglextensions.h +++ b/src/openglextensions/qopenglextensions.h @@ -5,35 +5,34 @@ ** ** This file is part of the QtGui module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. ** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/util/glgen/qopenglextensions.cpp.header b/util/glgen/qopenglextensions.cpp.header index 6a9f639d5d..a3a9a9fa73 100644 --- a/util/glgen/qopenglextensions.cpp.header +++ b/util/glgen/qopenglextensions.cpp.header @@ -5,35 +5,34 @@ ** ** This file is part of the QtGui module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. ** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/util/glgen/qopenglextensions.h.header b/util/glgen/qopenglextensions.h.header index b83b081166..c13ba37b39 100644 --- a/util/glgen/qopenglextensions.h.header +++ b/util/glgen/qopenglextensions.h.header @@ -5,35 +5,34 @@ ** ** This file is part of the QtGui module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. ** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** -- cgit v1.2.1 From d0d158f0921fbcc67ac33eedc69684c1b3b389a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 24 Jun 2013 10:58:03 +0200 Subject: Mac: Ensure that C++11 is always used when linking against a static Qt build If Qt was built with C++11, it links to libc++, and we need all projects that use Qt to link against the same library. Technically, we could do QMAKE_LFLAGS += -stdlib=libc++, but that hasn't been tested enough without also enabling C++11, so we keep the relationship between the two for now. Change-Id: Ic628bcbade60cc82f93707f372c2119c24d9dc8a Reviewed-by: Oswald Buddenhagen Reviewed-by: Liang Qi --- mkspecs/features/mac/default_post.prf | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf index 0538a81771..b183814e63 100644 --- a/mkspecs/features/mac/default_post.prf +++ b/mkspecs/features/mac/default_post.prf @@ -1,12 +1,12 @@ load(default_post) !no_objective_c:CONFIG += objective_c -# Pick a suitable default architecture for qmake-based applications. -# If the Qt package contains one of x86 and x86_64, pick that one. If it -# contains both then use the compiler default. Make a similiar decision for -# PowerPC-based systems. Note that this logic assumes that Qt has been -# configured with an architecture that is usable on the system. qt:!isEmpty(QT_CONFIG) { + # Pick a suitable default architecture for qmake-based applications. + # If the Qt package contains one of x86 and x86_64, pick that one. If it + # contains both then use the compiler default. Make a similar decision for + # PowerPC-based systems. Note that this logic assumes that Qt has been + # configured with an architecture that is usable on the system. contains(QMAKE_HOST.arch, ppc)|contains(QMAKE_HOST.arch, "Power Macintosh") { !contains(QT_CONFIG, ppc64):contains(QT_CONFIG, ppc):CONFIG += ppc contains(QT_CONFIG, ppc64):!contains(QT_CONFIG, ppc):CONFIG += ppc64 @@ -14,6 +14,9 @@ qt:!isEmpty(QT_CONFIG) { !contains(QT_CONFIG, x86_64):contains(QT_CONFIG, x86):CONFIG += x86 contains(QT_CONFIG, x86_64):!contains(QT_CONFIG, x86):CONFIG += x86_64 } + + # Ensure that C++11 is always used when linking against a static Qt build + contains(QT_CONFIG, static):contains(QT_CONFIG, c++11): CONFIG += c++11 } isEmpty(_QMAKE_CACHE_) { -- cgit v1.2.1 From 74ca6034e413dc7ae8203d8eef1264357023d8af Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 19 Jun 2013 12:32:45 +0200 Subject: Fix QDir::mkpath failing for drive paths on Windows This fixes a regression introduced in 3e2cd8ef6f1ce4f467. We shouldn't try to call mkdir for just a drive letter. Task-number: QTBUG-31862 Change-Id: I56035857aec03f9f1cceef62e82f372486b7737b Reviewed-by: Oswald Buddenhagen Reviewed-by: Shawn Rutledge Reviewed-by: Kai Koehne --- src/corelib/io/qfilesystemengine_win.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp index fdbd6e01e4..2c9ed9da3d 100644 --- a/src/corelib/io/qfilesystemengine_win.cpp +++ b/src/corelib/io/qfilesystemengine_win.cpp @@ -1034,6 +1034,10 @@ bool QFileSystemEngine::createDirectory(const QFileSystemEntry &entry, bool crea } if (oldslash != -1) oldslash = dirName.indexOf(QDir::separator(), oldslash); + } else if (dirName.size() > 2 + && dirName.at(1) == QLatin1Char(':')) { + // Don't try to call mkdir with just a drive letter + oldslash = 2; } for (int slash=0; slash != -1; oldslash = slash) { slash = dirName.indexOf(QDir::separator(), oldslash+1); -- cgit v1.2.1 From 1723a9861f5f8eb537b2b39533561a86b5d389f0 Mon Sep 17 00:00:00 2001 From: Bjoern Breitmeyer Date: Thu, 16 May 2013 17:35:48 +0200 Subject: Fixed testbuild with QT_NO_CURSOR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed the QCursor entry from the list of types if QT_NO_CURSOR is set. Change-Id: I6b8e925acedec75ed6e46b2e3fe34d0011667c91 Reviewed-by: Friedemann Kleint Reviewed-by: Eskil Abrahamsen Blomfeldt Reviewed-by: Thomas McGuire Reviewed-by: Jędrzej Nowacki --- tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp b/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp index da2c961558..1839b0670c 100644 --- a/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp +++ b/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp @@ -66,7 +66,7 @@ private slots: void constructCopy(); }; -#define FOR_EACH_GUI_METATYPE(F) \ +#define FOR_EACH_GUI_METATYPE_BASE(F) \ F(QFont, QFont) \ F(QPixmap, QPixmap) \ F(QBrush, QBrush) \ @@ -76,7 +76,6 @@ private slots: F(QPolygon, QPolygon) \ F(QRegion, QRegion) \ F(QBitmap, QBitmap) \ - F(QCursor, QCursor) \ F(QKeySequence, QKeySequence) \ F(QPen, QPen) \ F(QTextLength, QTextLength) \ @@ -89,6 +88,16 @@ private slots: F(QVector4D, QVector4D) \ F(QQuaternion, QQuaternion) +#ifndef QTEST_NO_CURSOR +# define FOR_EACH_GUI_METATYPE(F) \ + FOR_EACH_GUI_METATYPE_BASE(F) \ + F(QCursor, QCursor) +#else // !QTEST_NO_CURSOR +# define FOR_EACH_GUI_METATYPE(F) \ + FOR_EACH_GUI_METATYPE_BASE(F) +#endif // !QTEST_NO_CURSOR + + namespace { template struct static_assert_trigger { -- cgit v1.2.1 From bd97768ae54d643270e824f74d152892dbea1b9f Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Sun, 2 Jun 2013 06:03:08 -0400 Subject: Update for the newest Darwin-family operating systems. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ib90296e35f8aa8d63692cf03ba9ffcb94a1a7687 Reviewed-by: Tor Arne Vestbø --- src/corelib/global/qglobal.cpp | 8 +++++--- src/corelib/global/qsysinfo.h | 4 +++- src/corelib/global/qsystemdetection.h | 11 ++++++++++- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 6f63a0d9d3..7a00e4eb32 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1042,7 +1042,7 @@ bool qSharedBuild() Q_DECL_NOTHROW \enum QSysInfo::MacVersion This enum provides symbolic names for the various versions of the - Macintosh operating system. On Mac, the + OS X operating system. On OS X, the QSysInfo::MacintoshVersion variable gives the version of the system on which the application is run. @@ -1054,8 +1054,9 @@ bool qSharedBuild() Q_DECL_NOTHROW \value MV_10_4 Mac OS X 10.4 (unsupported) \value MV_10_5 Mac OS X 10.5 (unsupported) \value MV_10_6 Mac OS X 10.6 - \value MV_10_7 Mac OS X 10.7 - \value MV_10_8 Mac OS X 10.8 + \value MV_10_7 OS X 10.7 + \value MV_10_8 OS X 10.8 + \value MV_10_9 OS X 10.9 \value MV_Unknown An unknown and currently unsupported platform \value MV_CHEETAH Apple codename for MV_10_0 @@ -1067,6 +1068,7 @@ bool qSharedBuild() Q_DECL_NOTHROW \value MV_SNOWLEOPARD Apple codename for MV_10_6 \value MV_LION Apple codename for MV_10_7 \value MV_MOUNTAINLION Apple codename for MV_10_8 + \value MV_MAVERICKS Apple codename for MV_10_9 \sa WinVersion */ diff --git a/src/corelib/global/qsysinfo.h b/src/corelib/global/qsysinfo.h index 58939cc013..a6accdfebc 100644 --- a/src/corelib/global/qsysinfo.h +++ b/src/corelib/global/qsysinfo.h @@ -132,6 +132,7 @@ public: MV_10_6 = 0x0008, MV_10_7 = 0x0009, MV_10_8 = 0x000A, + MV_10_9 = 0x000B, /* codenames */ MV_CHEETAH = MV_10_0, @@ -142,7 +143,8 @@ public: MV_LEOPARD = MV_10_5, MV_SNOWLEOPARD = MV_10_6, MV_LION = MV_10_7, - MV_MOUNTAINLION = MV_10_8 + MV_MOUNTAINLION = MV_10_8, + MV_MAVERICKS = MV_10_9 }; static const MacVersion MacintoshVersion; static MacVersion macVersion(); diff --git a/src/corelib/global/qsystemdetection.h b/src/corelib/global/qsystemdetection.h index 690442d066..cb55fa808b 100644 --- a/src/corelib/global/qsystemdetection.h +++ b/src/corelib/global/qsystemdetection.h @@ -207,12 +207,18 @@ # if !defined(__MAC_10_8) # define __MAC_10_8 1080 # endif +# if !defined(__MAC_10_9) +# define __MAC_10_9 1090 +# endif # if !defined(MAC_OS_X_VERSION_10_7) # define MAC_OS_X_VERSION_10_7 1070 # endif # if !defined(MAC_OS_X_VERSION_10_8) # define MAC_OS_X_VERSION_10_8 1080 # endif +# if !defined(MAC_OS_X_VERSION_10_9) +# define MAC_OS_X_VERSION_10_9 1090 +# endif # # if !defined(__IPHONE_4_3) # define __IPHONE_4_3 40300 @@ -229,9 +235,12 @@ # if !defined(__IPHONE_6_1) # define __IPHONE_6_1 60100 # endif +# if !defined(__IPHONE_7_0) +# define __IPHONE_7_0 70000 +# endif # # if (__MAC_OS_X_VERSION_MAX_ALLOWED > __MAC_10_8) -# warning "This version of Mac OS X is unsupported" +# warning "This version of OS X is unsupported" # endif #endif -- cgit v1.2.1 From d0e82ede558b4c7b0f1a89b28a224cf77a3fc068 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 17 Jun 2013 21:09:43 +0200 Subject: mac framework build: always set QMAKE_FRAMEWORKPATH don't mess with the -F linker flag manually. qt headers include other headers via the canonical Module/Header syntax, which means that the compiler also needs the -F flag. QMAKE_FRAMEWORKPATH does exactly that. Task-number: QTBUG-29003 Change-Id: I5f4af1a462697cd6996c54436ccdb9fc2b216020 Reviewed-by: Andy Shaw Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_functions.prf | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index 699c42ee1f..1d34ad5d63 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -80,10 +80,8 @@ defineTest(qtAddModule) { FRAMEWORK_INCLUDE = $${MODULE_LIBS}/$${MODULE_NAME}.framework/Headers !qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) { INCLUDEPATH *= $$FRAMEWORK_INCLUDE - LINKAGE = -F$${MODULE_LIBS} - } else { - QMAKE_FRAMEWORKPATH *= $${MODULE_LIBS} } + QMAKE_FRAMEWORKPATH *= $${MODULE_LIBS} LINKAGE += -framework $${MODULE_NAME}$${QT_LIBINFIX} } } -- cgit v1.2.1 From 7090d4a4584bcde41e2156ed155127165af42e49 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 19 Jun 2013 16:35:59 +0200 Subject: un-nest conditionals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit it's cleaner, and it makes it possible to actually have a single else branch. Change-Id: I5ef917b678e2bd5a2face8ee19e942e5e952aa80 Reviewed-by: Tor Arne Vestbø --- mkspecs/features/qt_functions.prf | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index 1d34ad5d63..d58421ea59 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -75,15 +75,13 @@ defineTest(qtAddModule) { } unset(LINKAGE) - mac { - contains(MODULE_CONFIG, lib_bundle) { + mac:contains(MODULE_CONFIG, lib_bundle) { FRAMEWORK_INCLUDE = $${MODULE_LIBS}/$${MODULE_NAME}.framework/Headers !qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) { INCLUDEPATH *= $$FRAMEWORK_INCLUDE } QMAKE_FRAMEWORKPATH *= $${MODULE_LIBS} LINKAGE += -framework $${MODULE_NAME}$${QT_LIBINFIX} - } } # Re-insert the major version in the library name (cf qtLibraryTarget above) -- cgit v1.2.1 From c0d5a4ee12afc602734101c8bb41d66b29a9b13c Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 17 Jun 2013 21:33:06 +0200 Subject: don't needlessly do QMAKE_BUNDLE_DATA+=FRAMEWORK_HEADERS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit there is no point in adding a structure we don't actually define. Change-Id: Ica43123f17eca6ebd4b5b7ec2526ebabef31c82a Reviewed-by: Tor Arne Vestbø --- mkspecs/features/qt_module.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index 429e00bed9..6567dc8657 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -97,8 +97,8 @@ mac:CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) { FRAMEWORK_HEADERS.version = Versions FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES FRAMEWORK_HEADERS.path = Headers + QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS } - QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS } } -- cgit v1.2.1 From 7ea8c9d0f07acd2b7622ce2c8bc8d7d0570a0395 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 19 Jun 2013 13:30:04 +0200 Subject: install private headers into frameworks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-31641 Change-Id: Ifadc380c0a8983b2be93194e2e2257494b13dff8 Reviewed-by: Tor Arne Vestbø --- mkspecs/features/qt_functions.prf | 4 ++++ mkspecs/features/qt_module.prf | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index d58421ea59..bbbb5d36a3 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -80,6 +80,10 @@ defineTest(qtAddModule) { !qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) { INCLUDEPATH *= $$FRAMEWORK_INCLUDE } + auto_use_privates|isEqual(2, UsePrivate): \ + INCLUDEPATH += \ + $$FRAMEWORK_INCLUDE/$$eval(QT.$${1}.VERSION) \ + $$FRAMEWORK_INCLUDE/$$eval(QT.$${1}.VERSION)/$$MODULE_NAME QMAKE_FRAMEWORKPATH *= $${MODULE_LIBS} LINKAGE += -framework $${MODULE_NAME}$${QT_LIBINFIX} } diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index 6567dc8657..20a7c0e81f 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -97,7 +97,10 @@ mac:CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) { FRAMEWORK_HEADERS.version = Versions FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES FRAMEWORK_HEADERS.path = Headers - QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS + FRAMEWORK_PRIVATE_HEADERS.version = Versions + FRAMEWORK_PRIVATE_HEADERS.files = $$SYNCQT.PRIVATE_HEADER_FILES + FRAMEWORK_PRIVATE_HEADERS.path = Headers/$$VERSION/$$MODULE_INCNAME + QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS FRAMEWORK_PRIVATE_HEADERS } } } -- cgit v1.2.1 From 6d61dfdbb74a2055438b999c6962f89cc3388eea Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 18 Jun 2013 14:25:20 +0200 Subject: disable non-framework header install also for debug builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit i see no particular reason why debug builds should still get "normal" headers. Change-Id: I3625648549e8c234a365bab26823190ed2219cdf Reviewed-by: Tor Arne Vestbø --- mkspecs/features/qt_module.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index 20a7c0e81f..d349c26e53 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -91,9 +91,9 @@ else: \ mac:CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) { #QMAKE_FRAMEWORK_VERSION = 4.0 CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework + CONFIG -= qt_install_headers #no need to install these as well CONFIG(release, debug|release) { !debug_and_release|build_pass { - CONFIG -= qt_install_headers #no need to install these as well FRAMEWORK_HEADERS.version = Versions FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES FRAMEWORK_HEADERS.path = Headers -- cgit v1.2.1 From 01270cf6723fa3951b2129deeb0e3c1983448f63 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 18 Jun 2013 14:36:10 +0200 Subject: fix bundled header creation for debug builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the only case where we want to skip copying the bundled data (which is an optimization only) is the debug sub-build when we are actually building both debug and release. Change-Id: I1f3f67ccd9a64033b133ffaf58639cd9f7107c27 Reviewed-by: Tor Arne Vestbø --- mkspecs/features/qt_module.prf | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index d349c26e53..46f8e56ad5 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -92,16 +92,14 @@ mac:CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) { #QMAKE_FRAMEWORK_VERSION = 4.0 CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework CONFIG -= qt_install_headers #no need to install these as well - CONFIG(release, debug|release) { - !debug_and_release|build_pass { - FRAMEWORK_HEADERS.version = Versions - FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES - FRAMEWORK_HEADERS.path = Headers - FRAMEWORK_PRIVATE_HEADERS.version = Versions - FRAMEWORK_PRIVATE_HEADERS.files = $$SYNCQT.PRIVATE_HEADER_FILES - FRAMEWORK_PRIVATE_HEADERS.path = Headers/$$VERSION/$$MODULE_INCNAME - QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS FRAMEWORK_PRIVATE_HEADERS - } + !debug_and_release|if(build_all:CONFIG(release, debug|release)) { + FRAMEWORK_HEADERS.version = Versions + FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES + FRAMEWORK_HEADERS.path = Headers + FRAMEWORK_PRIVATE_HEADERS.version = Versions + FRAMEWORK_PRIVATE_HEADERS.files = $$SYNCQT.PRIVATE_HEADER_FILES + FRAMEWORK_PRIVATE_HEADERS.path = Headers/$$VERSION/$$MODULE_INCNAME + QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS FRAMEWORK_PRIVATE_HEADERS } } -- cgit v1.2.1 From 3ffc86e0e6d327d71782cbf84f1d62d4ad484bb0 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 25 Jun 2013 10:00:50 +0200 Subject: install qconfig.h into framework bundles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-31969 Change-Id: I5ade18352a9989bdfd513c51c021d475f39aa7c6 Reviewed-by: Tor Arne Vestbø --- src/corelib/global/global.pri | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri index 4084d4f2ad..a0842a946d 100644 --- a/src/corelib/global/global.pri +++ b/src/corelib/global/global.pri @@ -30,9 +30,12 @@ SOURCES += \ INCLUDEPATH += $$QT_BUILD_TREE/src/corelib/global # configure creates these, not syncqt, so we need to manually inject them -targ_headers.files += \ +qconfig_h_files = \ $$OUT_PWD/global/qconfig.h \ $$QT_BUILD_TREE/include/QtCore/QtConfig +targ_headers.files += $$qconfig_h_files +contains(QMAKE_BUNDLE_DATA, FRAMEWORK_HEADERS): \ + FRAMEWORK_HEADERS.files += $$qconfig_h_files # Only used on platforms with CONFIG += precompile_header PRECOMPILED_HEADER = global/qt_pch.h -- cgit v1.2.1 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(-) 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.1 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(+) 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.1 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(+) 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.1 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(-) 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.1 From 6086ff01f566c700bd87a2cbea2dd4a53dd1eb6c Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 25 Jun 2013 11:22:09 -0700 Subject: Replace win32-icc/qplatformdefs.h with the MSVC one There have been fixes done to the MSVC qplatformdefs.h that aren't reflected in the ICC one -- specially the inclusion of windows.h. Since ICC is never tested, simply defer to the MSVC one and hope it's enough. Task-number: QTBUG-30839 Change-Id: I3c22638cc7fac3399d3606b1583608e95208df6e Reviewed-by: Oswald Buddenhagen --- mkspecs/win32-icc/qplatformdefs.h | 108 +------------------------------------- 1 file changed, 1 insertion(+), 107 deletions(-) diff --git a/mkspecs/win32-icc/qplatformdefs.h b/mkspecs/win32-icc/qplatformdefs.h index b1950cd71f..e03bce8e6c 100644 --- a/mkspecs/win32-icc/qplatformdefs.h +++ b/mkspecs/win32-icc/qplatformdefs.h @@ -39,110 +39,4 @@ ** ****************************************************************************/ -#ifndef QPLATFORMDEFS_H -#define QPLATFORMDEFS_H - -#ifdef UNICODE -#ifndef _UNICODE -#define _UNICODE -#endif -#endif - -// Get Qt defines/settings - -#include "qglobal.h" - -#define _POSIX_ -#include -#undef _POSIX_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct _stati64 // non-ANSI defs -#define QT_STATBUF4TSTAT struct _stati64 // non-ANSI defs -#define QT_STAT ::_stati64 -#define QT_FSTAT ::_fstati64 -#else -#define QT_STATBUF struct _stat // non-ANSI defs -#define QT_STATBUF4TSTAT struct _stat // non-ANSI defs -#define QT_STAT ::_stat -#define QT_FSTAT ::_fstat -#endif -#define QT_STAT_REG _S_IFREG -#define QT_STAT_DIR _S_IFDIR -#define QT_STAT_MASK _S_IFMT -#if defined(_S_IFLNK) -# define QT_STAT_LNK _S_IFLNK -#endif -#define QT_FILENO _fileno -#define QT_OPEN ::_open -#define QT_CLOSE ::_close -#ifdef QT_LARGEFILE_SUPPORT -#define QT_LSEEK ::_lseeki64 -#define QT_TSTAT ::_tstati64 -#else -#define QT_LSEEK ::_lseek -#define QT_TSTAT ::_tstat -#endif -#define QT_READ ::_read -#define QT_WRITE ::_write -#define QT_ACCESS ::_access -#define QT_GETCWD ::_getcwd -#define QT_CHDIR ::_chdir -#define QT_MKDIR ::_mkdir -#define QT_RMDIR ::_rmdir -#define QT_OPEN_LARGEFILE 0 -#define QT_OPEN_RDONLY _O_RDONLY -#define QT_OPEN_WRONLY _O_WRONLY -#define QT_OPEN_RDWR _O_RDWR -#define QT_OPEN_CREAT _O_CREAT -#define QT_OPEN_TRUNC _O_TRUNC -#define QT_OPEN_APPEND _O_APPEND -#if defined(O_TEXT) -# define QT_OPEN_TEXT _O_TEXT -# define QT_OPEN_BINARY _O_BINARY -#endif - -#include "../common/c89/qplatformdefs.h" - -#if defined(QT_LARGEFILE_SUPPORT) && _MSC_VER > 1310 -#undef QT_FSEEK -#undef QT_FTELL - -#define QT_FSEEK ::_fseeki64 -#define QT_FTELL ::_ftelli64 -#endif - -#if defined(QT_LARGEFILE_SUPPORT) -#undef QT_OFF_T -#define QT_OFF_T __int64 -#endif - -#define QT_SIGNAL_ARGS int - -#if _MSC_VER>=1400 -# define QT_VSNPRINTF(buffer, count, format, arg) \ - ::vsnprintf_s(buffer, count, count-1, format, arg) -#else -# define QT_VSNPRINTF ::_vsnprintf -#endif -#define QT_SNPRINTF ::_snprintf - -# define F_OK 0 -# define X_OK 1 -# define W_OK 2 -# define R_OK 4 - -typedef int mode_t; - - -#endif // QPLATFORMDEFS_H +#include "../win32-msvc2005/qplatformdefs.h" -- cgit v1.2.1 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(-) 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.1 From 505617b171ece4cef57fa64512801199178dde7a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 26 Jun 2013 17:12:44 +0200 Subject: mac frameworks: don't create bogus symlinks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the entry for the normal headers already ensures that there is the correct version symlink. having an entry for the private headers as well is pointless, and in fact clobbered the symlink for the actual library. Change-Id: I2403761bf006b7bfa490ce85c7b0e46d5ef203c0 Reviewed-by: Stephen Kelly Reviewed-by: Tor Arne Vestbø --- mkspecs/features/qt_module.prf | 1 - 1 file changed, 1 deletion(-) diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index 46f8e56ad5..36cdffb5b4 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -96,7 +96,6 @@ mac:CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) { FRAMEWORK_HEADERS.version = Versions FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES FRAMEWORK_HEADERS.path = Headers - FRAMEWORK_PRIVATE_HEADERS.version = Versions FRAMEWORK_PRIVATE_HEADERS.files = $$SYNCQT.PRIVATE_HEADER_FILES FRAMEWORK_PRIVATE_HEADERS.path = Headers/$$VERSION/$$MODULE_INCNAME QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS FRAMEWORK_PRIVATE_HEADERS -- cgit v1.2.1 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(-) 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.1 From f63369d8336797e1a6e66c381cfee58f36313bb8 Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Thu, 27 Jun 2013 11:38:55 +0200 Subject: Doc: Fixed link to "Downloads" page. -previous link does not exist Change-Id: I86cb6311145cdcb0ebccd3e141d1e413744d585a Reviewed-by: Sergio Ahumada --- doc/global/externalsites/qt-webpages.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/global/externalsites/qt-webpages.qdoc b/doc/global/externalsites/qt-webpages.qdoc index f7bb9b1b89..1bb6228ed1 100644 --- a/doc/global/externalsites/qt-webpages.qdoc +++ b/doc/global/externalsites/qt-webpages.qdoc @@ -33,7 +33,7 @@ \title Qt Bug Tracker */ /*! - \externalpage http://qt.digia.com/downloads + \externalpage http://qt-project.org/downloads \title Downloads */ /*! -- cgit v1.2.1 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(-) 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.1 From f7a7859a7ec533f768b58fd7eff6aa6516242878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 24 Jun 2013 13:51:23 +0200 Subject: Deprecate Mac libc++ mkspecs We handle C++11 and libc++ through c++11.prf now, so separate mkspecs are not needed. Deprecating them allows us to remove them in a later release. Change-Id: I4e525f445aeab88c926fa62cedef6aa9b32a7f55 Reviewed-by: Oswald Buddenhagen Reviewed-by: Erik Verbruggen Reviewed-by: Thiago Macieira --- mkspecs/macx-clang-libc++-32/qmake.conf | 2 ++ mkspecs/macx-clang-libc++/qmake.conf | 2 ++ 2 files changed, 4 insertions(+) diff --git a/mkspecs/macx-clang-libc++-32/qmake.conf b/mkspecs/macx-clang-libc++-32/qmake.conf index aea19a4bc3..3f7342da0b 100644 --- a/mkspecs/macx-clang-libc++-32/qmake.conf +++ b/mkspecs/macx-clang-libc++-32/qmake.conf @@ -2,6 +2,8 @@ # qmake configuration for 32-bit Clang on OS X # +warning("QMakespec macx-clang-libc++-32 is deprecated. Use macx-clang-32 instead.") + MAKEFILE_GENERATOR = UNIX CONFIG += app_bundle incremental global_init_link_order lib_version_first plugin_no_soname QMAKE_INCREMENTAL_STYLE = sublib diff --git a/mkspecs/macx-clang-libc++/qmake.conf b/mkspecs/macx-clang-libc++/qmake.conf index 94cc0036d2..7f4151e81b 100644 --- a/mkspecs/macx-clang-libc++/qmake.conf +++ b/mkspecs/macx-clang-libc++/qmake.conf @@ -2,6 +2,8 @@ # qmake configuration for Clang on OS X # +warning("QMakespec macx-clang-libc++ is deprecated. Use macx-clang instead.") + MAKEFILE_GENERATOR = UNIX CONFIG += app_bundle incremental global_init_link_order lib_version_first plugin_no_soname QMAKE_INCREMENTAL_STYLE = sublib -- cgit v1.2.1 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(-) 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.1 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(-) 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.1 From a3feba69856af788dd5b13a3e86ae0ef59f0aeff Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 28 Jun 2013 10:48:31 +0200 Subject: fix location of private headers in mac bundles Change-Id: I2d9f117d4b25df878abc525499748ed1df9b9c18 Reviewed-by: Kai Koehne Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_module.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index 36cdffb5b4..4f36b3f67f 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -97,7 +97,7 @@ mac:CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) { FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES FRAMEWORK_HEADERS.path = Headers FRAMEWORK_PRIVATE_HEADERS.files = $$SYNCQT.PRIVATE_HEADER_FILES - FRAMEWORK_PRIVATE_HEADERS.path = Headers/$$VERSION/$$MODULE_INCNAME + FRAMEWORK_PRIVATE_HEADERS.path = Headers/$$VERSION/$$MODULE_INCNAME/private QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS FRAMEWORK_PRIVATE_HEADERS } } -- cgit v1.2.1 From 933ae0a0874f754e73fb8093fbad21382e526ca9 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 28 Jun 2013 11:07:44 +0200 Subject: install qpa headers into frameworks as well they are a somewhat different kind of private headers, but follow generally the same logic. Change-Id: Ic6f42ed7061dde2ffd0e32b1d713354b58a20970 Reviewed-by: Joerg Bornemann Reviewed-by: Kai Koehne --- mkspecs/features/qt_module.prf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index 4f36b3f67f..238843942a 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -98,7 +98,9 @@ mac:CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) { FRAMEWORK_HEADERS.path = Headers FRAMEWORK_PRIVATE_HEADERS.files = $$SYNCQT.PRIVATE_HEADER_FILES FRAMEWORK_PRIVATE_HEADERS.path = Headers/$$VERSION/$$MODULE_INCNAME/private - QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS FRAMEWORK_PRIVATE_HEADERS + FRAMEWORK_QPA_HEADERS.files = $$SYNCQT.QPA_HEADER_FILES + FRAMEWORK_QPA_HEADERS.path = Headers/$$VERSION/$$MODULE_INCNAME/qpa + QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS FRAMEWORK_PRIVATE_HEADERS FRAMEWORK_QPA_HEADERS } } -- cgit v1.2.1 From cb79be2076e3ba02b603f4ab65ca12cd99fa2eba Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 24 Jun 2013 20:30:12 +0200 Subject: remove qt_no_framework_direct_includes from qt build only the include statements found in public headers are constrained to work with this flag. our own c++ files and private headers can use other styles, which this flag breaks. Change-Id: Icb1ced17dc438083731049788ac28349c87ba7ef Reviewed-by: Joerg Bornemann Reviewed-by: Kai Koehne Reviewed-by: Oswald Buddenhagen --- mkspecs/features/qt_module.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index 238843942a..da4de5fa1e 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -90,7 +90,7 @@ else: \ #mac frameworks mac:CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) { #QMAKE_FRAMEWORK_VERSION = 4.0 - CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework + CONFIG += lib_bundle qt_framework CONFIG -= qt_install_headers #no need to install these as well !debug_and_release|if(build_all:CONFIG(release, debug|release)) { FRAMEWORK_HEADERS.version = Versions -- cgit v1.2.1 From 215f137e29ad9176fa1a5d4c446115379f5dbc0d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 1 Jul 2013 07:57:04 -0700 Subject: Restore header installation on Mac to always install to $includedir We haven't fully agreed on whether headers should be in $includedir or not for builds with frameworks, since frameworks carry their headers inside. However, this change came too late for Qt 5.1 for us to assess the potential impacts -- it's known to break at least the cmake files we ship. So restore the build to the way it was. This is a partial revert of 6d61dfdbb74a2055438b999c6962f89cc3388eea. Partial because the old behavior was partially broken: it did not install headers for release builds. Now we always install (and in debug-and-release mode, we might do it twice). Task-number: QTBUG-32134 Change-Id: Ib84879c5a148d3717d16a7a90b2f5735fb5d80be Reviewed-by: Sean Harmer Reviewed-by: Oswald Buddenhagen Reviewed-by: Lars Knoll --- mkspecs/features/qt_module.prf | 1 - 1 file changed, 1 deletion(-) diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index da4de5fa1e..53a5499545 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -91,7 +91,6 @@ else: \ mac:CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) { #QMAKE_FRAMEWORK_VERSION = 4.0 CONFIG += lib_bundle qt_framework - CONFIG -= qt_install_headers #no need to install these as well !debug_and_release|if(build_all:CONFIG(release, debug|release)) { FRAMEWORK_HEADERS.version = Versions FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES -- cgit v1.2.1