From eea10943492473bae7f048f8c59e35fb1bff36ca Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 1 Jun 2015 11:01:08 +0200 Subject: [PATCH 01/40] Android: Fix resuming app after locale change The default reaction to configuration changes in Android is to destroy the activity. To avoid this happening for locale changes, we had the "locale" configuration change registered in the default AndroidManifest.xml, however, you also need to register that you are handling the layoutDirection change, otherwise Android will not call onConfigurationChange() for language changes, but tear down the activity instead. [ChangeLog][Android] Fixed bug where application was not resumable after user changed language in system settings. Change-Id: I3fe84a9332217b062b5352b2c977e2dbeacd5239 Task-number: QTBUG-45430 Reviewed-by: BogDan Vatra --- src/android/templates/AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/android/templates/AndroidManifest.xml b/src/android/templates/AndroidManifest.xml index 60c612976f9..ad240956ef4 100644 --- a/src/android/templates/AndroidManifest.xml +++ b/src/android/templates/AndroidManifest.xml @@ -1,7 +1,7 @@ - Date: Tue, 2 Jun 2015 16:20:28 +0200 Subject: [PATCH 02/40] Rename QTextStream::readLine(QString *, qint64) into readLineInto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As discussed on the development mailing list, the new overload is ambiguous and breaks source compatibility. Therefore this function that is new in 5.5 shall be called readLineInto. Change-Id: I2aecb8441af4edb72f16d0bc6dabf10cdabf32e2 Reviewed-by: Jan Kundrát Reviewed-by: Marc Mutz Reviewed-by: Thiago Macieira --- src/corelib/io/qtextstream.cpp | 4 ++-- src/corelib/io/qtextstream.h | 2 +- .../corelib/io/qtextstream/tst_qtextstream.cpp | 18 +++++++++--------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp index 47b96d708f8..2fed83b2e38 100644 --- a/src/corelib/io/qtextstream.cpp +++ b/src/corelib/io/qtextstream.cpp @@ -1591,7 +1591,7 @@ QString QTextStream::readLine(qint64 maxlen) { QString line; - readLine(&line, maxlen); + readLineInto(&line, maxlen); return line; } @@ -1620,7 +1620,7 @@ QString QTextStream::readLine(qint64 maxlen) \sa readAll(), QIODevice::readLine() */ -bool QTextStream::readLine(QString *line, qint64 maxlen) +bool QTextStream::readLineInto(QString *line, qint64 maxlen) { Q_D(QTextStream); // keep in sync with CHECK_VALID_STREAM diff --git a/src/corelib/io/qtextstream.h b/src/corelib/io/qtextstream.h index 125502e68d3..e5f429ae4de 100644 --- a/src/corelib/io/qtextstream.h +++ b/src/corelib/io/qtextstream.h @@ -124,7 +124,7 @@ public: void skipWhiteSpace(); QString readLine(qint64 maxlen = 0); - bool readLine(QString *line, qint64 maxlen = 0); + bool readLineInto(QString *line, qint64 maxlen = 0); QString readAll(); QString read(qint64 maxlen); diff --git a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp index aa7a3762ce5..36da3b87704 100644 --- a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp +++ b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp @@ -81,7 +81,7 @@ private slots: void readLineMaxlen_data(); void readLineMaxlen(); void readLinesFromBufferCRCR(); - void readLineOverload(); + void readLineInto(); // all void readAllFromDevice_data(); @@ -612,22 +612,22 @@ protected: } }; -void tst_QTextStream::readLineOverload() +void tst_QTextStream::readLineInto() { QByteArray data = "1\n2\n3"; QTextStream ts(&data); QString line; - ts.readLine(&line); + ts.readLineInto(&line); QCOMPARE(line, QStringLiteral("1")); - ts.readLine(Q_NULLPTR, 0); // read the second line, but don't store it + ts.readLineInto(Q_NULLPTR, 0); // read the second line, but don't store it - ts.readLine(&line); + ts.readLineInto(&line); QCOMPARE(line, QStringLiteral("3")); - QVERIFY(!ts.readLine(&line)); + QVERIFY(!ts.readLineInto(&line)); QVERIFY(line.isEmpty()); QFile file(m_rfc3261FilePath); @@ -637,7 +637,7 @@ void tst_QTextStream::readLineOverload() line.reserve(1); int maxLineCapacity = line.capacity(); - while (ts.readLine(&line)) { + while (ts.readLineInto(&line)) { QVERIFY(line.capacity() >= maxLineCapacity); maxLineCapacity = line.capacity(); } @@ -647,7 +647,7 @@ void tst_QTextStream::readLineOverload() QVERIFY(errorDevice.open(QIODevice::ReadOnly)); ts.setDevice(&errorDevice); - QVERIFY(!ts.readLine(&line)); + QVERIFY(!ts.readLineInto(&line)); QVERIFY(line.isEmpty()); } @@ -1025,7 +1025,7 @@ void tst_QTextStream::performance() QTextStream stream2(&file3); QString line; - while (stream2.readLine(&line)) + while (stream2.readLineInto(&line)) ++nlines3; elapsed[2] = stopWatch.elapsed(); From 71cc35c8e39908ece3025c6fcfe3da3fb306a34d Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 2 Jun 2015 15:37:16 +0200 Subject: [PATCH 03/40] Avoid qtbase/bin/bin artifact when running make install Fix regression introduced in commit 63660402d. exists() also returns true for a directory ... Change-Id: I2b4fff00b18eeba53e959306ab33c3bef3795987 Reviewed-by: Oswald Buddenhagen --- qtbase.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qtbase.pro b/qtbase.pro index 51e8fb8760b..24d0f5287ba 100644 --- a/qtbase.pro +++ b/qtbase.pro @@ -49,7 +49,7 @@ INSTALLS += qmake #licheck licheck.path = $$[QT_HOST_BINS] licheck.files = $$PWD/bin/$$QT_LICHECK -exists($$licheck.files): INSTALLS += licheck +!isEmpty(QT_LICHECK): INSTALLS += licheck #syncqt syncqt.path = $$[QT_HOST_BINS] From cf452e20f9f755898cbd05bfd387f29e39613c4a Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Wed, 3 Jun 2015 11:17:21 +0300 Subject: [PATCH 04/40] Doc: Update due to renaming QTextStream::readLine() overload readLine() overload was renamed into readLineInto() in 21674735ccd029c17dc8b36211e9b5bc3595ba34. Change-Id: Iebd4c4e42ef4579c02ca38d7e41d00c3032130d8 Reviewed-by: Simon Hausmann --- src/corelib/doc/snippets/code/src_corelib_io_qtextstream.cpp | 2 +- src/corelib/io/qtextstream.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/doc/snippets/code/src_corelib_io_qtextstream.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qtextstream.cpp index c76a0f1f3bd..ab91a00f5fe 100644 --- a/src/corelib/doc/snippets/code/src_corelib_io_qtextstream.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_io_qtextstream.cpp @@ -51,7 +51,7 @@ if (data.open(QFile::WriteOnly | QFile::Truncate)) { //! [1] QTextStream stream(stdin); QString line; -while (stream.readLine(&line)) { +while (stream.readLineInto(&line)) { ... } //! [1] diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp index 2fed83b2e38..8ad1c2852cc 100644 --- a/src/corelib/io/qtextstream.cpp +++ b/src/corelib/io/qtextstream.cpp @@ -1612,7 +1612,7 @@ QString QTextStream::readLine(qint64 maxlen) If \a line has sufficient capacity for the data that is about to be read, this function may not need to allocate new memory. Because of - this, it can be faster than the other readLine() overload. + this, it can be faster than readLine(). Returns \c false if the stream has read to the end of the file or an error has occurred; otherwise returns \c true. The contents in From 769cc4d878c18ca3228fce846deccb5290901887 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 3 Jun 2015 10:18:38 +0200 Subject: [PATCH 05/40] Make logicalDpi consistent in relation to device pixel ratio In GNOME/Unity XCB, logical DPI is scaled by device pixel ratio, and on Macs logical DPI is constant but pixel ratio is based on physical DPI, making logical DPI effectively physical DPI divided by pixel ratio. This patch ensure the same logic is used for other XCB desktops. Change-Id: I60f24618cd49f6b34a6ff1eff317883d191d3491 Reviewed-by: Paul Olav Tvete --- src/plugins/platforms/xcb/qxcbscreen.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp index c14ec0bb3f7..63e4d9e75b0 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.cpp +++ b/src/plugins/platforms/xcb/qxcbscreen.cpp @@ -361,11 +361,11 @@ QDpi QXcbScreen::logicalDpi() const if (overrideDpi) return QDpi(overrideDpi, overrideDpi); - if (m_forcedDpi > 0) { - int primaryDpr = int(connection()->screens().at(0)->devicePixelRatio()); + int primaryDpr = int(connection()->screens().at(0)->devicePixelRatio()); + if (m_forcedDpi > 0) return QDpi(m_forcedDpi/primaryDpr, m_forcedDpi/primaryDpr); - } - return virtualDpi(); + QDpi vDpi = virtualDpi(); + return QDpi(vDpi.first/primaryDpr, vDpi.second/primaryDpr); } From ef4ef2884d3b3e26083ee71df37cd5efde4cffe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 3 Jun 2015 14:05:56 +0200 Subject: [PATCH 06/40] Use absolute rpath to Qt libraries for non-prefix builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-46391 Change-Id: Iaebba29c340fb027e23a0923f3692d47f9d450d5 Reviewed-by: Morten Johan Sørvig --- mkspecs/features/mac/default_post.prf | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf index 246c9c60e69..b459389c720 100644 --- a/mkspecs/features/mac/default_post.prf +++ b/mkspecs/features/mac/default_post.prf @@ -40,15 +40,13 @@ qt:!isEmpty(QT_CONFIG) { # libraries. This applies only to apps, since all loaded libraries inherit # rpaths from current process executable. else:!if(host_build:force_bootstrap):equals(TEMPLATE, app):!defined(QMAKE_RPATHDIR, var):contains(QT_CONFIG, rpath) { - # If app is outside of Qt SDK prefix use absolute path to Qt libraries, - # otherwise make it relative, so all SDK tools and examples work when - # relocated. - # Tests are an exception, since they are launched in their build not - # install location by CI, so we cannot use relative rpaths there. - if(!contains(target.path, "$$re_escape($$[QT_INSTALL_PREFIX])/.*")|\ - contains(target.path, "$$re_escape($$[QT_INSTALL_TESTS])/.*")) { - QMAKE_RPATHDIR = $$[QT_INSTALL_LIBS] - } else { + # If app is expected to be installed into the Qt prefix build, use + # relative path, so all SDK tools and examples work when relocated. + prefix_build:defined(target.path, var):\ + contains(target.path, "$$re_escape($$[QT_INSTALL_PREFIX])/.*"):\ + # Tests are an exception, since they are launched in their build not + # install location by CI, so we cannot use relative rpaths there. + !contains(target.path, "$$re_escape($$[QT_INSTALL_TESTS])/.*") { app_bundle { ios: binpath = $$target.path/$${TARGET}.app else: binpath = $$target.path/$${TARGET}.app/Contents/MacOS @@ -57,6 +55,9 @@ qt:!isEmpty(QT_CONFIG) { } QMAKE_RPATHDIR = @loader_path/$$relative_path($$[QT_INSTALL_LIBS], $$binpath) unset(binpath) + } else { + # Otherwise, use absolute path to Qt libraries + QMAKE_RPATHDIR = $$[QT_INSTALL_LIBS] } } } From 4ee7bfaff4db65d35200fffeaca3be1cc026fc2c Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Thu, 4 Jun 2015 12:20:17 +0200 Subject: [PATCH 07/40] QNSImageView - remove observer before dealloc It can happen that NSMenuDidEndTrackingNotification comes after our imageCell QNSImageView was deallocated (for example, mouse button is not released yet when dealloc called). Remove soon-to-be-deallocated observer. Change-Id: Ib155cc5f0b884c6b1fed0f986d12599096b582c6 Task-number: QTBUG-46425 Reviewed-by: Thierry Bastian Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm index f50f5526237..713758cc7ed 100755 --- a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm +++ b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm @@ -446,6 +446,7 @@ QT_END_NAMESPACE -(void)dealloc { [[NSStatusBar systemStatusBar] removeStatusItem:item]; + [[NSNotificationCenter defaultCenter] removeObserver:imageCell]; [imageCell release]; [item release]; [super dealloc]; From 50cd28b31dab6d775a72c5937fe39b208c6822df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Fri, 5 Jun 2015 09:30:51 +0200 Subject: [PATCH 08/40] Cocoa: Remove ToolTip windows from popup stack Match the cases for the adding logic. Change-Id: I61f49975b4cfcf2acf26b31b521cbc9b96f9d150 Task-number: QTBUG-46447 Reviewed-by: Erik Verbruggen Reviewed-by: Eike Ziller --- 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 86959869ccd..92fc66a04fa 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -749,7 +749,7 @@ void QCocoaWindow::setVisible(bool visible) monitor = nil; } - if (window()->type() == Qt::Popup) + if (window()->type() == Qt::Popup || window()->type() == Qt::ToolTip) QCocoaIntegration::instance()->popupWindowStack()->removeAll(this); if (parentCocoaWindow && window()->type() == Qt::Popup) { From bb7c78ed732ce0b93abc1027a1e6e9188fc13abb Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Thu, 4 Jun 2015 12:43:50 +0200 Subject: [PATCH 09/40] Doc: Remove generic thumbnails for a number of examples These examples now define their own images. Having duplicate definitions is bad as it results in invalid example manifest xml, and Qt Creator fails to detect all examples declared in that file. Task-number: QTBUG-41996 Change-Id: Ia9d6cd0b3ec4e82b79b1df54774c2d9cea279a59 Reviewed-by: Oswald Buddenhagen Reviewed-by: Liang Qi Reviewed-by: Venugopal Shivashankar --- doc/global/manifest-meta.qdocconf | 3 --- 1 file changed, 3 deletions(-) diff --git a/doc/global/manifest-meta.qdocconf b/doc/global/manifest-meta.qdocconf index 01950e650cb..37a06155d42 100644 --- a/doc/global/manifest-meta.qdocconf +++ b/doc/global/manifest-meta.qdocconf @@ -269,12 +269,9 @@ manifestmeta.thumbnail.names = "QtCore/Contiguous Cache Example" \ "QtWidgets/Event Transitions Example" \ "QtWidgets/Two-way Button Example" \ "QtWidgets/Validators Example" \ - "ActiveQt/*" \ "QtDbus/*" \ "QtHelp/*" \ "QtMultimedia/AudioEngine Example" \ - "QtMultimedia/Declarative Radio Example" \ - "QtMultimediaWidgets/Media Player Example" \ "QtQml/Extending QML*" \ "QtQuick/Qt Quick Examples - Accessibility" \ "QtSensors/Qt Sensors - SensorGesture QML Type example" \ From d0d0ee4ed7a1cc538363a82cde24f1b626b415ec Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Sun, 7 Jun 2015 19:12:19 -0700 Subject: [PATCH 10/40] Fix build on 32-bit OS X. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I5f01cb2a5a34a7a2a0c8f0571d50698bd46be733 Reviewed-by: Erik Verbruggen Reviewed-by: Morten Johan Sørvig --- .../other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm index d0ff6af6405..3056904dcf0 100644 --- a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm +++ b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm @@ -129,7 +129,7 @@ QDebug operator<<(QDebug dbg, AXErrorTag err) - (AXUIElementRef) ref { return reference; } - (void) print { - NSLog(@"Accessible Object role: '%@', title: '%@', description: '%@', value: '%@', rect: '%@'", self.role, self.title, self.description, self.value, NSStringFromRect(self.rect)); + NSLog(@"Accessible Object role: '%@', title: '%@', description: '%@', value: '%@', rect: '%@'", self.role, self.title, self.description, self.value, NSStringFromRect(NSRectFromCGRect(self.rect))); NSLog(@" Children: %ld", [[self childList] count]); } From 42f5f03d0abdd464a48f2a31122f52497dcc81c6 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 8 Jun 2015 16:01:21 +0200 Subject: [PATCH 11/40] Unexport QSslPreSharedKeyAuthenticator Exporting value classes (as opposed to just their non-inline methods) creates subtle binary incompatibility problems. In this case, between C++11 and C++98 builds because of the move assignment operator. Even though it's not a problem in practice, so far, for some types of classes this issue ie real (QVector, say), so it's best to avoid exporting what we don't need to export. Change-Id: Ifca6aaedcbfa79ca35e651de7630e69c3b266fe3 Reviewed-by: Thiago Macieira --- .../ssl/qsslpresharedkeyauthenticator.h | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/network/ssl/qsslpresharedkeyauthenticator.h b/src/network/ssl/qsslpresharedkeyauthenticator.h index 52301ef7e57..159b16d563e 100644 --- a/src/network/ssl/qsslpresharedkeyauthenticator.h +++ b/src/network/ssl/qsslpresharedkeyauthenticator.h @@ -43,13 +43,13 @@ QT_BEGIN_NAMESPACE class QSslPreSharedKeyAuthenticatorPrivate; -class Q_NETWORK_EXPORT QSslPreSharedKeyAuthenticator +class QSslPreSharedKeyAuthenticator { public: - QSslPreSharedKeyAuthenticator(); - ~QSslPreSharedKeyAuthenticator(); - QSslPreSharedKeyAuthenticator(const QSslPreSharedKeyAuthenticator &authenticator); - QSslPreSharedKeyAuthenticator &operator=(const QSslPreSharedKeyAuthenticator &authenticator); + Q_NETWORK_EXPORT QSslPreSharedKeyAuthenticator(); + Q_NETWORK_EXPORT ~QSslPreSharedKeyAuthenticator(); + Q_NETWORK_EXPORT QSslPreSharedKeyAuthenticator(const QSslPreSharedKeyAuthenticator &authenticator); + Q_NETWORK_EXPORT QSslPreSharedKeyAuthenticator &operator=(const QSslPreSharedKeyAuthenticator &authenticator); #ifdef Q_COMPILER_RVALUE_REFS inline QSslPreSharedKeyAuthenticator &operator=(QSslPreSharedKeyAuthenticator &&authenticator) @@ -61,15 +61,15 @@ public: d.swap(authenticator.d); } - QByteArray identityHint() const; + Q_NETWORK_EXPORT QByteArray identityHint() const; - void setIdentity(const QByteArray &identity); - QByteArray identity() const; - int maximumIdentityLength() const; + Q_NETWORK_EXPORT void setIdentity(const QByteArray &identity); + Q_NETWORK_EXPORT QByteArray identity() const; + Q_NETWORK_EXPORT int maximumIdentityLength() const; - void setPreSharedKey(const QByteArray &preSharedKey); - QByteArray preSharedKey() const; - int maximumPreSharedKeyLength() const; + Q_NETWORK_EXPORT void setPreSharedKey(const QByteArray &preSharedKey); + Q_NETWORK_EXPORT QByteArray preSharedKey() const; + Q_NETWORK_EXPORT int maximumPreSharedKeyLength() const; private: friend Q_NETWORK_EXPORT bool operator==(const QSslPreSharedKeyAuthenticator &lhs, const QSslPreSharedKeyAuthenticator &rhs); From 5ef662f1af2fb0c340b98edc083939b4383a04ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Mon, 8 Jun 2015 18:07:06 +0200 Subject: [PATCH 12/40] Android: Delay initialization of Accessibility. The accessibility class was created and activated in onCreate(), which meant we where trying to activate accessibility before the platform plugin was properly initialized. With this change we will also activate, or deactivate, accessibility in Qt whenever the state is changed by Android, compared to doing it at start-up only. Task-number: QTBUG-46355 Change-Id: I5cbae125df43f7694d4464d5054e6cfec4626e26 Reviewed-by: Eskil Abrahamsen Blomfeldt --- .../QtAccessibilityDelegate.java | 9 ++--- .../qt5/android/QtActivityDelegate.java | 36 ++++++++++--------- .../org/qtproject/qt5/android/QtNative.java | 10 ++++++ .../android/androidjniaccessibility.cpp | 10 ++++++ .../android/androidjniaccessibility.h | 1 + .../android/qandroidplatformaccessibility.cpp | 5 ++- .../android/qandroidplatformintegration.cpp | 6 ++-- 7 files changed, 50 insertions(+), 27 deletions(-) diff --git a/src/android/accessibility/jar/src/org/qtproject/qt5/android/accessibility/QtAccessibilityDelegate.java b/src/android/accessibility/jar/src/org/qtproject/qt5/android/accessibility/QtAccessibilityDelegate.java index 56e7543415a..6f956755975 100644 --- a/src/android/accessibility/jar/src/org/qtproject/qt5/android/accessibility/QtAccessibilityDelegate.java +++ b/src/android/accessibility/jar/src/org/qtproject/qt5/android/accessibility/QtAccessibilityDelegate.java @@ -107,10 +107,6 @@ public class QtAccessibilityDelegate extends View.AccessibilityDelegate if (m_manager.isEnabled()) accServiceListener.onAccessibilityStateChanged(true); } - - - // Enable Qt Accessibility so that notifications are enabled - QtNativeAccessibility.setActive(true); } private class AccessibilityManagerListener implements AccessibilityManager.AccessibilityStateChangeListener @@ -119,8 +115,6 @@ public class QtAccessibilityDelegate extends View.AccessibilityDelegate public void onAccessibilityStateChanged(boolean enabled) { if (enabled) { - // The accessibility code depends on android API level 16, so dynamically resolve it - if (android.os.Build.VERSION.SDK_INT >= 16) { try { View view = m_view; if (view == null) { @@ -147,13 +141,14 @@ public class QtAccessibilityDelegate extends View.AccessibilityDelegate // Unknown exception means something went wrong. Log.w("Qt A11y", "Unknown exception: " + e.toString()); } - } } else { if (m_view != null) { m_layout.removeView(m_view); m_view = null; } } + + QtNativeAccessibility.setActive(enabled); } } diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java index d6cd49f44c4..f4d2645e9a7 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java @@ -794,23 +794,6 @@ public class QtActivityDelegate m_surfaces = new HashMap(); m_nativeViews = new HashMap(); m_activity.registerForContextMenu(m_layout); - - // Initialize accessibility - try { - final String a11yDelegateClassName = "org.qtproject.qt5.android.accessibility.QtAccessibilityDelegate"; - Class qtDelegateClass = Class.forName(a11yDelegateClassName); - Constructor constructor = qtDelegateClass.getConstructor(android.app.Activity.class, - android.view.ViewGroup.class, - this.getClass()); - Object accessibilityDelegate = constructor.newInstance(m_activity, m_layout, this); - } catch (ClassNotFoundException e) { - // Class not found is fine since we are compatible with Android API < 16, but the function will - // only be available with that API level. - } catch (Exception e) { - // Unknown exception means something went wrong. - Log.w("Qt A11y", "Unknown exception: " + e.toString()); - } - m_activity.setContentView(m_layout, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); @@ -828,6 +811,25 @@ public class QtActivityDelegate m_currentRotation = rotation; } + public void initializeAccessibility() + { + // Initialize accessibility + try { + final String a11yDelegateClassName = "org.qtproject.qt5.android.accessibility.QtAccessibilityDelegate"; + Class qtDelegateClass = Class.forName(a11yDelegateClassName); + Constructor constructor = qtDelegateClass.getConstructor(android.app.Activity.class, + android.view.ViewGroup.class, + this.getClass()); + Object accessibilityDelegate = constructor.newInstance(m_activity, m_layout, this); + } catch (ClassNotFoundException e) { + // Class not found is fine since we are compatible with Android API < 16, but the function will + // only be available with that API level. + } catch (Exception e) { + // Unknown exception means something went wrong. + Log.w("Qt A11y", "Unknown exception: " + e.toString()); + } + } + public void onConfigurationChanged(Configuration configuration) { try { diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java index b2480618f80..040eba5e422 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java @@ -571,6 +571,16 @@ public class QtNative }); } + private static void initializeAccessibility() + { + runAction(new Runnable() { + @Override + public void run() { + m_activityDelegate.initializeAccessibility(); + } + }); + } + // screen methods public static native void setDisplayMetrics(int screenWidthPixels, int screenHeightPixels, diff --git a/src/plugins/platforms/android/androidjniaccessibility.cpp b/src/plugins/platforms/android/androidjniaccessibility.cpp index f8c3e262296..69f8bdbad75 100644 --- a/src/plugins/platforms/android/androidjniaccessibility.cpp +++ b/src/plugins/platforms/android/androidjniaccessibility.cpp @@ -42,6 +42,7 @@ #include "QtGui/qaccessible.h" #include #include +#include #include "qdebug.h" @@ -65,6 +66,15 @@ namespace QtAndroidAccessibility static jmethodID m_setTextSelectionMethodID = 0; static jmethodID m_setVisibleToUserMethodID = 0; + void initialize() + { + // API level > 16 is required. + if (QtAndroidPrivate::androidSdkVersion() < 16) + return; + + QJNIObjectPrivate::callStaticMethod(QtAndroid::applicationClass(), + "initializeAccessibility"); + } static void setActive(JNIEnv */*env*/, jobject /*thiz*/, jboolean active) { diff --git a/src/plugins/platforms/android/androidjniaccessibility.h b/src/plugins/platforms/android/androidjniaccessibility.h index 92013531189..a4cbab7834b 100644 --- a/src/plugins/platforms/android/androidjniaccessibility.h +++ b/src/plugins/platforms/android/androidjniaccessibility.h @@ -40,6 +40,7 @@ QT_BEGIN_NAMESPACE namespace QtAndroidAccessibility { + void initialize(); bool registerNatives(JNIEnv *env); } diff --git a/src/plugins/platforms/android/qandroidplatformaccessibility.cpp b/src/plugins/platforms/android/qandroidplatformaccessibility.cpp index e3a8b1a8f44..339023bd9f1 100644 --- a/src/plugins/platforms/android/qandroidplatformaccessibility.cpp +++ b/src/plugins/platforms/android/qandroidplatformaccessibility.cpp @@ -33,11 +33,14 @@ #include "qandroidplatformaccessibility.h" +#include "androidjniaccessibility.h" QT_BEGIN_NAMESPACE QAndroidPlatformAccessibility::QAndroidPlatformAccessibility() -{} +{ + QtAndroidAccessibility::initialize(); +} QAndroidPlatformAccessibility::~QAndroidPlatformAccessibility() {} diff --git a/src/plugins/platforms/android/qandroidplatformintegration.cpp b/src/plugins/platforms/android/qandroidplatformintegration.cpp index eb96bf11f06..2a127f5c3cd 100644 --- a/src/plugins/platforms/android/qandroidplatformintegration.cpp +++ b/src/plugins/platforms/android/qandroidplatformintegration.cpp @@ -148,6 +148,10 @@ QAndroidPlatformIntegration::QAndroidPlatformIntegration(const QStringList ¶ m_androidSystemLocale = new QAndroidSystemLocale; +#ifndef QT_NO_ACCESSIBILITY + m_accessibility = new QAndroidPlatformAccessibility(); +#endif // QT_NO_ACCESSIBILITY + QJNIObjectPrivate javaActivity(QtAndroid::activity()); if (javaActivity.isValid()) { QJNIObjectPrivate resources = javaActivity.callObjectMethod("getResources", "()Landroid/content/res/Resources;"); @@ -348,8 +352,6 @@ void QAndroidPlatformIntegration::setScreenOrientation(Qt::ScreenOrientation cur #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *QAndroidPlatformIntegration::accessibility() const { - if (!m_accessibility) - m_accessibility = new QAndroidPlatformAccessibility(); return m_accessibility; } #endif From 62d7221850e836fab0552207472ea79ceb5b109c Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Mon, 1 Jun 2015 09:49:04 -0700 Subject: [PATCH 13/40] 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: I5ea44a720e01e388a8d219a89c5b0ccd8fd23146 Reviewed-by: Tor Arne Vestbø Reviewed-by: Liang Qi Reviewed-by: Jani Heikkinen --- src/corelib/global/qglobal.cpp | 10 ++++++++++ src/corelib/global/qsysinfo.h | 9 ++++++++- src/corelib/global/qsystemdetection.h | 21 +++++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index d6f51626487..39c68d92d12 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1128,6 +1128,7 @@ bool qSharedBuild() Q_DECL_NOTHROW \value MV_10_8 OS X 10.8 \value MV_10_9 OS X 10.9 \value MV_10_10 OS X 10.10 + \value MV_10_11 OS X 10.11 \value MV_Unknown An unknown and currently unsupported platform \value MV_CHEETAH Apple codename for MV_10_0 @@ -1141,6 +1142,7 @@ bool qSharedBuild() Q_DECL_NOTHROW \value MV_MOUNTAINLION Apple codename for MV_10_8 \value MV_MAVERICKS Apple codename for MV_10_9 \value MV_YOSEMITE Apple codename for MV_10_10 + \value MV_ELCAPITAN Apple codename for MV_10_11 \value MV_IOS iOS (any) \value MV_IOS_4_3 iOS 4.3 @@ -1151,6 +1153,11 @@ bool qSharedBuild() Q_DECL_NOTHROW \value MV_IOS_7_0 iOS 7.0 \value MV_IOS_7_1 iOS 7.1 \value MV_IOS_8_0 iOS 8.0 + \value MV_IOS_8_1 iOS 8.1 + \value MV_IOS_8_2 iOS 8.2 + \value MV_IOS_8_3 iOS 8.3 + \value MV_IOS_8_4 iOS 8.4 + \value MV_IOS_9_0 iOS 9.0 \value MV_None Not a Darwin operating system @@ -2738,6 +2745,9 @@ QString QSysInfo::prettyProductName() case MV_YOSEMITE: basename = "OS X Yosemite ("; break; + case MV_ELCAPITAN: + basename = "OS X El Capitan ("; + break; } if (basename) return QLatin1String(basename) + productVersion() + QLatin1Char(')'); diff --git a/src/corelib/global/qsysinfo.h b/src/corelib/global/qsysinfo.h index a571e435683..625b366cc60 100644 --- a/src/corelib/global/qsysinfo.h +++ b/src/corelib/global/qsysinfo.h @@ -137,6 +137,7 @@ public: MV_10_8 = 0x000A, MV_10_9 = 0x000B, MV_10_10 = 0x000C, + MV_10_11 = 0x000D, /* codenames */ MV_CHEETAH = MV_10_0, @@ -150,6 +151,7 @@ public: MV_MOUNTAINLION = MV_10_8, MV_MAVERICKS = MV_10_9, MV_YOSEMITE = MV_10_10, + MV_ELCAPITAN = MV_10_11, /* iOS */ MV_IOS = 1 << 8, @@ -160,7 +162,12 @@ public: MV_IOS_6_1 = Q_MV_IOS(6, 1), MV_IOS_7_0 = Q_MV_IOS(7, 0), MV_IOS_7_1 = Q_MV_IOS(7, 1), - MV_IOS_8_0 = Q_MV_IOS(8, 0) + MV_IOS_8_0 = Q_MV_IOS(8, 0), + MV_IOS_8_1 = Q_MV_IOS(8, 1), + MV_IOS_8_2 = Q_MV_IOS(8, 2), + MV_IOS_8_3 = Q_MV_IOS(8, 3), + MV_IOS_8_4 = Q_MV_IOS(8, 4), + MV_IOS_9_0 = Q_MV_IOS(9, 0) }; #if defined(Q_OS_MAC) static const MacVersion MacintoshVersion; diff --git a/src/corelib/global/qsystemdetection.h b/src/corelib/global/qsystemdetection.h index 64f9d91ec74..562427e4b92 100644 --- a/src/corelib/global/qsystemdetection.h +++ b/src/corelib/global/qsystemdetection.h @@ -233,6 +233,9 @@ # if !defined(__MAC_10_10) # define __MAC_10_10 101000 # endif +# if !defined(__MAC_10_11) +# define __MAC_10_11 101100 +# endif # if !defined(MAC_OS_X_VERSION_10_7) # define MAC_OS_X_VERSION_10_7 1070 # endif @@ -245,6 +248,9 @@ # if !defined(MAC_OS_X_VERSION_10_10) # define MAC_OS_X_VERSION_10_10 101000 # endif +# if !defined(MAC_OS_X_VERSION_10_11) +# define MAC_OS_X_VERSION_10_11 101100 +# endif # # if !defined(__IPHONE_4_3) # define __IPHONE_4_3 40300 @@ -270,6 +276,21 @@ # if !defined(__IPHONE_8_0) # define __IPHONE_8_0 80000 # endif +# if !defined(__IPHONE_8_1) +# define __IPHONE_8_1 80100 +# endif +# if !defined(__IPHONE_8_2) +# define __IPHONE_8_2 80200 +# endif +# if !defined(__IPHONE_8_3) +# define __IPHONE_8_3 80300 +# endif +# if !defined(__IPHONE_8_4) +# define __IPHONE_8_4 80400 +# endif +# if !defined(__IPHONE_9_0) +# define __IPHONE_9_0 90000 +# endif #endif #ifdef __LSB_VERSION__ From 81054b117b5a3d0d9e4d17a531b453515410432b Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 8 Jun 2015 11:12:50 +0200 Subject: [PATCH 14/40] Inline QSpacerItem::sizePolicy() There's zero reason not to do it, esp. given how small a QSizePolicy is. Change-Id: I88b92bb27e6341b60a2cb3f2ddcc232f25f03ca8 Reviewed-by: Lars Knoll --- src/widgets/kernel/qlayoutitem.cpp | 5 +---- src/widgets/kernel/qlayoutitem.h | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/widgets/kernel/qlayoutitem.cpp b/src/widgets/kernel/qlayoutitem.cpp index 21f4c9a221f..3d444136e37 100644 --- a/src/widgets/kernel/qlayoutitem.cpp +++ b/src/widgets/kernel/qlayoutitem.cpp @@ -332,14 +332,11 @@ QSpacerItem * QSpacerItem::spacerItem() } /*! + \fn QSizePolicy QSpacerItem::sizePolicy() const \since 5.5 Returns the size policy of this item. */ -QSizePolicy QSpacerItem::sizePolicy() const -{ - return sizeP; -} /*! If this item is a QWidget, it is returned as a QWidget; otherwise diff --git a/src/widgets/kernel/qlayoutitem.h b/src/widgets/kernel/qlayoutitem.h index eaa129a85b0..650e114c76b 100644 --- a/src/widgets/kernel/qlayoutitem.h +++ b/src/widgets/kernel/qlayoutitem.h @@ -102,7 +102,7 @@ public: void setGeometry(const QRect&); QRect geometry() const; QSpacerItem *spacerItem(); - QSizePolicy sizePolicy() const; + QSizePolicy sizePolicy() const { return sizeP; } private: int width; From 36640aa0afb722479ba47d6fbd9401c433dead41 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Wed, 3 Jun 2015 15:28:01 +0200 Subject: [PATCH 15/40] Don't enforce all QMetaType::TypeFlag difference across Qt versions QMetaType::IsGadget was introduced in Qt 5.5 and set when Q_GADGET is used. If an existing Qt 5.4 class was converted to a gadget in Qt 5.5+, the two types would have differing QMetaType::TypeFlags. Such a conversion happened for QGeoCoordinate, QGeoShape, QGeoRectangle and QGeoCircle. There might be other classes too. In principle, the same problem exists for every future addition to QMetaType::TypeFlag too. This patch ensures that new flags are kept in the metatype database and the related qFatal call is not triggered for any flag >= TypeFlag::WasDeclaredAsMetaType. Change-Id: Ibb15daeb28d9a11b7f31658f4219cbca2499213f Task-number: QTBUG-46454 Reviewed-by: Alex Blasche Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/kernel/qmetatype.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index 3b70ef92edf..0f9cf41b775 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -1046,6 +1046,16 @@ int QMetaType::registerNormalizedType(const NS(QByteArray) &normalizedTypeName, if (idx >= User) { previousSize = ct->at(idx - User).size; previousFlags = ct->at(idx - User).flags; + + // Set new/additional flags in case of old library/app. + // Ensures that older code works in conjunction with new Qt releases + // requiring the new flags. + if (flags != previousFlags) { + QCustomTypeInfo &inf = ct->data()[idx - User]; + inf.flags |= flags; + if (metaObject) + inf.metaObject = metaObject; + } } } @@ -1061,11 +1071,11 @@ int QMetaType::registerNormalizedType(const NS(QByteArray) &normalizedTypeName, normalizedTypeName.constData(), idx, previousSize, size); } + // Do not compare types higher than 0x100: // Ignore WasDeclaredAsMetaType inconsitency, to many users were hitting the problem - previousFlags |= WasDeclaredAsMetaType; - flags |= WasDeclaredAsMetaType; - - if (previousFlags != flags) { + // Ignore IsGadget as it was added in Qt 5.5 + // Ignore all the future flags as well + if ((previousFlags ^ flags) & 0xff) { const int maskForTypeInfo = NeedsConstruction | NeedsDestruction | MovableType; const char *msg = "QMetaType::registerType: Binary compatibility break. " "\nType flags for type '%s' [%i] don't match. Previously " From 5dbd1ed7a3ebd69b2ee27512bee5195607dd14e8 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 10 Jun 2015 08:31:49 +0200 Subject: [PATCH 16/40] Fix signature of new methods Don't return a const QString &, return the QString by value. This is still broken for some of the older methods, but let's not add to it. Change-Id: Ic5cabb1b89eda0fcf678dbe175963e03109e5c2c Reviewed-by: Frederik Gladhorn --- src/gui/accessible/qaccessible.cpp | 12 ++++++------ src/gui/accessible/qaccessible.h | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp index 5b6bae7cabc..f2764ac4253 100644 --- a/src/gui/accessible/qaccessible.cpp +++ b/src/gui/accessible/qaccessible.cpp @@ -2743,7 +2743,7 @@ const QString &QAccessibleActionInterface::toggleAction() Returns the name of the scroll left default action. \sa actionNames(), localizedActionName() */ -const QString &QAccessibleActionInterface::scrollLeftAction() +QString QAccessibleActionInterface::scrollLeftAction() { return accessibleActionStrings()->scrollLeftAction; } @@ -2752,7 +2752,7 @@ const QString &QAccessibleActionInterface::scrollLeftAction() Returns the name of the scroll right default action. \sa actionNames(), localizedActionName() */ -const QString &QAccessibleActionInterface::scrollRightAction() +QString QAccessibleActionInterface::scrollRightAction() { return accessibleActionStrings()->scrollRightAction; } @@ -2761,7 +2761,7 @@ const QString &QAccessibleActionInterface::scrollRightAction() Returns the name of the scroll up default action. \sa actionNames(), localizedActionName() */ -const QString &QAccessibleActionInterface::scrollUpAction() +QString QAccessibleActionInterface::scrollUpAction() { return accessibleActionStrings()->scrollUpAction; } @@ -2770,7 +2770,7 @@ const QString &QAccessibleActionInterface::scrollUpAction() Returns the name of the scroll down default action. \sa actionNames(), localizedActionName() */ -const QString &QAccessibleActionInterface::scrollDownAction() +QString QAccessibleActionInterface::scrollDownAction() { return accessibleActionStrings()->scrollDownAction; } @@ -2779,7 +2779,7 @@ const QString &QAccessibleActionInterface::scrollDownAction() Returns the name of the previous page default action. \sa actionNames(), localizedActionName() */ -const QString &QAccessibleActionInterface::previousPageAction() +QString QAccessibleActionInterface::previousPageAction() { return accessibleActionStrings()->previousPageAction; } @@ -2788,7 +2788,7 @@ const QString &QAccessibleActionInterface::previousPageAction() Returns the name of the next page default action. \sa actionNames(), localizedActionName() */ -const QString &QAccessibleActionInterface::nextPageAction() +QString QAccessibleActionInterface::nextPageAction() { return accessibleActionStrings()->nextPageAction; } diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h index faa8cd719d3..bfe1e6c542c 100644 --- a/src/gui/accessible/qaccessible.h +++ b/src/gui/accessible/qaccessible.h @@ -636,12 +636,12 @@ public: static const QString &showMenuAction(); static const QString &setFocusAction(); static const QString &toggleAction(); - static const QString &scrollLeftAction(); - static const QString &scrollRightAction(); - static const QString &scrollUpAction(); - static const QString &scrollDownAction(); - static const QString &nextPageAction(); - static const QString &previousPageAction(); + static QString scrollLeftAction(); + static QString scrollRightAction(); + static QString scrollUpAction(); + static QString scrollDownAction(); + static QString nextPageAction(); + static QString previousPageAction(); }; class Q_GUI_EXPORT QAccessibleImageInterface From 5818ba4b0bb53b44ee41176321ca5cc852468b13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 9 Jun 2015 13:37:05 +0200 Subject: [PATCH 17/40] Compile on 10.7: Disable constexpr support Apple Clang 3.2 is known bad with broken or partial support. Which version is the first good version is unknown. Change-Id: I1b938281680dde5acbe0e08979444b6055a1cc4e Reviewed-by: Thiago Macieira --- 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 f8a8a436bec..a5738a434b1 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -613,7 +613,7 @@ # if __has_feature(cxx_strong_enums) # define Q_COMPILER_CLASS_ENUM # endif -# if __has_feature(cxx_constexpr) +# if __has_feature(cxx_constexpr) && Q_CC_CLANG > 302 /* CLANG 3.2 has bad/partial support */ # define Q_COMPILER_CONSTEXPR # endif # if __has_feature(cxx_decltype) /* && __has_feature(cxx_decltype_incomplete_return_types) */ From 92cda9474245c79b635c21cd140c5d0a3a6d2e5b Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Mon, 8 Jun 2015 11:55:10 +0200 Subject: [PATCH 18/40] QSslSocket: move default cipher, EC and default CA APIs to QSslConfiguration QSslConfiguration is better suited for these APIs. The ones in QSslSocket that already have a counterpart have been deprecated. [ChangeLog][QtNetwork][SSL/TLS Support] Most of the QSslSocket functions to deal with ciphersuites, certification authorities as well as elliptic curves have been deprecated in favor of the corresponding counterparts in QSslConfiguration. Task-number: QTBUG-46558 Change-Id: I1de03379efcbcab931c20e876e252769fe4279e0 Reviewed-by: Liang Qi Reviewed-by: Richard J. Moore Reviewed-by: Jani Heikkinen --- src/network/ssl/qsslcipher.cpp | 5 +- src/network/ssl/qsslconfiguration.cpp | 45 +++++ src/network/ssl/qsslconfiguration.h | 3 + src/network/ssl/qsslsocket.cpp | 178 +++++------------- src/network/ssl/qsslsocket.h | 35 ++-- src/network/ssl/qsslsocket_openssl.cpp | 2 +- src/network/ssl/qsslsocket_p.h | 2 - .../tst_qsslellipticcurve.cpp | 6 +- 8 files changed, 116 insertions(+), 160 deletions(-) diff --git a/src/network/ssl/qsslcipher.cpp b/src/network/ssl/qsslcipher.cpp index 8f2b8b54ad4..c480b79371a 100644 --- a/src/network/ssl/qsslcipher.cpp +++ b/src/network/ssl/qsslcipher.cpp @@ -54,6 +54,7 @@ #include "qsslcipher.h" #include "qsslcipher_p.h" #include "qsslsocket.h" +#include "qsslconfiguration.h" #ifndef QT_NO_DEBUG_STREAM #include @@ -81,7 +82,7 @@ QSslCipher::QSslCipher() QSslCipher::QSslCipher(const QString &name) : d(new QSslCipherPrivate) { - foreach (const QSslCipher &cipher, QSslSocket::supportedCiphers()) { + foreach (const QSslCipher &cipher, QSslConfiguration::supportedCiphers()) { if (cipher.name() == name) { *this = cipher; return; @@ -102,7 +103,7 @@ QSslCipher::QSslCipher(const QString &name) QSslCipher::QSslCipher(const QString &name, QSsl::SslProtocol protocol) : d(new QSslCipherPrivate) { - foreach (const QSslCipher &cipher, QSslSocket::supportedCiphers()) { + foreach (const QSslCipher &cipher, QSslConfiguration::supportedCiphers()) { if (cipher.name() == name && cipher.protocol() == protocol) { *this = cipher; return; diff --git a/src/network/ssl/qsslconfiguration.cpp b/src/network/ssl/qsslconfiguration.cpp index 5c95c9f5440..4803e472243 100644 --- a/src/network/ssl/qsslconfiguration.cpp +++ b/src/network/ssl/qsslconfiguration.cpp @@ -36,6 +36,7 @@ #include "qsslconfiguration.h" #include "qsslconfiguration_p.h" #include "qsslsocket.h" +#include "qsslsocket_p.h" #include "qmutex.h" #include "qdebug.h" @@ -589,6 +590,20 @@ void QSslConfiguration::setCiphers(const QList &ciphers) d->ciphers = ciphers; } +/*! + \since 5.5 + + Returns the list of cryptographic ciphers supported by this + system. This list is set by the system's SSL libraries and may + vary from system to system. + + \sa ciphers(), setCiphers() +*/ +QList QSslConfiguration::supportedCiphers() +{ + return QSslSocketPrivate::supportedCiphers(); +} + /*! Returns this connection's CA certificate database. The CA certificate database is used by the socket during the handshake phase to @@ -618,6 +633,22 @@ void QSslConfiguration::setCaCertificates(const QList &certific d->allowRootCertOnDemandLoading = false; } +/*! + \since 5.5 + + This function provides the CA certificate database + provided by the operating system. The CA certificate database + returned by this function is used to initialize the database + returned by caCertificates() on the default QSslConfiguration. + + \sa caCertificates(), setCaCertificates(), defaultConfiguration() +*/ +QList QSslConfiguration::systemCaCertificates() +{ + // we are calling ensureInitialized() in the method below + return QSslSocketPrivate::systemCaCertificates(); +} + /*! Enables or disables an SSL compatibility \a option. If \a on is true, the \a option is enabled. If \a on is false, the @@ -743,6 +774,20 @@ void QSslConfiguration::setEllipticCurves(const QVector &curv d->ellipticCurves = curves; } +/*! + \since 5.5 + + Returns the list of elliptic curves supported by this + system. This list is set by the system's SSL libraries and may + vary from system to system. + + \sa ellipticCurves(), setEllipticCurves() +*/ +QVector QSslConfiguration::supportedEllipticCurves() +{ + return QSslSocketPrivate::supportedEllipticCurves(); +} + /*! \since 5.3 diff --git a/src/network/ssl/qsslconfiguration.h b/src/network/ssl/qsslconfiguration.h index c5a1c6e6d43..960aec60ce7 100644 --- a/src/network/ssl/qsslconfiguration.h +++ b/src/network/ssl/qsslconfiguration.h @@ -111,10 +111,12 @@ public: // Cipher settings QList ciphers() const; void setCiphers(const QList &ciphers); + static QList supportedCiphers(); // Certificate Authority (CA) settings QList caCertificates() const; void setCaCertificates(const QList &certificates); + static QList systemCaCertificates(); void setSslOption(QSsl::SslOption option, bool on); bool testSslOption(QSsl::SslOption option) const; @@ -126,6 +128,7 @@ public: // EC settings QVector ellipticCurves() const; void setEllipticCurves(const QVector &curves); + static QVector supportedEllipticCurves(); static QSslConfiguration defaultConfiguration(); static void setDefaultConfiguration(const QSslConfiguration &configuration); diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index 513cc51620b..07c0cd4bf8d 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -1166,6 +1166,10 @@ QSslKey QSslSocket::privateKey() const } /*! + \deprecated + + Use QSslConfiguration::ciphers() instead. + Returns this socket's current cryptographic cipher suite. This list is used during the socket's handshake phase for choosing a session cipher. The returned list of ciphers is ordered by @@ -1197,6 +1201,10 @@ QList QSslSocket::ciphers() const } /*! + \deprecated + + USe QSslConfiguration::setCiphers() instead. + Sets the cryptographic cipher suite for this socket to \a ciphers, which must contain a subset of the ciphers in the list returned by supportedCiphers(). @@ -1213,6 +1221,10 @@ void QSslSocket::setCiphers(const QList &ciphers) } /*! + \deprecated + + Use QSslConfiguration::setCiphers() instead. + Sets the cryptographic cipher suite for this socket to \a ciphers, which is a colon-separated list of cipher suite names. The ciphers are listed in order of preference, starting with the most preferred cipher. For example: @@ -1238,6 +1250,10 @@ void QSslSocket::setCiphers(const QString &ciphers) } /*! + \deprecated + + Use QSslConfiguration::setCiphers() on the default QSslConfiguration instead. + Sets the default cryptographic cipher suite for all sockets in this application to \a ciphers, which must contain a subset of the ciphers in the list returned by supportedCiphers(). @@ -1254,6 +1270,10 @@ void QSslSocket::setDefaultCiphers(const QList &ciphers) } /*! + \deprecated + + Use QSslConfiguration::ciphers() on the default QSslConfiguration instead. + Returns the default cryptographic cipher suite for all sockets in this application. This list is used during the socket's handshake phase when negotiating with the peer to choose a session cipher. @@ -1273,6 +1293,10 @@ QList QSslSocket::defaultCiphers() } /*! + \deprecated + + Use QSslConfiguration::supportedCiphers() instead. + Returns the list of cryptographic ciphers supported by this system. This list is set by the system's SSL libraries and may vary from system to system. @@ -1284,120 +1308,6 @@ QList QSslSocket::supportedCiphers() return QSslSocketPrivate::supportedCiphers(); } -/*! - \since 5.5 - - Returns this socket's current list of elliptic curves. This - list is used during the socket's handshake phase for choosing an - elliptic curve (when using an elliptic curve cipher). - The returned list of curves is ordered by descending preference - (i.e., the first curve in the list is the most preferred one). - - By default, this list is empty. An empty default list means that the - handshake phase can choose any of the curves supported by this system's SSL - libraries (which may vary from system to system). The list of curves - supported by this system's SSL libraries is returned by - supportedEllipticCurves(). - - You can restrict the list of curves used for choosing the session cipher - for this socket by calling setEllipticCurves() with a subset of the - supported ciphers. You can revert to using the entire set by calling - setEllipticCurves() with the list returned by supportedEllipticCurves(). - - \sa setEllipticCurves(), defaultEllipticCurves(), setDefaultEllipticCurves(), supportedEllipticCurves() -*/ -QVector QSslSocket::ellipticCurves() const -{ - Q_D(const QSslSocket); - return d->configuration.ellipticCurves; -} - -/*! - \since 5.5 - - Sets the list of elliptic curves to be used by this socket to \a curves, - which must contain a subset of the curves in the list returned by - supportedEllipticCurves(). - - Restricting the elliptic curves must be done before the handshake - phase, where the session cipher is chosen. - - If an empty list is set, then the handshake phase can choose any of the - curves supported by this system's SSL libraries (which may vary from system - to system). The list of curves supported by this system's SSL libraries is - returned by supportedEllipticCurves(). - - Use setCipher() in order to disable the usage of elliptic curve ciphers. - - \sa ellipticCurves(), setDefaultEllipticCurves(), supportedEllipticCurves() -*/ -void QSslSocket::setEllipticCurves(const QVector &curves) -{ - Q_D(QSslSocket); - d->configuration.ellipticCurves = curves; -} - -/*! - \since 5.5 - - Sets the list of elliptic curves to be used by all sockets in this - application to \a curves, which must contain a subset of the curves in the - list returned by supportedEllipticCurves(). - - Restricting the default elliptic curves only affects SSL sockets - that perform their handshake phase after the default list has been changed. - - If an empty list is set, then the handshake phase can choose any of the - curves supported by this system's SSL libraries (which may vary from system - to system). The list of curves supported by this system's SSL libraries is - returned by supportedEllipticCurves(). - - Use setDefaultCiphers() in order to disable the usage of elliptic curve ciphers. - - \sa setEllipticCurves(), defaultEllipticCurves(), supportedEllipticCurves() -*/ -void QSslSocket::setDefaultEllipticCurves(const QVector &curves) -{ - QSslSocketPrivate::setDefaultEllipticCurves(curves); -} - - -/*! - \since 5.5 - - Returns the default elliptic curves list for all sockets in - this application. This list is used during the socket's handshake - phase when negotiating with the peer to choose a session cipher. - The list is ordered by preference (i.e., the first curve in the - list is the most preferred one). - - By default, this list is empty. An empty default list means that the - handshake phase can choose any of the curves supported by this system's SSL - libraries (which may vary from system to system). The list of curves - supported by this system's SSL libraries is returned by - supportedEllipticCurves(). - - \sa setDefaultEllipticCurves(), supportedEllipticCurves() -*/ -QVector QSslSocket::defaultEllipticCurves() -{ - return QSslSocketPrivate::defaultEllipticCurves(); -} - -/*! - \since 5.5 - - Returns the list of elliptic curves supported by this - system. This list is set by the system's SSL libraries and may - vary from system to system. - - \sa ellipticCurves(), setEllipticCurves(), defaultEllipticCurves() -*/ -QVector QSslSocket::supportedEllipticCurves() -{ - return QSslSocketPrivate::supportedEllipticCurves(); -} - /*! Searches all files in the \a path for certificates encoded in the specified \a format and adds them to this socket's CA certificate @@ -1456,6 +1366,10 @@ void QSslSocket::addCaCertificates(const QList &certificates) } /*! + \deprecated + + Use QSslConfiguration::setCaCertificates() instead. + Sets this socket's CA certificate database to be \a certificates. The certificate database must be set prior to the SSL handshake. The CA certificate database is used by the socket during the @@ -1475,6 +1389,10 @@ void QSslSocket::setCaCertificates(const QList &certificates) } /*! + \deprecated + + Use QSslConfiguration::caCertificates() instead. + Returns this socket's CA certificate database. The CA certificate database is used by the socket during the handshake phase to validate the peer's certificate. It can be moodified prior to the @@ -1535,6 +1453,10 @@ void QSslSocket::addDefaultCaCertificates(const QList &certific } /*! + \deprecated + + Use QSslConfiguration::setCaCertificates() on the default QSslConfiguration instead. + Sets the default CA certificate database to \a certificates. The default CA certificate database is originally set to your system's default CA certificate database. You can override the default CA @@ -1552,6 +1474,10 @@ void QSslSocket::setDefaultCaCertificates(const QList &certific } /*! + \deprecated + + Use QSslConfiguration::caCertificates() on the default QSslConfiguration instead. + Returns the current default CA certificate database. This database is originally set to your system's default CA certificate database. If no system default database is found, an empty database will be @@ -1572,6 +1498,10 @@ QList QSslSocket::defaultCaCertificates() } /*! + \deprecated + + Use QSslConfiguration::systemDefaultCaCertificates instead. + This function provides the CA certificate database provided by the operating system. The CA certificate database returned by this function is used to initialize the database @@ -2163,16 +2093,6 @@ void QSslSocketPrivate::setDefaultSupportedCiphers(const QList &ciph globalData()->supportedCiphers = ciphers; } -/*! - \internal -*/ -QVector QSslSocketPrivate::defaultEllipticCurves() -{ - QSslSocketPrivate::ensureInitialized(); - const QMutexLocker locker(&globalData()->mutex); - return globalData()->config->ellipticCurves; -} - /*! \internal */ @@ -2183,16 +2103,6 @@ QVector QSslSocketPrivate::supportedEllipticCurves() return globalData()->supportedEllipticCurves; } -/*! - \internal -*/ -void QSslSocketPrivate::setDefaultEllipticCurves(const QVector &curves) -{ - const QMutexLocker locker(&globalData()->mutex); - globalData()->config.detach(); - globalData()->config->ellipticCurves = curves; -} - /*! \internal */ diff --git a/src/network/ssl/qsslsocket.h b/src/network/ssl/qsslsocket.h index 8ad6d033a72..4124f5b7e55 100644 --- a/src/network/ssl/qsslsocket.h +++ b/src/network/ssl/qsslsocket.h @@ -144,34 +144,33 @@ public: QSslKey privateKey() const; // Cipher settings. - QList ciphers() const; - void setCiphers(const QList &ciphers); - void setCiphers(const QString &ciphers); - static void setDefaultCiphers(const QList &ciphers); - static QList defaultCiphers(); - static QList supportedCiphers(); - - // EC settings. - QVector ellipticCurves() const; - void setEllipticCurves(const QVector &curves); - static void setDefaultEllipticCurves(const QVector &curves); - static QVector defaultEllipticCurves(); - static QVector supportedEllipticCurves(); +#if QT_DEPRECATED_SINCE(5, 5) + QT_DEPRECATED_X("Use QSslConfiguration::ciphers()") QList ciphers() const; + QT_DEPRECATED_X("Use QSslConfiguration::setCiphers()") void setCiphers(const QList &ciphers); + QT_DEPRECATED void setCiphers(const QString &ciphers); + QT_DEPRECATED static void setDefaultCiphers(const QList &ciphers); + QT_DEPRECATED static QList defaultCiphers(); + QT_DEPRECATED_X("Use QSslConfiguration::supportedCiphers()") static QList supportedCiphers(); +#endif // QT_DEPRECATED_SINCE(5, 5) // CA settings. bool addCaCertificates(const QString &path, QSsl::EncodingFormat format = QSsl::Pem, QRegExp::PatternSyntax syntax = QRegExp::FixedString); void addCaCertificate(const QSslCertificate &certificate); void addCaCertificates(const QList &certificates); - void setCaCertificates(const QList &certificates); - QList caCertificates() const; +#if QT_DEPRECATED_SINCE(5, 5) + QT_DEPRECATED_X("Use QSslConfiguration::setCaCertificates()") void setCaCertificates(const QList &certificates); + QT_DEPRECATED_X("Use QSslConfiguration::caCertificates()") QList caCertificates() const; +#endif // QT_DEPRECATED_SINCE(5, 5) static bool addDefaultCaCertificates(const QString &path, QSsl::EncodingFormat format = QSsl::Pem, QRegExp::PatternSyntax syntax = QRegExp::FixedString); static void addDefaultCaCertificate(const QSslCertificate &certificate); static void addDefaultCaCertificates(const QList &certificates); - static void setDefaultCaCertificates(const QList &certificates); - static QList defaultCaCertificates(); - static QList systemCaCertificates(); +#if QT_DEPRECATED_SINCE(5, 5) + QT_DEPRECATED static void setDefaultCaCertificates(const QList &certificates); + QT_DEPRECATED static QList defaultCaCertificates(); + QT_DEPRECATED_X("Use QSslConfiguration::systemCaCertificates()") static QList systemCaCertificates(); +#endif // QT_DEPRECATED_SINCE(5, 5) bool waitForConnected(int msecs = 30000) Q_DECL_OVERRIDE; bool waitForEncrypted(int msecs = 30000); diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index 19848a73f04..049666b70bf 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -1685,7 +1685,7 @@ QList QSslSocketBackendPrivate::verify(const QList & setDefaultCaCertificates(defaultCaCertificates() + systemCaCertificates()); } - foreach (const QSslCertificate &caCertificate, QSslSocket::defaultCaCertificates()) { + foreach (const QSslCertificate &caCertificate, QSslConfiguration::defaultConfiguration().caCertificates()) { // From https://www.openssl.org/docs/ssl/SSL_CTX_load_verify_locations.html: // // If several CA certificates matching the name, key identifier, and diff --git a/src/network/ssl/qsslsocket_p.h b/src/network/ssl/qsslsocket_p.h index 5f726f2371b..d6519718d95 100644 --- a/src/network/ssl/qsslsocket_p.h +++ b/src/network/ssl/qsslsocket_p.h @@ -137,9 +137,7 @@ public: static void setDefaultSupportedCiphers(const QList &ciphers); static void resetDefaultCiphers(); - static QVector defaultEllipticCurves(); static QVector supportedEllipticCurves(); - static void setDefaultEllipticCurves(const QVector &curves); static void setDefaultSupportedEllipticCurves(const QVector &curves); static void resetDefaultEllipticCurves(); diff --git a/tests/auto/network/ssl/qsslellipticcurve/tst_qsslellipticcurve.cpp b/tests/auto/network/ssl/qsslellipticcurve/tst_qsslellipticcurve.cpp index c97b46a5122..685d354cc9e 100644 --- a/tests/auto/network/ssl/qsslellipticcurve/tst_qsslellipticcurve.cpp +++ b/tests/auto/network/ssl/qsslellipticcurve/tst_qsslellipticcurve.cpp @@ -34,7 +34,7 @@ #include #include -#include +#include class tst_QSslEllipticCurve : public QObject { @@ -84,7 +84,7 @@ void tst_QSslEllipticCurve::fromShortName_data() QTest::newRow("QString()") << QString() << QSslEllipticCurve() << false; QTest::newRow("\"\"") << QString("") << QSslEllipticCurve() << false; QTest::newRow("does-not-exist") << QStringLiteral("does-not-exist") << QSslEllipticCurve() << false; - Q_FOREACH (QSslEllipticCurve ec, QSslSocket::supportedEllipticCurves()) { + Q_FOREACH (QSslEllipticCurve ec, QSslConfiguration::supportedEllipticCurves()) { const QString sN = ec.shortName(); QTest::newRow(qPrintable("supported EC \"" + sN + '"')) << sN << ec << true; // At least in the OpenSSL impl, the short name is case-sensitive. That feels odd. @@ -117,7 +117,7 @@ void tst_QSslEllipticCurve::fromLongName_data() QTest::newRow("QString()") << QString() << QSslEllipticCurve() << false; QTest::newRow("\"\"") << QString("") << QSslEllipticCurve() << false; QTest::newRow("does-not-exist") << QStringLiteral("does-not-exist") << QSslEllipticCurve() << false; - Q_FOREACH (QSslEllipticCurve ec, QSslSocket::supportedEllipticCurves()) { + Q_FOREACH (QSslEllipticCurve ec, QSslConfiguration::supportedEllipticCurves()) { const QString lN = ec.longName(); QTest::newRow(qPrintable("supported EC \"" + lN + '"')) << lN << ec << true; } From 827e195f17599446d27124ef74a131277fb143c7 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 11 Jun 2015 10:37:21 +0200 Subject: [PATCH 19/40] OSX: check if we have a native drag before accessing it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We used to check if [sender draggingSource] != nil to determine if the current drag was started by the application itself or somewhere else. While this is correct use of the API, the problem is that a drag can also be started by UIKit if e.g dragging the file icon in the titlebar. And in that case, Qt has no no native drag data. Since we didn't take this usecase into account, we tried to access the data anyway, which led to a crash. This patch will instead check if we have native drag data directly before trying to access it, which will also cover the usecase mentioned above. Task-number: QTBUG-46598 Change-Id: Ic91b86f658670b895d90a1533246ba24a00dde41 Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qnsview.mm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index ff6cd14bc72..d44cdb392c5 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -1913,8 +1913,9 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin QGuiApplicationPrivate::modifier_buttons = [QNSView convertKeyModifiers: [[NSApp currentEvent] modifierFlags]]; QPlatformDragQtResponse response(false, Qt::IgnoreAction, QRect()); - if ([sender draggingSource] != nil) { - QCocoaDrag* nativeDrag = QCocoaIntegration::instance()->drag(); + QCocoaDrag* nativeDrag = QCocoaIntegration::instance()->drag(); + if (nativeDrag->currentDrag()) { + // The drag was started from within the application response = QWindowSystemInterface::handleDrag(target, nativeDrag->platformDropData(), mapWindowCoordinates(m_window, target, qt_windowPoint), qtAllowed); [self updateCursorFromDragResponse:response drag:nativeDrag]; } else { @@ -1950,8 +1951,9 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin Qt::DropActions qtAllowed = qt_mac_mapNSDragOperations([sender draggingSourceOperationMask]); QPlatformDropQtResponse response(false, Qt::IgnoreAction); - if ([sender draggingSource] != nil) { - QCocoaDrag* nativeDrag = QCocoaIntegration::instance()->drag(); + QCocoaDrag* nativeDrag = QCocoaIntegration::instance()->drag(); + if (nativeDrag->currentDrag()) { + // The drag was started from within the application response = QWindowSystemInterface::handleDrop(target, nativeDrag->platformDropData(), mapWindowCoordinates(m_window, target, qt_windowPoint), qtAllowed); } else { QCocoaDropData mimeData([sender draggingPasteboard]); From 9a029c9de409976b8983fce81ae2029e010cb5f7 Mon Sep 17 00:00:00 2001 From: Ivan Komissarov Date: Tue, 26 May 2015 12:10:51 +0300 Subject: [PATCH 20/40] Fix sizes QStorageInfo returns for invalid drives Zero is a legitimate size to be returned by bytesFree/bytesAvailable functions, so change those functions to return some 'invalid' size in case of an invalid drive. This is also consistent with the original version from the Qt Systems framework. [ChangeLog][QtCore][QStorageInfo] Fixed sizes returned for invalid drives. Task-number: QTBUG-45724 Change-Id: I312fba521fdf8d52d7a0ac0e46cacca625775e80 Reviewed-by: Oswald Buddenhagen Reviewed-by: Thiago Macieira --- src/corelib/io/qstorageinfo.cpp | 6 ++++++ src/corelib/io/qstorageinfo_p.h | 2 +- .../io/qstorageinfo/tst_qstorageinfo.cpp | 18 +++++++++--------- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/corelib/io/qstorageinfo.cpp b/src/corelib/io/qstorageinfo.cpp index d63b6a2a215..337a9c7cefd 100644 --- a/src/corelib/io/qstorageinfo.cpp +++ b/src/corelib/io/qstorageinfo.cpp @@ -186,6 +186,8 @@ QString QStorageInfo::rootPath() const This size can be less than or equal to the free size returned by bytesFree() function. + Returns -1 if QStorageInfo object is not valid. + \sa bytesTotal(), bytesFree() */ qint64 QStorageInfo::bytesAvailable() const @@ -198,6 +200,8 @@ qint64 QStorageInfo::bytesAvailable() const quotas on the filesystem, this value can be larger than the value returned by bytesAvailable(). + Returns -1 if QStorageInfo object is not valid. + \sa bytesTotal(), bytesAvailable() */ qint64 QStorageInfo::bytesFree() const @@ -208,6 +212,8 @@ qint64 QStorageInfo::bytesFree() const /*! Returns the total volume size in bytes. + Returns -1 if QStorageInfo object is not valid. + \sa bytesFree(), bytesAvailable() */ qint64 QStorageInfo::bytesTotal() const diff --git a/src/corelib/io/qstorageinfo_p.h b/src/corelib/io/qstorageinfo_p.h index 9e152df1ada..564321bedd5 100644 --- a/src/corelib/io/qstorageinfo_p.h +++ b/src/corelib/io/qstorageinfo_p.h @@ -53,7 +53,7 @@ class QStorageInfoPrivate : public QSharedData { public: inline QStorageInfoPrivate() : QSharedData(), - bytesTotal(0), bytesFree(0), bytesAvailable(0), + bytesTotal(-1), bytesFree(-1), bytesAvailable(-1), readOnly(false), ready(false), valid(false) {} diff --git a/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp b/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp index 2190c32c017..a7a0cf4ddb9 100644 --- a/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp +++ b/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp @@ -61,9 +61,9 @@ void tst_QStorageInfo::defaultValues() QVERIFY(!storage.isRoot()); QVERIFY(storage.device().isEmpty()); QVERIFY(storage.fileSystemType().isEmpty()); - QVERIFY(storage.bytesTotal() == 0); - QVERIFY(storage.bytesFree() == 0); - QVERIFY(storage.bytesAvailable() == 0); + QVERIFY(storage.bytesTotal() == -1); + QVERIFY(storage.bytesFree() == -1); + QVERIFY(storage.bytesAvailable() == -1); } void tst_QStorageInfo::operatorEqual() @@ -106,9 +106,9 @@ void tst_QStorageInfo::root() QVERIFY(!storage.device().isEmpty()); QVERIFY(!storage.fileSystemType().isEmpty()); #ifndef Q_OS_HAIKU - QVERIFY(storage.bytesTotal() > 0); - QVERIFY(storage.bytesFree() > 0); - QVERIFY(storage.bytesAvailable() > 0); + QVERIFY(storage.bytesTotal() >= 0); + QVERIFY(storage.bytesFree() >= 0); + QVERIFY(storage.bytesAvailable() >= 0); #endif } @@ -121,9 +121,9 @@ void tst_QStorageInfo::currentStorage() QVERIFY(appPath.startsWith(storage.rootPath(), Qt::CaseInsensitive)); QVERIFY(!storage.device().isEmpty()); QVERIFY(!storage.fileSystemType().isEmpty()); - QVERIFY(storage.bytesTotal() > 0); - QVERIFY(storage.bytesFree() > 0); - QVERIFY(storage.bytesAvailable() > 0); + QVERIFY(storage.bytesTotal() >= 0); + QVERIFY(storage.bytesFree() >= 0); + QVERIFY(storage.bytesAvailable() >= 0); } void tst_QStorageInfo::storageList() From eb9f2e304fd7bb458ad56ae27f21ed47c7c59ae5 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Wed, 10 Jun 2015 18:40:52 -0700 Subject: [PATCH 21/40] Version transitionType as a new property It is exposed in the QtQml.StateMachine import, but note that the metaobject version is just incremented (no need to match QtQml.StateMachine, which is in a different module). Change-Id: I50773d9dec5252aa93846b7e5f743958ee838023 Reviewed-by: Simon Hausmann --- src/corelib/statemachine/qabstracttransition.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/statemachine/qabstracttransition.h b/src/corelib/statemachine/qabstracttransition.h index bf32b3e825f..475a4dedfc5 100644 --- a/src/corelib/statemachine/qabstracttransition.h +++ b/src/corelib/statemachine/qabstracttransition.h @@ -59,7 +59,7 @@ class Q_CORE_EXPORT QAbstractTransition : public QObject Q_PROPERTY(QState* sourceState READ sourceState) Q_PROPERTY(QAbstractState* targetState READ targetState WRITE setTargetState NOTIFY targetStateChanged) Q_PROPERTY(QList targetStates READ targetStates WRITE setTargetStates NOTIFY targetStatesChanged) - Q_PROPERTY(TransitionType transitionType READ transitionType WRITE setTransitionType) + Q_PROPERTY(TransitionType transitionType READ transitionType WRITE setTransitionType REVISION 1) public: enum TransitionType { ExternalTransition, From d3379cee8a81afaf0f0691d248a399c69025a68f Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Sat, 13 Jun 2015 15:12:40 +0200 Subject: [PATCH 22/40] Document -secure-transport parameter in configure Change-Id: Iea658e37b681c54de35307b1e587adf0efd70970 Reviewed-by: Richard J. Moore --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index 7251e8e673b..8a4c89ed08d 100755 --- a/configure +++ b/configure @@ -2697,6 +2697,8 @@ MacOS/iOS options: link tools against those frameworks. -no-framework ...... Do not build Qt as a series of frameworks. + -secure-transport .. Use SecureTransport instead of OpenSSL (requires -no-openssl) + -sdk ......... Build Qt using Apple provided SDK . The argument should be one of the available SDKs as listed by 'xcodebuild -showsdks'. Note that the argument applies only to Qt libraries and applications built From 61ca116a2eaf8a275803524ade494ace6b9cb812 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 8 Jun 2015 21:49:48 +0200 Subject: [PATCH 23/40] QTest: Make qExtractTestData() return the created QTemporaryDir ... and enable auto-deletion on it. This allows users of the function to get rid of their own cleanup code. They just need to keep the shared pointer alive for as long as they need it. Drive-by changes: - replaced QStringLiterals that were only used as the rhs of op+ - replaced an instance of mid() used as the rhs of op+ with midRef() - enabled NRVO Change-Id: I161d39461e020c9e8d473c0810dea2109fe0d62d Reviewed-by: Lars Knoll --- src/testlib/qtestcase.cpp | 35 +++++++++++-------- src/testlib/qtestcase.h | 4 ++- .../corelib/io/qfileinfo/tst_qfileinfo.cpp | 15 ++++---- 3 files changed, 31 insertions(+), 23 deletions(-) diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index e3c543671b0..d9611f161e8 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -2794,36 +2794,39 @@ static inline bool isWindowsBuildDirectory(const QString &dirName) #endif /*! - Extract a directory from resources to disk. The content is extracted - recursively to a temporary folder. The extracted content is not removed - automatically. + Extracts a directory from resources to disk. The content is extracted + recursively to a temporary folder. The extracted content is removed + automatically once the last reference to the return value goes out of scope. \a dirName is the name of the directory to extract from resources. - Returns the path where the data was extracted or an empty string in case of + Returns the temporary directory where the data was extracted or null in case of errors. */ -QString QTest::qExtractTestData(const QString &dirName) +QSharedPointer QTest::qExtractTestData(const QString &dirName) { - QTemporaryDir temporaryDir; - temporaryDir.setAutoRemove(false); + QSharedPointer result; // null until success, then == tempDir - if (!temporaryDir.isValid()) - return QString(); + QSharedPointer tempDir = QSharedPointer::create(); - const QString dataPath = temporaryDir.path(); + tempDir->setAutoRemove(true); + + if (!tempDir->isValid()) + return result; + + const QString dataPath = tempDir->path(); const QString resourcePath = QLatin1Char(':') + dirName; const QFileInfo fileInfo(resourcePath); if (!fileInfo.isDir()) { qWarning("Resource path '%s' is not a directory.", qPrintable(resourcePath)); - return QString(); + return result; } QDirIterator it(resourcePath, QDirIterator::Subdirectories); if (!it.hasNext()) { qWarning("Resource directory '%s' is empty.", qPrintable(resourcePath)); - return QString(); + return result; } while (it.hasNext()) { @@ -2832,17 +2835,19 @@ QString QTest::qExtractTestData(const QString &dirName) QFileInfo fileInfo = it.fileInfo(); if (!fileInfo.isDir()) { - const QString destination = dataPath + QLatin1Char('/') + fileInfo.filePath().mid(resourcePath.length()); + const QString destination = dataPath + QLatin1Char('/') + fileInfo.filePath().midRef(resourcePath.length()); QFileInfo destinationFileInfo(destination); QDir().mkpath(destinationFileInfo.path()); if (!QFile::copy(fileInfo.filePath(), destination)) { qWarning("Failed to copy '%s'.", qPrintable(fileInfo.filePath())); - return QString(); + return result; } } } - return dataPath; + result = qMove(tempDir); + + return result; } /*! \internal diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h index 2c6a94faa1c..f24283b65ee 100644 --- a/src/testlib/qtestcase.h +++ b/src/testlib/qtestcase.h @@ -40,6 +40,8 @@ #include #include #include +#include +#include #include @@ -250,7 +252,7 @@ namespace QTest Q_TESTLIB_EXPORT void ignoreMessage(QtMsgType type, const QRegularExpression &messagePattern); #endif - Q_TESTLIB_EXPORT QString qExtractTestData(const QString &dirName); + Q_TESTLIB_EXPORT QSharedPointer qExtractTestData(const QString &dirName); Q_TESTLIB_EXPORT QString qFindTestData(const char* basepath, const char* file = 0, int line = 0, const char* builddir = 0); Q_TESTLIB_EXPORT QString qFindTestData(const QString& basepath, const char* file = 0, int line = 0, const char* builddir = 0); diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp index 62e183f6193..1e51f2c5f4d 100644 --- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp @@ -263,21 +263,23 @@ private slots: private: const QString m_currentDir; - QString m_dataPath; QString m_sourceFile; QString m_proFile; QString m_resourcesDir; QTemporaryDir m_dir; + QSharedPointer m_dataDir; }; void tst_QFileInfo::initTestCase() { - m_dataPath = QEXTRACTTESTDATA("/testdata"); - QVERIFY(!m_dataPath.isEmpty()); + m_dataDir = QEXTRACTTESTDATA("/testdata"); + QVERIFY(m_dataDir); + const QString dataPath = m_dataDir->path(); + QVERIFY(!dataPath.isEmpty()); - m_sourceFile = m_dataPath + QStringLiteral("/tst_qfileinfo.cpp"); - m_resourcesDir = m_dataPath + QStringLiteral("/resources"); - m_proFile = m_dataPath + QStringLiteral("/tst_qfileinfo.pro"); + m_sourceFile = dataPath + QLatin1String("/tst_qfileinfo.cpp"); + m_resourcesDir = dataPath + QLatin1String("/resources"); + m_proFile = dataPath + QLatin1String("/tst_qfileinfo.pro"); QVERIFY(m_dir.isValid()); QVERIFY(QDir::setCurrent(m_dir.path())); @@ -286,7 +288,6 @@ void tst_QFileInfo::initTestCase() void tst_QFileInfo::cleanupTestCase() { QDir::setCurrent(m_currentDir); // Release temporary directory so that it can be deleted on Windows - QDir(m_dataPath).removeRecursively(); } // Testing get/set functions From b5220d9dff295862c4d7389bf1ae9a7d75e90b54 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Mon, 15 Jun 2015 11:16:48 +0200 Subject: [PATCH 24/40] pbuilder_pbx: disable bit code for Xcode projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With Xcode7, Apple added support for compiling apps to bit code instead of binary (*). But this is only supported when the deployment target is at least 6.0. And in Qt-5.5, the deployment target is still set to 5.1.1. The result is that every Qt application will fail building once people move to Xcode7. Instead of bumping the deployment target (which we plan to do for Qt-5.6), we choose to switch off bit code for now. *: https://developer.apple.com/library/prerelease/ios/documentation/IDEs/Conceptual/AppDistributionGuide/AppThinning/AppThinning.html Change-Id: I23001563439a7726506b7cd2dc77a82533b8a27b Reviewed-by: Tor Arne Vestbø --- qmake/generators/mac/pbuilder_pbx.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index deacac2c837..81bb0683ac5 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -1408,6 +1408,10 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) QMap settings; settings.insert("COPY_PHASE_STRIP", (as_release ? "YES" : "NO")); + // Bitcode is only supported with a deployment target >= iOS 6.0. + // Disable it for now, and consider switching it on when later + // bumping the deployment target. + settings.insert("ENABLE_BITCODE", "NO"); settings.insert("GCC_GENERATE_DEBUGGING_SYMBOLS", as_release ? "NO" : "YES"); if(!as_release) settings.insert("GCC_OPTIMIZATION_LEVEL", "0"); From 4bfeac8ed385d41a8b63c84ce0e2668808335ee8 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 9 Jun 2015 10:51:12 -0700 Subject: [PATCH 25/40] Add changelog for 5.5.0 in qtbase Change-Id: I049a653beeb5454c9539ffff13e6233c123f8da7 Reviewed-by: Lars Knoll --- dist/changes-5.5.0 | 543 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 543 insertions(+) create mode 100644 dist/changes-5.5.0 diff --git a/dist/changes-5.5.0 b/dist/changes-5.5.0 new file mode 100644 index 00000000000..cba15969404 --- /dev/null +++ b/dist/changes-5.5.0 @@ -0,0 +1,543 @@ +Qt 5.5 introduces many new features and improvements as well as bugfixes +over the 5.4.x series. For more details, refer to the online documentation +included in this distribution. The documentation is also available online: + + http://doc.qt.io/qt-5.5 + +The Qt version 5.5 series is binary compatible with the 5.4.x series. +Applications compiled for 5.4 will continue to run with 5.5. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + + http://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* Deprecation Notice * +**************************************************************************** + + - Support for the following platforms or toolchains is deprecated in Qt + 5.5 and may be removed or stop compiling in a future version of Qt: + * Apple OS X builds using GNU libstdc++ + * BlackBerry 10 + * GNU Compiler Collection (GCC) versions 4.6 and earlier + * QNX 6.5 + * Microsoft Visual Studio compiler versions 2008 and 2010 + * Microsoft Windows XP, Windows Vista + * Microsoft Windows Embedded Compact 7 + Note: QNX 6.6 continues to be supported. + + - The QtWebKit, QtScript modules and support for the QML 1 language and + QtQuick 1 is deprecated and Qt 5.5 will be the last release to + include them. Starting with Qt 5.6, the source code for those modules + will not be included in Qt's packaging. Compiling the 5.5 release of + those modules along with other, updated Qt 5.6 modules should work. + + - [QTBUG-25121] The usage of the QStyleOptionProgressBar::orientation + member has been deprecated. + +**************************************************************************** +* Important Behavior Changes * +**************************************************************************** + + - Q_ASSERT will now expand the condition even in release mode when asserts + are disabled, albeit in an unreachable code path. This solves compiler + warnings about variables and functions that were unused in release mode + because they were only used in assertions. Unfortunately, codebases that + hid those functions and variables via #ifndef will need to remove the + conditionals to compile with Qt 5.5. + - QDBusConnection::sender() (deprecated since Qt 4.3) has changed to + always return an invalid QDBusConnection. To know what connection the + incoming call was received from, use QDBusContext. + - QHostAddress will no longer convert IPv6 addresses of type "v4-mapped" + to IPv4. To perform this conversion manually, construct another + QHostAddress with the result of toIPv4Address(). + - (DY)LD_LIBRARY_PATH will no longer "stick" in the process environment + when starting a QProcess. This means that if a QProcess is started with + a clear environment, it will not specially inherit (DY)LD_LIBRARY_PATH + from the parent process. This should not affect most applications, but + if the old behavior is desired, one can simply pass a clear + QProcessEnvironment with the (DY)LD_LIBRARY_PATH values added, to the + QProcess. + - QAbstractTableModel and QAbstractListModel now reimplement sibling() + to avoid calling parent() (which returns a constant). Subclasses of + these models that override parent(), will likely also need to + override sibling() now. + + - QCoreApplication: + * [QTBUG-30330][QTSOLBUG-184] On Windows, QCoreApplication::arguments() + now returns a list built from argv on Windows as well if a modified + argv was passed to the class' constructor. + + - QIODevice: + * Opening Android assets with QIODevice::ReadWrite now returns false to + correctly indicate that the files are not writable. + + - QItemDelegate: + * [QTBUG-3305] QItemDelegate will now not close a + QTextEdit/QPlainTextEdit editor when the tab key is pressed; instead, + the key will reach the editor. + + - QProgressDialog: + * [QTBUG-17427][QTBUG-25316] The timer for estimating the duration of + the progress dialog is now started in the constructor and in + setValue(minimum()), as well as when calling setValue(0), as + previously documented. + + - QSaveFile: + * [QTBUG-44086] Files created by QSaveFile do now have the same + rights as files created by QFile. This also fixes a regression in + QSettings: In the Qt 5.4 series, new files created by QSettings + were only readable by the current user. + + - QVariant: + * [QTBUG-42722] QVariant now obeys the C++ type promotion rules when + comparing numeric types (integrals, float and double), including the + fact that unsigned comparisons are preferred for types of the same + rank (that is, now QVariant(-1) > QVariant(0U)). + + - QWindow: + * QWindows will no longer be re-shown automatically when moved from a + destroyed QScreen, unless that QScreen was a virtual sibling of the + primary screen. + + - qmake: + * Qt configure and qmake used with a MinGW spec will no longer emulate + MSVC by picking up the INCLUDE and LIB environment variables. Use the + -I/-L configure options to pass additional paths, as you would under + Unix. + +**************************************************************************** +* Library * +**************************************************************************** + +QtCore +------ + + - Added qEnvironmentVariableIntValue(). + - Added Q_DECL_RELAXED_CONSTEXPR for the corresponding C++14 feature + - Added qHashRange() and qHashRangeCommutative() functions to aid + implementing qHash() overloads for custom types. + - Q_ENUMS and Q_FLAGS have been deprecated, and replaced by Q_ENUM and + Q_FLAG macros. These two new macros automatically register the enum with + the Qt metatype system, allowing automatic conversion to or from string + in QVariant, or to show the strings by QDebug operators. They also + enable the new QMetaEnum::fromType function. + - QPersistentModel index becomes an built-in meta-type, including QVariant + support. + - Updated Unicode data to v.7.0 + - Updated QLocale data to CLDR v.27 + - Updated QTimeZone data to CLDR v.27 + + - Item Models: + * QItemSelectionModel can now be created without a model and have one + set later. + + - Logging: + * QtInfoMsg got added as a new QtMsgType. Use the new qInfo(), qCInfo() + macros to log to it. + + - Logging framework: + * %{threadid} now prints the real thread ID. On Linux, OS X, iOS, + FreeBSD and Windows, the value is unique system-wide. On other + systems, it will print something that may be process-specific (the + value of pthread_self(3)). To print the pointer to QThread::current(), + use %{qthreadptr}. + + - Objective-C: + * [QTBUG-37116] Added NSDate/CDateRef converters for QDateTime + + - QAssociativeIterable: + * Added find(). + + - QCommandLineParser: + * Message boxes are used to display errors and usage if no console + window can be obtained on Windows. + + - QDebug: + * Printing of QStrings and QStringRefs whenever "noquote" is not active + now prints the strings in a format that can be copied back to C++ + code. All characters that aren't printable in US-ASCII are escaped + (this includes printable Unicode characters outside of US-ASCII). + Pretty-printing will not respect QTextFormat padding or field widths. + * Similarly, printing of QByteArrays whenever "noquote" is not active now + prints the arrays in a format consumable in C++, with all non-printable + characters printed in hex escape sequences. + + - QJsonObject: + * Added conversion to and from QVariantHash + + - QLibrary: + * Added DeepBindHint which maps to RTLD_DEEPBIND on Linux making it + possible to load libraries with external symbols that clash with + already loaded ones, such as plugins linked to Qt4. + + - QLockFile: + * [QTBUG-45497] Detection of stale lock files got more robust and takes + the name of the process that belongs to the stored PID into account. + + - QRegularExpression: + * Support for matching using QStringRef as the subject's string type has + been added. + + - QSet: + * Can now be used as the key in QSet and QHash. + + - QSortFilterProxyModel: + * [QTBUG-35440] QSortFilterProxyModel now properly forwards the roles + that have been changed when the source model emits dataChanged(). + + - QStandardPaths: + * [QTBUG-38872][QTBUG-38845] Added QStandardPaths::AppConfigLocation, + for application-specific configuration directory. ConfigLocation was + inconsistent. + + - QString: + * Added support for retrieving the QRegularExpressionMatch to indexOf + and lastIndexOf. + * Added QT_RESTRICTED_CAST_FROM_ASCII macro as less intrusive + alternative to QT_NO_CAST_FROM_ASCII. + * Added methods for convenient conversion to and from std::u16string and + std::u32string. + * Added asprintf(), vasprintf(). + + - QThreadPool: + * Added QThreadPool::cancel() which allows removing from the job queue a + job that hasn't been started yet. + + - QTimeZone: + * Added methods systemTimeZone() and utc() that return QTimeZone objects + for the system time zone and for UTC, respectively. + + - QVector: + * Added QVector::append(const QVector &) overload + + - QVector3D: + * Added convenience project and unproject methods to use like gluProject + and gluUnproject + + - QtMath: + * qmath.h no longer includes math.h, so any sources depending on that + indirect inclusion may fail to build. + + - State Machine: + * Added support for internal transitions. + * [QTBUG-40293] Added an addTransition() overload that takes a + pointer-to-member for the signal triggering the transition. + * [QTBUG-44963] Fixed an issue where a history state restore would + activate too many states, possibly putting the state machine in an + invalid state. + * QTBUG-44783] Fixed an issue where the state machine could end up in + an invalid state when transitions from a parallel state were not + checked for conflicts. + * Fixed a case where a parallel state was not exited and re-entered + when one of its substates was exited and subsequently re-entered. + * Fixed the non-deterministic behavior of picking a transition from a + set of conflicting transitions. + +QtDBus +------ + + - Added annotation org.qtproject.QtDBus.MethodName to allow + autogenerating C++ methods with different names to the original DBus + method + +QtGui +----- + + - Added support for device-specific backend plugins in eglfs. + - eglfs is now using fullscreen mode also when running on X11. + - Added a plugin to get mouse, keyboard and touch events via libinput. + - The linuxfb platform plugin's input device handling is now compatible + with eglfs. The evdev keyboard, mouse and touch code is compiled in by + default. + - The mouse cursor on Embedded Linux is now handling hotplugging correctly + with eglfs and linuxfb regardless of how the input handling code is + loaded (via a generic plugin or built in to the platform plugin). + - QOffscreenSurface is now relying on EGL_KHR_surfaceless_context when + available, and avoids creating a pbuffer surface when the extension is + present. + - initializeOpenGLFunctions() no longer needs to be called when querying a + versioned function wrapper object via QOpenGLContext::versionFunctions(). + - Added version function classes for OpenGL 4.4 and 4.5 and deprecate some + erroneously classified functions. + - Exposed TabFocusBehavior in QStyleHints + - [QTBUG-42240][QTBUG-43263] Qt now contains a built-in GPU driver + blacklist for Windows that disables the usage of desktop OpenGL with + some older cards that are known to be unstable with opengl32.dll. + - [QTBUG-44937] Support for QScreen::grabWindow() is now available on + embedded platforms (eglfs, linuxfb). + - Added QStyleHints::singleClickActivation to access whether the platform + expects item activation to occur on single clicks rather than double + clicks. + - [QTBUG-40034] QOpenGLWidget and QQuickWidget are now supported on iOS. + + - Accessibility: + * [QTBUG-44479] Qt now reports text attributes correctly on Linux, so + ORCA+F now works properly in QTextEdit and other text controls. + + - Accessibility / OS X: + * QTextEdit now properly reports to accessibility visual lines + (softlines) as lines, instead of whole paragraphs. This allows better + VoiceOver user experience when reading text line by line using arrows + up/down. + * Visual bounds returned by QTextEdit were singificantly improved; this + enables VoiceOver to draw properly positioned VoiceOver cursor. + + - Image plugins: + * [QTBUG-37946][QTBUG-43563][QTBUG-45552][QTBUG-45865] An option has + been added to QImageReader to enable automatic application of EXIF + orientation. This behavior was default in Qt 5.4.1, but reverted in Qt + 5.4.2. + + - QFontDatabase: + * Added QFontDatabase::isPrivateFamily() + + - QImage: + * Added support for grayscale and alpha 8-bit formats which can also be + rendered to. + + - QPainter: + * [QTBUG-35830] QPainter will no longer try to replace IntersectClip + with ReplaceClip if the paint engine is a QPicture. + + - QPlatformSurfaceEvent: + * [QTBUG-42476][QTBUG-42483] Added event class QPlatformSurfaceEvent, + which is sent to QWindow and QOffscreenSurface when native surface is + created or about to be destroyed. + + - QQuaternion: + * Added methods to convert a quaternion to/from Euler angles and to/from + rotation matrix. + + - QScreen: + * Added devicePixelRatio property. + + - QTextDocument: + * Support for searching with a QRegularExpression in a document has been + added. + + - QWheelEvent: + * On OSX, trackpad wheel event phase transitions now occur in the order + ScrollBegin, ScrollUpdate, ..., ScrollEnd, ScrollUpdate, ..., + ScrollEnd, where the second batch of updates represents momentum + events (inertial scrolling). + + - QWindow: + * [QTBUG-32956] lastWindowClosed will now be emitted even if + quitOnLastWindowClosed is not set. + + - Windows: + * [QTBUG-43263] Introduced experimental feature allowing the user to + specify a GPU driver buglist with some additional keywords to chooose + the GL renderer backend depending on GPU. + + - i18n: + * [QTBUG-43447] Fixed bug where layout direction did not switch + according to the instruction in the translation file. + + - Text: + * [QTBUG-39286] Fixed position of underline on centered text when the + text layout's width is an even number. + +QtNetwork +--------- + + - [QTBUG-26295] Introduced libproxy backend for Unix platforms, enabled + automatically if the required dev package is present + - As some legacy ifdefs for OpenSSL 0.9.7 and 0.9.8f were removed, Qt + will no longer build with these versions. In addition, there is no + longer support for an OpenSSL library built with NO_TLSEXT. + - [QTBUG-26538] Fixed a bug that caused both QTcpSocket and QUdpSocket to + close the socket and lose any bound ports before connecting. Now + bind()/setSocketDescriptor() followed by connect() will retain the + original file descriptor. + + - QLocalSocket: + * [QTBUG-16688] On Windows, waitForReadyRead now always waits for more + data, even if bytes are still in the buffer. + + - QNetworkAccessManager: + * It is now possible to use TLS PSK ciphersuites when using HTTPS (or + similar protocols working over SSL). + + - QSslSocket: + * [QTBUG-39077] It is now possible to use TLS PSK ciphersuites in client + sockets. + * A new SSL backend for iOS and OS X, implemented with Apple's Secure + Transport (Security Framework). + + - SSL/TLS support: + * [QTBUG-18972] It is now possible to parse elliptic curve certificates. + * It is now possible to choose which elliptic curves should be used by + an elliptic curve cipher. + +QtTest +------ + + - QCOMPARE now pretty-prints QSizePolicy{,::Policy,::ControlType{,s}}. + - QtTest now prints an escaped version of QByteArrays that failed to + compare with QCOMPARE, instead of the hex dump. + - QTest::toString() can now be overloaded (instead of just specialized) + for custom types, and is now reliably found through argument-dependent + lookup (ADL). + +QtWidgets +--------- + + - Added QPlainTextEdit::createStandardContextMenu(QPoint) overload that + takes the position in document coordinates. This method enables the + actions that are sensitive to the given position eg. where the user + clicked. + + - Accessibility / OS X: + * VoiceOver users of QTextEdit can now use mouse and touch exploration + on trackpad to point at text to have spoken to them. + + - Layouts: + * [QTBUG-43099] Fixed a bug where spans sometimes didn't distribute + themselves to the last cells they covered. + + - QAbstractItemView: + * Added iconSizeChanged signal. + + - QAbstractScrollArea: + * [QTBUG-8315] A getter for the viewport margins has been added. + + - QComboBox: + * A QComboBox does not reset itself any more when setting the same model + more than once. + * [QTBUG-43350] QComboBox will now reset its root model index when a new + model is set on it. + + - QHeaderView: + * [QTBUG-21201] Auto-scroll the view when making extended row/column + selections. + * Default section size is now style-dependent by default. + * Added resetDefaultSectionSize(). + + - QMenu: + * [QTBUG-20094] QMenu now pick up how "sloppy" submenus behave from the + style. + + - QOpenGLWidget: + * [QTBUG-40717] Added an UpdateBehavior flag to QOpenGLWidget and + enabled support for NoParitalUpdate for QOpenGLWidget. NoPartialUpdate + is the default update behavior for QOpenGLWidget. + + - QSizePolicy: + * QSizePolicy::ControlTypes is now introspectable through QSizePolicy's + meta object. + + - QToolButton: + * [QTBUG-23396] Fixed the double removal of ampersands. + + - QTreeWidget: + * [QTBUG-40060] Restored Qt 5.1 behavior of QTreeWidgetItems with + ItemIsTristate to enable automatic management of the check state. + User-editable tristate checkboxes are now enabled by setting the new + flag ItemIsUserTristate. + +**************************************************************************** +* Platform Specific Changes * +**************************************************************************** + + - Removed BlackBerry PlayBook support. + +Android +------- + + - [QTBUG-43705] Fixed canonical path for nonexistent paths on some + devices. + - [QTBUG-38700] On devices with translucent system UI, Qt's windows are now + positioned to avoid overlapping it. This behavior can be + overridden in the application's AndroidManifest.xml. + - [QTBUG-45430] Fixed a bug that caused applications not to be resumable + after user changed language in system settings. + + - QtCore / QTimeZone: + * [QTBUG-35908] Android timezones are now available in QTimeZone. + + - QtWidgets: + * Enable QDockWidget window decorations. + +OS X +---- + + - [QTBUG-43999] QApplication::setWindowIcon now changes the icon for the + application in the dock. + + - Text: + * [QTBUG-44708] Fixed appending text with a different writing system and + formatting to a latin ligature. + +Windows +------- + + - QMimeData: + * [QTBUG-17373] Added support for handling dropping of multiple mail + attachments, adding ;index=N to the mimetype string + application/x-qt-windows-mime;value="FileContents" + + - Text: + * [QTBUG-44501] Fixed design metrics for text + +X11/XCB +------- + + - GLX and EGL code paths are now dynamically resolved, making it possible + for one build of a plugin to use both code paths. The default is to use + the GLX code path if available. This can be overridden by specifying + QT_XCB_GL_INTEGRATION=xcb_egl as an environment variable. Enable the + logging category qt.xcb.glintegration.debug to get debug log output of + what integration is used. + - [QTBUG-31762] QSystemTrayIcon now uses StatusNotifier D-Bus protocol + when the desktop environment supports it + - [QTBUG-40174][QTBUG-42985] If all QScreens (xcb outputs) are + disconnected while an application is running, + QGuiApplication::primaryScreen() will now return null until a screen is + connected again. + +**************************************************************************** +* Compiler Specific Changes * +**************************************************************************** + + - Qt 5.5 now unconditionally uses the "using" keyword. Compilers that do + not support this keyword are deprecated and will not be able to build + Qt. Previous versions of Qt may or may not compile, as no testing was + done to ensure it worked. + - Visual Studio: -Zm200 (an option to specify the precompiled header + memory allocation limit) is not added anymore by qmake to the compiler + calls. If you encounter an C1076 compiler error you might need to re-add + it in your .pro file. + +**************************************************************************** +* Tools * +**************************************************************************** + +configure +--------- + + - Added support for GCC/Clang -fsanitize= options + +qmake +----- + + - For commercial builds, qmake now checks for a valid Qt license. This + requires setting up a Qt Account (or .qt-license file) on the + development machine. + + - Important Behavior Changes: + * A lot of quoting issues have been fixed. As a side effect, qmake + has become more sensitive to over-quoted file names in project + files. + +**************************************************************************** +* Third-party libraries * +**************************************************************************** + + - [QTBUG-44815][QTBUG-37660][QTBUG-44694][QTBUG-42443] ANGLE was updated + to Chromium branch 2356 (2.1~99f075dade7c). From 39f53be6199f514cf0e94a8ff759d68e04b06a3b Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 17 Jun 2015 13:05:47 +0200 Subject: [PATCH 26/40] Doc: Remove link to deprecated QProcess::pid() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QProcess::pid() is deprecated since Qt 5.3. Rather link to it's replacement. Change-Id: Iaea86137a046513809f9f92ff88fe21233adaa34 Reviewed-by: Topi Reiniö --- src/corelib/io/qprocess.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index ead04791e5c..1842541644e 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -2053,7 +2053,7 @@ QByteArray QProcess::readAllStandardError() printed at the console, and the existing process will continue running unaffected. - \sa pid(), started(), waitForStarted(), setNativeArguments() + \sa processId(), started(), waitForStarted(), setNativeArguments() */ void QProcess::start(const QString &program, const QStringList &arguments, OpenMode mode) { From 0e8d657ae05aeab25aa261a88bbdc9aa21ac0e0d Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 16 Jun 2015 23:51:08 +0200 Subject: [PATCH 27/40] Changelog: Mention changes regardig Q_GADGET Change-Id: I8d0e76bd1f9697c48f88452555e6792ab124074a Reviewed-by: Simon Hausmann --- dist/changes-5.5.0 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dist/changes-5.5.0 b/dist/changes-5.5.0 index cba15969404..3d588f7f884 100644 --- a/dist/changes-5.5.0 +++ b/dist/changes-5.5.0 @@ -147,6 +147,11 @@ QtCore value of pthread_self(3)). To print the pointer to QThread::current(), use %{qthreadptr}. + - moc + * Classes annotated with Q_GADGET can now have Q_PROPERTY and Q_INVOKABLE + functions. QMetaProperty::{read,write}OnGadget and + QMetaMethod::invokeOnGadget can be used with those. + - Objective-C: * [QTBUG-37116] Added NSDate/CDateRef converters for QDateTime From 997f52b83d41d2ed31a3b36384d1dd3bc78a697c Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Tue, 16 Jun 2015 14:10:51 +0200 Subject: [PATCH 28/40] qdoc: Keep track of attributes written to example manifest files The content written to example manifest files can be extended with additional metadata in the form of xml attributes. In order to avoid invalid (duplicated) input from generating malformed xml, QDoc now keeps track of the attributes and only writes metadata that hasn't already been written. Task-number: QTBUG-46692 Change-Id: I645935fa8f32b915b7335c400f5a8f2cf72802b7 Reviewed-by: Martin Smith --- src/tools/qdoc/htmlgenerator.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index 8d84019ab5e..21fffdabc3f 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -4456,6 +4456,7 @@ void HtmlGenerator::generateManifestFile(const QString &manifest, const QString writer.writeAttribute("module", project); writer.writeStartElement(manifest); + QStringList usedAttributes; i = exampleNodeMap.begin(); while (i != exampleNodeMap.end()) { const ExampleNode* en = i.value(); @@ -4469,6 +4470,10 @@ void HtmlGenerator::generateManifestFile(const QString &manifest, const QString ++i; continue; } + // attributes that are always written for the element + usedAttributes.clear(); + usedAttributes << "name" << "docUrl" << "projectPath"; + writer.writeStartElement(element); writer.writeAttribute("name", en->title()); QString docUrl = manifestDir + fileBase(en) + ".html"; @@ -4502,8 +4507,10 @@ void HtmlGenerator::generateManifestFile(const QString &manifest, const QString writer.writeAttribute("projectPath", examplesPath + proFiles[0]); } } - if (!en->imageFileName().isEmpty()) + if (!en->imageFileName().isEmpty()) { writer.writeAttribute("imageUrl", manifestDir + en->imageFileName()); + usedAttributes << "imageUrl"; + } QString fullName = project + QLatin1Char('/') + en->title(); QSet tags; @@ -4529,7 +4536,10 @@ void HtmlGenerator::generateManifestFile(const QString &manifest, const QString if (attrList.count() == 1) attrList.append(QStringLiteral("true")); QString attrName = attrList.takeFirst(); - writer.writeAttribute(attrName, attrList.join(div)); + if (!usedAttributes.contains(attrName)) { + writer.writeAttribute(attrName, attrList.join(div)); + usedAttributes << attrName; + } } } } From aec2b28eea3354ec80350e25f4305c74ca9bc184 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 16 Jun 2015 15:09:09 +0200 Subject: [PATCH 29/40] OSX: show file dialog in showCocoaFilePanel, don't wait for exec() This reverts commit 21e6c7ae4745a76b676dfaa9fe17a2dd40fc0c5c because in QtQuick.Controls, we do not call exec(): we just set the dialog visible. If it is a sheet, then it is already acting as a modal dialog, basically. Task-number: QTBUG-46691 Change-Id: I7fe89f2a2ade0d4ddcf540c9bfc4f5963a077471 Reviewed-by: Timur Pocheptsov --- src/gui/kernel/qplatformdialoghelper.cpp | 6 ---- src/gui/kernel/qplatformdialoghelper.h | 1 - .../platforms/cocoa/qcocoafiledialoghelper.h | 1 - .../platforms/cocoa/qcocoafiledialoghelper.mm | 28 +++++-------------- src/widgets/dialogs/qdialog.cpp | 5 +--- 5 files changed, 8 insertions(+), 33 deletions(-) diff --git a/src/gui/kernel/qplatformdialoghelper.cpp b/src/gui/kernel/qplatformdialoghelper.cpp index 3d7c2f7bf0d..3d37088182c 100644 --- a/src/gui/kernel/qplatformdialoghelper.cpp +++ b/src/gui/kernel/qplatformdialoghelper.cpp @@ -137,12 +137,6 @@ QVariant QPlatformDialogHelper::defaultStyleHint(QPlatformDialogHelper::StyleHi return QVariant(); } -void QPlatformDialogHelper::execModalForWindow(QWindow *parent) -{ - Q_UNUSED(parent); - exec(); -} - // Font dialog class QFontDialogOptionsPrivate : public QSharedData diff --git a/src/gui/kernel/qplatformdialoghelper.h b/src/gui/kernel/qplatformdialoghelper.h index 6d3a367e603..8b2b9881b7f 100644 --- a/src/gui/kernel/qplatformdialoghelper.h +++ b/src/gui/kernel/qplatformdialoghelper.h @@ -145,7 +145,6 @@ public: virtual QVariant styleHint(StyleHint hint) const; virtual void exec() = 0; - virtual void execModalForWindow(QWindow *parent); virtual bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent) = 0; diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h index 36943a563e1..48d7efe1747 100644 --- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h +++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h @@ -51,7 +51,6 @@ public: virtual ~QCocoaFileDialogHelper(); void exec(); - void execModalForWindow(QWindow *parent); bool defaultNameFilterDisables() const; diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm index 19f81c72a13..4ece1b5a22f 100644 --- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm @@ -254,22 +254,17 @@ static QString strippedText(QString s) || [self panel:nil shouldShowFilename:filepath]; [self updateProperties]; + QCocoaMenuBar::redirectKnownMenuItemsToFirstResponder(); [mSavePanel setDirectoryURL: [NSURL fileURLWithPath:mCurrentDir]]; [mSavePanel setNameFieldStringValue:selectable ? QCFString::toNSString(info.fileName()) : @""]; NSWindow *nsparent = static_cast(qGuiApp->platformNativeInterface()->nativeResourceForWindow("nswindow", parent)); - qApp->processEvents(QEventLoop::ExcludeUserInputEvents | QEventLoop::ExcludeSocketNotifiers); - QCocoaMenuBar::redirectKnownMenuItemsToFirstResponder(); - [mSavePanel beginSheetModalForWindow:nsparent completionHandler:^(NSInteger result){ - [[NSApplication sharedApplication] stopModalWithCode:result]; + mReturnCode = result; + if (mHelper) + mHelper->QNSOpenSavePanelDelegate_panelClosed(result == NSOKButton); }]; - - mReturnCode = [[NSApplication sharedApplication] runModalForWindow:nsparent]; - QAbstractEventDispatcher::instance()->interrupt(); - if (mHelper) - mHelper->QNSOpenSavePanelDelegate_panelClosed(mReturnCode == NSOKButton); } - (BOOL)isHiddenFile:(NSString *)filename isDir:(BOOL)isDir @@ -711,15 +706,14 @@ void QCocoaFileDialogHelper::createNSOpenSavePanelDelegate() bool QCocoaFileDialogHelper::showCocoaFilePanel(Qt::WindowModality windowModality, QWindow *parent) { - Q_UNUSED(parent) - createNSOpenSavePanelDelegate(); if (!mDelegate) return false; if (windowModality == Qt::NonModal) [mDelegate showModelessPanel]; - // no need to show a Qt::ApplicationModal dialog here, since it will be done in exec; - // Qt::WindowModal will be done in execModalForWindow. + else if (windowModality == Qt::WindowModal && parent) + [mDelegate showWindowModalSheet:parent]; + // no need to show a Qt::ApplicationModal dialog here, since it will be done in _q_platformRunNativeAppModalPanel() return true; } @@ -751,14 +745,6 @@ void QCocoaFileDialogHelper::exec() } -void QCocoaFileDialogHelper::execModalForWindow(QWindow *parent) -{ - if (!parent) - return exec(); - - [mDelegate showWindowModalSheet:parent]; -} - bool QCocoaFileDialogHelper::defaultNameFilterDisables() const { return true; diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp index 6676a3ccba6..65def6d4b83 100644 --- a/src/widgets/dialogs/qdialog.cpp +++ b/src/widgets/dialogs/qdialog.cpp @@ -534,10 +534,7 @@ int QDialog::exec() QPointer guard = this; if (d->nativeDialogInUse) { - if (windowModality() == Qt::WindowModal) - d->platformHelper()->execModalForWindow(d->parentWindow()); - else - d->platformHelper()->exec(); + d->platformHelper()->exec(); } else { QEventLoop eventLoop; d->eventLoop = &eventLoop; From 059e1df345bab5754488a63e6d149de86ebf655a Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 16 Jun 2015 12:31:51 +0200 Subject: [PATCH 30/40] fix PCH related regression in vcxproj generator When PRECOMPILED_HEADER is set to foo/bar/stable.h and PRECOMPILED_SOURCE is empty, then a C++ file foo/bar/stable.cpp is generated that contains the include "stable.h". We must pass the exact string "stable.h" to the /Yc compile switch instead of "foo/bar/stable.h". Commit dc612acdc6577594c8f61345cea2de549d7aae34 introduced this regression to allow to have PRECOMPILED_SOURCE in a different directory than PRECOMPILED_HEADER. Change-Id: I1a7e096c0455b946a5660d23c70c72abd4c7ac1b Task-number: QTBUG-46679 Reviewed-by: Oswald Buddenhagen Reviewed-by: Joerg Bornemann --- qmake/generators/win32/msvc_objectmodel.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index aa7320bc277..09937c8ac20 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -2238,6 +2238,8 @@ void VCFilter::modifyPCHstage(QString str) CompilerTool.UsePrecompiledHeader = (isCFile ? pchNone : pchCreateUsingSpecific); if (isCFile) CompilerTool.PrecompiledHeaderThrough = QLatin1String("$(NOINHERIT)"); + else if (autogenSourceFile) + CompilerTool.PrecompiledHeaderThrough = Project->precompHFilename; CompilerTool.ForcedIncludeFiles = QStringList("$(NOINHERIT)"); } From dbddb1751e448a157c9900ce72e8e956f4102314 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Fri, 19 Jun 2015 10:24:15 +0200 Subject: [PATCH 31/40] winrt: Fixed connectToHost, which is meant to be synchronous Task-number: QTBUG-46339 Change-Id: I413fef39424a0815ef4604000f85ad37ac2b4dc2 Reviewed-by: Maurice Kalinowski --- .../socket/qnativesocketengine_winrt.cpp | 53 +++++++++---------- .../socket/qnativesocketengine_winrt_p.h | 2 +- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/src/network/socket/qnativesocketengine_winrt.cpp b/src/network/socket/qnativesocketengine_winrt.cpp index 5c615034fcc..5e58ee38952 100644 --- a/src/network/socket/qnativesocketengine_winrt.cpp +++ b/src/network/socket/qnativesocketengine_winrt.cpp @@ -285,11 +285,23 @@ bool QNativeSocketEngine::connectToHostByName(const QString &name, quint16 port) return false; } d->socketState = QAbstractSocket::ConnectingState; - hr = d->connectOp->put_Completed(Callback( - d, &QNativeSocketEnginePrivate::handleConnectToHost).Get()); - Q_ASSERT_SUCCEEDED(hr); + hr = QWinRTFunctions::await(d->connectOp); + RETURN_FALSE_IF_FAILED("Connection could not be established"); + bool connectionErrors = false; + d->handleConnectionErrors(d->connectOp.Get(), &connectionErrors); + if (connectionErrors) + return false; + d->connectOp.Reset(); - return d->socketState == QAbstractSocket::ConnectedState; + d->socketState = QAbstractSocket::ConnectedState; + emit connectionReady(); + + // Delay the reader so that the SSL socket can upgrade + if (d->sslSocket) + connect(d->sslSocket, SIGNAL(encrypted()), SLOT(establishRead())); + else + establishRead(); + return true; } bool QNativeSocketEngine::bind(const QHostAddress &address, quint16 port) @@ -1104,47 +1116,34 @@ HRESULT QNativeSocketEnginePrivate::handleClientConnection(IStreamSocketListener return S_OK; } -HRESULT QNativeSocketEnginePrivate::handleConnectToHost(IAsyncAction *action, AsyncStatus) +void QNativeSocketEnginePrivate::handleConnectionErrors(IAsyncAction *connectAction, bool *errorsOccured) { - Q_Q(QNativeSocketEngine); - - HRESULT hr = action->GetResults(); - if (wasDeleted || !connectOp) // Protect against a late callback - return S_OK; - - connectOp.Reset(); + bool error = true; + HRESULT hr = connectAction->GetResults(); switch (hr) { case 0x8007274c: // A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. setError(QAbstractSocket::NetworkError, ConnectionTimeOutErrorString); socketState = QAbstractSocket::UnconnectedState; - return S_OK; + break; case 0x80072751: // A socket operation was attempted to an unreachable host. setError(QAbstractSocket::HostNotFoundError, HostUnreachableErrorString); socketState = QAbstractSocket::UnconnectedState; - return S_OK; + break; case 0x8007274d: // No connection could be made because the target machine actively refused it. setError(QAbstractSocket::ConnectionRefusedError, ConnectionRefusedErrorString); socketState = QAbstractSocket::UnconnectedState; - return S_OK; + break; default: if (FAILED(hr)) { setError(QAbstractSocket::UnknownSocketError, UnknownSocketErrorString); socketState = QAbstractSocket::UnconnectedState; - return S_OK; + } else { + error = false; } break; } - - socketState = QAbstractSocket::ConnectedState; - emit q->connectionReady(); - - // Delay the reader so that the SSL socket can upgrade - if (sslSocket) - q->connect(sslSocket, SIGNAL(encrypted()), SLOT(establishRead())); - else - q->establishRead(); - - return S_OK; + if (errorsOccured) + *errorsOccured = error; } HRESULT QNativeSocketEnginePrivate::handleReadyRead(IAsyncBufferOperation *asyncInfo, AsyncStatus status) diff --git a/src/network/socket/qnativesocketengine_winrt_p.h b/src/network/socket/qnativesocketengine_winrt_p.h index 42920c96f26..eb032bc977a 100644 --- a/src/network/socket/qnativesocketengine_winrt_p.h +++ b/src/network/socket/qnativesocketengine_winrt_p.h @@ -216,7 +216,7 @@ private: ABI::Windows::Networking::Sockets::IDatagramSocketMessageReceivedEventArgs *args); HRESULT handleClientConnection(ABI::Windows::Networking::Sockets::IStreamSocketListener *tcpListener, ABI::Windows::Networking::Sockets::IStreamSocketListenerConnectionReceivedEventArgs *args); - HRESULT handleConnectToHost(ABI::Windows::Foundation::IAsyncAction *, ABI::Windows::Foundation::AsyncStatus); + void handleConnectionErrors(ABI::Windows::Foundation::IAsyncAction *connectAction, bool *errorsOccured); HRESULT handleReadyRead(ABI::Windows::Foundation::IAsyncOperationWithProgress *asyncInfo, ABI::Windows::Foundation::AsyncStatus); }; From fb46d63e414bf6d93d362f72105fe84ad69a1390 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Wed, 17 Jun 2015 14:17:48 +0200 Subject: [PATCH 32/40] Doc: Update the list of highlighted examples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove highlighting for a number of older and less relevant examples. Add examples from new modules, and examples that have been visually polished. Task-number: QTBUG-37203 Change-Id: I4e9be9a54f1ecea3bb407c049c1d44a7c00333a6 Reviewed-by: Leena Miettinen Reviewed-by: Topi Reiniö --- doc/global/manifest-meta.qdocconf | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/global/manifest-meta.qdocconf b/doc/global/manifest-meta.qdocconf index 37a06155d42..e7f0464efde 100644 --- a/doc/global/manifest-meta.qdocconf +++ b/doc/global/manifest-meta.qdocconf @@ -42,15 +42,16 @@ manifestmeta.highlighted.names = "QtQuick/Qt Quick Demo - Same Game" \ "QtQuick/Qt Quick Demo - StocQt" \ "QtQuick/Qt Quick Demo - Clocks" \ "QtQuick/Qt Quick Examples - Shader Effects" \ - "QtQuick/Qt Quick Examples - Text" \ - "QtQuick/Qt Quick Examples - Window and Screen" \ + "QtQuickExtras/Qt Quick Extras - Dashboard" \ + "QtQuickExtras/Qt Quick Extras - Gallery" \ "QtQuickControls/Qt Quick Controls - Gallery" \ "QtQuickControls/Qt Quick Controls - Text Editor Example" \ "QtQuickControls/Qt Quick Controls - Table View Example" \ "QtQuickControls/Qt Quick Controls - Calendar Example" \ "QtQuickDialogs/Qt Quick System Dialog Examples" \ - "QtWidgets/Application Example" \ - "QtWinExtras/Quick Player" + "QtWinExtras/Quick Player" \ + "QtMultimedia/QML Video Shader Effects Example" \ + "QtCanvas3D/Planets Example" manifestmeta.highlighted.attributes = isHighlighted:true From 1fb3273cfd5bb1b0d334e2b0eefdcf6cfbdd22e3 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Thu, 11 Jun 2015 14:36:42 +0200 Subject: [PATCH 33/40] Detect and set Xcode 6.3 clang version This becomes necessary to avoid compilation errors with Xcode 7 and clang 7.0.0. (Note that its version information doesn't state which LLVM version it's based on, though we suspect it could be 3.7.0svn.) Change-Id: I2bfc7f2b73ca7a61798b123cc2715037028f0e5f Reviewed-by: Thiago Macieira --- src/corelib/global/qcompilerdetection.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index a5738a434b1..82c3bf82dca 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -155,7 +155,9 @@ /* Clang also masquerades as GCC */ # if defined(__apple_build_version__) # /* http://en.wikipedia.org/wiki/Xcode#Toolchain_Versions */ -# if __apple_build_version__ >= 6000051 +# if __apple_build_version__ >= 6020049 +# define Q_CC_CLANG 306 +# elif __apple_build_version__ >= 6000051 # define Q_CC_CLANG 305 # elif __apple_build_version__ >= 5030038 # define Q_CC_CLANG 304 From b0a9eddf4da21075415c98ae4b8073043e92256e Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Sat, 16 May 2015 14:59:48 +0200 Subject: [PATCH 34/40] testlib: fix compile error with macosx10.8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [NSDate date] returns an id, so one needs to send a message instead of accessing a property. Backport commit 92b3397a from the 5.5 branch. Change-Id: Id70915e1ac23994a081765e0a527802fef61b573 Reviewed-by: Tim Blechmann Reviewed-by: Thiago Macieira Reviewed-by: Tor Arne Vestbø --- src/testlib/qxctestlogger.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/testlib/qxctestlogger.mm b/src/testlib/qxctestlogger.mm index 833e566af59..34116a26701 100644 --- a/src/testlib/qxctestlogger.mm +++ b/src/testlib/qxctestlogger.mm @@ -126,7 +126,7 @@ private: if (!([NSDate timeIntervalSinceReferenceDate] > 0)) qFatal("error: Device date '%s' is bad, likely set to update automatically. Please correct.", - [NSDate date].description.UTF8String); + [[NSDate date] description].UTF8String); XCTestDriver *testDriver = nil; if ([QtTestLibWrapper usingTestManager]) From 4fe865ac7a701b7c950ee0c79b6153b43e1b49ae Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 16 Apr 2015 17:32:18 -0700 Subject: [PATCH 35/40] Doc: document future direction of QCoreApplication::notify() It will definitely not be called for events outside the main thread, but we haven't decided for the main thread, in Qt 6. [ChangeLog][Future direction notices] In Qt 6, QCoreApplication::notify() will not be called for events being delivered to objects outside the main thread. The reason for that is that the main application object may begin destruction while those threads are still delivering events, which is undefined behavior. Applications that currently override notify() and use that function outside the main thread are advised to find other solutions in the mean time. Change-Id: I27eaacb532114dd188c4ffff13d5a5c8df3bc85b Reviewed-by: Simon Hausmann --- src/corelib/kernel/qcoreapplication.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index b6f839d554d..ecafe91b433 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -1005,6 +1005,17 @@ bool QCoreApplication::notifyInternal(QObject *receiver, QEvent *event) do not change the focus widget. \endlist + \b{Future direction:} This function will not be called for objects that live + outside the main thread in Qt 6. Applications that need that functionality + should find other solutions for their event inspection needs in the meantime. + The change may be extended to the main thread, causing this function to be + deprecated. + + \warning If you override this function, you must ensure all threads that + process events stop doing so before your application object begins + destruction. This includes threads started by other libraries that you may be + using, but does not apply to Qt's own threads. + \sa QObject::event(), installNativeEventFilter() */ From 993889401b889b544171f4fa968d8aabb71241b7 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 15 Jun 2015 11:34:34 +0200 Subject: [PATCH 36/40] Revert "Windows: Use DND effect chosen in DragEnter/Move for Drop." The change causes items in QListWidget and QTreeWidget to disappear during InternalMove since the widgets modify the actions of the event to remember an internal state. This reverts commit 988f1b2e5745646cf1bd7f9f65507356ff2ba12e. Task-number: QTBUG-46642 Task-number: QTBUG-43466 Change-Id: I27d888d7a1fdfcf8eaf8806ccd4ca33b292b9d8c Reviewed-by: Joerg Bornemann --- src/plugins/platforms/windows/qwindowsdrag.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/qwindowsdrag.cpp b/src/plugins/platforms/windows/qwindowsdrag.cpp index e10add9c7c3..03438e3ee29 100644 --- a/src/plugins/platforms/windows/qwindowsdrag.cpp +++ b/src/plugins/platforms/windows/qwindowsdrag.cpp @@ -626,7 +626,7 @@ QWindowsOleDropTarget::Drop(LPDATAOBJECT pDataObj, DWORD grfKeyState, const QPlatformDropQtResponse response = QWindowSystemInterface::handleDrop(m_window, windowsDrag->dropData(), m_lastPoint / QWindowsScaling::factor(), - translateToQDragDropActions(m_chosenEffect)); + translateToQDragDropActions(*pdwEffect)); if (response.isAccepted()) { const Qt::DropAction action = response.acceptedAction(); From f64736188f3c0d35086d77c9cc6ae8a855833580 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 8 Jun 2015 18:30:21 -0400 Subject: [PATCH 37/40] Don't document the IsGadget flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There's still some discussion as to whether it's safe to use. Until we're completely sure, don't let users use it. We can always bring it back later. Change-Id: I049a653beeb5454c9539ffff13e5e3e343da0e7d Reviewed-by: Jędrzej Nowacki --- src/corelib/kernel/qmetatype.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index 0f9cf41b775..58912e3fb7f 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -303,7 +303,7 @@ struct DefinedTypesFilter { \omitvalue WeakPointerToQObject \omitvalue TrackingPointerToQObject \omitvalue WasDeclaredAsMetaType - \value IsGadget This type is a Q_GADGET and it's corresponding QMetaObject can be accessed with QMetaType::metaObject Since 5.5. + \omitvalue IsGadget This type is a Q_GADGET and it's corresponding QMetaObject can be accessed with QMetaType::metaObject Since 5.5. */ /*! From 021ffbfc6ffa863d2f3c34fec11cb6e61eb68796 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 16 Jun 2015 23:50:11 +0200 Subject: [PATCH 38/40] Changelog: Document the SIC related to indirect includes Because of 90e7cc172a7521396bb2d49720ee4ceb9a9390b3 Change-Id: I3e9339d6e07d6564e38f3f25df28644437ed5955 Reviewed-by: Marc Mutz --- dist/changes-5.5.0 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dist/changes-5.5.0 b/dist/changes-5.5.0 index 3d588f7f884..f3f4daab6f8 100644 --- a/dist/changes-5.5.0 +++ b/dist/changes-5.5.0 @@ -66,6 +66,9 @@ information about a particular change. to avoid calling parent() (which returns a constant). Subclasses of these models that override parent(), will likely also need to override sibling() now. +- Qt 5.5 received some header #include cleanups. Code that relied on indirect + includes from Qt headers may need to include some headers explicitly now. + For example, qstringlist.h no longer includes QDataStream and QObject. - QCoreApplication: * [QTBUG-30330][QTSOLBUG-184] On Windows, QCoreApplication::arguments() From f2b7a523da3ad45b6920226519944dc3d76445d8 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 22 Jun 2015 17:46:30 +0200 Subject: [PATCH 39/40] (mostly) build system changelog for 5.5.0 Change-Id: Ib68a73574a2c6c13e90484ad5a86398e1cea24cd Reviewed-by: Thiago Macieira Reviewed-by: Maurice Kalinowski --- dist/changes-5.5.0 | 59 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 48 insertions(+), 11 deletions(-) diff --git a/dist/changes-5.5.0 b/dist/changes-5.5.0 index f3f4daab6f8..48ecaf3c7c6 100644 --- a/dist/changes-5.5.0 +++ b/dist/changes-5.5.0 @@ -39,6 +39,9 @@ information about a particular change. - [QTBUG-25121] The usage of the QStyleOptionProgressBar::orientation member has been deprecated. + - QLibraryInfo::buildDate() was deprecated and will return a constant + date now. + **************************************************************************** * Important Behavior Changes * **************************************************************************** @@ -108,10 +111,17 @@ information about a particular change. primary screen. - qmake: + * For commercial builds, qmake now checks for a valid Qt license. This + requires setting up a Qt Account (or .qt-license file) on the + development machine. * Qt configure and qmake used with a MinGW spec will no longer emulate MSVC by picking up the INCLUDE and LIB environment variables. Use the -I/-L configure options to pass additional paths, as you would under Unix. + * A lot of quoting issues have been fixed. As a side effect, qmake + has become more sensitive to over-quoted file names in project + files. + * qmake is now stricter about syntax errors in project files. **************************************************************************** * Library * @@ -472,6 +482,10 @@ Android - QtWidgets: * Enable QDockWidget window decorations. + - The QtDBus module is now disabled by default. + + - Added support for arm64-v8a, x86_64, and mips64 with gcc 4.9. + OS X ---- @@ -526,22 +540,45 @@ X11/XCB * Tools * **************************************************************************** -configure ---------- +configure & build system +------------------------ - - Added support for GCC/Clang -fsanitize= options + - Added support for VS2015. + - [QTBUG-31814][OS X/iOS] Qt is now built with a relative RPATH. + - [VS2012+] Qt is now always built with C++11 with these compilers. + - [Windows] Added -static-runtime option. + - Added support for GCC/Clang -fsanitize= options. + - Enabled tslib autodetection by default. + - Added configure-time check for IPC support. + - [QTBUG-44690][QNX] Fixed NEON detection when cross-compiling on Windows. + - On-device compilation should work better on RaspPi and some other + devices now (use linux-g++ mkspec). + - configure -redo and config.status support spaces in arguments now. + - Qt can be now built in and installed to directories with spaces. + Note that source directories with spaces are still not supported. qmake ----- - - For commercial builds, qmake now checks for a valid Qt license. This - requires setting up a Qt Account (or .qt-license file) on the - development machine. - - - Important Behavior Changes: - * A lot of quoting issues have been fixed. As a side effect, qmake - has become more sensitive to over-quoted file names in project - files. + - [QTBUG-3069][Linux] Building with -rpath will now create DT_RUNPATH tags + instead of DT_RPATH, allowing LD_LIBRARY_PATH to override the rpath. + - [QTBUG-41917][VS] Fixed project generation when PRECOMPILED_SOURCE is + in a different directory than PRECOMPILED_HEADER. + - [QTBUG-42454][MinGW] Added handling of QMAKE_MANIFEST. + - [QTBUG-13496][MSVC] CONFIG+=no_batch is now automatically added when + multiple sources with the same base name exist. + - Added $$[QT_INSTALL_PREFIX/dev], etc. properties which reflect the + on-device locations of Qt (the -prefix, etc. passed to configure). + - Building under MSys is less problematic now. + - [QTBUG-37269] Fixed cross-compilation for Unix on Windows/MinGW. + - [QTBUG-8202][QTBUG-20566][QTBUG-44685] Fixed distclean targets. + - [QTBUG-43162][VS] Added DISTFILES support for Visual Studio projects. + - [QTBUG-41753][VS][WinPhone] Fixed MdilXapCompile deployment step. + - [QTBUG-44960][VS] Reworked .dll deployment. Added $$QMAKE_DLL_PATHS. + - [QTBUG-44823][MSVC] Fixed unreasonable values being passed in /VERSION. + Added $$VERSION_PE_HEADER to override the value. + - [WinRT] The icon handling was reworked/extended. + - [QTBUG-12711] Fixed infinite recursion on malformed .prl files. **************************************************************************** * Third-party libraries * From fae33bfbe35f8d082b420ee09662ff60634cb355 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 25 Jun 2015 09:28:29 -0700 Subject: [PATCH 40/40] Update the changelog with the LTS discussion results And include one more ChangeLog entry that was committed to 5.5.0 Change-Id: I255870833a024a36adf6ffff13eb0808447c50f8 --- dist/changes-5.5.0 | 47 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 8 deletions(-) diff --git a/dist/changes-5.5.0 b/dist/changes-5.5.0 index 48ecaf3c7c6..12240425337 100644 --- a/dist/changes-5.5.0 +++ b/dist/changes-5.5.0 @@ -20,21 +20,33 @@ information about a particular change. **************************************************************************** - Support for the following platforms or toolchains is deprecated in Qt - 5.5 and may be removed or stop compiling in a future version of Qt: + 5.5 and will be removed as of Qt 5.6: * Apple OS X builds using GNU libstdc++ * BlackBerry 10 - * GNU Compiler Collection (GCC) versions 4.6 and earlier * QNX 6.5 + + The following platforms or toolchains are deprecated and will be + removed as of Qt 5.7: + * Apple OS X 10.7 (Lion) + * GNU Compiler Collection (GCC) versions 4.6 and earlier * Microsoft Visual Studio compiler versions 2008 and 2010 * Microsoft Windows XP, Windows Vista * Microsoft Windows Embedded Compact 7 - Note: QNX 6.6 continues to be supported. - - The QtWebKit, QtScript modules and support for the QML 1 language and - QtQuick 1 is deprecated and Qt 5.5 will be the last release to - include them. Starting with Qt 5.6, the source code for those modules - will not be included in Qt's packaging. Compiling the 5.5 release of - those modules along with other, updated Qt 5.6 modules should work. + Deprecated platforms and toolchains continue to work until removed. + + - The QtWebKit and QtQuick1 modules and support for the QML 1 language + are deprecated and Qt 5.5 will be the last release to include + them. Starting with Qt 5.6, the source code for those modules will + not be included in Qt's packaging. Compiling the 5.5 release of + QtWebKit modules along with Qt 5.6 or future versions should + work. QtQuick1 is not guaranteed to work in future versions after + Qt 5.6. + + - The QtScript module is deprecated and will be removed from Qt's + packaging starting with version 5.7. The 5.5 and 5.6 releases of + QtScript should continue to work along with Qt 5.7 and future + versions. - [QTBUG-25121] The usage of the QStyleOptionProgressBar::orientation member has been deprecated. @@ -42,6 +54,25 @@ information about a particular change. - QLibraryInfo::buildDate() was deprecated and will return a constant date now. +**************************************************************************** +* Future Direction Notice * +**************************************************************************** + + - In Qt 6, QCoreApplication::notify() will not be called for events being + delivered to objects outside the main thread. The reason for that is + that the main application object may begin destruction while those + threads are still delivering events, which is undefined behavior. + Applications that currently override notify() and use that function + outside the main thread are advised to find other solutions in the mean + time. + + - Qt 5.7 will begin requiring certain C++11 features in order to + compile. The minimum compiler versions for that release will be: + * Clang 3.2 (included in XCode 5.0) + * GCC 4.7 + * Intel C++ Composer XE 2013 SP1 (compiler version 14.0) + * Microsoft Visual Studio 2012 (compiler version 17.0) + **************************************************************************** * Important Behavior Changes * ****************************************************************************