summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-06-28 07:46:47 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2015-06-28 07:46:47 +0000
commitcb6cba2b6f11ba67a93135ac1646971e71da345b (patch)
tree441b4a02f9d03b851aa08c419c76de7c5da0b6f6 /src
parentf1b01b7d159bcf04a2b832dba36f876479669641 (diff)
parent4dd8a63fc13cee365c58ef67fa4a4503aeceebe8 (diff)
Merge "Merge remote-tracking branch 'origin/5.5.0' into 5.5" into refs/staging/5.5
Diffstat (limited to 'src')
-rw-r--r--src/android/accessibility/jar/src/org/qtproject/qt5/android/accessibility/QtAccessibilityDelegate.java9
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java34
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtNative.java10
-rw-r--r--src/android/templates/AndroidManifest.xml2
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_io_qtextstream.cpp2
-rw-r--r--src/corelib/global/qcompilerdetection.h6
-rw-r--r--src/corelib/global/qglobal.cpp10
-rw-r--r--src/corelib/global/qsysinfo.h9
-rw-r--r--src/corelib/global/qsystemdetection.h21
-rw-r--r--src/corelib/io/qprocess.cpp2
-rw-r--r--src/corelib/io/qstorageinfo.cpp6
-rw-r--r--src/corelib/io/qstorageinfo_p.h2
-rw-r--r--src/corelib/io/qtextstream.cpp6
-rw-r--r--src/corelib/io/qtextstream.h2
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp11
-rw-r--r--src/corelib/kernel/qmetatype.cpp20
-rw-r--r--src/corelib/statemachine/qabstracttransition.h2
-rw-r--r--src/gui/accessible/qaccessible.cpp12
-rw-r--r--src/gui/accessible/qaccessible.h12
-rw-r--r--src/gui/kernel/qplatformdialoghelper.cpp6
-rw-r--r--src/gui/kernel/qplatformdialoghelper.h1
-rw-r--r--src/network/socket/qnativesocketengine_winrt.cpp53
-rw-r--r--src/network/socket/qnativesocketengine_winrt_p.h2
-rw-r--r--src/network/ssl/qsslcipher.cpp5
-rw-r--r--src/network/ssl/qsslconfiguration.cpp45
-rw-r--r--src/network/ssl/qsslconfiguration.h3
-rw-r--r--src/network/ssl/qsslpresharedkeyauthenticator.h24
-rw-r--r--src/network/ssl/qsslsocket.cpp178
-rw-r--r--src/network/ssl/qsslsocket.h35
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp2
-rw-r--r--src/network/ssl/qsslsocket_p.h2
-rw-r--r--src/plugins/platforms/android/androidjniaccessibility.cpp10
-rw-r--r--src/plugins/platforms/android/androidjniaccessibility.h1
-rw-r--r--src/plugins/platforms/android/qandroidplatformaccessibility.cpp5
-rw-r--r--src/plugins/platforms/android/qandroidplatformintegration.cpp6
-rw-r--r--src/plugins/platforms/cocoa/qcocoafiledialoghelper.h1
-rw-r--r--src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm28
-rwxr-xr-xsrc/plugins/platforms/cocoa/qcocoasystemtrayicon.mm1
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm2
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm10
-rw-r--r--src/plugins/platforms/windows/qwindowsdrag.cpp2
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.cpp8
-rw-r--r--src/testlib/qtestcase.cpp37
-rw-r--r--src/testlib/qtestcase.h4
-rw-r--r--src/tools/qdoc/htmlgenerator.cpp14
-rw-r--r--src/widgets/dialogs/qdialog.cpp5
-rw-r--r--src/widgets/kernel/qlayoutitem.cpp5
-rw-r--r--src/widgets/kernel/qlayoutitem.h2
48 files changed, 356 insertions, 319 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 56e7543415..6f95675597 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 d6cd49f44c..f4d2645e9a 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
@@ -794,7 +794,25 @@ public class QtActivityDelegate
m_surfaces = new HashMap<Integer, QtSurface>();
m_nativeViews = new HashMap<Integer, View>();
m_activity.registerForContextMenu(m_layout);
+ m_activity.setContentView(m_layout,
+ new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT));
+ int orientation = m_activity.getResources().getConfiguration().orientation;
+ int rotation = m_activity.getWindowManager().getDefaultDisplay().getRotation();
+ boolean rot90 = (rotation == Surface.ROTATION_90 || rotation == Surface.ROTATION_270);
+ boolean currentlyLandscape = (orientation == Configuration.ORIENTATION_LANDSCAPE);
+ if ((currentlyLandscape && !rot90) || (!currentlyLandscape && rot90))
+ m_nativeOrientation = Configuration.ORIENTATION_LANDSCAPE;
+ else
+ m_nativeOrientation = Configuration.ORIENTATION_PORTRAIT;
+
+ QtNative.handleOrientationChanged(rotation, m_nativeOrientation);
+ m_currentRotation = rotation;
+ }
+
+ public void initializeAccessibility()
+ {
// Initialize accessibility
try {
final String a11yDelegateClassName = "org.qtproject.qt5.android.accessibility.QtAccessibilityDelegate";
@@ -810,22 +828,6 @@ public class QtActivityDelegate
// 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));
-
- int orientation = m_activity.getResources().getConfiguration().orientation;
- int rotation = m_activity.getWindowManager().getDefaultDisplay().getRotation();
- boolean rot90 = (rotation == Surface.ROTATION_90 || rotation == Surface.ROTATION_270);
- boolean currentlyLandscape = (orientation == Configuration.ORIENTATION_LANDSCAPE);
- if ((currentlyLandscape && !rot90) || (!currentlyLandscape && rot90))
- m_nativeOrientation = Configuration.ORIENTATION_LANDSCAPE;
- else
- m_nativeOrientation = Configuration.ORIENTATION_PORTRAIT;
-
- QtNative.handleOrientationChanged(rotation, m_nativeOrientation);
- m_currentRotation = rotation;
}
public void onConfigurationChanged(Configuration configuration)
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 b2480618f8..040eba5e42 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/android/templates/AndroidManifest.xml b/src/android/templates/AndroidManifest.xml
index 60c612976f..ad240956ef 100644
--- a/src/android/templates/AndroidManifest.xml
+++ b/src/android/templates/AndroidManifest.xml
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<manifest package="org.qtproject.example" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0" android:versionCode="1" android:installLocation="auto">
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="-- %%INSERT_APP_NAME%% --">
- <activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation"
+ <activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation"
android:name="org.qtproject.qt5.android.bindings.QtActivity"
android:label="-- %%INSERT_APP_NAME%% --"
android:screenOrientation="unspecified"
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 c76a0f1f3b..ab91a00f5f 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/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 50dfe84403..7ff1b67918 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
@@ -616,7 +618,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) */
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 126bf62fb6..5fd221e1c0 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
@@ -2735,6 +2742,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 a571e43568..625b366cc6 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 64f9d91ec7..562427e4b9 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__
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index ead04791e5..1842541644 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)
{
diff --git a/src/corelib/io/qstorageinfo.cpp b/src/corelib/io/qstorageinfo.cpp
index d63b6a2a21..337a9c7cef 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 9e152df1ad..564321bedd 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/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp
index 47b96d708f..8ad1c2852c 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;
}
@@ -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
@@ -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 125502e68d..e5f429ae4d 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/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 34dad73c80..8489afe5a7 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()
*/
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index 3b70ef92ed..58912e3fb7 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.
*/
/*!
@@ -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 "
diff --git a/src/corelib/statemachine/qabstracttransition.h b/src/corelib/statemachine/qabstracttransition.h
index bf32b3e825..475a4dedfc 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<QAbstractState*> 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,
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp
index 5b6bae7cab..f2764ac425 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 faa8cd719d..bfe1e6c542 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
diff --git a/src/gui/kernel/qplatformdialoghelper.cpp b/src/gui/kernel/qplatformdialoghelper.cpp
index 3d7c2f7bf0..3d37088182 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 6d3a367e60..8b2b9881b7 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/network/socket/qnativesocketengine_winrt.cpp b/src/network/socket/qnativesocketengine_winrt.cpp
index 5c615034fc..5e58ee3895 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<IAsyncActionCompletedHandler>(
- 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();
+
+ d->socketState = QAbstractSocket::ConnectedState;
+ emit connectionReady();
- return d->socketState == QAbstractSocket::ConnectedState;
+ // 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 42920c96f2..eb032bc977 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<ABI::Windows::Storage::Streams::IBuffer *, UINT32> *asyncInfo, ABI::Windows::Foundation::AsyncStatus);
};
diff --git a/src/network/ssl/qsslcipher.cpp b/src/network/ssl/qsslcipher.cpp
index 8f2b8b54ad..c480b79371 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 <QtCore/qdebug.h>
@@ -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 5c95c9f544..4803e47224 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"
@@ -590,6 +591,20 @@ void QSslConfiguration::setCiphers(const QList<QSslCipher> &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<QSslCipher> 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
validate the peer's certificate. It can be modified prior to the
@@ -619,6 +634,22 @@ void QSslConfiguration::setCaCertificates(const QList<QSslCertificate> &certific
}
/*!
+ \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<QSslCertificate> 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
\a option is disabled.
@@ -744,6 +775,20 @@ void QSslConfiguration::setEllipticCurves(const QVector<QSslEllipticCurve> &curv
}
/*!
+ \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<QSslEllipticCurve> QSslConfiguration::supportedEllipticCurves()
+{
+ return QSslSocketPrivate::supportedEllipticCurves();
+}
+
+/*!
\since 5.3
This function returns the protocol negotiated with the server
diff --git a/src/network/ssl/qsslconfiguration.h b/src/network/ssl/qsslconfiguration.h
index c5a1c6e6d4..960aec60ce 100644
--- a/src/network/ssl/qsslconfiguration.h
+++ b/src/network/ssl/qsslconfiguration.h
@@ -111,10 +111,12 @@ public:
// Cipher settings
QList<QSslCipher> ciphers() const;
void setCiphers(const QList<QSslCipher> &ciphers);
+ static QList<QSslCipher> supportedCiphers();
// Certificate Authority (CA) settings
QList<QSslCertificate> caCertificates() const;
void setCaCertificates(const QList<QSslCertificate> &certificates);
+ static QList<QSslCertificate> systemCaCertificates();
void setSslOption(QSsl::SslOption option, bool on);
bool testSslOption(QSsl::SslOption option) const;
@@ -126,6 +128,7 @@ public:
// EC settings
QVector<QSslEllipticCurve> ellipticCurves() const;
void setEllipticCurves(const QVector<QSslEllipticCurve> &curves);
+ static QVector<QSslEllipticCurve> supportedEllipticCurves();
static QSslConfiguration defaultConfiguration();
static void setDefaultConfiguration(const QSslConfiguration &configuration);
diff --git a/src/network/ssl/qsslpresharedkeyauthenticator.h b/src/network/ssl/qsslpresharedkeyauthenticator.h
index 52301ef7e5..159b16d563 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);
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index 513cc51620..07c0cd4bf8 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<QSslCipher> 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<QSslCipher> &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<QSslCipher> &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<QSslCipher> 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.
@@ -1285,120 +1309,6 @@ QList<QSslCipher> QSslSocket::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<QSslEllipticCurve> 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<QSslEllipticCurve> &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<QSslEllipticCurve> &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<QSslEllipticCurve> 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<QSslEllipticCurve> 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
database. \a path can be explicit, or it can contain wildcards in
@@ -1456,6 +1366,10 @@ void QSslSocket::addCaCertificates(const QList<QSslCertificate> &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<QSslCertificate> &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<QSslCertificate> &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<QSslCertificate> &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<QSslCertificate> 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
@@ -2166,16 +2096,6 @@ void QSslSocketPrivate::setDefaultSupportedCiphers(const QList<QSslCipher> &ciph
/*!
\internal
*/
-QVector<QSslEllipticCurve> QSslSocketPrivate::defaultEllipticCurves()
-{
- QSslSocketPrivate::ensureInitialized();
- const QMutexLocker locker(&globalData()->mutex);
- return globalData()->config->ellipticCurves;
-}
-
-/*!
- \internal
-*/
QVector<QSslEllipticCurve> QSslSocketPrivate::supportedEllipticCurves()
{
QSslSocketPrivate::ensureInitialized();
@@ -2186,16 +2106,6 @@ QVector<QSslEllipticCurve> QSslSocketPrivate::supportedEllipticCurves()
/*!
\internal
*/
-void QSslSocketPrivate::setDefaultEllipticCurves(const QVector<QSslEllipticCurve> &curves)
-{
- const QMutexLocker locker(&globalData()->mutex);
- globalData()->config.detach();
- globalData()->config->ellipticCurves = curves;
-}
-
-/*!
- \internal
-*/
void QSslSocketPrivate::setDefaultSupportedEllipticCurves(const QVector<QSslEllipticCurve> &curves)
{
const QMutexLocker locker(&globalData()->mutex);
diff --git a/src/network/ssl/qsslsocket.h b/src/network/ssl/qsslsocket.h
index 8ad6d033a7..4124f5b7e5 100644
--- a/src/network/ssl/qsslsocket.h
+++ b/src/network/ssl/qsslsocket.h
@@ -144,34 +144,33 @@ public:
QSslKey privateKey() const;
// Cipher settings.
- QList<QSslCipher> ciphers() const;
- void setCiphers(const QList<QSslCipher> &ciphers);
- void setCiphers(const QString &ciphers);
- static void setDefaultCiphers(const QList<QSslCipher> &ciphers);
- static QList<QSslCipher> defaultCiphers();
- static QList<QSslCipher> supportedCiphers();
-
- // EC settings.
- QVector<QSslEllipticCurve> ellipticCurves() const;
- void setEllipticCurves(const QVector<QSslEllipticCurve> &curves);
- static void setDefaultEllipticCurves(const QVector<QSslEllipticCurve> &curves);
- static QVector<QSslEllipticCurve> defaultEllipticCurves();
- static QVector<QSslEllipticCurve> supportedEllipticCurves();
+#if QT_DEPRECATED_SINCE(5, 5)
+ QT_DEPRECATED_X("Use QSslConfiguration::ciphers()") QList<QSslCipher> ciphers() const;
+ QT_DEPRECATED_X("Use QSslConfiguration::setCiphers()") void setCiphers(const QList<QSslCipher> &ciphers);
+ QT_DEPRECATED void setCiphers(const QString &ciphers);
+ QT_DEPRECATED static void setDefaultCiphers(const QList<QSslCipher> &ciphers);
+ QT_DEPRECATED static QList<QSslCipher> defaultCiphers();
+ QT_DEPRECATED_X("Use QSslConfiguration::supportedCiphers()") static QList<QSslCipher> 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<QSslCertificate> &certificates);
- void setCaCertificates(const QList<QSslCertificate> &certificates);
- QList<QSslCertificate> caCertificates() const;
+#if QT_DEPRECATED_SINCE(5, 5)
+ QT_DEPRECATED_X("Use QSslConfiguration::setCaCertificates()") void setCaCertificates(const QList<QSslCertificate> &certificates);
+ QT_DEPRECATED_X("Use QSslConfiguration::caCertificates()") QList<QSslCertificate> 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<QSslCertificate> &certificates);
- static void setDefaultCaCertificates(const QList<QSslCertificate> &certificates);
- static QList<QSslCertificate> defaultCaCertificates();
- static QList<QSslCertificate> systemCaCertificates();
+#if QT_DEPRECATED_SINCE(5, 5)
+ QT_DEPRECATED static void setDefaultCaCertificates(const QList<QSslCertificate> &certificates);
+ QT_DEPRECATED static QList<QSslCertificate> defaultCaCertificates();
+ QT_DEPRECATED_X("Use QSslConfiguration::systemCaCertificates()") static QList<QSslCertificate> 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 19848a73f0..049666b70b 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -1685,7 +1685,7 @@ QList<QSslError> QSslSocketBackendPrivate::verify(const QList<QSslCertificate> &
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 5f726f2371..d6519718d9 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<QSslCipher> &ciphers);
static void resetDefaultCiphers();
- static QVector<QSslEllipticCurve> defaultEllipticCurves();
static QVector<QSslEllipticCurve> supportedEllipticCurves();
- static void setDefaultEllipticCurves(const QVector<QSslEllipticCurve> &curves);
static void setDefaultSupportedEllipticCurves(const QVector<QSslEllipticCurve> &curves);
static void resetDefaultEllipticCurves();
diff --git a/src/plugins/platforms/android/androidjniaccessibility.cpp b/src/plugins/platforms/android/androidjniaccessibility.cpp
index f8c3e26229..69f8bdbad7 100644
--- a/src/plugins/platforms/android/androidjniaccessibility.cpp
+++ b/src/plugins/platforms/android/androidjniaccessibility.cpp
@@ -42,6 +42,7 @@
#include "QtGui/qaccessible.h"
#include <QtCore/qmath.h>
#include <QtCore/private/qjnihelpers_p.h>
+#include <QtCore/private/qjni_p.h>
#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<void>(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 9201353118..a4cbab7834 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 e3a8b1a8f4..339023bd9f 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 eb96bf11f0..2a127f5c3c 100644
--- a/src/plugins/platforms/android/qandroidplatformintegration.cpp
+++ b/src/plugins/platforms/android/qandroidplatformintegration.cpp
@@ -148,6 +148,10 @@ QAndroidPlatformIntegration::QAndroidPlatformIntegration(const QStringList &para
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
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h
index 573e137489..576bb3af08 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h
@@ -51,7 +51,6 @@ public:
virtual ~QCocoaFileDialogHelper();
void exec() Q_DECL_OVERRIDE;
- void execModalForWindow(QWindow *parent) Q_DECL_OVERRIDE;
bool defaultNameFilterDisables() const Q_DECL_OVERRIDE;
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
index 19f81c72a1..4ece1b5a22 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<NSWindow *>(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/plugins/platforms/cocoa/qcocoasystemtrayicon.mm b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
index f50f552623..713758cc7e 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];
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 495d5831f7..3188463dbe 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) {
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index d2a135d013..355704ff37 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]);
diff --git a/src/plugins/platforms/windows/qwindowsdrag.cpp b/src/plugins/platforms/windows/qwindowsdrag.cpp
index e10add9c7c..03438e3ee2 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();
diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp
index 993566b11c..040cea1cb2 100644
--- a/src/plugins/platforms/xcb/qxcbscreen.cpp
+++ b/src/plugins/platforms/xcb/qxcbscreen.cpp
@@ -373,11 +373,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);
}
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index c96b72bef7..efc18180db 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -2812,36 +2812,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<QTemporaryDir> QTest::qExtractTestData(const QString &dirName)
{
- QTemporaryDir temporaryDir;
- temporaryDir.setAutoRemove(false);
+ QSharedPointer<QTemporaryDir> result; // null until success, then == tempDir
- if (!temporaryDir.isValid())
- return QString();
+ QSharedPointer<QTemporaryDir> tempDir = QSharedPointer<QTemporaryDir>::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()) {
@@ -2850,21 +2853,23 @@ 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;
}
if (!QFile::setPermissions(destination, QFile::ReadUser | QFile::WriteUser | QFile::ReadGroup)) {
qWarning("Failed to set permissions on '%s'.", qPrintable(destination));
- 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 2c6a94faa1..f24283b65e 100644
--- a/src/testlib/qtestcase.h
+++ b/src/testlib/qtestcase.h
@@ -40,6 +40,8 @@
#include <QtCore/qnamespace.h>
#include <QtCore/qmetatype.h>
#include <QtCore/qtypetraits.h>
+#include <QtCore/qsharedpointer.h>
+#include <QtCore/qtemporarydir.h>
#include <string.h>
@@ -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<QTemporaryDir> 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/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp
index 2066342a6a..10b7242c18 100644
--- a/src/tools/qdoc/htmlgenerator.cpp
+++ b/src/tools/qdoc/htmlgenerator.cpp
@@ -4457,6 +4457,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();
@@ -4470,6 +4471,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";
@@ -4503,8 +4508,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<QString> tags;
@@ -4530,7 +4537,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;
+ }
}
}
}
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp
index 68a419afc9..054c220b84 100644
--- a/src/widgets/dialogs/qdialog.cpp
+++ b/src/widgets/dialogs/qdialog.cpp
@@ -534,10 +534,7 @@ int QDialog::exec()
QPointer<QDialog> 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;
diff --git a/src/widgets/kernel/qlayoutitem.cpp b/src/widgets/kernel/qlayoutitem.cpp
index 21f4c9a221..3d444136e3 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 eaa129a85b..650e114c76 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;