summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xconfigure2
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java5
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtNative.java19
-rw-r--r--src/angle/src/common/common.pri5
-rw-r--r--src/corelib/global/qglobal.h4
-rw-r--r--src/corelib/global/qlogging.cpp9
-rw-r--r--src/corelib/global/qnamespace.qdoc2
-rw-r--r--src/corelib/io/qdir_p.h11
-rw-r--r--src/corelib/io/qtemporaryfile_p.h11
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp8
-rw-r--r--src/corelib/kernel/qeventloop_p.h11
-rw-r--r--src/corelib/kernel/qmetaobject_moc_p.h11
-rw-r--r--src/corelib/mimetypes/qmimedatabase_p.h11
-rw-r--r--src/corelib/mimetypes/qmimeglobpattern_p.h11
-rw-r--r--src/corelib/mimetypes/qmimemagicrule_p.h11
-rw-r--r--src/corelib/mimetypes/qmimemagicrulematcher_p.h11
-rw-r--r--src/corelib/mimetypes/qmimeprovider_p.h11
-rw-r--r--src/corelib/mimetypes/qmimetype_p.h11
-rw-r--r--src/corelib/mimetypes/qmimetypeparser_p.h11
-rw-r--r--src/corelib/plugin/qsystemlibrary_p.h11
-rw-r--r--src/corelib/tools/qcollator_p.h11
-rw-r--r--src/corelib/tools/qsimd_p.h11
-rw-r--r--src/corelib/tools/qstring.cpp10
-rw-r--r--src/corelib/tools/qstringiterator_p.h11
-rw-r--r--src/gui/image/qgifhandler_p.h11
-rw-r--r--src/gui/image/qjpeghandler_p.h11
-rw-r--r--src/gui/image/qpixmap_blitter_p.h11
-rw-r--r--src/gui/kernel/qguiapplication.cpp1
-rw-r--r--src/gui/kernel/qplatformtheme_p.h8
-rw-r--r--src/gui/kernel/qshapedpixmapdndwindow_p.h11
-rw-r--r--src/gui/kernel/qsimpledrag_p.h15
-rw-r--r--src/gui/opengl/qopengl_p.h11
-rw-r--r--src/gui/opengl/qopenglqueryhelper_p.h11
-rw-r--r--src/gui/opengl/qopengltexture_p.h11
-rw-r--r--src/gui/opengl/qopengltextureblitter_p.h11
-rw-r--r--src/gui/opengl/qopengltexturehelper_p.h11
-rw-r--r--src/gui/opengl/qopenglversionfunctionsfactory_p.h11
-rw-r--r--src/gui/opengl/qtriangulatingstroker_p.h11
-rw-r--r--src/gui/painting/qblittable_p.h11
-rw-r--r--src/gui/painting/qcosmeticstroker_p.h11
-rw-r--r--src/gui/painting/qpaintengine_blitter_p.h11
-rw-r--r--src/gui/text/qtextlayout.cpp2
-rw-r--r--src/gui/util/qabstractlayoutstyleinfo_p.h11
-rw-r--r--src/gui/util/qlayoutpolicy_p.h11
-rw-r--r--src/network/access/qnetworkaccessauthenticationmanager.cpp2
-rw-r--r--src/network/kernel/qurlinfo_p.h11
-rw-r--r--src/network/ssl/qsslcertificateextension_p.h11
-rw-r--r--src/network/ssl/qsslcontext_p.h11
-rw-r--r--src/platformsupport/cfsocketnotifier/qcfsocketnotifier_p.h11
-rw-r--r--src/platformsupport/cglconvenience/cglconvenience_p.h11
-rw-r--r--src/platformsupport/clipboard/qmacmime_p.h11
-rw-r--r--src/platformsupport/devicediscovery/qdevicediscovery_p.h11
-rw-r--r--src/platformsupport/eglconvenience/qeglcompositor_p.h11
-rw-r--r--src/platformsupport/eglconvenience/qeglconvenience_p.h11
-rw-r--r--src/platformsupport/eglconvenience/qeglpbuffer_p.h11
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformbackingstore_p.h11
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformcontext_p.h11
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformcursor_p.h11
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformintegration_p.h11
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformscreen_p.h11
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformwindow_p.h11
-rw-r--r--src/platformsupport/eglconvenience/qxlibeglintegration_p.h11
-rw-r--r--src/platformsupport/eventdispatchers/qeventdispatcher_cf_p.h11
-rw-r--r--src/platformsupport/fbconvenience/qfbbackingstore_p.h11
-rw-r--r--src/platformsupport/fbconvenience/qfbcursor_p.h11
-rw-r--r--src/platformsupport/fbconvenience/qfbscreen_p.h11
-rw-r--r--src/platformsupport/fbconvenience/qfbvthandler_p.h11
-rw-r--r--src/platformsupport/fbconvenience/qfbwindow_p.h11
-rw-r--r--src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h11
-rw-r--r--src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h11
-rw-r--r--src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h11
-rw-r--r--src/platformsupport/fontdatabases/genericunix/qgenericunixfontdatabase_p.h11
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm3
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h11
-rw-r--r--src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h11
-rw-r--r--src/platformsupport/glxconvenience/qglxconvenience_p.h11
-rw-r--r--src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h11
-rw-r--r--src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h11
-rw-r--r--src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager_p.h11
-rw-r--r--src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h11
-rw-r--r--src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h11
-rw-r--r--src/platformsupport/input/evdevtablet/qevdevtablet_p.h11
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouch_p.h11
-rw-r--r--src/platformsupport/linuxaccessibility/application_p.h11
-rw-r--r--src/platformsupport/linuxaccessibility/atspiadaptor_p.h11
-rw-r--r--src/platformsupport/linuxaccessibility/bridge_p.h11
-rw-r--r--src/platformsupport/linuxaccessibility/cache_p.h11
-rw-r--r--src/platformsupport/linuxaccessibility/constant_mappings_p.h10
-rw-r--r--src/platformsupport/linuxaccessibility/dbusconnection_p.h11
-rw-r--r--src/platformsupport/linuxaccessibility/struct_marshallers_p.h11
-rw-r--r--src/platformsupport/services/genericunix/qgenericunixservices_p.h11
-rw-r--r--src/platformsupport/themes/genericunix/qgenericunixthemes_p.h11
-rw-r--r--src/plugins/platforms/android/androidjniinput.cpp16
-rw-r--r--src/plugins/platforms/cocoa/qcocoaapplication.mm10
-rw-r--r--src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm3
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenu.mm5
-rw-r--r--src/plugins/platforms/cocoa/qnsview.h6
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm2
-rw-r--r--src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp66
-rw-r--r--src/plugins/platforms/qnx/qqnxrasterbackingstore.h12
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp2
-rw-r--r--src/plugins/platforms/xcb/xcb-plugin.pro1
-rw-r--r--src/plugins/platforms/xcb/xcb-static/xcb-static.pro3
-rw-r--r--src/plugins/printsupport/cups/qcupsprintersupport_p.h11
-rw-r--r--src/sql/drivers/ibase/qsql_ibase.cpp14
-rw-r--r--src/sql/kernel/qsqlquery.cpp6
-rw-r--r--src/sql/kernel/qsqlresult.cpp6
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsglobal_p.h11
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp21
-rw-r--r--src/widgets/dialogs/qfiledialog_p.h5
-rw-r--r--src/widgets/graphicsview/qgraphicsgridlayoutengine_p.h11
-rw-r--r--src/widgets/graphicsview/qgraphicslayoutstyleinfo_p.h11
-rw-r--r--src/widgets/itemviews/qfileiconprovider_p.h11
-rw-r--r--src/widgets/itemviews/qstyleditemdelegate.cpp3
-rw-r--r--src/widgets/kernel/qboxlayout.cpp18
-rw-r--r--src/widgets/kernel/qformlayout.cpp22
-rw-r--r--src/widgets/kernel/qgridlayout.cpp23
-rw-r--r--src/widgets/kernel/qlayout.cpp41
-rw-r--r--src/widgets/kernel/qlayout_p.h2
-rw-r--r--src/widgets/kernel/qwidgetwindow_qpa_p.h11
-rw-r--r--src/widgets/kernel/qwindowcontainer_p.h11
-rw-r--r--src/widgets/styles/qfusionstyle_p.h11
-rw-r--r--src/widgets/styles/qgtkstyle_p.h11
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm150
-rw-r--r--src/widgets/styles/qmacstyle_mac_p.h11
-rw-r--r--src/widgets/styles/qmacstyle_mac_p_p.h8
-rw-r--r--src/widgets/styles/qstylehelper.cpp10
-rw-r--r--src/widgets/styles/qstylehelper_p.h2
-rw-r--r--src/widgets/styles/qwindowscestyle_p.h11
-rw-r--r--src/widgets/styles/qwindowsmobilestyle_p.h11
-rw-r--r--src/widgets/styles/qwindowsstyle_p.h11
-rw-r--r--src/widgets/styles/qwindowsvistastyle_p.h11
-rw-r--r--src/widgets/styles/qwindowsxpstyle_p.h11
-rw-r--r--src/widgets/widgets/qkeysequenceedit_p.h11
-rw-r--r--src/widgets/widgets/qplaintextedit.cpp3
-rw-r--r--src/widgets/widgets/qsizegrip.cpp2
-rw-r--r--src/widgets/widgets/qtoolbutton.cpp4
-rw-r--r--tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp23
-rw-r--r--tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp23
-rw-r--r--tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp32
-rw-r--r--tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp24
-rw-r--r--tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp32
-rw-r--r--tests/auto/widgets/widgets/qsizegrip/tst_qsizegrip.cpp25
-rw-r--r--tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp28
-rw-r--r--tests/manual/qlayout/gridwidget.cpp8
-rw-r--r--tests/manual/qlayout/hbwidget.cpp8
-rw-r--r--tests/manual/qlayout/vbwidget.cpp8
147 files changed, 1597 insertions, 197 deletions
diff --git a/configure b/configure
index cb8d78fd3c..b3b7528382 100755
--- a/configure
+++ b/configure
@@ -195,7 +195,7 @@ expandQMakeConf()
extractQMakeVariables()
{
- $AWK '
+ LC_ALL=C $AWK '
BEGIN {
values["LITERAL_WHITESPACE"] = " "
values["LITERAL_DOLLAR"] = "$"
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 8e8b50f737..9e067f14c5 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
@@ -361,11 +361,6 @@ public class QtActivityDelegate
});
}
- public boolean isSoftwareKeyboardVisible()
- {
- return m_keyboardIsVisible;
- }
-
String getAppIconSize(Activity a)
{
int size = a.getResources().getDimensionPixelSize(android.R.dimen.app_icon_size);
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 0107cff23a..0e2af9a192 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
@@ -397,25 +397,6 @@ public class QtNative
});
}
- private static boolean isSoftwareKeyboardVisible()
- {
- final Semaphore semaphore = new Semaphore(0);
- final Boolean[] ret = {false};
- runAction(new Runnable() {
- @Override
- public void run() {
- ret[0] = m_activityDelegate.isSoftwareKeyboardVisible();
- semaphore.release();
- }
- });
- try {
- semaphore.acquire();
- } catch (Exception e) {
- e.printStackTrace();
- }
- return ret[0];
- }
-
private static void setFullScreen(final boolean fullScreen)
{
runAction(new Runnable() {
diff --git a/src/angle/src/common/common.pri b/src/angle/src/common/common.pri
index 0943b3f299..afb8a8675d 100644
--- a/src/angle/src/common/common.pri
+++ b/src/angle/src/common/common.pri
@@ -7,6 +7,11 @@ INCLUDEPATH += \
LIBS_PRIVATE = $$QMAKE_LIBS_CORE $$QMAKE_LIBS_GUI
+lib_replace.match = $$[QT_INSTALL_LIBS/get]
+lib_replace.replace = $$[QT_INSTALL_LIBS/raw]
+lib_replace.CONFIG = path
+QMAKE_PRL_INSTALL_REPLACE += lib_replace
+
# DirectX is included in the Windows 8 Kit, but everything else requires the DX SDK.
win32-msvc2012|win32-msvc2013|winrt {
FXC = fxc.exe
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 255eb6c00b..c159ea172d 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -45,11 +45,11 @@
#include <stddef.h>
-#define QT_VERSION_STR "5.3.2"
+#define QT_VERSION_STR "5.3.3"
/*
QT_VERSION is (major << 16) + (minor << 8) + patch.
*/
-#define QT_VERSION 0x050302
+#define QT_VERSION 0x050303
/*
can be used like #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0))
*/
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index ca0fb1bb23..51169eb963 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -1282,12 +1282,9 @@ static void qDefaultMsgHandler(QtMsgType type, const char *buf)
qDefaultMessageHandler(type, emptyContext, QString::fromLocal8Bit(buf));
}
-#if defined(Q_COMPILER_THREAD_LOCAL) || (defined(Q_CC_MSVC) && !defined(Q_OS_WINCE))
-#if defined(Q_CC_MSVC)
-static __declspec(thread) bool msgHandlerGrabbed = false;
-#else
+#if defined(Q_COMPILER_THREAD_LOCAL)
+
static thread_local bool msgHandlerGrabbed = false;
-#endif
static bool grabMessageHandler()
{
@@ -1306,7 +1303,7 @@ static void ungrabMessageHandler()
#else
static bool grabMessageHandler() { return true; }
static void ungrabMessageHandler() { }
-#endif // (Q_COMPILER_THREAD_LOCAL) || ((Q_CC_MSVC) && !(Q_OS_WINCE))
+#endif // (Q_COMPILER_THREAD_LOCAL)
static void qt_message_print(QtMsgType msgType, const QMessageLogContext &context, const QString &message)
{
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index a47f2e2945..50697e82a7 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -125,7 +125,7 @@
to author a plugin. This includes avoiding loading our nib for the main
menu and not taking possession of the native menu bar. When setting this
attribute to true will also set the AA_DontUseNativeMenuBar attribute
- to true.
+ to true. It also disables native event filters.
\value AA_DontUseNativeMenuBar All menubars created while this attribute is
set to true won't be used as a native menubar (e.g, the menubar at
diff --git a/src/corelib/io/qdir_p.h b/src/corelib/io/qdir_p.h
index bf7726db2f..4d2f25f9ba 100644
--- a/src/corelib/io/qdir_p.h
+++ b/src/corelib/io/qdir_p.h
@@ -42,6 +42,17 @@
#ifndef QDIR_P_H
#define QDIR_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qfilesystementry_p.h"
#include "qfilesystemmetadata_p.h"
diff --git a/src/corelib/io/qtemporaryfile_p.h b/src/corelib/io/qtemporaryfile_p.h
index fe637c8dfd..46e9d169f4 100644
--- a/src/corelib/io/qtemporaryfile_p.h
+++ b/src/corelib/io/qtemporaryfile_p.h
@@ -42,6 +42,17 @@
#ifndef QTEMPORARYFILE_P_H
#define QTEMPORARYFILE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qglobal.h>
#ifndef QT_NO_TEMPORARYFILE
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 6868eb6a1e..82c157ee7f 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -2528,6 +2528,9 @@ void QCoreApplication::removeLibraryPath(const QString &path)
\note The filter function set here receives native messages,
i.e. MSG or XCB event structs.
+ \note Native event filters will be disabled when the application the
+ Qt::AA_MacPluginApplication attribute is set.
+
For maximum portability, you should always try to use QEvents
and QObject::installEventFilter() whenever possible.
@@ -2537,6 +2540,11 @@ void QCoreApplication::removeLibraryPath(const QString &path)
*/
void QCoreApplication::installNativeEventFilter(QAbstractNativeEventFilter *filterObj)
{
+ if (QCoreApplication::testAttribute(Qt::AA_MacPluginApplication)) {
+ qWarning("Native event filters are not applied when the Qt::AA_MacPluginApplication attribute is set");
+ return;
+ }
+
QAbstractEventDispatcher *eventDispatcher = QAbstractEventDispatcher::instance(QCoreApplicationPrivate::theMainThread);
if (!filterObj || !eventDispatcher)
return;
diff --git a/src/corelib/kernel/qeventloop_p.h b/src/corelib/kernel/qeventloop_p.h
index 30c61ca759..1a1743260b 100644
--- a/src/corelib/kernel/qeventloop_p.h
+++ b/src/corelib/kernel/qeventloop_p.h
@@ -42,6 +42,17 @@
#ifndef QEVENTLOOP_P_H
#define QEVENTLOOP_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qobject_p.h"
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/kernel/qmetaobject_moc_p.h b/src/corelib/kernel/qmetaobject_moc_p.h
index d26cd54e5d..1a7ca63ae1 100644
--- a/src/corelib/kernel/qmetaobject_moc_p.h
+++ b/src/corelib/kernel/qmetaobject_moc_p.h
@@ -43,6 +43,17 @@
# error "Include qmetaobject_p.h (or moc's utils.h) before including this file."
#endif
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
QT_BEGIN_NAMESPACE
// This function is shared with moc.cpp. This file should be included where needed.
diff --git a/src/corelib/mimetypes/qmimedatabase_p.h b/src/corelib/mimetypes/qmimedatabase_p.h
index 78bb6c2780..d0546cf5ce 100644
--- a/src/corelib/mimetypes/qmimedatabase_p.h
+++ b/src/corelib/mimetypes/qmimedatabase_p.h
@@ -42,6 +42,17 @@
#ifndef QMIMEDATABASE_P_H
#define QMIMEDATABASE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qhash.h>
#include <QtCore/qmutex.h>
diff --git a/src/corelib/mimetypes/qmimeglobpattern_p.h b/src/corelib/mimetypes/qmimeglobpattern_p.h
index ca22aa9588..05d701e787 100644
--- a/src/corelib/mimetypes/qmimeglobpattern_p.h
+++ b/src/corelib/mimetypes/qmimeglobpattern_p.h
@@ -42,6 +42,17 @@
#ifndef QMIMEGLOBPATTERN_P_H
#define QMIMEGLOBPATTERN_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qstringlist.h>
#include <QtCore/qhash.h>
diff --git a/src/corelib/mimetypes/qmimemagicrule_p.h b/src/corelib/mimetypes/qmimemagicrule_p.h
index c252440d6c..aeed1908a7 100644
--- a/src/corelib/mimetypes/qmimemagicrule_p.h
+++ b/src/corelib/mimetypes/qmimemagicrule_p.h
@@ -42,6 +42,17 @@
#ifndef QMIMEMAGICRULE_P_H
#define QMIMEMAGICRULE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qbytearray.h>
#include <QtCore/qscopedpointer.h>
#include <QtCore/qlist.h>
diff --git a/src/corelib/mimetypes/qmimemagicrulematcher_p.h b/src/corelib/mimetypes/qmimemagicrulematcher_p.h
index 159342482f..49de59f55a 100644
--- a/src/corelib/mimetypes/qmimemagicrulematcher_p.h
+++ b/src/corelib/mimetypes/qmimemagicrulematcher_p.h
@@ -42,6 +42,17 @@
#ifndef QMIMEMAGICRULEMATCHER_P_H
#define QMIMEMAGICRULEMATCHER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qbytearray.h>
#include <QtCore/qlist.h>
#include <QtCore/qstring.h>
diff --git a/src/corelib/mimetypes/qmimeprovider_p.h b/src/corelib/mimetypes/qmimeprovider_p.h
index 4a263093bd..f79373bb0a 100644
--- a/src/corelib/mimetypes/qmimeprovider_p.h
+++ b/src/corelib/mimetypes/qmimeprovider_p.h
@@ -42,6 +42,17 @@
#ifndef QMIMEPROVIDER_P_H
#define QMIMEPROVIDER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qdatetime.h>
#include "qmimedatabase_p.h"
#include <QtCore/qset.h>
diff --git a/src/corelib/mimetypes/qmimetype_p.h b/src/corelib/mimetypes/qmimetype_p.h
index c500520fe1..637c85d8ca 100644
--- a/src/corelib/mimetypes/qmimetype_p.h
+++ b/src/corelib/mimetypes/qmimetype_p.h
@@ -42,6 +42,17 @@
#ifndef QMIMETYPE_P_H
#define QMIMETYPE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qmimetype.h"
#include <QtCore/qhash.h>
diff --git a/src/corelib/mimetypes/qmimetypeparser_p.h b/src/corelib/mimetypes/qmimetypeparser_p.h
index c92bb81be4..ef7a12cdd5 100644
--- a/src/corelib/mimetypes/qmimetypeparser_p.h
+++ b/src/corelib/mimetypes/qmimetypeparser_p.h
@@ -43,6 +43,17 @@
#ifndef QMIMETYPEPARSER_P_H
#define QMIMETYPEPARSER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qmimedatabase_p.h"
#include "qmimeprovider_p.h"
diff --git a/src/corelib/plugin/qsystemlibrary_p.h b/src/corelib/plugin/qsystemlibrary_p.h
index 4a2c86990f..8b0fd57faf 100644
--- a/src/corelib/plugin/qsystemlibrary_p.h
+++ b/src/corelib/plugin/qsystemlibrary_p.h
@@ -42,6 +42,17 @@
#ifndef QSYSTEMLIBRARY_P_H
#define QSYSTEMLIBRARY_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qglobal.h>
#ifdef Q_OS_WIN
# include <QtCore/qstring.h>
diff --git a/src/corelib/tools/qcollator_p.h b/src/corelib/tools/qcollator_p.h
index 50e1a01f82..526521ebf4 100644
--- a/src/corelib/tools/qcollator_p.h
+++ b/src/corelib/tools/qcollator_p.h
@@ -43,6 +43,17 @@
#ifndef QCOLLATOR_P_H
#define QCOLLATOR_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qcollator.h"
#include <QVector>
#ifdef QT_USE_ICU
diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
index e1c22bac71..b8dd3b101e 100644
--- a/src/corelib/tools/qsimd_p.h
+++ b/src/corelib/tools/qsimd_p.h
@@ -42,6 +42,17 @@
#ifndef QSIMD_P_H
#define QSIMD_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qglobal.h>
#include <qatomic.h>
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 6c8db11212..3b18d31547 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -1306,9 +1306,6 @@ const QString::Null QString::null = { };
Returns a copy of the \a str string. The given string is converted
to Unicode using the fromUtf8() function.
- This constructor is only available if Qt is configured with STL
- compatibility enabled.
-
\sa fromLatin1(), fromLocal8Bit(), fromUtf8()
*/
@@ -1341,7 +1338,7 @@ const QString::Null QString::null = { };
wchar_t is 2 bytes wide (e.g. windows) and in ucs4 on platforms
where wchar_t is 4 bytes wide (most Unix systems).
- This operator is mostly useful to pass a QString to a function
+ This method is mostly useful to pass a QString to a function
that accepts a std::wstring object.
\sa utf16(), toLatin1(), toUtf8(), toLocal8Bit()
@@ -7720,12 +7717,9 @@ bool QString::isRightToLeft() const
QString. The Unicode data is converted into 8-bit characters using
the toUtf8() function.
- This operator is mostly useful to pass a QString to a function
+ This method is mostly useful to pass a QString to a function
that accepts a std::string object.
- If the QString contains non-Latin1 Unicode characters, using this
- can lead to loss of information.
-
\sa toLatin1(), toUtf8(), toLocal8Bit()
*/
diff --git a/src/corelib/tools/qstringiterator_p.h b/src/corelib/tools/qstringiterator_p.h
index c3986f0477..4ae705b085 100644
--- a/src/corelib/tools/qstringiterator_p.h
+++ b/src/corelib/tools/qstringiterator_p.h
@@ -43,6 +43,17 @@
#ifndef QSTRINGITERATOR_H
#define QSTRINGITERATOR_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qstring.h>
QT_BEGIN_NAMESPACE
diff --git a/src/gui/image/qgifhandler_p.h b/src/gui/image/qgifhandler_p.h
index bf4ba30e20..80c9e145c5 100644
--- a/src/gui/image/qgifhandler_p.h
+++ b/src/gui/image/qgifhandler_p.h
@@ -47,6 +47,17 @@
#ifndef QGIFHANDLER_P_H
#define QGIFHANDLER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtGui/qimageiohandler.h>
#include <QtGui/qimage.h>
#include <QtCore/qbytearray.h>
diff --git a/src/gui/image/qjpeghandler_p.h b/src/gui/image/qjpeghandler_p.h
index f5676d9b14..4342782f03 100644
--- a/src/gui/image/qjpeghandler_p.h
+++ b/src/gui/image/qjpeghandler_p.h
@@ -42,6 +42,17 @@
#ifndef QJPEGHANDLER_P_H
#define QJPEGHANDLER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtGui/qimageiohandler.h>
#include <QtCore/QSize>
#include <QtCore/QRect>
diff --git a/src/gui/image/qpixmap_blitter_p.h b/src/gui/image/qpixmap_blitter_p.h
index 1f723178d8..481fb0bc24 100644
--- a/src/gui/image/qpixmap_blitter_p.h
+++ b/src/gui/image/qpixmap_blitter_p.h
@@ -42,6 +42,17 @@
#ifndef QPIXMAP_BLITTER_P_H
#define QPIXMAP_BLITTER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformpixmap.h>
#include <private/qpaintengine_blitter_p.h>
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 7648233608..4727e754cd 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -588,6 +588,7 @@ QGuiApplication::~QGuiApplication()
#endif //QT_NO_SESSIONMANAGER
clearPalette();
+ QFontDatabase::removeAllApplicationFonts();
#ifndef QT_NO_CURSOR
d->cursor_list.clear();
diff --git a/src/gui/kernel/qplatformtheme_p.h b/src/gui/kernel/qplatformtheme_p.h
index 217c284a9e..f493037ddd 100644
--- a/src/gui/kernel/qplatformtheme_p.h
+++ b/src/gui/kernel/qplatformtheme_p.h
@@ -46,9 +46,11 @@
// W A R N I N G
// -------------
//
-// This file is part of the QPA API and is not meant to be used
-// in applications. Usage of this API may make your code
-// source and binary incompatible with future versions of Qt.
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
//
#include <QtCore/QtGlobal>
diff --git a/src/gui/kernel/qshapedpixmapdndwindow_p.h b/src/gui/kernel/qshapedpixmapdndwindow_p.h
index 20674b6b19..1b56f47bd5 100644
--- a/src/gui/kernel/qshapedpixmapdndwindow_p.h
+++ b/src/gui/kernel/qshapedpixmapdndwindow_p.h
@@ -42,6 +42,17 @@
#ifndef QSHAPEDPIXMAPDNDWINDOW_H
#define QSHAPEDPIXMAPDNDWINDOW_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtGui/QWindow>
#include <QtGui/QPixmap>
#include <QtGui/QBackingStore>
diff --git a/src/gui/kernel/qsimpledrag_p.h b/src/gui/kernel/qsimpledrag_p.h
index 36ea4c1ec5..d17440f7a2 100644
--- a/src/gui/kernel/qsimpledrag_p.h
+++ b/src/gui/kernel/qsimpledrag_p.h
@@ -39,8 +39,19 @@
**
****************************************************************************/
-#ifndef QSIMPLEDRAG_H
-#define QSIMPLEDRAG_H
+#ifndef QSIMPLEDRAG_P_H
+#define QSIMPLEDRAG_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
#include <qpa/qplatformdrag.h>
diff --git a/src/gui/opengl/qopengl_p.h b/src/gui/opengl/qopengl_p.h
index 3cf636751a..5926fc8fba 100644
--- a/src/gui/opengl/qopengl_p.h
+++ b/src/gui/opengl/qopengl_p.h
@@ -42,6 +42,17 @@
#ifndef QOPENGL_P_H
#define QOPENGL_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qopengl.h>
#include <private/qopenglcontext_p.h>
#include <QtCore/qset.h>
diff --git a/src/gui/opengl/qopenglqueryhelper_p.h b/src/gui/opengl/qopenglqueryhelper_p.h
index a7136c1cb7..bfafb30518 100644
--- a/src/gui/opengl/qopenglqueryhelper_p.h
+++ b/src/gui/opengl/qopenglqueryhelper_p.h
@@ -42,6 +42,17 @@
#ifndef QOPENGLQUERYHELPER_P_H
#define QOPENGLQUERYHELPER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qglobal.h>
#if !defined(QT_OPENGL_ES_2)
diff --git a/src/gui/opengl/qopengltexture_p.h b/src/gui/opengl/qopengltexture_p.h
index a732805f55..c50139ee59 100644
--- a/src/gui/opengl/qopengltexture_p.h
+++ b/src/gui/opengl/qopengltexture_p.h
@@ -42,6 +42,17 @@
#ifndef QABSTRACTOPENGLTEXTURE_P_H
#define QABSTRACTOPENGLTEXTURE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#ifndef QT_NO_OPENGL
#include "private/qobject_p.h"
diff --git a/src/gui/opengl/qopengltextureblitter_p.h b/src/gui/opengl/qopengltextureblitter_p.h
index c1dcaf5700..44b442f50e 100644
--- a/src/gui/opengl/qopengltextureblitter_p.h
+++ b/src/gui/opengl/qopengltextureblitter_p.h
@@ -42,6 +42,17 @@
#ifndef QOPENGLTEXTUREBLITTER_P_H
#define QOPENGLTEXTUREBLITTER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtGui/qopengl.h>
#include <QtGui/QMatrix3x3>
diff --git a/src/gui/opengl/qopengltexturehelper_p.h b/src/gui/opengl/qopengltexturehelper_p.h
index 782486b90d..a920a08c71 100644
--- a/src/gui/opengl/qopengltexturehelper_p.h
+++ b/src/gui/opengl/qopengltexturehelper_p.h
@@ -42,6 +42,17 @@
#ifndef QOPENGLTEXTUREHELPER_P_H
#define QOPENGLTEXTUREHELPER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qglobal.h>
#ifndef QT_NO_OPENGL
diff --git a/src/gui/opengl/qopenglversionfunctionsfactory_p.h b/src/gui/opengl/qopenglversionfunctionsfactory_p.h
index 2312e900f9..c644bc9082 100644
--- a/src/gui/opengl/qopenglversionfunctionsfactory_p.h
+++ b/src/gui/opengl/qopenglversionfunctionsfactory_p.h
@@ -51,6 +51,17 @@
#ifndef QOPENGLVERSIONFUNCTIONFACTORY_P_H
#define QOPENGLVERSIONFUNCTIONFACTORY_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#ifndef QT_NO_OPENGL
#include <QtCore/QtGlobal>
diff --git a/src/gui/opengl/qtriangulatingstroker_p.h b/src/gui/opengl/qtriangulatingstroker_p.h
index 2328f75af8..dc3a13e698 100644
--- a/src/gui/opengl/qtriangulatingstroker_p.h
+++ b/src/gui/opengl/qtriangulatingstroker_p.h
@@ -42,6 +42,17 @@
#ifndef QTRIANGULATINGSTROKER_P_H
#define QTRIANGULATINGSTROKER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <private/qdatabuffer_p.h>
#include <qvarlengtharray.h>
#include <private/qvectorpath_p.h>
diff --git a/src/gui/painting/qblittable_p.h b/src/gui/painting/qblittable_p.h
index f65549d63c..5c625f664e 100644
--- a/src/gui/painting/qblittable_p.h
+++ b/src/gui/painting/qblittable_p.h
@@ -42,6 +42,17 @@
#ifndef QBLITTABLE_P_H
#define QBLITTABLE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qsize.h>
#include <QtGui/private/qpixmap_blitter_p.h>
diff --git a/src/gui/painting/qcosmeticstroker_p.h b/src/gui/painting/qcosmeticstroker_p.h
index 5fc3559da4..84e22b2653 100644
--- a/src/gui/painting/qcosmeticstroker_p.h
+++ b/src/gui/painting/qcosmeticstroker_p.h
@@ -42,6 +42,17 @@
#ifndef QCOSMETICSTROKER_P_H
#define QCOSMETICSTROKER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <private/qdrawhelper_p.h>
#include <private/qvectorpath_p.h>
#include <private/qpaintengine_raster_p.h>
diff --git a/src/gui/painting/qpaintengine_blitter_p.h b/src/gui/painting/qpaintengine_blitter_p.h
index b70ee5fc5c..d917a30f1f 100644
--- a/src/gui/painting/qpaintengine_blitter_p.h
+++ b/src/gui/painting/qpaintengine_blitter_p.h
@@ -42,6 +42,17 @@
#ifndef QPAINTENGINE_BLITTER_P_H
#define QPAINTENGINE_BLITTER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "private/qpaintengine_raster_p.h"
#ifndef QT_NO_BLITTABLE
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index 4879ae51d7..8e605e4ae1 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -2583,7 +2583,7 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const
}
int lineEnd = line.from + line.length + line.trailingSpaces;
- int pos = *cursorPos;
+ int pos = qBound(0, *cursorPos, lineEnd);
int itm;
const QCharAttributes *attributes = eng->attributes();
if (!attributes) {
diff --git a/src/gui/util/qabstractlayoutstyleinfo_p.h b/src/gui/util/qabstractlayoutstyleinfo_p.h
index 52f151c5d2..b0f901d0ac 100644
--- a/src/gui/util/qabstractlayoutstyleinfo_p.h
+++ b/src/gui/util/qabstractlayoutstyleinfo_p.h
@@ -42,6 +42,17 @@
#ifndef QABSTRACTLAYOUTSTYLEINFO_P_H
#define QABSTRACTLAYOUTSTYLEINFO_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qnamespace.h>
#include "qlayoutpolicy_p.h"
diff --git a/src/gui/util/qlayoutpolicy_p.h b/src/gui/util/qlayoutpolicy_p.h
index 664afef1a4..2d98bcd84c 100644
--- a/src/gui/util/qlayoutpolicy_p.h
+++ b/src/gui/util/qlayoutpolicy_p.h
@@ -42,6 +42,17 @@
#ifndef QLAYOUTPOLICY_H
#define QLAYOUTPOLICY_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qobject.h>
#include <QtCore/qnamespace.h>
diff --git a/src/network/access/qnetworkaccessauthenticationmanager.cpp b/src/network/access/qnetworkaccessauthenticationmanager.cpp
index ea7bdc198a..b92f9c1b9b 100644
--- a/src/network/access/qnetworkaccessauthenticationmanager.cpp
+++ b/src/network/access/qnetworkaccessauthenticationmanager.cpp
@@ -231,6 +231,8 @@ void QNetworkAccessAuthenticationManager::cacheCredentials(const QUrl &url,
const QAuthenticator *authenticator)
{
Q_ASSERT(authenticator);
+ if (authenticator->isNull())
+ return;
QString domain = QString::fromLatin1("/"); // FIXME: make QAuthenticator return the domain
QString realm = authenticator->realm();
diff --git a/src/network/kernel/qurlinfo_p.h b/src/network/kernel/qurlinfo_p.h
index 1aa59f25ad..31eb0730d3 100644
--- a/src/network/kernel/qurlinfo_p.h
+++ b/src/network/kernel/qurlinfo_p.h
@@ -42,6 +42,17 @@
#ifndef QURLINFO_H
#define QURLINFO_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qdatetime.h>
#include <QtCore/qstring.h>
#include <QtCore/qiodevice.h>
diff --git a/src/network/ssl/qsslcertificateextension_p.h b/src/network/ssl/qsslcertificateextension_p.h
index cc04e76634..6891733174 100644
--- a/src/network/ssl/qsslcertificateextension_p.h
+++ b/src/network/ssl/qsslcertificateextension_p.h
@@ -42,6 +42,17 @@
#ifndef QSSLCERTIFICATEEXTENSION_P_H
#define QSSLCERTIFICATEEXTENSION_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qsslcertificateextension.h"
QT_BEGIN_NAMESPACE
diff --git a/src/network/ssl/qsslcontext_p.h b/src/network/ssl/qsslcontext_p.h
index 20b27c1ce7..408376b954 100644
--- a/src/network/ssl/qsslcontext_p.h
+++ b/src/network/ssl/qsslcontext_p.h
@@ -44,6 +44,17 @@
#ifndef QSSLCONTEXT_H
#define QSSLCONTEXT_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qvariant.h>
#include <QtNetwork/qsslcertificate.h>
#include <QtNetwork/qsslconfiguration.h>
diff --git a/src/platformsupport/cfsocketnotifier/qcfsocketnotifier_p.h b/src/platformsupport/cfsocketnotifier/qcfsocketnotifier_p.h
index cd1eb8e4ca..dcd1b12ad7 100644
--- a/src/platformsupport/cfsocketnotifier/qcfsocketnotifier_p.h
+++ b/src/platformsupport/cfsocketnotifier/qcfsocketnotifier_p.h
@@ -42,6 +42,17 @@
#ifndef QCFSOCKETNOTIFIER_P_H
#define QCFSOCKETNOTIFIER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qabstracteventdispatcher.h>
#include <QtCore/qhash.h>
diff --git a/src/platformsupport/cglconvenience/cglconvenience_p.h b/src/platformsupport/cglconvenience/cglconvenience_p.h
index 82842a78f0..674753d878 100644
--- a/src/platformsupport/cglconvenience/cglconvenience_p.h
+++ b/src/platformsupport/cglconvenience/cglconvenience_p.h
@@ -42,6 +42,17 @@
#ifndef QMACGLCONVENIENCE_H
#define QMACGLCONVENIENCE_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QSurfaceFormat>
#include <QString>
#include <OpenGL/OpenGL.h>
diff --git a/src/platformsupport/clipboard/qmacmime_p.h b/src/platformsupport/clipboard/qmacmime_p.h
index 0802987fab..6bdb90232c 100644
--- a/src/platformsupport/clipboard/qmacmime_p.h
+++ b/src/platformsupport/clipboard/qmacmime_p.h
@@ -42,6 +42,17 @@
#ifndef QMACMIME_H
#define QMACMIME_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore>
#include <CoreFoundation/CoreFoundation.h>
diff --git a/src/platformsupport/devicediscovery/qdevicediscovery_p.h b/src/platformsupport/devicediscovery/qdevicediscovery_p.h
index 0e21118324..fd44cdd8da 100644
--- a/src/platformsupport/devicediscovery/qdevicediscovery_p.h
+++ b/src/platformsupport/devicediscovery/qdevicediscovery_p.h
@@ -42,6 +42,17 @@
#ifndef QDEVICEDISCOVERY_H
#define QDEVICEDISCOVERY_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QObject>
#include <QSocketNotifier>
#include <QStringList>
diff --git a/src/platformsupport/eglconvenience/qeglcompositor_p.h b/src/platformsupport/eglconvenience/qeglcompositor_p.h
index 370345ada6..2e0a3adaf3 100644
--- a/src/platformsupport/eglconvenience/qeglcompositor_p.h
+++ b/src/platformsupport/eglconvenience/qeglcompositor_p.h
@@ -42,6 +42,17 @@
#ifndef QEGLCOMPOSITOR_H
#define QEGLCOMPOSITOR_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/QTimer>
QT_BEGIN_NAMESPACE
diff --git a/src/platformsupport/eglconvenience/qeglconvenience_p.h b/src/platformsupport/eglconvenience/qeglconvenience_p.h
index 8616275e53..41d392e43a 100644
--- a/src/platformsupport/eglconvenience/qeglconvenience_p.h
+++ b/src/platformsupport/eglconvenience/qeglconvenience_p.h
@@ -42,6 +42,17 @@
#ifndef QEGLCONVENIENCE_H
#define QEGLCONVENIENCE_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtGui/QSurfaceFormat>
#include <QtCore/QVector>
#include <QtCore/QSizeF>
diff --git a/src/platformsupport/eglconvenience/qeglpbuffer_p.h b/src/platformsupport/eglconvenience/qeglpbuffer_p.h
index 1b4ac6f991..92d89198a4 100644
--- a/src/platformsupport/eglconvenience/qeglpbuffer_p.h
+++ b/src/platformsupport/eglconvenience/qeglpbuffer_p.h
@@ -42,6 +42,17 @@
#ifndef QEGLPBUFFER_H
#define QEGLPBUFFER_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <EGL/egl.h>
#include <qpa/qplatformoffscreensurface.h>
diff --git a/src/platformsupport/eglconvenience/qeglplatformbackingstore_p.h b/src/platformsupport/eglconvenience/qeglplatformbackingstore_p.h
index cb1e5999b0..57c632a4c5 100644
--- a/src/platformsupport/eglconvenience/qeglplatformbackingstore_p.h
+++ b/src/platformsupport/eglconvenience/qeglplatformbackingstore_p.h
@@ -42,6 +42,17 @@
#ifndef QEGLPLATFORMBACKINGSTORE_H
#define QEGLPLATFORMBACKINGSTORE_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformbackingstore.h>
#include <QImage>
diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext_p.h b/src/platformsupport/eglconvenience/qeglplatformcontext_p.h
index 714633c3bc..8fbd573e33 100644
--- a/src/platformsupport/eglconvenience/qeglplatformcontext_p.h
+++ b/src/platformsupport/eglconvenience/qeglplatformcontext_p.h
@@ -42,6 +42,17 @@
#ifndef QEGLPLATFORMCONTEXT_H
#define QEGLPLATFORMCONTEXT_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformwindow.h>
#include <qpa/qplatformopenglcontext.h>
#include <EGL/egl.h>
diff --git a/src/platformsupport/eglconvenience/qeglplatformcursor_p.h b/src/platformsupport/eglconvenience/qeglplatformcursor_p.h
index 6f4216874a..be2ec56787 100644
--- a/src/platformsupport/eglconvenience/qeglplatformcursor_p.h
+++ b/src/platformsupport/eglconvenience/qeglplatformcursor_p.h
@@ -42,6 +42,17 @@
#ifndef QEGLPLATFORMCURSOR_H
#define QEGLPLATFORMCURSOR_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformcursor.h>
#include <qpa/qplatformscreen.h>
diff --git a/src/platformsupport/eglconvenience/qeglplatformintegration_p.h b/src/platformsupport/eglconvenience/qeglplatformintegration_p.h
index f665455383..cc10f3ed77 100644
--- a/src/platformsupport/eglconvenience/qeglplatformintegration_p.h
+++ b/src/platformsupport/eglconvenience/qeglplatformintegration_p.h
@@ -42,6 +42,17 @@
#ifndef QEGLPLATFORMINTEGRATION_H
#define QEGLPLATFORMINTEGRATION_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformintegration.h>
#include <qpa/qplatformnativeinterface.h>
#include <EGL/egl.h>
diff --git a/src/platformsupport/eglconvenience/qeglplatformscreen_p.h b/src/platformsupport/eglconvenience/qeglplatformscreen_p.h
index d0d8a52a87..955d9db5de 100644
--- a/src/platformsupport/eglconvenience/qeglplatformscreen_p.h
+++ b/src/platformsupport/eglconvenience/qeglplatformscreen_p.h
@@ -42,6 +42,17 @@
#ifndef QEGLPLATFORMSCREEN_H
#define QEGLPLATFORMSCREEN_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/QList>
#include <qpa/qplatformscreen.h>
#include <EGL/egl.h>
diff --git a/src/platformsupport/eglconvenience/qeglplatformwindow_p.h b/src/platformsupport/eglconvenience/qeglplatformwindow_p.h
index 17a1d07a79..86d6eee57a 100644
--- a/src/platformsupport/eglconvenience/qeglplatformwindow_p.h
+++ b/src/platformsupport/eglconvenience/qeglplatformwindow_p.h
@@ -42,6 +42,17 @@
#ifndef QEGLPLATFORMWINDOW_H
#define QEGLPLATFORMWINDOW_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformwindow.h>
#include <EGL/egl.h>
diff --git a/src/platformsupport/eglconvenience/qxlibeglintegration_p.h b/src/platformsupport/eglconvenience/qxlibeglintegration_p.h
index a1360fe74e..2ee63d4fbc 100644
--- a/src/platformsupport/eglconvenience/qxlibeglintegration_p.h
+++ b/src/platformsupport/eglconvenience/qxlibeglintegration_p.h
@@ -42,6 +42,17 @@
#ifndef QTESTLITEEGLINTEGRATION_H
#define QTESTLITEEGLINTEGRATION_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qeglconvenience_p.h"
#include <X11/X.h>
#include <X11/Xlib.h>
diff --git a/src/platformsupport/eventdispatchers/qeventdispatcher_cf_p.h b/src/platformsupport/eventdispatchers/qeventdispatcher_cf_p.h
index 1742a9b939..fe911be510 100644
--- a/src/platformsupport/eventdispatchers/qeventdispatcher_cf_p.h
+++ b/src/platformsupport/eventdispatchers/qeventdispatcher_cf_p.h
@@ -76,6 +76,17 @@
#ifndef QEVENTDISPATCHER_CF_P_H
#define QEVENTDISPATCHER_CF_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#define DEBUG_EVENT_DISPATCHER 0
#include <QtCore/qabstracteventdispatcher.h>
diff --git a/src/platformsupport/fbconvenience/qfbbackingstore_p.h b/src/platformsupport/fbconvenience/qfbbackingstore_p.h
index 8e560ee46a..2a8597e5d9 100644
--- a/src/platformsupport/fbconvenience/qfbbackingstore_p.h
+++ b/src/platformsupport/fbconvenience/qfbbackingstore_p.h
@@ -42,6 +42,17 @@
#ifndef QFBBACKINGSTORE_P_H
#define QFBBACKINGSTORE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformbackingstore.h>
QT_BEGIN_NAMESPACE
diff --git a/src/platformsupport/fbconvenience/qfbcursor_p.h b/src/platformsupport/fbconvenience/qfbcursor_p.h
index 40377e2075..4196cad96f 100644
--- a/src/platformsupport/fbconvenience/qfbcursor_p.h
+++ b/src/platformsupport/fbconvenience/qfbcursor_p.h
@@ -42,6 +42,17 @@
#ifndef QFBCURSOR_P_H
#define QFBCURSOR_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformcursor.h>
QT_BEGIN_NAMESPACE
diff --git a/src/platformsupport/fbconvenience/qfbscreen_p.h b/src/platformsupport/fbconvenience/qfbscreen_p.h
index dd940c4a1d..db93304fc7 100644
--- a/src/platformsupport/fbconvenience/qfbscreen_p.h
+++ b/src/platformsupport/fbconvenience/qfbscreen_p.h
@@ -42,6 +42,17 @@
#ifndef QFBSCREEN_P_H
#define QFBSCREEN_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformscreen.h>
#include <QtCore/QTimer>
#include <QtCore/QSize>
diff --git a/src/platformsupport/fbconvenience/qfbvthandler_p.h b/src/platformsupport/fbconvenience/qfbvthandler_p.h
index d98cd5a9d1..ddaedca3e0 100644
--- a/src/platformsupport/fbconvenience/qfbvthandler_p.h
+++ b/src/platformsupport/fbconvenience/qfbvthandler_p.h
@@ -42,6 +42,17 @@
#ifndef QFBVTHANDLER_H
#define QFBVTHANDLER_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QObject>
QT_BEGIN_NAMESPACE
diff --git a/src/platformsupport/fbconvenience/qfbwindow_p.h b/src/platformsupport/fbconvenience/qfbwindow_p.h
index a2e0785c96..8e526404e0 100644
--- a/src/platformsupport/fbconvenience/qfbwindow_p.h
+++ b/src/platformsupport/fbconvenience/qfbwindow_p.h
@@ -42,6 +42,17 @@
#ifndef QFBWINDOW_P_H
#define QFBWINDOW_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformwindow.h>
QT_BEGIN_NAMESPACE
diff --git a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h
index 247a2855e2..a512644966 100644
--- a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h
+++ b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h
@@ -42,6 +42,17 @@
#ifndef QBASICFONTDATABASE_H
#define QBASICFONTDATABASE_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformfontdatabase.h>
#include <QtCore/QByteArray>
#include <QtCore/QString>
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h
index ba706dc59e..fc929e464d 100644
--- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h
@@ -42,6 +42,17 @@
#ifndef QFONTCONFIGDATABASE_H
#define QFONTCONFIGDATABASE_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformfontdatabase.h>
#include <QtPlatformSupport/private/qbasicfontdatabase_p.h>
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h b/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h
index 2d93d236e5..3c2be10be6 100644
--- a/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h
@@ -42,6 +42,17 @@
#ifndef QFONTENGINEMULTIFONTCONFIG_H
#define QFONTENGINEMULTIFONTCONFIG_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtGui/private/qfontengine_qpa_p.h>
#include <fontconfig/fontconfig.h>
diff --git a/src/platformsupport/fontdatabases/genericunix/qgenericunixfontdatabase_p.h b/src/platformsupport/fontdatabases/genericunix/qgenericunixfontdatabase_p.h
index a8a0b8fe9c..42fd677cf7 100644
--- a/src/platformsupport/fontdatabases/genericunix/qgenericunixfontdatabase_p.h
+++ b/src/platformsupport/fontdatabases/genericunix/qgenericunixfontdatabase_p.h
@@ -42,6 +42,17 @@
#ifndef QGENERICUNIXFONTDATABASE_H
#define QGENERICUNIXFONTDATABASE_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qglobal.h>
#ifdef Q_FONTCONFIGDATABASE
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
index ca7afb7d1b..063d20dbd4 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
@@ -768,6 +768,9 @@ QList<int> QCoreTextFontDatabase::standardSizes() const
void QCoreTextFontDatabase::removeApplicationFonts()
{
+ if (m_applicationFonts.isEmpty())
+ return;
+
foreach (const QVariant &font, m_applicationFonts) {
#if HAVE_CORETEXT
if (&CTFontManagerUnregisterGraphicsFont && &CTFontManagerUnregisterFontsForURL) {
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
index a3da27b28d..10f54310a8 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
@@ -42,6 +42,17 @@
#ifndef QCORETEXTFONTDATABASE_H
#define QCORETEXTFONTDATABASE_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qglobal.h>
#define HAVE_CORETEXT QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_8, __IPHONE_4_1)
#define HAVE_ATS QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_5, __IPHONE_NA)
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
index b9593b983e..8157742219 100644
--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
@@ -42,6 +42,17 @@
#ifndef QFONTENGINE_CORETEXT_P_H
#define QFONTENGINE_CORETEXT_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <private/qfontengine_p.h>
#include <private/qcore_mac_p.h>
diff --git a/src/platformsupport/glxconvenience/qglxconvenience_p.h b/src/platformsupport/glxconvenience/qglxconvenience_p.h
index 66548a3479..0477589d6c 100644
--- a/src/platformsupport/glxconvenience/qglxconvenience_p.h
+++ b/src/platformsupport/glxconvenience/qglxconvenience_p.h
@@ -42,6 +42,17 @@
#ifndef QGLXCONVENIENCE_H
#define QGLXCONVENIENCE_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QSurfaceFormat>
#include <QVector>
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h b/src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h
index 5e919ebeb7..ff34ad346b 100644
--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h
+++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h
@@ -42,6 +42,17 @@
#ifndef QEVDEVKEYBOARDHANDLER_DEFAULTMAP_P_H
#define QEVDEVKEYBOARDHANDLER_DEFAULTMAP_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qnamespace.h"
#include "linux/input.h"
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h
index 1065b05d51..81bc2f6154 100644
--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h
+++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h
@@ -42,6 +42,17 @@
#ifndef QEVDEVKEYBOARDHANDLER_P_H
#define QEVDEVKEYBOARDHANDLER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qobject.h>
#include <QTimer>
#include <QDataStream>
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager_p.h b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager_p.h
index 37c60c035c..0b1ccc23ab 100644
--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager_p.h
+++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager_p.h
@@ -42,6 +42,17 @@
#ifndef QEVDEVKEYBOARDMANAGER_P_H
#define QEVDEVKEYBOARDMANAGER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qevdevkeyboardhandler_p.h"
#include <QtPlatformSupport/private/qdevicediscovery_p.h>
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h b/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h
index d419a1913e..5d8a536ee1 100644
--- a/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h
+++ b/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h
@@ -42,6 +42,17 @@
#ifndef QEVDEVMOUSEHANDLER_P_H
#define QEVDEVMOUSEHANDLER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QObject>
#include <QString>
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h b/src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h
index d52a16ea75..662b216b11 100644
--- a/src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h
+++ b/src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h
@@ -42,6 +42,17 @@
#ifndef QEVDEVMOUSEMANAGER_P_H
#define QEVDEVMOUSEMANAGER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qevdevmousehandler_p.h"
#include <QtPlatformSupport/private/qdevicediscovery_p.h>
diff --git a/src/platformsupport/input/evdevtablet/qevdevtablet_p.h b/src/platformsupport/input/evdevtablet/qevdevtablet_p.h
index 9222db9907..f168d8200b 100644
--- a/src/platformsupport/input/evdevtablet/qevdevtablet_p.h
+++ b/src/platformsupport/input/evdevtablet/qevdevtablet_p.h
@@ -42,6 +42,17 @@
#ifndef QEVDEVTABLET_P_H
#define QEVDEVTABLET_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QObject>
#include <QString>
#include <QThread>
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouch_p.h b/src/platformsupport/input/evdevtouch/qevdevtouch_p.h
index d0ea839f51..a5d9e73200 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouch_p.h
+++ b/src/platformsupport/input/evdevtouch/qevdevtouch_p.h
@@ -42,6 +42,17 @@
#ifndef QEVDEVTOUCH_P_H
#define QEVDEVTOUCH_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QObject>
#include <QString>
#include <QList>
diff --git a/src/platformsupport/linuxaccessibility/application_p.h b/src/platformsupport/linuxaccessibility/application_p.h
index e8684ab2b5..9a33c21ab6 100644
--- a/src/platformsupport/linuxaccessibility/application_p.h
+++ b/src/platformsupport/linuxaccessibility/application_p.h
@@ -42,6 +42,17 @@
#ifndef Q_SPI_APPLICATION_H
#define Q_SPI_APPLICATION_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/QPointer>
#include <QtCore/QQueue>
#include <QtDBus/QDBusConnection>
diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor_p.h b/src/platformsupport/linuxaccessibility/atspiadaptor_p.h
index 8e905e4cca..8e7f55fdbc 100644
--- a/src/platformsupport/linuxaccessibility/atspiadaptor_p.h
+++ b/src/platformsupport/linuxaccessibility/atspiadaptor_p.h
@@ -43,6 +43,17 @@
#ifndef ATSPIADAPTOR_H
#define ATSPIADAPTOR_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <atspi/atspi-constants.h>
#include <QtCore/qsharedpointer.h>
diff --git a/src/platformsupport/linuxaccessibility/bridge_p.h b/src/platformsupport/linuxaccessibility/bridge_p.h
index 0e1624c522..f4b1680b15 100644
--- a/src/platformsupport/linuxaccessibility/bridge_p.h
+++ b/src/platformsupport/linuxaccessibility/bridge_p.h
@@ -43,6 +43,17 @@
#ifndef QSPIACCESSIBLEBRIDGE_H
#define QSPIACCESSIBLEBRIDGE_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtDBus/qdbusconnection.h>
#include <qpa/qplatformaccessibility.h>
diff --git a/src/platformsupport/linuxaccessibility/cache_p.h b/src/platformsupport/linuxaccessibility/cache_p.h
index a8128d9320..8f262cba55 100644
--- a/src/platformsupport/linuxaccessibility/cache_p.h
+++ b/src/platformsupport/linuxaccessibility/cache_p.h
@@ -43,6 +43,17 @@
#ifndef Q_SPI_CACHE_H
#define Q_SPI_CACHE_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/QObject>
#include "struct_marshallers_p.h"
diff --git a/src/platformsupport/linuxaccessibility/constant_mappings_p.h b/src/platformsupport/linuxaccessibility/constant_mappings_p.h
index a0287a910b..9e653feb66 100644
--- a/src/platformsupport/linuxaccessibility/constant_mappings_p.h
+++ b/src/platformsupport/linuxaccessibility/constant_mappings_p.h
@@ -39,6 +39,16 @@
**
****************************************************************************/
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
/*
* This file contains AT-SPI constants and mappings between QAccessible
diff --git a/src/platformsupport/linuxaccessibility/dbusconnection_p.h b/src/platformsupport/linuxaccessibility/dbusconnection_p.h
index 70f6fb80ac..1e75a10de8 100644
--- a/src/platformsupport/linuxaccessibility/dbusconnection_p.h
+++ b/src/platformsupport/linuxaccessibility/dbusconnection_p.h
@@ -43,6 +43,17 @@
#ifndef DBUSCONNECTION_H
#define DBUSCONNECTION_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/QString>
#include <QtDBus/QDBusConnection>
#include <QtDBus/QDBusVariant>
diff --git a/src/platformsupport/linuxaccessibility/struct_marshallers_p.h b/src/platformsupport/linuxaccessibility/struct_marshallers_p.h
index 0b775d5521..8f7da0df9a 100644
--- a/src/platformsupport/linuxaccessibility/struct_marshallers_p.h
+++ b/src/platformsupport/linuxaccessibility/struct_marshallers_p.h
@@ -43,6 +43,17 @@
#ifndef Q_SPI_STRUCT_MARSHALLERS_H
#define Q_SPI_STRUCT_MARSHALLERS_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qlist.h>
#include <QtCore/qpair.h>
#include <QtDBus/QDBusArgument>
diff --git a/src/platformsupport/services/genericunix/qgenericunixservices_p.h b/src/platformsupport/services/genericunix/qgenericunixservices_p.h
index 92166caf7b..d758c71b79 100644
--- a/src/platformsupport/services/genericunix/qgenericunixservices_p.h
+++ b/src/platformsupport/services/genericunix/qgenericunixservices_p.h
@@ -42,6 +42,17 @@
#ifndef QGENERICUNIXDESKTOPSERVICES_H
#define QGENERICUNIXDESKTOPSERVICES_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformservices.h>
#include <QtCore/QString>
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
index 36fcdd8dce..b8f6737ea0 100644
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
@@ -42,6 +42,17 @@
#ifndef QGENERICUNIXTHEMES_H
#define QGENERICUNIXTHEMES_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformtheme.h>
#include <QtCore/QString>
#include <QtCore/QStringList>
diff --git a/src/plugins/platforms/android/androidjniinput.cpp b/src/plugins/platforms/android/androidjniinput.cpp
index cd0659227d..2c4b664487 100644
--- a/src/plugins/platforms/android/androidjniinput.cpp
+++ b/src/plugins/platforms/android/androidjniinput.cpp
@@ -59,10 +59,10 @@ namespace QtAndroidInput
static jmethodID m_showSoftwareKeyboardMethodID = 0;
static jmethodID m_resetSoftwareKeyboardMethodID = 0;
static jmethodID m_hideSoftwareKeyboardMethodID = 0;
- static jmethodID m_isSoftwareKeyboardVisibleMethodID = 0;
static jmethodID m_updateSelectionMethodID = 0;
static bool m_ignoreMouseEvents = false;
+ static bool m_softwareKeyboardVisible = false;
static QList<QWindowSystemInterface::TouchPoint> m_touchPoints;
@@ -125,15 +125,7 @@ namespace QtAndroidInput
bool isSoftwareKeyboardVisible()
{
- AttachedJNIEnv env;
- if (!env.jniEnv)
- return false;
-
- bool visibility = env.jniEnv->CallStaticBooleanMethod(applicationClass(), m_isSoftwareKeyboardVisibleMethodID);
-#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
- qDebug() << "@@@ ISSOFTWAREKEYBOARDVISIBLE" << visibility;
-#endif
- return visibility;
+ return m_softwareKeyboardVisible;
}
@@ -714,8 +706,9 @@ namespace QtAndroidInput
false);
}
- static void keyboardVisibilityChanged(JNIEnv */*env*/, jobject /*thiz*/, jboolean /*visibility*/)
+ static void keyboardVisibilityChanged(JNIEnv */*env*/, jobject /*thiz*/, jboolean visibility)
{
+ m_softwareKeyboardVisible = visibility;
QAndroidInputContext *inputContext = QAndroidInputContext::androidInputContext();
if (inputContext && qGuiApp)
inputContext->emitInputPanelVisibleChanged();
@@ -756,7 +749,6 @@ namespace QtAndroidInput
GET_AND_CHECK_STATIC_METHOD(m_showSoftwareKeyboardMethodID, appClass, "showSoftwareKeyboard", "(IIIII)V");
GET_AND_CHECK_STATIC_METHOD(m_resetSoftwareKeyboardMethodID, appClass, "resetSoftwareKeyboard", "()V");
GET_AND_CHECK_STATIC_METHOD(m_hideSoftwareKeyboardMethodID, appClass, "hideSoftwareKeyboard", "()V");
- GET_AND_CHECK_STATIC_METHOD(m_isSoftwareKeyboardVisibleMethodID, appClass, "isSoftwareKeyboardVisible", "()Z");
GET_AND_CHECK_STATIC_METHOD(m_updateSelectionMethodID, appClass, "updateSelection", "(IIII)V");
return true;
}
diff --git a/src/plugins/platforms/cocoa/qcocoaapplication.mm b/src/plugins/platforms/cocoa/qcocoaapplication.mm
index 551a59823c..bac76357da 100644
--- a/src/plugins/platforms/cocoa/qcocoaapplication.mm
+++ b/src/plugins/platforms/cocoa/qcocoaapplication.mm
@@ -189,6 +189,12 @@ QT_BEGIN_NAMESPACE
void qt_redirectNSApplicationSendEvent()
{
+ if (QCoreApplication::testAttribute(Qt::AA_MacPluginApplication))
+ // In a plugin we cannot chain sendEvent hooks: a second plugin could
+ // store the implementation of the first, which during the program flow
+ // can be unloaded.
+ return;
+
if ([NSApp isMemberOfClass:[QNSApplication class]]) {
// No need to change implementation since Qt
// already controls a subclass of NSApplication
@@ -209,6 +215,10 @@ void qt_redirectNSApplicationSendEvent()
void qt_resetNSApplicationSendEvent()
{
+ if (QCoreApplication::testAttribute(Qt::AA_MacPluginApplication))
+ return;
+
+
qt_cocoa_change_back_implementation([NSApplication class],
@selector(sendEvent:),
@selector(QT_MANGLE_NAMESPACE(qt_sendEvent_original):));
diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
index 92358ecc74..24ad75ceec 100644
--- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
+++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
@@ -163,6 +163,9 @@ static void cleanupCocoaApplicationDelegate()
- (NSMenu *)applicationDockMenu:(NSApplication *)sender
{
Q_UNUSED(sender);
+ // Manually invoke the delegate's -menuWillOpen: method.
+ // See QTBUG-39604 (and its fix) for details.
+ [[dockMenu delegate] menuWillOpen:dockMenu];
return [[dockMenu retain] autorelease];
}
diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm
index a89979a8ea..3d0201e1a0 100644
--- a/src/plugins/platforms/cocoa/qcocoamenu.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenu.mm
@@ -463,9 +463,8 @@ void QCocoaMenu::showPopup(const QWindow *parentWindow, QPoint pos, const QPlatf
// Else, we need to transform 'pos' to window or screen coordinates.
NSPoint nsPos = NSMakePoint(pos.x() - 1, pos.y());
if (view) {
- // Flip y-coordinate first, the convert to content view space.
- nsPos.y = view.frame.size.height - nsPos.y;
- nsPos = [view convertPoint:nsPos toView:view.window.contentView];
+ // convert coordinates from view to the view's window
+ nsPos = [view convertPoint:nsPos toView:nil];
} else if (!QGuiApplication::screens().isEmpty()) {
QScreen *screen = QGuiApplication::screens().at(0);
nsPos.y = screen->availableVirtualSize().height() - nsPos.y;
diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h
index 5387f2a825..cbeecb987f 100644
--- a/src/plugins/platforms/cocoa/qnsview.h
+++ b/src/plugins/platforms/cocoa/qnsview.h
@@ -48,6 +48,8 @@
#include <QtGui/QImage>
#include <QtGui/QAccessible>
+#include "private/qcore_mac_p.h"
+
QT_BEGIN_NAMESPACE
class QCocoaWindow;
class QCocoaBackingStore;
@@ -56,7 +58,7 @@ QT_END_NAMESPACE
Q_FORWARD_DECLARE_OBJC_CLASS(QNSViewMouseMoveHelper);
-@interface QNSView : NSView <NSTextInputClient> {
+@interface QT_MANGLE_NAMESPACE(QNSView) : NSView <NSTextInputClient> {
QCocoaBackingStore* m_backingStore;
QPoint m_backingStoreOffset;
CGImageRef m_maskImage;
@@ -134,4 +136,6 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QNSViewMouseMoveHelper);
@end
+QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSView);
+
#endif //QNSVIEW_H
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index a18ee7ff71..7ece5dcdf8 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -122,7 +122,7 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil;
@end
-@implementation QNSView
+@implementation QT_MANGLE_NAMESPACE(QNSView)
+ (void)initialize
{
diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
index 7ae042cb50..c986a960f3 100644
--- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
+++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
@@ -58,7 +58,8 @@ QT_BEGIN_NAMESPACE
QQnxRasterBackingStore::QQnxRasterBackingStore(QWindow *window)
: QPlatformBackingStore(window),
- m_hasUnflushedPaintOperations(false)
+ m_needsPosting(false),
+ m_scrolled(false)
{
qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window;
@@ -85,10 +86,10 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion &region, const
qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << this->window();
// Sometimes this method is called even though there is nothing to be
- // flushed, for instance, after an expose event directly follows a
- // geometry change event.
- if (!m_hasUnflushedPaintOperations)
- return;
+ // flushed (posted in "screen" parlance), for instance, after an expose
+ // event directly follows a geometry change event.
+ if (!m_needsPosting)
+ return;
QQnxWindow *targetWindow = 0;
if (window)
@@ -99,25 +100,11 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion &region, const
// child windows, are performed; conceptually ,child windows have no buffers
// (actually they do have a 1x1 placeholder buffer due to libscreen limitations),
// since Qt will only draw to the backing store of the top-level window.
- if (!targetWindow || targetWindow == platformWindow()) {
+ if (!targetWindow || targetWindow == platformWindow())
+ platformWindow()->post(region); // update the display with newly rendered content
- // visit all pending scroll operations
- for (int i = m_scrollOpList.size() - 1; i >= 0; i--) {
-
- // do the scroll operation
- ScrollOp &op = m_scrollOpList[i];
- QRegion srcArea = op.totalArea.intersected( op.totalArea.translated(-op.dx, -op.dy) );
- platformWindow()->scroll(srcArea, op.dx, op.dy);
- }
-
- // clear all pending scroll operations
- m_scrollOpList.clear();
-
- // update the display with newly rendered content
- platformWindow()->post(region);
- }
-
- m_hasUnflushedPaintOperations = false;
+ m_needsPosting = false;
+ m_scrolled = false;
}
void QQnxRasterBackingStore::resize(const QSize &size, const QRegion &staticContents)
@@ -134,31 +121,14 @@ bool QQnxRasterBackingStore::scroll(const QRegion &area, int dx, int dy)
{
qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window();
- // calculate entire region affected by scroll operation (src + dst)
- QRegion totalArea = area.translated(dx, dy);
- totalArea += area;
- m_hasUnflushedPaintOperations = true;
-
- // visit all pending scroll operations
- for (int i = m_scrollOpList.size() - 1; i >= 0; i--) {
-
- ScrollOp &op = m_scrollOpList[i];
- if (op.totalArea == totalArea) {
- // same area is being scrolled again - update delta
- op.dx += dx;
- op.dy += dy;
- return true;
- } else if (op.totalArea.intersects(totalArea)) {
- // current scroll overlaps previous scroll but is
- // not equal in area - just paint everything
- qWarning("QQNX: pending scroll operations overlap but not equal");
- return false;
- }
- }
+ m_needsPosting = true;
- // create new scroll operation
- m_scrollOpList.append( ScrollOp(totalArea, dx, dy) );
- return true;
+ if (!m_scrolled) {
+ platformWindow()->scroll(area, dx, dy, true);
+ m_scrolled = true;
+ return true;
+ }
+ return false;
}
void QQnxRasterBackingStore::beginPaint(const QRegion &region)
@@ -166,7 +136,7 @@ void QQnxRasterBackingStore::beginPaint(const QRegion &region)
Q_UNUSED(region);
qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window();
- m_hasUnflushedPaintOperations = true;
+ m_needsPosting = true;
platformWindow()->adjustBufferSize();
diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.h b/src/plugins/platforms/qnx/qqnxrasterbackingstore.h
index 35efd68571..d71e274a1d 100644
--- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.h
+++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.h
@@ -64,19 +64,11 @@ public:
void endPaint();
private:
- class ScrollOp {
- public:
- ScrollOp(const QRegion &a, int x, int y) : totalArea(a), dx(x), dy(y) {}
- QRegion totalArea;
- int dx;
- int dy;
- };
-
QQnxRasterWindow *platformWindow() const;
QWindow *m_window;
- QList<ScrollOp> m_scrollOpList;
- bool m_hasUnflushedPaintOperations;
+ bool m_needsPosting;
+ bool m_scrolled;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 7d04c99d16..0382144cbe 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -1952,7 +1952,7 @@ void QWindowsWindow::getSizeHints(MINMAXINFO *mmi) const
mmi->ptMaxPosition.x = screen->availableGeometry().x();
mmi->ptMaxPosition.y = screen->availableGeometry().y();
} else if (!screen){
- qWarning() << "effectiveScreen() returned a null screen";
+ qWarning() << "window()->screen() returned a null screen";
}
}
diff --git a/src/plugins/platforms/xcb/xcb-plugin.pro b/src/plugins/platforms/xcb/xcb-plugin.pro
index 4d76e4d449..874d42c36c 100644
--- a/src/plugins/platforms/xcb/xcb-plugin.pro
+++ b/src/plugins/platforms/xcb/xcb-plugin.pro
@@ -105,6 +105,7 @@ contains(QT_CONFIG, opengl) {
DEFINES += $$QMAKE_DEFINES_XCB
LIBS += $$QMAKE_LIBS_XCB
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_XCB
+QMAKE_CFLAGS += $$QMAKE_CFLAGS_XCB
CONFIG += qpa/genericunixfontdatabase
diff --git a/src/plugins/platforms/xcb/xcb-static/xcb-static.pro b/src/plugins/platforms/xcb/xcb-static/xcb-static.pro
index dfdcb2e83a..d0fe282b14 100644
--- a/src/plugins/platforms/xcb/xcb-static/xcb-static.pro
+++ b/src/plugins/platforms/xcb/xcb-static/xcb-static.pro
@@ -10,6 +10,9 @@ XCB_DIR = ../../../../3rdparty/xcb
INCLUDEPATH += $$XCB_DIR/include $$XCB_DIR/include/xcb $$XCB_DIR/sysinclude
+QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_XCB
+QMAKE_CFLAGS += $$QMAKE_CFLAGS_XCB
+
# ignore compiler warnings in 3rdparty code
QMAKE_CFLAGS_STATIC_LIB+=-w
diff --git a/src/plugins/printsupport/cups/qcupsprintersupport_p.h b/src/plugins/printsupport/cups/qcupsprintersupport_p.h
index 1cba4e997b..9fe5f28850 100644
--- a/src/plugins/printsupport/cups/qcupsprintersupport_p.h
+++ b/src/plugins/printsupport/cups/qcupsprintersupport_p.h
@@ -43,6 +43,17 @@
#ifndef QCUPSPRINTERSUPPORT_H
#define QCUPSPRINTERSUPPORT_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformprintersupport.h>
#ifndef QT_NO_PRINTER
diff --git a/src/sql/drivers/ibase/qsql_ibase.cpp b/src/sql/drivers/ibase/qsql_ibase.cpp
index cc26bfe7e8..c751fea825 100644
--- a/src/sql/drivers/ibase/qsql_ibase.cpp
+++ b/src/sql/drivers/ibase/qsql_ibase.cpp
@@ -1030,11 +1030,15 @@ bool QIBaseResult::exec()
*((qint64*)d->inda->sqlvar[para].sqldata) = val.toLongLong();
break;
case SQL_LONG:
- if (d->inda->sqlvar[para].sqlscale < 0)
- *((long*)d->inda->sqlvar[para].sqldata) =
- (long)floor(0.5 + val.toDouble() * pow(10.0, d->inda->sqlvar[para].sqlscale * -1));
- else
- *((long*)d->inda->sqlvar[para].sqldata) = (long)val.toLongLong();
+ if (d->inda->sqlvar[para].sqllen == 4) {
+ if (d->inda->sqlvar[para].sqlscale < 0)
+ *((qint32*)d->inda->sqlvar[para].sqldata) =
+ (qint32)floor(0.5 + val.toDouble() * pow(10.0, d->inda->sqlvar[para].sqlscale * -1));
+ else
+ *((qint32*)d->inda->sqlvar[para].sqldata) = (qint32)val.toInt();
+ } else {
+ *((qint64*)d->inda->sqlvar[para].sqldata) = val.toLongLong();
+ }
break;
case SQL_SHORT:
if (d->inda->sqlvar[para].sqlscale < 0)
diff --git a/src/sql/kernel/qsqlquery.cpp b/src/sql/kernel/qsqlquery.cpp
index 6b13eb02ed..b98e2baf1e 100644
--- a/src/sql/kernel/qsqlquery.cpp
+++ b/src/sql/kernel/qsqlquery.cpp
@@ -1063,12 +1063,6 @@ bool QSqlQuery::execBatch(BatchExecutionMode mode)
To bind a NULL value, use a null QVariant; for example, use
\c {QVariant(QVariant::String)} if you are binding a string.
- Values cannot be bound to multiple locations in the query, eg:
- \code
- INSERT INTO testtable (id, name, samename) VALUES (:id, :name, :name)
- \endcode
- Binding to name will bind to the first :name, but not the second.
-
\sa addBindValue(), prepare(), exec(), boundValue(), boundValues()
*/
void QSqlQuery::bindValue(const QString& placeholder, const QVariant& val,
diff --git a/src/sql/kernel/qsqlresult.cpp b/src/sql/kernel/qsqlresult.cpp
index 09b8f8d889..f933e6eeb1 100644
--- a/src/sql/kernel/qsqlresult.cpp
+++ b/src/sql/kernel/qsqlresult.cpp
@@ -704,12 +704,6 @@ void QSqlResult::bindValue(int index, const QVariant& val, QSql::ParamType param
Binds the value \a val of parameter type \a paramType to the \a
placeholder name in the current record (row).
- Values cannot be bound to multiple locations in the query, eg:
- \code
- INSERT INTO testtable (id, name, samename) VALUES (:id, :name, :name)
- \endcode
- Binding to name will bind to the first :name, but not the second.
-
\note Binding an undefined placeholder will result in undefined behavior.
\sa QSqlQuery::bindValue()
diff --git a/src/tools/qdoc/qmlparser/qqmljsglobal_p.h b/src/tools/qdoc/qmlparser/qqmljsglobal_p.h
index c53e12ea56..f9e5aa9643 100644
--- a/src/tools/qdoc/qmlparser/qqmljsglobal_p.h
+++ b/src/tools/qdoc/qmlparser/qqmljsglobal_p.h
@@ -41,6 +41,17 @@
#ifndef QQMLJSGLOBAL_P_H
#define QQMLJSGLOBAL_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qglobal.h>
#ifdef QT_CREATOR
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index 9219757dbf..e53cdeac29 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -454,15 +454,15 @@ QByteArray QFileDialog::saveState() const
stream << d->qFileDialogUi->splitter->saveState();
stream << d->qFileDialogUi->sidebar->urls();
} else {
- stream << QByteArray();
- stream << QList<QUrl>();
+ stream << d->splitterState;
+ stream << d->sidebarUrls;
}
stream << history();
stream << *lastVisitedDir();
if (d->usingWidgets())
stream << d->qFileDialogUi->treeView->header()->saveState();
else
- stream << QByteArray();
+ stream << d->headerData;
stream << qint32(viewMode());
return data;
}
@@ -484,9 +484,6 @@ bool QFileDialog::restoreState(const QByteArray &state)
QDataStream stream(&sd, QIODevice::ReadOnly);
if (stream.atEnd())
return false;
- QByteArray splitterState;
- QByteArray headerData;
- QList<QUrl> bookmarks;
QStringList history;
QString currentDirectory;
qint32 marker;
@@ -497,11 +494,11 @@ bool QFileDialog::restoreState(const QByteArray &state)
if (marker != QFileDialogMagic || v != version)
return false;
- stream >> splitterState
- >> bookmarks
+ stream >> d->splitterState
+ >> d->sidebarUrls
>> history
>> currentDirectory
- >> headerData
+ >> d->headerData
>> viewMode;
setDirectory(lastVisitedDir()->isEmpty() ? currentDirectory : *lastVisitedDir());
@@ -510,7 +507,7 @@ bool QFileDialog::restoreState(const QByteArray &state)
if (!d->usingWidgets())
return true;
- if (!d->qFileDialogUi->splitter->restoreState(splitterState))
+ if (!d->qFileDialogUi->splitter->restoreState(d->splitterState))
return false;
QList<int> list = d->qFileDialogUi->splitter->sizes();
if (list.count() >= 2 && list.at(0) == 0 && list.at(1) == 0) {
@@ -519,12 +516,12 @@ bool QFileDialog::restoreState(const QByteArray &state)
d->qFileDialogUi->splitter->setSizes(list);
}
- d->qFileDialogUi->sidebar->setUrls(bookmarks);
+ d->qFileDialogUi->sidebar->setUrls(d->sidebarUrls);
while (history.count() > 5)
history.pop_front();
setHistory(history);
QHeaderView *headerView = d->qFileDialogUi->treeView->header();
- if (!headerView->restoreState(headerData))
+ if (!headerView->restoreState(d->headerData))
return false;
QList<QAction*> actions = headerView->actions();
diff --git a/src/widgets/dialogs/qfiledialog_p.h b/src/widgets/dialogs/qfiledialog_p.h
index 632bbca5a4..89c6414b71 100644
--- a/src/widgets/dialogs/qfiledialog_p.h
+++ b/src/widgets/dialogs/qfiledialog_p.h
@@ -273,6 +273,11 @@ public:
QSharedPointer<QFileDialogOptions> options;
+ // Memory of what was read from QSettings in restoreState() in case widgets are not used
+ QByteArray splitterState;
+ QByteArray headerData;
+ QList<QUrl> sidebarUrls;
+
~QFileDialogPrivate();
private:
diff --git a/src/widgets/graphicsview/qgraphicsgridlayoutengine_p.h b/src/widgets/graphicsview/qgraphicsgridlayoutengine_p.h
index 1338114d96..1c12f15744 100644
--- a/src/widgets/graphicsview/qgraphicsgridlayoutengine_p.h
+++ b/src/widgets/graphicsview/qgraphicsgridlayoutengine_p.h
@@ -42,6 +42,17 @@
#ifndef QGRAPHICSGRIDLAYOUTENGINE_P_H
#define QGRAPHICSGRIDLAYOUTENGINE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtGui/private/qgridlayoutengine_p.h>
#ifndef QT_NO_GRAPHICSVIEW
diff --git a/src/widgets/graphicsview/qgraphicslayoutstyleinfo_p.h b/src/widgets/graphicsview/qgraphicslayoutstyleinfo_p.h
index 275ebab6a1..8770e96136 100644
--- a/src/widgets/graphicsview/qgraphicslayoutstyleinfo_p.h
+++ b/src/widgets/graphicsview/qgraphicslayoutstyleinfo_p.h
@@ -41,6 +41,17 @@
#ifndef QGRAPHICSLAYOUTSTYLEINFO_P_H
#define QGRAPHICSLAYOUTSTYLEINFO_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtGui/private/qabstractlayoutstyleinfo_p.h>
#include <QtWidgets/qstyleoption.h>
diff --git a/src/widgets/itemviews/qfileiconprovider_p.h b/src/widgets/itemviews/qfileiconprovider_p.h
index 9b2d536258..1c50a7e772 100644
--- a/src/widgets/itemviews/qfileiconprovider_p.h
+++ b/src/widgets/itemviews/qfileiconprovider_p.h
@@ -42,6 +42,17 @@
#ifndef QFILEICONPROVIDER_P_H
#define QFILEICONPROVIDER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qfileiconprovider.h"
#include <QtCore/qstring.h>
diff --git a/src/widgets/itemviews/qstyleditemdelegate.cpp b/src/widgets/itemviews/qstyleditemdelegate.cpp
index da5aeb3290..b5fc8d7d63 100644
--- a/src/widgets/itemviews/qstyleditemdelegate.cpp
+++ b/src/widgets/itemviews/qstyleditemdelegate.cpp
@@ -627,6 +627,9 @@ void QStyledItemDelegate::setItemEditorFactory(QItemEditorFactory *factory)
\li \uicontrol Esc
\endlist
+ If the \a editor's type is QTextEdit or QPlainTextEdit then \uicontrol Enter and
+ \uicontrol Return keys are \e not handled.
+
In the case of \uicontrol Tab, \uicontrol Backtab, \uicontrol Enter and \uicontrol Return
key press events, the \a editor's data is comitted to the model
and the editor is closed. If the \a event is a \uicontrol Tab key press
diff --git a/src/widgets/kernel/qboxlayout.cpp b/src/widgets/kernel/qboxlayout.cpp
index 157fa55d2e..a186326551 100644
--- a/src/widgets/kernel/qboxlayout.cpp
+++ b/src/widgets/kernel/qboxlayout.cpp
@@ -51,20 +51,6 @@
QT_BEGIN_NAMESPACE
-/*
- Returns \c true if the \a widget can be added to the \a layout;
- otherwise returns \c false.
-*/
-static bool checkWidget(QLayout *layout, QWidget *widget)
-{
- if (!widget) {
- qWarning("QLayout: Cannot add null widget to %s/%s", layout->metaObject()->className(),
- layout->objectName().toLocal8Bit().data());
- return false;
- }
- return true;
-}
-
struct QBoxLayoutItem
{
QBoxLayoutItem(QLayoutItem *it, int stretch_ = 0)
@@ -958,6 +944,8 @@ void QBoxLayout::insertSpacerItem(int index, QSpacerItem *spacerItem)
void QBoxLayout::insertLayout(int index, QLayout *layout, int stretch)
{
Q_D(QBoxLayout);
+ if (!d->checkLayout(layout))
+ return;
if (!adoptLayout(layout))
return;
if (index < 0) // append
@@ -991,7 +979,7 @@ void QBoxLayout::insertWidget(int index, QWidget *widget, int stretch,
Qt::Alignment alignment)
{
Q_D(QBoxLayout);
- if (!checkWidget(this, widget))
+ if (!d->checkWidget(widget))
return;
addChildWidget(widget);
if (index < 0) // append
diff --git a/src/widgets/kernel/qformlayout.cpp b/src/widgets/kernel/qformlayout.cpp
index 239e1ce1e2..9f545b858a 100644
--- a/src/widgets/kernel/qformlayout.cpp
+++ b/src/widgets/kernel/qformlayout.cpp
@@ -1280,6 +1280,8 @@ void QFormLayout::addRow(QLayout *layout)
void QFormLayout::insertRow(int row, QWidget *label, QWidget *field)
{
Q_D(QFormLayout);
+ if ((label && !d->checkWidget(label)) || (field && !d->checkWidget(field)))
+ return;
row = d->insertRow(row);
if (label)
@@ -1295,6 +1297,8 @@ void QFormLayout::insertRow(int row, QWidget *label, QWidget *field)
void QFormLayout::insertRow(int row, QWidget *label, QLayout *field)
{
Q_D(QFormLayout);
+ if ((label && !d->checkWidget(label)) || (field && !d->checkLayout(field)))
+ return;
row = d->insertRow(row);
if (label)
@@ -1313,6 +1317,10 @@ void QFormLayout::insertRow(int row, QWidget *label, QLayout *field)
*/
void QFormLayout::insertRow(int row, const QString &labelText, QWidget *field)
{
+ Q_D(QFormLayout);
+ if (field && !d->checkWidget(field))
+ return;
+
QLabel *label = 0;
if (!labelText.isEmpty()) {
label = new QLabel(labelText);
@@ -1331,6 +1339,10 @@ void QFormLayout::insertRow(int row, const QString &labelText, QWidget *field)
*/
void QFormLayout::insertRow(int row, const QString &labelText, QLayout *field)
{
+ Q_D(QFormLayout);
+ if (field && !d->checkLayout(field))
+ return;
+
insertRow(row, labelText.isEmpty() ? 0 : new QLabel(labelText), field);
}
@@ -1344,11 +1356,8 @@ void QFormLayout::insertRow(int row, const QString &labelText, QLayout *field)
void QFormLayout::insertRow(int row, QWidget *widget)
{
Q_D(QFormLayout);
-
- if (!widget) {
- qWarning("QFormLayout: Cannot add null field to %s", qPrintable(objectName()));
+ if (!d->checkWidget(widget))
return;
- }
row = d->insertRow(row);
d->setWidget(row, SpanningRole, widget);
@@ -1365,11 +1374,8 @@ void QFormLayout::insertRow(int row, QWidget *widget)
void QFormLayout::insertRow(int row, QLayout *layout)
{
Q_D(QFormLayout);
-
- if (!layout) {
- qWarning("QFormLayout: Cannot add null field to %s", qPrintable(objectName()));
+ if (!d->checkLayout(layout))
return;
- }
row = d->insertRow(row);
d->setLayout(row, SpanningRole, layout);
diff --git a/src/widgets/kernel/qgridlayout.cpp b/src/widgets/kernel/qgridlayout.cpp
index 5434c40f97..6782e4a9f8 100644
--- a/src/widgets/kernel/qgridlayout.cpp
+++ b/src/widgets/kernel/qgridlayout.cpp
@@ -1430,20 +1430,6 @@ void QGridLayout::addItem(QLayoutItem *item, int row, int column, int rowSpan, i
invalidate();
}
-/*
- Returns \c true if the widget \a w can be added to the layout \a l;
- otherwise returns \c false.
-*/
-static bool checkWidget(QLayout *l, QWidget *w)
-{
- if (!w) {
- qWarning("QLayout: Cannot add null widget to %s/%s", l->metaObject()->className(),
- l->objectName().toLocal8Bit().data());
- return false;
- }
- return true;
-}
-
/*!
Adds the given \a widget to the cell grid at \a row, \a column. The
top-left position is (0, 0) by default.
@@ -1454,7 +1440,8 @@ static bool checkWidget(QLayout *l, QWidget *w)
*/
void QGridLayout::addWidget(QWidget *widget, int row, int column, Qt::Alignment alignment)
{
- if (!checkWidget(this, widget))
+ Q_D(QGridLayout);
+ if (!d->checkWidget(widget))
return;
if (row < 0 || column < 0) {
qWarning("QGridLayout: Cannot add %s/%s to %s/%s at row %d column %d",
@@ -1483,7 +1470,7 @@ void QGridLayout::addWidget(QWidget *widget, int fromRow, int fromColumn,
int rowSpan, int columnSpan, Qt::Alignment alignment)
{
Q_D(QGridLayout);
- if (!checkWidget(this, widget))
+ if (!d->checkWidget(widget))
return;
int toRow = (rowSpan < 0) ? -1 : fromRow + rowSpan - 1;
int toColumn = (columnSpan < 0) ? -1 : fromColumn + columnSpan - 1;
@@ -1518,6 +1505,8 @@ void QGridLayout::addWidget(QWidget *widget, int fromRow, int fromColumn,
void QGridLayout::addLayout(QLayout *layout, int row, int column, Qt::Alignment alignment)
{
Q_D(QGridLayout);
+ if (!d->checkLayout(layout))
+ return;
if (!adoptLayout(layout))
return;
QGridBox *b = new QGridBox(layout);
@@ -1538,6 +1527,8 @@ void QGridLayout::addLayout(QLayout *layout, int row, int column,
int rowSpan, int columnSpan, Qt::Alignment alignment)
{
Q_D(QGridLayout);
+ if (!d->checkLayout(layout))
+ return;
if (!adoptLayout(layout))
return;
QGridBox *b = new QGridBox(layout);
diff --git a/src/widgets/kernel/qlayout.cpp b/src/widgets/kernel/qlayout.cpp
index eb21a580b1..778514f47a 100644
--- a/src/widgets/kernel/qlayout.cpp
+++ b/src/widgets/kernel/qlayout.cpp
@@ -858,6 +858,47 @@ void QLayoutPrivate::reparentChildWidgets(QWidget *mw)
}
/*!
+ Returns \c true if the \a widget can be added to the \a layout;
+ otherwise returns \c false.
+*/
+bool QLayoutPrivate::checkWidget(QWidget *widget) const
+{
+ Q_Q(const QLayout);
+ if (!widget) {
+ qWarning("QLayout: Cannot add a null widget to %s/%s", q->metaObject()->className(),
+ qPrintable(q->objectName()));
+ return false;
+ }
+ if (widget == q->parentWidget()) {
+ qWarning("QLayout: Cannot add parent widget %s/%s to its child layout %s/%s",
+ widget->metaObject()->className(), qPrintable(widget->objectName()),
+ q->metaObject()->className(), qPrintable(q->objectName()));
+ return false;
+ }
+ return true;
+}
+
+/*!
+ Returns \c true if the \a otherLayout can be added to the \a layout;
+ otherwise returns \c false.
+*/
+bool QLayoutPrivate::checkLayout(QLayout *otherLayout) const
+{
+ Q_Q(const QLayout);
+ if (!otherLayout) {
+ qWarning("QLayout: Cannot add a null layout to %s/%s", q->metaObject()->className(),
+ qPrintable(q->objectName()));
+ return false;
+ }
+ if (otherLayout == q) {
+ qWarning("QLayout: Cannot add layout %s/%s to itself", q->metaObject()->className(),
+ qPrintable(q->objectName()));
+ return false;
+ }
+ return true;
+}
+
+/*!
This function is called from \c addWidget() functions in
subclasses to add \a w as a managed widget of a layout.
diff --git a/src/widgets/kernel/qlayout_p.h b/src/widgets/kernel/qlayout_p.h
index 2100d86aba..71e0f9bcd3 100644
--- a/src/widgets/kernel/qlayout_p.h
+++ b/src/widgets/kernel/qlayout_p.h
@@ -76,6 +76,8 @@ public:
void getMargin(int *result, int userMargin, QStyle::PixelMetric pm) const;
void doResize(const QSize &);
void reparentChildWidgets(QWidget *mw);
+ bool checkWidget(QWidget *widget) const;
+ bool checkLayout(QLayout *otherLayout) const;
static QWidgetItem *createWidgetItem(const QLayout *layout, QWidget *widget);
static QSpacerItem *createSpacerItem(const QLayout *layout, int w, int h, QSizePolicy::Policy hPolicy = QSizePolicy::Minimum, QSizePolicy::Policy vPolicy = QSizePolicy::Minimum);
diff --git a/src/widgets/kernel/qwidgetwindow_qpa_p.h b/src/widgets/kernel/qwidgetwindow_qpa_p.h
index 06ba8ea646..76ba618afe 100644
--- a/src/widgets/kernel/qwidgetwindow_qpa_p.h
+++ b/src/widgets/kernel/qwidgetwindow_qpa_p.h
@@ -42,6 +42,17 @@
#ifndef QWIDGETWINDOW_QPA_P_H
#define QWIDGETWINDOW_QPA_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtGui/qwindow.h>
#include <QtCore/private/qobject_p.h>
diff --git a/src/widgets/kernel/qwindowcontainer_p.h b/src/widgets/kernel/qwindowcontainer_p.h
index 014b163f97..45b3cc021f 100644
--- a/src/widgets/kernel/qwindowcontainer_p.h
+++ b/src/widgets/kernel/qwindowcontainer_p.h
@@ -42,6 +42,17 @@
#ifndef QWINDOWCONTAINER_H
#define QWINDOWCONTAINER_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtWidgets/qwidget.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/styles/qfusionstyle_p.h b/src/widgets/styles/qfusionstyle_p.h
index 9e5a55918d..ceee6f8b03 100644
--- a/src/widgets/styles/qfusionstyle_p.h
+++ b/src/widgets/styles/qfusionstyle_p.h
@@ -42,6 +42,17 @@
#ifndef QFUSIONSTYLE_P_H
#define QFUSIONSTYLE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtWidgets/qcommonstyle.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/styles/qgtkstyle_p.h b/src/widgets/styles/qgtkstyle_p.h
index 525d7f840a..93bb0d309b 100644
--- a/src/widgets/styles/qgtkstyle_p.h
+++ b/src/widgets/styles/qgtkstyle_p.h
@@ -42,6 +42,17 @@
#ifndef QGTKSTYLE_P_H
#define QGTKSTYLE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <private/qwindowsstyle_p.h>
#include <QtGui/QPalette>
#include <QtGui/QFont>
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 0845a5eb02..d74e032412 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -1335,7 +1335,7 @@ void QMacStylePrivate::initComboboxBdi(const QStyleOptionComboBox *combo, HIThem
bdi->adornment = kThemeAdornmentFocus;
if (combo->activeSubControls & QStyle::SC_ComboBoxArrow)
bdi->state = kThemeStatePressed;
- else if (tds == kThemeStateInactive)
+ else if (tds == kThemeStateInactive && QSysInfo::MacintoshVersion <= QSysInfo::MV_10_9)
bdi->state = kThemeStateActive;
else
bdi->state = tds;
@@ -1702,7 +1702,7 @@ void QMacStylePrivate::setAutoDefaultButton(QObject *button) const
}
QMacStylePrivate::QMacStylePrivate()
- : mouseDown(false)
+ : mouseDown(false), backingStoreNSView(nil)
{
defaultButtonStart = CFAbsoluteTimeGetCurrent();
memset(&buttonState, 0, sizeof(ButtonState));
@@ -1715,6 +1715,12 @@ QMacStylePrivate::QMacStylePrivate()
}
+QMacStylePrivate::~QMacStylePrivate()
+{
+ Q_FOREACH (NSView *b, buttons)
+ [b release];
+}
+
ThemeDrawState QMacStylePrivate::getDrawState(QStyle::State flags)
{
ThemeDrawState tds = kThemeStateActive;
@@ -1732,6 +1738,97 @@ ThemeDrawState QMacStylePrivate::getDrawState(QStyle::State flags)
return tds;
}
+NSView *QMacStylePrivate::buttonOfKind(ThemeButtonKind kind) const
+{
+ NSView *bv = buttons[kind];
+ if (!bv) {
+ if (kind == kThemePopupButton)
+ bv = [[NSPopUpButton alloc] init];
+ else if (kind == kThemeComboBox)
+ bv = [[NSComboBox alloc] init];
+ else
+ bv = [[NSButton alloc] init];
+
+ switch (kind) {
+ case kThemeArrowButton: {
+ NSButton *bc = (NSButton *)bv;
+ bc.buttonType = NSOnOffButton;
+ bc.bezelStyle = NSDisclosureBezelStyle;
+ break;
+ }
+ case kThemeCheckBox:
+ case kThemeCheckBoxSmall:
+ case kThemeCheckBoxMini: {
+ NSButton *bc = (NSButton *)bv;
+ bc.buttonType = NSSwitchButton;
+ break;
+ }
+ case kThemeRadioButton:
+ case kThemeRadioButtonSmall:
+ case kThemeRadioButtonMini: {
+ NSButton *bc = (NSButton *)bv;
+ bc.buttonType = NSRadioButton;
+ break;
+ }
+ case kThemePushButton:
+ case kThemePushButtonSmall:
+ case kThemePushButtonMini: {
+ NSButton *bc = (NSButton *)bv;
+ bc.buttonType = NSMomentaryPushButton;
+ bc.bezelStyle = NSRoundedBezelStyle;
+ break;
+ }
+ default:
+ break;
+ }
+
+// if (kind == kThemePushButtonSmall
+// || kind == kThemePopupButtonSmall
+// || kind == kThemeCheckBoxSmall
+// || kind == kThemeRadioButtonSmall)
+// bc.controlSize = NSSmallControlSize;
+// else if (kind == kThemePushButtonMini
+// || kind == kThemePopupButtonMini
+// || kind == kThemeCheckBoxMini
+// || kind == kThemeRadioButtonMini)
+// bc.controlSize = NSMiniControlSize;
+
+ if ([bv isKindOfClass:[NSButton class]]) {
+ NSButton *bc = (NSButton *)bv;
+ bc.title = nil;
+ }
+
+ const_cast<QMacStylePrivate *>(this)->buttons.insert(kind, bv);
+ }
+
+ return bv;
+}
+
+void QMacStylePrivate::drawNSViewInRect(NSView *view, const QRect &qtRect, QPainter *p) const
+{
+ QMacCGContext ctx(p);
+ CGContextSaveGState(ctx);
+
+ [NSGraphicsContext saveGraphicsState];
+ [NSGraphicsContext setCurrentContext:[NSGraphicsContext
+ graphicsContextWithGraphicsPort:ctx flipped:YES]];
+
+ CGRect rect = CGRectMake(qtRect.x() + 1, qtRect.y(), qtRect.width(), qtRect.height());
+
+ [backingStoreNSView addSubview:view];
+ view.frame = rect;
+ [view drawRect:rect];
+ [view removeFromSuperviewWithoutNeedingDisplay];
+
+ [NSGraphicsContext restoreGraphicsState];
+ CGContextRestoreGState(ctx);
+}
+
+void QMacStylePrivate::resolveCurrentNSView(QWindow *window)
+{
+ backingStoreNSView = window ? (NSView *)window->winId() : nil;
+}
+
void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonDrawInfo *bdi,
QPainter *p, const QStyleOption *opt) const
{
@@ -1742,8 +1839,12 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD
finalyoff = 0;
const bool combo = opt->type == QStyleOption::SO_ComboBox;
+ const bool editableCombo = bdi->kind == kThemeComboBox
+ || bdi->kind == kThemeComboBoxSmall
+ || bdi->kind == kThemeComboBoxMini;
const bool button = opt->type == QStyleOption::SO_Button;
const bool pressed = bdi->state == kThemeStatePressed;
+ const bool usingYosemiteOrLater = QSysInfo::MacintoshVersion > QSysInfo::MV_10_9;
if (button && pressed) {
if (bdi->kind == kThemePushButton) {
@@ -1788,7 +1889,7 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD
if (!combo && !button && bdi->value == kThemeButtonOff) {
pm = activePixmap;
- } else if (combo || button) {
+ } else if (!usingYosemiteOrLater && (combo || button)) {
QImage image = activePixmap.toImage();
for (int y = 0; y < height; ++y) {
@@ -1815,6 +1916,40 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD
}
}
pm = QPixmap::fromImage(image);
+ } else if ((usingYosemiteOrLater && combo && !editableCombo) || button) {
+ NSButton *bc = (NSButton *)buttonOfKind(bdi->kind);
+ [bc highlight:pressed];
+ bc.enabled = bdi->state != kThemeStateUnavailable && bdi->state != kThemeStateUnavailableInactive;
+ bc.state = bdi->value == kThemeButtonOn ? NSOnState :
+ bdi->value == kThemeButtonMixed ? NSMixedState : NSOffState;
+ p->translate(0, 1);
+ drawNSViewInRect(bc, opt->rect, p);
+ p->translate(0, -1);
+ return;
+ } else if (usingYosemiteOrLater && editableCombo) {
+ QImage image = activePixmap.toImage();
+
+ for (int y = 0; y < height; ++y) {
+ QRgb *scanLine = reinterpret_cast<QRgb *>(image.scanLine(y));
+
+ for (int x = 0; x < width; ++x) {
+ QRgb &pixel = scanLine[x];
+ int gray = qRed(pixel); // We know the image is grayscale
+ int alpha = qAlpha(pixel);
+
+ if (gray == 128 && alpha == 128) {
+ pixel = qRgba(255, 255, 255, 255);
+ } else if (alpha == 0) {
+ pixel = 0;
+ } else {
+ bool belowThreshold = (alpha * gray) / 255 + 255 - alpha < 128;
+ gray = belowThreshold ? 0 : 2 * gray - 255;
+ alpha = belowThreshold ? 0 : 2 * alpha - 255;
+ pixel = qRgba(gray, gray, gray, alpha);
+ }
+ }
+ }
+ pm = QPixmap::fromImage(image);
} else {
QImage activeImage = activePixmap.toImage();
QImage colorlessImage;
@@ -2919,6 +3054,9 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
Q_D(const QMacStyle);
ThemeDrawState tds = d->getDrawState(opt->state);
QMacCGContext cg(p);
+ QWindow *window = w && w->window() ? w->window()->windowHandle() :
+ QStyleHelper::styleObjectWindow(opt->styleObject);
+ const_cast<QMacStylePrivate *>(d)->resolveCurrentNSView(window);
switch (pe) {
case PE_IndicatorArrowUp:
case PE_IndicatorArrowDown:
@@ -3333,6 +3471,9 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
Q_D(const QMacStyle);
ThemeDrawState tds = d->getDrawState(opt->state);
QMacCGContext cg(p);
+ QWindow *window = w && w->window() ? w->window()->windowHandle() :
+ QStyleHelper::styleObjectWindow(opt->styleObject);
+ const_cast<QMacStylePrivate *>(d)->resolveCurrentNSView(window);
switch (ce) {
case CE_HeaderSection:
if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
@@ -5050,6 +5191,9 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
Q_D(const QMacStyle);
ThemeDrawState tds = d->getDrawState(opt->state);
QMacCGContext cg(p);
+ QWindow *window = widget && widget->window() ? widget->window()->windowHandle() :
+ QStyleHelper::styleObjectWindow(opt->styleObject);
+ const_cast<QMacStylePrivate *>(d)->resolveCurrentNSView(window);
switch (cc) {
case CC_Slider:
case CC_ScrollBar:
diff --git a/src/widgets/styles/qmacstyle_mac_p.h b/src/widgets/styles/qmacstyle_mac_p.h
index 305bcf871c..b0fb9e06be 100644
--- a/src/widgets/styles/qmacstyle_mac_p.h
+++ b/src/widgets/styles/qmacstyle_mac_p.h
@@ -42,6 +42,17 @@
#ifndef QMACSTYLE_MAC_P_H
#define QMACSTYLE_MAC_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtWidgets/qcommonstyle.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/styles/qmacstyle_mac_p_p.h b/src/widgets/styles/qmacstyle_mac_p_p.h
index 6f42f0ea79..3bbff61340 100644
--- a/src/widgets/styles/qmacstyle_mac_p_p.h
+++ b/src/widgets/styles/qmacstyle_mac_p_p.h
@@ -145,6 +145,7 @@ class QMacStylePrivate : public QCommonStylePrivate
Q_DECLARE_PUBLIC(QMacStyle)
public:
QMacStylePrivate();
+ ~QMacStylePrivate();
// Ideally these wouldn't exist, but since they already exist we need some accessors.
static const int PushButtonLeftOffset;
@@ -194,6 +195,11 @@ public:
void setAutoDefaultButton(QObject *button) const;
+ NSView *buttonOfKind(ThemeButtonKind kind) const;
+
+ void drawNSViewInRect(NSView *view, const QRect &rect, QPainter *p) const;
+ void resolveCurrentNSView(QWindow *window);
+
public:
mutable QPointer<QObject> pressedButton;
mutable QPointer<QObject> defaultButton;
@@ -212,6 +218,8 @@ public:
void *nsscroller;
#endif
void *indicatorBranchButtonCell;
+ NSView *backingStoreNSView;
+ QHash<ThemeButtonKind , NSView *> buttons;
};
QT_END_NAMESPACE
diff --git a/src/widgets/styles/qstylehelper.cpp b/src/widgets/styles/qstylehelper.cpp
index 6be07a3f45..49e406a8b7 100644
--- a/src/widgets/styles/qstylehelper.cpp
+++ b/src/widgets/styles/qstylehelper.cpp
@@ -47,6 +47,7 @@
#include <qmath.h>
#include <qscrollbar.h>
#include <qabstractscrollarea.h>
+#include <qwindow.h>
#include "qstylehelper_p.h"
#include <qstringbuilder.h>
@@ -397,5 +398,14 @@ QColor backgroundColor(const QPalette &pal, const QWidget* widget)
return widget->parentWidget()->parentWidget()->palette().color(QPalette::Base);
return pal.color(QPalette::Base);
}
+
+QWindow *styleObjectWindow(QObject *so)
+{
+ if (so)
+ return so->property("_q_styleObjectWindow").value<QWindow *>();
+
+ return 0;
+}
+
}
QT_END_NAMESPACE
diff --git a/src/widgets/styles/qstylehelper_p.h b/src/widgets/styles/qstylehelper_p.h
index 73e5c94dcd..1229af7497 100644
--- a/src/widgets/styles/qstylehelper_p.h
+++ b/src/widgets/styles/qstylehelper_p.h
@@ -68,6 +68,7 @@ class QPainter;
class QPixmap;
class QStyleOptionSlider;
class QStyleOption;
+class QWindow;
namespace QStyleHelper
{
@@ -87,6 +88,7 @@ namespace QStyleHelper
bool hasAncestor(QObject *obj, QAccessible::Role role);
#endif
QColor backgroundColor(const QPalette &pal, const QWidget* widget = 0);
+ QWindow *styleObjectWindow(QObject *so);
}
diff --git a/src/widgets/styles/qwindowscestyle_p.h b/src/widgets/styles/qwindowscestyle_p.h
index 73fb2b7ab7..d5e2ee84ed 100644
--- a/src/widgets/styles/qwindowscestyle_p.h
+++ b/src/widgets/styles/qwindowscestyle_p.h
@@ -42,6 +42,17 @@
#ifndef QWINDOWSCESTYLE_P_H
#define QWINDOWSCESTYLE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <private/qwindowsstyle_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/styles/qwindowsmobilestyle_p.h b/src/widgets/styles/qwindowsmobilestyle_p.h
index 4262bf5c73..75a4e45ea9 100644
--- a/src/widgets/styles/qwindowsmobilestyle_p.h
+++ b/src/widgets/styles/qwindowsmobilestyle_p.h
@@ -42,6 +42,17 @@
#ifndef QWINDOWSMOBILESTYLE_P_H
#define QWINDOWSMOBILESTYLE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <private/qwindowsstyle_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/styles/qwindowsstyle_p.h b/src/widgets/styles/qwindowsstyle_p.h
index 1107e70061..39b85ec148 100644
--- a/src/widgets/styles/qwindowsstyle_p.h
+++ b/src/widgets/styles/qwindowsstyle_p.h
@@ -42,6 +42,17 @@
#ifndef QWINDOWSSTYLE_P_H
#define QWINDOWSSTYLE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtWidgets/qcommonstyle.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/styles/qwindowsvistastyle_p.h b/src/widgets/styles/qwindowsvistastyle_p.h
index f7914f1645..1b3201c026 100644
--- a/src/widgets/styles/qwindowsvistastyle_p.h
+++ b/src/widgets/styles/qwindowsvistastyle_p.h
@@ -42,6 +42,17 @@
#ifndef QWINDOWSVISTASTYLE_P_H
#define QWINDOWSVISTASTYLE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <private/qwindowsxpstyle_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/styles/qwindowsxpstyle_p.h b/src/widgets/styles/qwindowsxpstyle_p.h
index d61132295c..4bb7c73660 100644
--- a/src/widgets/styles/qwindowsxpstyle_p.h
+++ b/src/widgets/styles/qwindowsxpstyle_p.h
@@ -42,6 +42,17 @@
#ifndef QWINDOWSXPSTYLE_P_H
#define QWINDOWSXPSTYLE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <private/qwindowsstyle_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/widgets/qkeysequenceedit_p.h b/src/widgets/widgets/qkeysequenceedit_p.h
index f74433bb71..adb3dc7a55 100644
--- a/src/widgets/widgets/qkeysequenceedit_p.h
+++ b/src/widgets/widgets/qkeysequenceedit_p.h
@@ -43,6 +43,17 @@
#ifndef QKEYSEQUENCEEDIT_P_H
#define QKEYSEQUENCEEDIT_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qkeysequenceedit.h"
#include <private/qwidget_p.h>
diff --git a/src/widgets/widgets/qplaintextedit.cpp b/src/widgets/widgets/qplaintextedit.cpp
index 23c1e99231..bd7f844eca 100644
--- a/src/widgets/widgets/qplaintextedit.cpp
+++ b/src/widgets/widgets/qplaintextedit.cpp
@@ -998,7 +998,8 @@ void QPlainTextEditPrivate::_q_adjustScrollbars()
} else {
vmax = qMax(0, doc->lineCount() - 1);
- vSliderLength = viewport->height() / q->fontMetrics().lineSpacing();
+ int lineSpacing = q->fontMetrics().lineSpacing();
+ vSliderLength = lineSpacing != 0 ? viewport->height() / lineSpacing : 0;
}
diff --git a/src/widgets/widgets/qsizegrip.cpp b/src/widgets/widgets/qsizegrip.cpp
index e46de3958f..5994071bfc 100644
--- a/src/widgets/widgets/qsizegrip.cpp
+++ b/src/widgets/widgets/qsizegrip.cpp
@@ -83,7 +83,7 @@ public:
int dyMax;
Qt::Corner m_corner;
bool gotMousePress;
- QWidget *tlw;
+ QPointer<QWidget> tlw;
#ifdef Q_WS_MAC
void updateMacSizer(bool hide) const;
#endif
diff --git a/src/widgets/widgets/qtoolbutton.cpp b/src/widgets/widgets/qtoolbutton.cpp
index 497bc52109..cb441d6c6e 100644
--- a/src/widgets/widgets/qtoolbutton.cpp
+++ b/src/widgets/widgets/qtoolbutton.cpp
@@ -652,6 +652,10 @@ void QToolButton::setMenu(QMenu* menu)
} else {
d->menuAction = 0;
}
+
+ // changing the menu set may change the size hint, so reset it
+ d->sizeHint = QSize();
+ updateGeometry();
update();
}
diff --git a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
index ec698e5db4..e49d8c3b07 100644
--- a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
+++ b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
@@ -86,6 +86,7 @@ private slots:
void cursorToXForSetColumns();
void cursorToXForTrailingSpaces_data();
void cursorToXForTrailingSpaces();
+ void cursorToXInvalidInput();
void horizontalAlignment_data();
void horizontalAlignment();
void horizontalAlignmentMultiline_data();
@@ -674,6 +675,28 @@ void tst_QTextLayout::cursorToXForTrailingSpaces()
QCOMPARE(line.cursorToX(6), cursorAt6);
}
+void tst_QTextLayout::cursorToXInvalidInput()
+{
+ QTextLayout layout("aaa", testFont);
+
+ layout.beginLayout();
+ QTextLine line = layout.createLine();
+ line.setLineWidth(5);
+ layout.endLayout();
+
+ int cursorPos;
+
+ cursorPos = 0;
+ layout.lineAt(0).cursorToX(&cursorPos);
+ QCOMPARE(cursorPos, 0);
+ cursorPos = -300;
+ layout.lineAt(0).cursorToX(&cursorPos);
+ QCOMPARE(cursorPos, 0);
+ cursorPos = 300;
+ layout.lineAt(0).cursorToX(&cursorPos);
+ QCOMPARE(cursorPos, 3);
+}
+
void tst_QTextLayout::horizontalAlignment_data()
{
qreal width = TESTFONT_SIZE * 4;
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
index 9988db74c7..70c118b681 100644
--- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -219,6 +219,7 @@ private Q_SLOTS:
void putToFile();
void putToFtp_data();
void putToFtp();
+ void putToFtpWithInvalidCredentials(); // QTBUG-40622
void putToHttp_data();
void putToHttp();
void putToHttpSynchronous_data();
@@ -2075,6 +2076,28 @@ void tst_QNetworkReply::putToFtp()
QObject::disconnect(r, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
}
+void tst_QNetworkReply::putToFtpWithInvalidCredentials()
+{
+ QUrl url("ftp://" + QtNetworkSettings::serverName());
+ url.setPath(QString("/qtest/upload/qnetworkaccess-putToFtp-%1-%2")
+ .arg(QTest::currentDataTag())
+ .arg(uniqueExtension));
+ url.setUserName("invalidUser");
+ url.setPassword("InvalidPassword");
+ QNetworkRequest req(url);
+ QNetworkReplyPtr r;
+
+ for (int i = 0; i < 2; i++)
+ {
+ runSimpleRequest(QNetworkAccessManager::PutOperation, req, r, QByteArray());
+
+ QVERIFY(r->isFinished());
+ QCOMPARE(r->url(), url);
+ QCOMPARE(r->error(), QNetworkReply::AuthenticationRequiredError);
+ r->close();
+ }
+}
+
void tst_QNetworkReply::putToHttp_data()
{
putToFile_data();
diff --git a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
index 850bedd9cc..4167d633b0 100644
--- a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
+++ b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
@@ -79,6 +79,8 @@ private slots:
void taskQTBUG_7103_minMaxWidthNotRespected();
void taskQTBUG_27420_takeAtShouldUnparentLayout();
+ void taskQTBUG_40609_addingWidgetToItsOwnLayout();
+ void taskQTBUG_40609_addingLayoutToItself();
void replaceWidget();
};
@@ -329,6 +331,36 @@ void tst_QBoxLayout::taskQTBUG_27420_takeAtShouldUnparentLayout()
QVERIFY(!inner.isNull());
}
+void tst_QBoxLayout::taskQTBUG_40609_addingWidgetToItsOwnLayout(){
+ QWidget widget;
+ widget.setObjectName("347b469225a24a0ef05150a");
+ QVBoxLayout layout(&widget);
+ layout.setObjectName("ef9e2b42298e0e6420105bb");
+
+ QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add a null widget to QVBoxLayout/ef9e2b42298e0e6420105bb");
+ layout.addWidget(Q_NULLPTR);
+ QCOMPARE(layout.count(), 0);
+
+ QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add parent widget QWidget/347b469225a24a0ef05150a to its child layout QVBoxLayout/ef9e2b42298e0e6420105bb");
+ layout.addWidget(&widget);
+ QCOMPARE(layout.count(), 0);
+}
+
+void tst_QBoxLayout::taskQTBUG_40609_addingLayoutToItself(){
+ QWidget widget;
+ widget.setObjectName("fe44e5cb6c08006597126a");
+ QVBoxLayout layout(&widget);
+ layout.setObjectName("cc751dd0f50f62b05a62da");
+
+ QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add a null layout to QVBoxLayout/cc751dd0f50f62b05a62da");
+ layout.addLayout(Q_NULLPTR);
+ QCOMPARE(layout.count(), 0);
+
+ QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add layout QVBoxLayout/cc751dd0f50f62b05a62da to itself");
+ layout.addLayout(&layout);
+ QCOMPARE(layout.count(), 0);
+}
+
struct Descr
{
Descr(int min, int sh, int max = -1, bool exp= false, int _stretch = 0, bool _empty = false)
diff --git a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
index 9df7e1662d..962e472606 100644
--- a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
+++ b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
@@ -135,6 +135,8 @@ private slots:
*/
void taskQTBUG_27420_takeAtShouldUnparentLayout();
+ void taskQTBUG_40609_addingWidgetToItsOwnLayout();
+ void taskQTBUG_40609_addingLayoutToItself();
};
@@ -949,6 +951,28 @@ void tst_QFormLayout::taskQTBUG_27420_takeAtShouldUnparentLayout()
QVERIFY(!inner.isNull());
}
+void tst_QFormLayout::taskQTBUG_40609_addingWidgetToItsOwnLayout(){
+ QWidget widget;
+ widget.setObjectName("6435cbada60548b4522cbb6");
+ QFormLayout layout(&widget);
+ layout.setObjectName("c03c0e22c0b6d019a93a248");
+
+ QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add parent widget QWidget/6435cbada60548b4522cbb6 to its child layout QFormLayout/c03c0e22c0b6d019a93a248");
+ layout.addRow(QLatin1String("48c81f39b7320082f8"), &widget);
+ QCOMPARE(layout.count(), 0);
+}
+
+void tst_QFormLayout::taskQTBUG_40609_addingLayoutToItself(){
+ QWidget widget;
+ widget.setObjectName("2bc425637d084c07ce65956");
+ QFormLayout layout(&widget);
+ layout.setObjectName("60e31de0c8800eaba713a4f2");
+
+ QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add layout QFormLayout/60e31de0c8800eaba713a4f2 to itself");
+ layout.addRow(QLatin1String("9a2cd4f40c06b489f889"), &layout);
+ QCOMPARE(layout.count(), 0);
+}
+
void tst_QFormLayout::replaceWidget()
{
QWidget w;
diff --git a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
index 3b7c2ac14d..0dcae2fbcc 100644
--- a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
+++ b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
@@ -101,6 +101,8 @@ private slots:
void distributeMultiCell();
void taskQTBUG_27420_takeAtShouldUnparentLayout();
+ void taskQTBUG_40609_addingWidgetToItsOwnLayout();
+ void taskQTBUG_40609_addingLayoutToItself();
void replaceWidget();
private:
@@ -1660,6 +1662,36 @@ void tst_QGridLayout::taskQTBUG_27420_takeAtShouldUnparentLayout()
QVERIFY(!inner.isNull());
}
+void tst_QGridLayout::taskQTBUG_40609_addingWidgetToItsOwnLayout(){
+ QWidget widget;
+ widget.setObjectName("9bb37ca762aeb7269b8");
+ QGridLayout layout(&widget);
+ layout.setObjectName("d631e91a35f2b66a6dff35");
+
+ QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add a null widget to QGridLayout/d631e91a35f2b66a6dff35");
+ layout.addWidget(Q_NULLPTR, 0, 0);
+ QCOMPARE(layout.count(), 0);
+
+ QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add parent widget QWidget/9bb37ca762aeb7269b8 to its child layout QGridLayout/d631e91a35f2b66a6dff35");
+ layout.addWidget(&widget, 0, 0);
+ QCOMPARE(layout.count(), 0);
+}
+
+void tst_QGridLayout::taskQTBUG_40609_addingLayoutToItself(){
+ QWidget widget;
+ widget.setObjectName("0373d417fffe2c59c6fe543");
+ QGridLayout layout(&widget);
+ layout.setObjectName("5d79e1b0aed83f100e3c2");
+
+ QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add a null layout to QGridLayout/5d79e1b0aed83f100e3c2");
+ layout.addLayout(Q_NULLPTR, 0, 0);
+ QCOMPARE(layout.count(), 0);
+
+ QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add layout QGridLayout/5d79e1b0aed83f100e3c2 to itself");
+ layout.addLayout(&layout, 0, 0);
+ QCOMPARE(layout.count(), 0);
+}
+
void tst_QGridLayout::replaceWidget()
{
QWidget wdg;
diff --git a/tests/auto/widgets/widgets/qsizegrip/tst_qsizegrip.cpp b/tests/auto/widgets/widgets/qsizegrip/tst_qsizegrip.cpp
index f88cd634de..2600348998 100644
--- a/tests/auto/widgets/widgets/qsizegrip/tst_qsizegrip.cpp
+++ b/tests/auto/widgets/widgets/qsizegrip/tst_qsizegrip.cpp
@@ -46,6 +46,10 @@
#include <QLineEdit>
#include <QVBoxLayout>
#include <QLabel>
+#include <QMainWindow>
+#include <QStatusBar>
+#include <QMdiArea>
+#include <QMdiSubWindow>
static inline Qt::Corner sizeGripCorner(QWidget *parent, QSizeGrip *sizeGrip)
{
@@ -75,6 +79,7 @@ private slots:
void hideAndShowOnWindowStateChange_data();
void hideAndShowOnWindowStateChange();
void orientation();
+ void dontCrashOnTLWChange();
private:
QLineEdit *dummyWidget;
@@ -191,6 +196,26 @@ void tst_QSizeGrip::orientation()
QCOMPARE(sizeGripCorner(&widget, sizeGrip), Qt::TopRightCorner);
}
+void tst_QSizeGrip::dontCrashOnTLWChange()
+{
+ // QTBUG-22867
+ QMdiArea mdiArea;
+ mdiArea.show();
+
+ QMainWindow *mw = new QMainWindow();
+ QMdiSubWindow *mdi = mdiArea.addSubWindow(mw);
+ mw->statusBar()->setSizeGripEnabled(true);
+ mdiArea.removeSubWindow(mw);
+ delete mdi;
+ mw->show();
+
+ // the above setup causes a change of TLW for the size grip,
+ // and it must not crash.
+
+ QVERIFY(QTest::qWaitForWindowExposed(&mdiArea));
+ QVERIFY(QTest::qWaitForWindowExposed(mw));
+}
+
QTEST_MAIN(tst_QSizeGrip)
#include "tst_qsizegrip.moc"
diff --git a/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp b/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp
index 168a17773e..650f189309 100644
--- a/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp
+++ b/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp
@@ -66,6 +66,7 @@ private slots:
void task230994_iconSize();
void task176137_autoRepeatOfAction();
void qtbug_26956_popupTimerDone();
+ void qtbug_34759_sizeHintResetWhenSettingMenu();
protected slots:
void sendMouseClick();
@@ -265,5 +266,32 @@ void tst_QToolButton::qtbug_26956_popupTimerDone()
tb->showMenu();
}
+void tst_QToolButton::qtbug_34759_sizeHintResetWhenSettingMenu()
+{
+ // There is no reliable way of checking what's ultimately a style-dependent
+ // sizing. So the idea is checking if the size is the "correct" size w.r.t.
+ // another toolbutton which has had a menu set before it was shown for the first time
+
+ QToolButton button1;
+ QToolButton button2;
+
+ button1.setToolButtonStyle(Qt::ToolButtonIconOnly);
+ button1.setPopupMode(QToolButton::MenuButtonPopup);
+
+ button2.setToolButtonStyle(Qt::ToolButtonIconOnly);
+ button2.setPopupMode(QToolButton::MenuButtonPopup);
+
+ button2.setMenu(new QMenu(&button2));
+
+ button1.show();
+ button2.show();
+
+ QVERIFY(QTest::qWaitForWindowExposed(&button1));
+ QVERIFY(QTest::qWaitForWindowExposed(&button2));
+
+ button1.setMenu(new QMenu(&button1));
+ QTRY_COMPARE(button1.sizeHint(), button2.sizeHint());
+}
+
QTEST_MAIN(tst_QToolButton)
#include "tst_qtoolbutton.moc"
diff --git a/tests/manual/qlayout/gridwidget.cpp b/tests/manual/qlayout/gridwidget.cpp
index 31f0094182..6d7de3c763 100644
--- a/tests/manual/qlayout/gridwidget.cpp
+++ b/tests/manual/qlayout/gridwidget.cpp
@@ -53,6 +53,7 @@ GridWidget::GridWidget(QWidget *parent) :
QWidget(parent)
{
QGridLayout *hb = new QGridLayout(this);
+ hb->setObjectName("GridWidget");
QComboBox *combo = new QComboBox();
combo->addItem("123");
QComboBox *combo2 = new QComboBox();
@@ -71,4 +72,11 @@ GridWidget::GridWidget(QWidget *parent) :
hb->addWidget(new QPushButton("123"), 1, 4);
hb->addWidget(new QSpinBox(), 0, 5);
hb->addWidget(new QSpinBox(), 1, 5);
+
+ qDebug("There should be four warnings, but no crash or freeze:");
+ hb->addWidget(this, 6, 6); ///< This command should print a warning, but should not add "this"
+ hb->addWidget(Q_NULLPTR, 6, 7); ///< This command should print a warning, but should not add "NULL"
+ hb->addLayout(hb, 7, 6); ///< This command should print a warning, but should not add "hb"
+ hb->addLayout(Q_NULLPTR, 7, 7); ///< This command should print a warning, but should not add "NULL"
+ qDebug("Neither crashed nor frozen");
}
diff --git a/tests/manual/qlayout/hbwidget.cpp b/tests/manual/qlayout/hbwidget.cpp
index e8bb07f4a4..743b420b0d 100644
--- a/tests/manual/qlayout/hbwidget.cpp
+++ b/tests/manual/qlayout/hbwidget.cpp
@@ -53,6 +53,7 @@ HbWidget::HbWidget(QWidget *parent) :
QWidget(parent)
{
QHBoxLayout *hb = new QHBoxLayout(this);
+ hb->setObjectName("HbWidget");
QComboBox *combo = new QComboBox(this);
combo->addItem("123");
QComboBox *combo2 = new QComboBox();
@@ -67,4 +68,11 @@ HbWidget::HbWidget(QWidget *parent) :
hb->addWidget(new QDateTimeEdit());
hb->addWidget(new QPushButton("123"));
hb->addWidget(new QSpinBox());
+
+ qDebug("There should be four warnings, but no crash or freeze:");
+ hb->addWidget(this); ///< This command should print a warning, but should not add "this"
+ hb->addWidget(Q_NULLPTR); ///< This command should print a warning, but should not add "NULL"
+ hb->addLayout(hb); ///< This command should print a warning, but should not add "hb"
+ hb->addLayout(Q_NULLPTR); ///< This command should print a warning, but should not add "NULL"
+ qDebug("Neither crashed nor frozen");
}
diff --git a/tests/manual/qlayout/vbwidget.cpp b/tests/manual/qlayout/vbwidget.cpp
index 063176625d..ffd918b955 100644
--- a/tests/manual/qlayout/vbwidget.cpp
+++ b/tests/manual/qlayout/vbwidget.cpp
@@ -53,6 +53,7 @@ VbWidget::VbWidget(QWidget *parent) :
QWidget(parent)
{
QVBoxLayout *hb = new QVBoxLayout(this);
+ hb->setObjectName("VbWidget");
QComboBox *combo = new QComboBox(this);
combo->addItem("123");
QComboBox *combo2 = new QComboBox();
@@ -67,4 +68,11 @@ VbWidget::VbWidget(QWidget *parent) :
hb->addWidget(new QDateTimeEdit());
hb->addWidget(new QPushButton("123"));
hb->addWidget(new QSpinBox());
+
+ qDebug("There should be four warnings, but no crash or freeze:");
+ hb->addWidget(this); ///< This command should print a warning, but should not add "this"
+ hb->addWidget(Q_NULLPTR); ///< This command should print a warning, but should not add "NULL"
+ hb->addLayout(hb); ///< This command should print a warning, but should not add "hb"
+ hb->addLayout(Q_NULLPTR); ///< This command should print a warning, but should not add "NULL"
+ qDebug("Neither crashed nor frozen");
}