summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-02-06 14:21:16 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-02-07 13:07:25 +0100
commita1fe728fa5bd6cb9e50cf317a58efcf4eea4de2c (patch)
tree0798ae897d111147238544826c79243b6f9a48a4 /src
parent57fe9bd2c6a361cf979d17d962abed5db17a1457 (diff)
parent65bd80ebfc1be81a196a861ade40ff874a3554f0 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/gui/kernel/qguiapplication.cpp src/plugins/platforms/android/androidjnimain.cpp src/plugins/platforms/android/qandroidplatformintegration.cpp src/plugins/platforms/android/qandroidplatformintegration.h src/plugins/platforms/android/qandroidplatformopenglcontext.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/sql/doc/src/sql-driver.qdoc src/widgets/widgets/qtoolbararealayout.cpp Change-Id: Ifd7e58760c3cb6bd8a7d1dd32ef83b7ec190d41e
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/angle/src/libEGL/Display.cpp2
-rw-r--r--src/angle/patches/0001-Fix-compilation-of-ANGLE-with-mingw-tdm64-gcc-4.8.1.patch33
-rw-r--r--src/corelib/animation/qabstractanimation_p.h4
-rw-r--r--src/corelib/doc/qtcore.qdocconf2
-rw-r--r--src/corelib/global/qglobal.cpp8
-rw-r--r--src/corelib/global/qglobal.h8
-rw-r--r--src/corelib/global/qlogging.cpp43
-rw-r--r--src/corelib/io/qdir.cpp9
-rw-r--r--src/corelib/io/qfileselector.cpp18
-rw-r--r--src/corelib/io/qiodevice.cpp5
-rw-r--r--src/corelib/io/qloggingcategory.cpp2
-rw-r--r--src/corelib/itemmodels/qsortfilterproxymodel.cpp17
-rw-r--r--src/corelib/kernel/qobject.h4
-rw-r--r--src/corelib/kernel/qvariant.cpp6
-rw-r--r--src/corelib/plugin/qlibrary.cpp21
-rw-r--r--src/corelib/tools/qalgorithms.qdoc3
-rw-r--r--src/corelib/tools/qbitarray.cpp9
-rw-r--r--src/corelib/tools/qbytearray.cpp30
-rw-r--r--src/corelib/tools/qcommandlineoption.cpp6
-rw-r--r--src/corelib/tools/qrect.h2
-rw-r--r--src/corelib/tools/qstring.cpp2
-rw-r--r--src/corelib/tools/qstring.h8
-rw-r--r--src/corelib/tools/qvector.h7
-rw-r--r--src/dbus/qdbusmetaobject.cpp33
-rw-r--r--src/gui/accessible/qaccessibleplugin.cpp2
-rw-r--r--src/gui/doc/qtgui.qdocconf3
-rw-r--r--src/gui/gui.pro2
-rw-r--r--src/gui/image/qicon.cpp56
-rw-r--r--src/gui/image/qiconloader.cpp7
-rw-r--r--src/gui/image/qpictureformatplugin.cpp2
-rw-r--r--src/gui/kernel/qgenericplugin.cpp2
-rw-r--r--src/gui/kernel/qguiapplication.cpp3
-rw-r--r--src/gui/kernel/qwindow.cpp4
-rw-r--r--src/gui/opengl/qopenglframebufferobject.cpp2
-rw-r--r--src/gui/opengl/qopengltexturecache.cpp29
-rw-r--r--src/gui/text/qfontengine.cpp13
-rw-r--r--src/gui/text/qfontengine_ft.cpp29
-rw-r--r--src/gui/text/qfontengine_p.h5
-rw-r--r--src/gui/text/qharfbuzzng.cpp22
-rw-r--r--src/gui/text/qtextengine.cpp4
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp7
-rw-r--r--src/network/access/qnetworkdiskcache.cpp14
-rw-r--r--src/network/access/qnetworkreplyfileimpl.cpp6
-rw-r--r--src/network/kernel/qdnslookup_unix.cpp2
-rw-r--r--src/network/kernel/qhostinfo_unix.cpp2
-rw-r--r--src/network/socket/qabstractsocket.cpp2
-rw-r--r--src/opengl/doc/src/qtopengl-examples.qdoc5
-rw-r--r--src/opengl/qglframebufferobject.cpp5
-rw-r--r--src/opengl/qglpixelbuffer.cpp2
-rw-r--r--src/platformsupport/devicediscovery/qdevicediscovery_static.cpp28
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouch.cpp112
-rw-r--r--src/platformsupport/linuxaccessibility/constant_mappings.cpp27
-rw-r--r--src/platformsupport/themes/genericunix/qgenericunixthemes.cpp10
-rw-r--r--src/plugins/accessible/widgets/main.cpp2
-rw-r--r--src/plugins/accessible/widgets/simplewidgets.cpp35
-rw-r--r--src/plugins/accessible/widgets/simplewidgets.h13
-rw-r--r--src/plugins/accessible/widgets/widgets.json3
-rw-r--r--src/plugins/platforms/android/androidjnimain.cpp12
-rw-r--r--src/plugins/platforms/android/androidjnimain.h1
-rw-r--r--src/plugins/platforms/android/qandroidplatformintegration.cpp47
-rw-r--r--src/plugins/platforms/android/qandroidplatformintegration.h7
-rw-r--r--src/plugins/platforms/android/qandroidplatformopenglcontext.cpp9
-rw-r--r--src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm6
-rw-r--r--src/plugins/platforms/cocoa/qcocoasystemsettings.mm1
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.h1
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm17
-rw-r--r--src/plugins/platforms/cocoa/qnsview.h1
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm17
-rw-r--r--src/plugins/platforms/minimalegl/main.cpp8
-rw-r--r--src/plugins/platforms/qnx/qqnxeglwindow.cpp7
-rw-r--r--src/plugins/platforms/qnx/qqnxrasterwindow.cpp6
-rw-r--r--src/plugins/platforms/qnx/qqnxscreen.cpp2
-rw-r--r--src/plugins/platforms/windows/qwindowskeymapper.cpp4
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp6
-rw-r--r--src/sql/doc/src/sql-driver.qdoc67
-rw-r--r--src/testlib/doc/qttestlib.qdocconf2
-rw-r--r--src/testlib/doc/src/qttest-index.qdoc2
-rw-r--r--src/testlib/doc/src/qttestlib-manual.qdoc2
-rw-r--r--src/testlib/qtestresult.cpp6
-rw-r--r--src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc3
-rw-r--r--src/tools/qdoc/doc/qdoc-manual-intro.qdoc5
-rw-r--r--src/tools/qdoc/generator.cpp11
-rw-r--r--src/tools/qdoc/helpprojectwriter.cpp3
-rw-r--r--src/widgets/doc/qtwidgets.qdocconf2
-rw-r--r--src/widgets/doc/src/gestures.qdoc8
-rw-r--r--src/widgets/itemviews/qlistview.cpp8
-rw-r--r--src/widgets/itemviews/qtableview.cpp4
-rw-r--r--src/widgets/itemviews/qtreeview.cpp6
-rw-r--r--src/widgets/kernel/qaction.cpp2
-rw-r--r--src/widgets/kernel/qwidget.cpp2
-rw-r--r--src/widgets/kernel/qwidget_qpa.cpp15
-rw-r--r--src/widgets/kernel/qwindowcontainer.cpp6
-rw-r--r--src/widgets/kernel/qwindowcontainer_p.h3
-rw-r--r--src/widgets/styles/qcommonstyle.cpp2
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm8
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp4
-rw-r--r--src/widgets/styles/qwindowsvistastyle.cpp6
-rw-r--r--src/widgets/widgets.pro1
-rw-r--r--src/widgets/widgets/qmainwindow.cpp43
-rw-r--r--src/widgets/widgets/qmenubar.cpp4
-rw-r--r--src/widgets/widgets/qplaintextedit.cpp1
-rw-r--r--src/widgets/widgets/qtabbar.cpp3
-rw-r--r--src/widgets/widgets/qtoolbararealayout.cpp8
-rw-r--r--src/widgets/widgets/widgets.pri9
104 files changed, 729 insertions, 411 deletions
diff --git a/src/3rdparty/angle/src/libEGL/Display.cpp b/src/3rdparty/angle/src/libEGL/Display.cpp
index 14973aff30..b18a876a55 100644
--- a/src/3rdparty/angle/src/libEGL/Display.cpp
+++ b/src/3rdparty/angle/src/libEGL/Display.cpp
@@ -525,7 +525,7 @@ void Display::initVendorString()
if (mRenderer && mRenderer->getLUID(&adapterLuid))
{
char adapterLuidString[64];
- sprintf_s(adapterLuidString, sizeof(adapterLuidString), " (adapter LUID: %08x%08x)", adapterLuid.HighPart, adapterLuid.LowPart);
+ snprintf(adapterLuidString, sizeof(adapterLuidString), " (adapter LUID: %08l%08l)", adapterLuid.HighPart, adapterLuid.LowPart);
mVendorString += adapterLuidString;
}
diff --git a/src/angle/patches/0001-Fix-compilation-of-ANGLE-with-mingw-tdm64-gcc-4.8.1.patch b/src/angle/patches/0001-Fix-compilation-of-ANGLE-with-mingw-tdm64-gcc-4.8.1.patch
new file mode 100644
index 0000000000..498cce1b7c
--- /dev/null
+++ b/src/angle/patches/0001-Fix-compilation-of-ANGLE-with-mingw-tdm64-gcc-4.8.1.patch
@@ -0,0 +1,33 @@
+From 58a797397378aff3aa039a8b2a2d7011fe788737 Mon Sep 17 00:00:00 2001
+From: Kai Koehne <kai.koehne@digia.com>
+Date: Tue, 21 Jan 2014 10:23:38 +0100
+Subject: [PATCH] Fix compilation of ANGLE with mingw-tdm64 gcc 4.8.1
+
+Do not rely on sprintf_s being declared/defined. This also fixes
+deployment to Windows XP.
+
+See https://chromium-review.googlesource.com/#/c/182975/ for a similar
+commit proposed upstream.
+
+Task-number: QTBUG-36242
+Change-Id: I520e2f61aeab34963e7a57baafd413c7db93f110
+---
+ src/3rdparty/angle/src/libEGL/Display.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/3rdparty/angle/src/libEGL/Display.cpp b/src/3rdparty/angle/src/libEGL/Display.cpp
+index a382c3b..82b48ce 100644
+--- a/src/3rdparty/angle/src/libEGL/Display.cpp
++++ b/src/3rdparty/angle/src/libEGL/Display.cpp
+@@ -523,7 +523,7 @@ void Display::initVendorString()
+ if (mRenderer && mRenderer->getLUID(&adapterLuid))
+ {
+ char adapterLuidString[64];
+- sprintf_s(adapterLuidString, sizeof(adapterLuidString), " (adapter LUID: %08x%08x)", adapterLuid.HighPart, adapterLuid.LowPart);
++ snprintf(adapterLuidString, sizeof(adapterLuidString), " (adapter LUID: %08l%08l)", adapterLuid.HighPart, adapterLuid.LowPart);
+
+ mVendorString += adapterLuidString;
+ }
+--
+1.8.5.2.msysgit.0
+
diff --git a/src/corelib/animation/qabstractanimation_p.h b/src/corelib/animation/qabstractanimation_p.h
index 322de22caf..39d9cf0fe6 100644
--- a/src/corelib/animation/qabstractanimation_p.h
+++ b/src/corelib/animation/qabstractanimation_p.h
@@ -46,8 +46,8 @@
// W A R N I N G
// -------------
//
-// This file is not part of the Qt API. It exists for the convenience
-// of QIODevice. This header file may change from version to
+// This file is not part of the Qt API.
+// This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf
index fa5afb033c..18fdfb18f3 100644
--- a/src/corelib/doc/qtcore.qdocconf
+++ b/src/corelib/doc/qtcore.qdocconf
@@ -26,7 +26,7 @@ qhp.QtCore.subprojects.classes.sortPages = true
tagfile = ../../../doc/qtcore/qtcore.tags
-depends += qtgui qtwidgets qtnetwork qtdoc qtquick qtlinguist qtdesigner qtconcurrent qtxml qmake
+depends += qtgui qtwidgets qtnetwork qtdoc qtmacextras qtquick qtlinguist qtdesigner qtconcurrent qtxml qmake
headerdirs += ..
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index e84c31eecf..fe10c493a7 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -1988,7 +1988,7 @@ const QSysInfo::WinVersion QSysInfo::WindowsVersion = QSysInfo::windowsVersion()
conditions that it would not otherwise know about. However, there is no
guarantee that the compiler will actually use those hints.
- This macro could be considered a "lighter" version of \l{Q_ASSERT}. While
+ This macro could be considered a "lighter" version of \l{Q_ASSERT()}. While
Q_ASSERT will abort the program's execution if the condition is false,
Q_ASSUME will tell the compiler not to generate code for those conditions.
Therefore, it is important that the assumptions always hold, otherwise
@@ -3359,7 +3359,7 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters)
If you need C++11 noexcept semantics, don't use this macro, use
Q_DECL_NOEXCEPT/Q_DECL_NOEXCEPT_EXPR instead.
- \sa Q_DECL_NOEXCEPT, Q_DECL_NOEXCEPT_EXPR
+ \sa Q_DECL_NOEXCEPT, Q_DECL_NOEXCEPT_EXPR()
*/
/*!
@@ -3413,7 +3413,7 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters)
function can't possibly throw, don't use this macro, use
Q_DECL_NOTHROW instead.
- \sa Q_DECL_NOTHROW, Q_DECL_NOEXCEPT_EXPR
+ \sa Q_DECL_NOTHROW, Q_DECL_NOEXCEPT_EXPR()
*/
/*!
@@ -3435,7 +3435,7 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters)
function can't possibly throw, don't use this macro, use
Q_DECL_NOTHROW instead.
- \sa Q_DECL_NOTHROW, Q_DECL_NOEXCEPT_EXPR
+ \sa Q_DECL_NOTHROW, Q_DECL_NOEXCEPT
*/
/*!
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 1e9b20757d..6a6656a6f6 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -838,9 +838,13 @@ Q_CORE_EXPORT void qFreeAligned(void *ptr);
# pragma warning(disable: 4800) /* 'type' : forcing value to bool 'true' or 'false' (performance warning) */
# pragma warning(disable: 4097) /* typedef-name 'identifier1' used as synonym for class-name 'identifier2' */
# pragma warning(disable: 4706) /* assignment within conditional expression */
-# pragma warning(disable: 4786) /* 'identifier' : identifier was truncated to 'number' characters in the debug information */
+# if _MSC_VER <= 1310 // MSVC 2003
+# pragma warning(disable: 4786) /* 'identifier' : identifier was truncated to 'number' characters in the debug information */
+# endif
# pragma warning(disable: 4355) /* 'this' : used in base member initializer list */
-# pragma warning(disable: 4231) /* nonstandard extension used : 'identifier' before template explicit instantiation */
+# if _MSC_VER < 1800 // MSVC 2013
+# pragma warning(disable: 4231) /* nonstandard extension used : 'identifier' before template explicit instantiation */
+# endif
# pragma warning(disable: 4710) /* function not inlined */
# pragma warning(disable: 4530) /* C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc */
# elif defined(Q_CC_BOR)
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index dbe28da120..10b0d63fb0 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -1244,6 +1244,32 @@ 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
+static thread_local bool msgHandlerGrabbed = false;
+#endif
+
+static bool grabMessageHandler()
+{
+ if (msgHandlerGrabbed)
+ return false;
+
+ msgHandlerGrabbed = true;
+ return true;
+}
+
+static void ungrabMessageHandler()
+{
+ msgHandlerGrabbed = false;
+}
+
+#else
+static bool grabMessageHandler() { return true; }
+static void ungrabMessageHandler() { }
+#endif // (Q_COMPILER_THREAD_LOCAL) || ((Q_CC_MSVC) && !(Q_OS_WINCE))
+
static void qt_message_print(QtMsgType msgType, const QMessageLogContext &context, const QString &message)
{
#ifndef QT_BOOTSTRAPPED
@@ -1261,12 +1287,19 @@ static void qt_message_print(QtMsgType msgType, const QMessageLogContext &contex
if (!messageHandler)
messageHandler = qDefaultMessageHandler;
- // prefer new message handler over the old one
- if (msgHandler == qDefaultMsgHandler
- || messageHandler != qDefaultMessageHandler) {
- (*messageHandler)(msgType, context, message);
+ // prevent recursion in case the message handler generates messages
+ // itself, e.g. by using Qt API
+ if (grabMessageHandler()) {
+ // prefer new message handler over the old one
+ if (msgHandler == qDefaultMsgHandler
+ || messageHandler != qDefaultMessageHandler) {
+ (*messageHandler)(msgType, context, message);
+ } else {
+ (*msgHandler)(msgType, message.toLocal8Bit().constData());
+ }
+ ungrabMessageHandler();
} else {
- (*msgHandler)(msgType, message.toLocal8Bit().constData());
+ fprintf(stderr, "%s", message.toLocal8Bit().constData());
}
}
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index 3075e0fb12..909143ecf3 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -716,11 +716,12 @@ QString QDir::absoluteFilePath(const QString &fileName) const
return fileName;
d->resolveAbsoluteEntry();
+ const QString absoluteDirPath = d->absoluteDirEntry.filePath();
if (fileName.isEmpty())
- return d->absoluteDirEntry.filePath();
- if (!d->absoluteDirEntry.isRoot())
- return d->absoluteDirEntry.filePath() % QLatin1Char('/') % fileName;
- return d->absoluteDirEntry.filePath() % fileName;
+ return absoluteDirPath;
+ if (!absoluteDirPath.endsWith(QLatin1Char('/')))
+ return absoluteDirPath % QLatin1Char('/') % fileName;
+ return absoluteDirPath % fileName;
}
/*!
diff --git a/src/corelib/io/qfileselector.cpp b/src/corelib/io/qfileselector.cpp
index 92d3564a0f..b4021c060f 100644
--- a/src/corelib/io/qfileselector.cpp
+++ b/src/corelib/io/qfileselector.cpp
@@ -102,7 +102,7 @@ QFileSelectorPrivate::QFileSelectorPrivate()
your code might look something like this:
\code
QString defaultsPath = "data/defaults.conf";
-#if defined(Q_OS_LINUX_ANDROID)
+#if defined(Q_OS_ANDROID)
defaultsPath = "data/android/defaults.conf";
#elif defined(Q_OS_BLACKBERRY)
defaultsPath = "data/blackberry/defaults.conf";
@@ -157,7 +157,7 @@ QFileSelectorPrivate::QFileSelectorPrivate()
Selectors normally available are
\list
\li platform, any of the following strings which match the platform the application is running
- on: android, blackberry, ios, mac, linux, wince, unix, windows.
+ on: android, blackberry, ios, osx, darwin, mac, linux, wince, unix, windows.
\li locale, same as QLocale::system().name().
\endlist
@@ -368,18 +368,22 @@ QStringList QFileSelectorPrivate::platformSelectors()
# endif
#elif defined(Q_OS_UNIX)
ret << QStringLiteral("unix");
-# if defined(Q_OS_LINUX_ANDROID)
+# if defined(Q_OS_ANDROID)
ret << QStringLiteral("android");
# elif defined(Q_OS_BLACKBERRY)
ret << QStringLiteral("blackberry");
# elif defined(Q_OS_QNX)
ret << QStringLiteral("qnx");
-# elif defined(Q_OS_IOS)
- ret << QStringLiteral("ios");
# elif defined(Q_OS_LINUX)
ret << QStringLiteral("linux");
-# elif defined(Q_OS_MAC)
- ret << QStringLiteral("mac");
+# elif defined(Q_OS_DARWIN)
+ ret << QStringLiteral("darwin");
+ ret << QStringLiteral("mac"); // compatibility synonym
+# if defined(Q_OS_IOS)
+ ret << QStringLiteral("ios");
+# elif defined(Q_OS_OSX)
+ ret << QStringLiteral("osx");
+# endif
# else
struct utsname u;
if (uname(&u) != -1)
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index a81b8580c4..53019e1ff4 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -259,9 +259,10 @@ QIODevicePrivate::~QIODevicePrivate()
\value NotOpen The device is not open.
\value ReadOnly The device is open for reading.
- \value WriteOnly The device is open for writing.
+ \value WriteOnly The device is open for writing. Note that this mode implies
+ Truncate.
\value ReadWrite The device is open for reading and writing.
- \value Append The device is opened in append mode, so that all data is
+ \value Append The device is opened in append mode so that all data is
written to the end of the file.
\value Truncate If possible, the device is truncated before it is opened.
All earlier contents of the device are lost.
diff --git a/src/corelib/io/qloggingcategory.cpp b/src/corelib/io/qloggingcategory.cpp
index 8c3ca5fd65..de77dd9a6e 100644
--- a/src/corelib/io/qloggingcategory.cpp
+++ b/src/corelib/io/qloggingcategory.cpp
@@ -72,7 +72,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QLoggingCategory, qtDefaultCategory,
\section1 Checking category configuration
QLoggingCategory provides \l isDebugEnabled(), \l isWarningEnabled(),
- \l isCriticalEnabled(), \l isTraceEnabled(), as well as \l isEnabled()
+ \l isCriticalEnabled(), as well as \l isEnabled()
to check whether messages for the given message type should be logged.
\note The qCDebug(), qCWarning(), qCCritical() macros prevent arguments
diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
index 68f6c2ebf2..ebc97ca2d9 100644
--- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp
+++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
@@ -458,10 +458,21 @@ void QSortFilterProxyModelPrivate::sort()
*/
bool QSortFilterProxyModelPrivate::update_source_sort_column()
{
- Q_Q(QSortFilterProxyModel);
- QModelIndex proxy_index = q->index(0, proxy_sort_column, QModelIndex());
int old_source_sort_column = source_sort_column;
- source_sort_column = q->mapToSource(proxy_index).column();
+
+ if (proxy_sort_column == -1) {
+ source_sort_column = -1;
+ } else {
+ // We cannot use index mapping here because in case of a still-empty
+ // proxy model there's no valid proxy index we could map to source.
+ // So always use the root mapping directly instead.
+ Mapping *m = create_mapping(QModelIndex()).value();
+ if (proxy_sort_column < m->source_columns.size())
+ source_sort_column = m->source_columns.at(proxy_sort_column);
+ else
+ source_sort_column = -1;
+ }
+
return old_source_sort_column != source_sort_column;
}
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h
index 5197d98f19..ee6ef23139 100644
--- a/src/corelib/kernel/qobject.h
+++ b/src/corelib/kernel/qobject.h
@@ -206,9 +206,9 @@ public:
const char *member, Qt::ConnectionType type = Qt::AutoConnection) const;
#ifdef Q_QDOC
- static QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type);
+ static QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type = Qt::AutoConnection);
static QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor);
- static QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type);
+ static QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type = Qt::AutoConnection);
#else
//Connect a signal to a pointer to qobject member function
template <typename Func1, typename Func2>
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 91ccf3996e..dd9a7693ca 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -2833,8 +2833,8 @@ static bool canConvertMetaObject(int fromId, int toId, QObject *fromObject)
\snippet code/src_corelib_kernel_qvariant.cpp 10
- \sa convert(), QSequentialIterable, qRegisterSequentialConverter(), QAssociativeIterable,
- qRegisterAssociativeConverter()
+ \sa convert(), QSequentialIterable, Q_DECLARE_SEQUENTIAL_CONTAINER_METATYPE(), QAssociativeIterable,
+ Q_DECLARE_ASSOCIATIVE_CONTAINER_METATYPE()
*/
bool QVariant::canConvert(int targetTypeId) const
{
@@ -3334,7 +3334,7 @@ QDebug operator<<(QDebug dbg, const QVariant::Type p)
\snippet code/src_corelib_kernel_qvariant.cpp 9
- \sa setValue(), fromValue(), canConvert(), qRegisterSequentialConverter()
+ \sa setValue(), fromValue(), canConvert(), Q_DECLARE_SEQUENTIAL_CONTAINER_METATYPE()
*/
/*! \fn bool QVariant::canConvert() const
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index 468f759189..9736950c89 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -374,6 +374,7 @@ private:
static QBasicMutex qt_library_mutex;
static QLibraryStore *qt_library_data = 0;
+static bool qt_library_data_once;
QLibraryStore::~QLibraryStore()
{
@@ -429,8 +430,11 @@ Q_DESTRUCTOR_FUNCTION(qlibraryCleanup)
// must be called with a locked mutex
QLibraryStore *QLibraryStore::instance()
{
- if (Q_UNLIKELY(!qt_library_data))
+ if (Q_UNLIKELY(!qt_library_data_once && !qt_library_data)) {
+ // only create once per process lifetime
qt_library_data = new QLibraryStore;
+ qt_library_data_once = true;
+ }
return qt_library_data;
}
@@ -440,12 +444,15 @@ inline QLibraryPrivate *QLibraryStore::findOrCreate(const QString &fileName, con
QLibraryStore *data = instance();
// check if this library is already loaded
- QLibraryPrivate *lib = data->libraryMap.value(fileName);
+ QLibraryPrivate *lib = 0;
+ if (Q_LIKELY(data))
+ lib = data->libraryMap.value(fileName);
if (!lib)
lib = new QLibraryPrivate(fileName, version);
// track this library
- data->libraryMap.insert(fileName, lib);
+ if (Q_LIKELY(data))
+ data->libraryMap.insert(fileName, lib);
lib->libraryRefCount.ref();
return lib;
@@ -464,9 +471,11 @@ inline void QLibraryStore::releaseLibrary(QLibraryPrivate *lib)
// no one else is using
Q_ASSERT(lib->libraryUnloadCount.load() == 0);
- QLibraryPrivate *that = data->libraryMap.take(lib->fileName);
- Q_ASSERT(lib == that);
- Q_UNUSED(that);
+ if (Q_LIKELY(data)) {
+ QLibraryPrivate *that = data->libraryMap.take(lib->fileName);
+ Q_ASSERT(lib == that);
+ Q_UNUSED(that);
+ }
delete lib;
}
diff --git a/src/corelib/tools/qalgorithms.qdoc b/src/corelib/tools/qalgorithms.qdoc
index 40eb2ed41d..8feb180248 100644
--- a/src/corelib/tools/qalgorithms.qdoc
+++ b/src/corelib/tools/qalgorithms.qdoc
@@ -662,9 +662,6 @@
This function requires the item type (in the example above,
QString) to implement \c operator<().
- See the \l{<QtAlgorithms>#binaryFind example}{detailed
- description} for an example usage.
-
\sa qLowerBound(), qUpperBound(), {random access iterators}
*/
diff --git a/src/corelib/tools/qbitarray.cpp b/src/corelib/tools/qbitarray.cpp
index 2e22cf8340..a6f22abce8 100644
--- a/src/corelib/tools/qbitarray.cpp
+++ b/src/corelib/tools/qbitarray.cpp
@@ -119,14 +119,6 @@ QT_BEGIN_NAMESPACE
\since 5.2
*/
-/*!
- \fn QBitArray &QBitArray::operator=(QBitArray &&other)
-
- Move-assigns \a other to this QBitArray instance.
-
- \since 5.2
-*/
-
/*! \fn QBitArray::QBitArray()
Constructs an empty bit array.
@@ -464,6 +456,7 @@ void QBitArray::fill(bool value, int begin, int end)
*/
/*! \fn QBitArray &QBitArray::operator=(QBitArray &&other)
+ \since 5.2
Moves \a other to this bit array and returns a reference to
this bit array.
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index a9cfd604c7..ab1167d0f6 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -1303,12 +1303,10 @@ void QByteArray::chop(int n)
returns a reference to this byte array. The Unicode data is
converted into 8-bit characters using QString::toUtf8().
- If the QString contains non-ASCII Unicode characters, using this
- operator can lead to loss of information. You can disable this
- operator by defining \c QT_NO_CAST_TO_ASCII when you compile your
- applications. You then need to call QString::toUtf8() (or
- QString::toLatin1() or QString::toUtf8() or QString::toLocal8Bit())
- explicitly if you want to convert the data to \c{const char *}.
+ You can disable this function by defining \c QT_NO_CAST_TO_ASCII when you
+ compile your applications. You then need to call QString::toUtf8() (or
+ QString::toLatin1() or QString::toLocal8Bit()) explicitly if you want to
+ convert the data to \c{const char *}.
*/
/*! \fn QByteArray &QByteArray::operator+=(const char *str)
@@ -1667,12 +1665,10 @@ QByteArray &QByteArray::append(const QByteArray &ba)
Appends the string \a str to this byte array. The Unicode data is
converted into 8-bit characters using QString::toUtf8().
- If the QString contains non-ASCII Unicode characters, using this
- function can lead to loss of information. You can disable this
- function by defining \c QT_NO_CAST_TO_ASCII when you compile your
- applications. You then need to call QString::toUtf8() (or
- QString::toLatin1() or QString::toUtf8() or QString::toLocal8Bit())
- explicitly if you want to convert the data to \c{const char *}.
+ You can disable this function by defining \c QT_NO_CAST_TO_ASCII when you
+ compile your applications. You then need to call QString::toUtf8() (or
+ QString::toLatin1() or QString::toLocal8Bit()) explicitly if you want to
+ convert the data to \c{const char *}.
*/
/*!
@@ -2148,12 +2144,10 @@ QByteArray &QByteArray::replace(char before, const QByteArray &after)
string \a after. The Unicode data is converted into 8-bit
characters using QString::toUtf8().
- If the QString contains non-ASCII Unicode characters, using this
- function can lead to loss of information. You can disable this
- function by defining \c QT_NO_CAST_TO_ASCII when you compile your
- applications. You then need to call QString::toUtf8() (or
- QString::toLatin1() or QString::toUtf8() or QString::toLocal8Bit())
- explicitly if you want to convert the data to \c{const char *}.
+ You can disable this function by defining \c QT_NO_CAST_TO_ASCII when you
+ compile your applications. You then need to call QString::toUtf8() (or
+ QString::toLatin1() or QString::toLocal8Bit()) explicitly if you want to
+ convert the data to \c{const char *}.
*/
/*! \fn QByteArray &QByteArray::replace(char before, const char *after)
diff --git a/src/corelib/tools/qcommandlineoption.cpp b/src/corelib/tools/qcommandlineoption.cpp
index 86f087674b..ccf9211b52 100644
--- a/src/corelib/tools/qcommandlineoption.cpp
+++ b/src/corelib/tools/qcommandlineoption.cpp
@@ -79,7 +79,7 @@ public:
This class is used to describe an option on the command line. It allows
different ways of defining the same option with multiple aliases possible.
It is also used to describe how the option is used - it may be a flag (e.g. \c{-v})
- or take an argument (e.g. \c{-o file}).
+ or take a value (e.g. \c{-o file}).
Examples:
\snippet code/src_corelib_tools_qcommandlineoption.cpp 0
@@ -232,8 +232,8 @@ void QCommandLineOptionPrivate::setNames(const QStringList &nameList)
for the documentation of the option in the help output. An option with names \c{o} and \c{output},
and a value name of \c{file} will appear as \c{-o, --output <file>}.
- Call QCommandLineParser::argument() if you expect the option to be present
- only once, and QCommandLineParser::arguments() if you expect that option
+ Call QCommandLineParser::value() if you expect the option to be present
+ only once, and QCommandLineParser::values() if you expect that option
to be present multiple times.
\sa valueName()
diff --git a/src/corelib/tools/qrect.h b/src/corelib/tools/qrect.h
index 62ebdd10cd..22696f9edf 100644
--- a/src/corelib/tools/qrect.h
+++ b/src/corelib/tools/qrect.h
@@ -512,7 +512,7 @@ public:
Q_DECL_CONSTEXPR inline QRectF translated(qreal dx, qreal dy) const;
Q_DECL_CONSTEXPR inline QRectF translated(const QPointF &p) const;
- inline void moveTo(qreal x, qreal t);
+ inline void moveTo(qreal x, qreal y);
inline void moveTo(const QPointF &p);
inline void setRect(qreal x, qreal y, qreal w, qreal h);
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 390a65aa23..f5e25f1de9 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -7845,7 +7845,7 @@ QString &QString::setRawData(const QChar *unicode, int size)
\snippet code/src_corelib_tools_qstring.cpp 6
- \sa QString, QLatin1Char, QStringLiteral
+ \sa QString, QLatin1Char, {QStringLiteral()}{QStringLiteral}
*/
/*! \fn QLatin1String::QLatin1String(const char *str)
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index 4432759b03..0b7ca1f444 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -1062,13 +1062,13 @@ inline QT_ASCII_CAST_WARN bool operator==(const char *s1, const QString &s2)
inline QT_ASCII_CAST_WARN bool operator!=(const char *s1, const QString &s2)
{ return QString::compare_helper(s2.constData(), s2.size(), s1, -1) != 0; }
inline QT_ASCII_CAST_WARN bool operator<(const char *s1, const QString &s2)
-{ return QString::compare_helper(s2.constData(), s2.size(), s1, -1) < 0; }
-inline QT_ASCII_CAST_WARN bool operator>(const char *s1, const QString &s2)
{ return QString::compare_helper(s2.constData(), s2.size(), s1, -1) > 0; }
+inline QT_ASCII_CAST_WARN bool operator>(const char *s1, const QString &s2)
+{ return QString::compare_helper(s2.constData(), s2.size(), s1, -1) < 0; }
inline QT_ASCII_CAST_WARN bool operator<=(const char *s1, const QString &s2)
-{ return QString::compare_helper(s2.constData(), s2.size(), s1, -1) <= 0; }
-inline QT_ASCII_CAST_WARN bool operator>=(const char *s1, const QString &s2)
{ return QString::compare_helper(s2.constData(), s2.size(), s1, -1) >= 0; }
+inline QT_ASCII_CAST_WARN bool operator>=(const char *s1, const QString &s2)
+{ return QString::compare_helper(s2.constData(), s2.size(), s1, -1) <= 0; }
inline QT_ASCII_CAST_WARN bool operator==(const char *s1, QLatin1String s2)
{ return QString::fromUtf8(s1) == s2; }
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index 505e1a32e4..075e8e83e8 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -254,7 +254,10 @@ private:
};
#ifdef Q_CC_MSVC
-# pragma warning ( disable : 4345 ) // behavior change: an object of POD type constructed with an initializer of the form () will be default-initialized
+// behavior change: an object of POD type constructed with an initializer of the form ()
+// will be default-initialized
+# pragma warning ( push )
+# pragma warning ( disable : 4345 )
#endif
template <typename T>
@@ -270,7 +273,7 @@ void QVector<T>::defaultConstruct(T *from, T *to)
}
#ifdef Q_CC_MSVC
-# pragma warning ( default: 4345 )
+# pragma warning ( pop )
#endif
template <typename T>
diff --git a/src/dbus/qdbusmetaobject.cpp b/src/dbus/qdbusmetaobject.cpp
index 13c538bb59..392eac6081 100644
--- a/src/dbus/qdbusmetaobject.cpp
+++ b/src/dbus/qdbusmetaobject.cpp
@@ -128,12 +128,7 @@ QDBusMetaObjectGenerator::QDBusMetaObjectGenerator(const QString &interfaceName,
}
}
-Q_DBUS_EXPORT bool qt_dbus_metaobject_skip_annotations = false;
-
-QDBusMetaObjectGenerator::Type
-QDBusMetaObjectGenerator::findType(const QByteArray &signature,
- const QDBusIntrospection::Annotations &annotations,
- const char *direction, int id)
+static int registerComplexDBusType(const char *typeName)
{
struct QDBusRawTypeHandler {
static void destroy(void *)
@@ -159,6 +154,22 @@ QDBusMetaObjectGenerator::findType(const QByteArray &signature,
}
};
+ return QMetaType::registerNormalizedType(typeName, QDBusRawTypeHandler::destroy,
+ QDBusRawTypeHandler::create,
+ QDBusRawTypeHandler::destruct,
+ QDBusRawTypeHandler::construct,
+ sizeof(void *),
+ QMetaType::MovableType,
+ 0);
+}
+
+Q_DBUS_EXPORT bool qt_dbus_metaobject_skip_annotations = false;
+
+QDBusMetaObjectGenerator::Type
+QDBusMetaObjectGenerator::findType(const QByteArray &signature,
+ const QDBusIntrospection::Annotations &annotations,
+ const char *direction, int id)
+{
Type result;
result.id = QVariant::Invalid;
@@ -195,13 +206,7 @@ QDBusMetaObjectGenerator::findType(const QByteArray &signature,
// type is still unknown or doesn't match back to the signature that it
// was expected to, so synthesize a fake type
typeName = "QDBusRawType<0x" + signature.toHex() + ">*";
- type = QMetaType::registerType(typeName, QDBusRawTypeHandler::destroy,
- QDBusRawTypeHandler::create,
- QDBusRawTypeHandler::destruct,
- QDBusRawTypeHandler::construct,
- sizeof(void *),
- QMetaType::MovableType,
- 0);
+ type = registerComplexDBusType(typeName);
}
result.name = typeName;
@@ -217,7 +222,7 @@ QDBusMetaObjectGenerator::findType(const QByteArray &signature,
type = QVariant::Map;
} else {
result.name = "QDBusRawType::" + signature;
- type = -1;
+ type = registerComplexDBusType(result.name);
}
} else {
result.name = QMetaType::typeName(type);
diff --git a/src/gui/accessible/qaccessibleplugin.cpp b/src/gui/accessible/qaccessibleplugin.cpp
index 8cdbca6767..17b3f52805 100644
--- a/src/gui/accessible/qaccessibleplugin.cpp
+++ b/src/gui/accessible/qaccessibleplugin.cpp
@@ -87,8 +87,6 @@ QAccessiblePlugin::~QAccessiblePlugin()
Creates and returns a QAccessibleInterface implementation for the
class \a key and the object \a object. Keys are case sensitive.
-
- \sa keys()
*/
QT_END_NAMESPACE
diff --git a/src/gui/doc/qtgui.qdocconf b/src/gui/doc/qtgui.qdocconf
index a963f55dc8..e3ec216f9b 100644
--- a/src/gui/doc/qtgui.qdocconf
+++ b/src/gui/doc/qtgui.qdocconf
@@ -29,6 +29,9 @@ tagfile = ../../../doc/qtgui/qtgui.tags
depends += \
qtcore \
+ qtimageformats \
+ qtmacextras \
+ qtmultimedia \
qtnetwork \
qtopengl \
qtsvg \
diff --git a/src/gui/gui.pro b/src/gui/gui.pro
index 3203b41362..f4c35a36c5 100644
--- a/src/gui/gui.pro
+++ b/src/gui/gui.pro
@@ -81,7 +81,7 @@ contains(QT_CONFIG, angle) {
!isEmpty(QMAKE_LIBDIR_OPENGL_ES2): CMAKE_OPENGL_LIBDIR = $$cmakePortablePaths($$QMAKE_LIBDIR_OPENGL_ES2)
CMAKE_GL_HEADER_NAME = GLES2/gl2.h
CMAKE_QT_OPENGL_IMPLEMENTATION = GLESv2
- } else {
+ } else:contains(QT_CONFIG, opengl) {
!isEmpty(QMAKE_INCDIR_OPENGL): CMAKE_GL_INCDIRS = $$cmakeTargetPaths($$QMAKE_INCDIR_OPENGL)
CMAKE_OPENGL_INCDIRS = $$cmakePortablePaths($$QMAKE_INCDIR_OPENGL)
CMAKE_OPENGL_LIBS = $$cmakeProcessLibs($$QMAKE_LIBS_OPENGL)
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp
index c1a8cfaa1e..0a4b50bbea 100644
--- a/src/gui/image/qicon.cpp
+++ b/src/gui/image/qicon.cpp
@@ -43,6 +43,7 @@
#include "qicon_p.h"
#include "qiconengine.h"
#include "qiconengineplugin.h"
+#include "qimagereader.h"
#include "private/qfactoryloader_p.h"
#include "private/qiconloader_p.h"
#include "qpainter.h"
@@ -365,37 +366,40 @@ void QPixmapIconEngine::addPixmap(const QPixmap &pixmap, QIcon::Mode mode, QIcon
void QPixmapIconEngine::addFile(const QString &fileName, const QSize &_size, QIcon::Mode mode, QIcon::State state)
{
if (!fileName.isEmpty()) {
- QSize size = _size;
- QPixmap pixmap;
-
QString abs = fileName;
if (fileName.at(0) != QLatin1Char(':'))
abs = QFileInfo(fileName).absoluteFilePath();
-
- for (int i = 0; i < pixmaps.count(); ++i) {
- if (pixmaps.at(i).mode == mode && pixmaps.at(i).state == state) {
- QPixmapIconEngineEntry *pe = &pixmaps[i];
- if(size == QSize()) {
- pixmap = QPixmap(abs);
- size = pixmap.size();
- }
- if (pe->size == QSize() && pe->pixmap.isNull()) {
- pe->pixmap = QPixmap(pe->fileName);
- // Reset the devicePixelRatio. The pixmap may be loaded from a @2x file,
- // but be used as a 1x pixmap by QIcon.
- pe->pixmap.setDevicePixelRatio(1.0);
- pe->size = pe->pixmap.size();
- }
- if(pe->size == size) {
- pe->pixmap = pixmap;
- pe->fileName = abs;
- return;
+ QImageReader reader(abs);
+
+ do {
+ QSize size = _size;
+ QPixmap pixmap;
+
+ for (int i = 0; i < pixmaps.count(); ++i) {
+ if (pixmaps.at(i).mode == mode && pixmaps.at(i).state == state) {
+ QPixmapIconEngineEntry *pe = &pixmaps[i];
+ if (size == QSize()) {
+ pixmap.convertFromImage(reader.read());
+ size = pixmap.size();
+ }
+ if (pe->size == QSize() && pe->pixmap.isNull()) {
+ pe->pixmap = QPixmap(pe->fileName);
+ // Reset the devicePixelRatio. The pixmap may be loaded from a @2x file,
+ // but be used as a 1x pixmap by QIcon.
+ pe->pixmap.setDevicePixelRatio(1.0);
+ pe->size = pe->pixmap.size();
+ }
+ if (pe->size == size) {
+ pe->pixmap = pixmap;
+ pe->fileName = abs;
+ return;
+ }
}
}
- }
- QPixmapIconEngineEntry e(abs, size, mode, state);
- e.pixmap = pixmap;
- pixmaps += e;
+ QPixmapIconEngineEntry e(abs, size, mode, state);
+ e.pixmap = pixmap;
+ pixmaps += e;
+ } while (reader.jumpToNextImage());
}
}
diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp
index d202d62957..9e979023cd 100644
--- a/src/gui/image/qiconloader.cpp
+++ b/src/gui/image/qiconloader.cpp
@@ -519,10 +519,11 @@ QPixmap PixmapEntry::pixmap(const QSize &size, QIcon::Mode mode, QIcon::State st
return cachedPixmap;
} else {
if (basePixmap.size() != actualSize)
- basePixmap = basePixmap.scaled(actualSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
- cachedPixmap = basePixmap;
+ cachedPixmap = basePixmap.scaled(actualSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
+ else
+ cachedPixmap = basePixmap;
if (QGuiApplication *guiApp = qobject_cast<QGuiApplication *>(qApp))
- cachedPixmap = static_cast<QGuiApplicationPrivate*>(QObjectPrivate::get(guiApp))->applyQIconStyleHelper(mode, basePixmap);
+ cachedPixmap = static_cast<QGuiApplicationPrivate*>(QObjectPrivate::get(guiApp))->applyQIconStyleHelper(mode, cachedPixmap);
QPixmapCache::insert(key, cachedPixmap);
}
return cachedPixmap;
diff --git a/src/gui/image/qpictureformatplugin.cpp b/src/gui/image/qpictureformatplugin.cpp
index c87b9ba6ac..69c3d9ccec 100644
--- a/src/gui/image/qpictureformatplugin.cpp
+++ b/src/gui/image/qpictureformatplugin.cpp
@@ -79,8 +79,6 @@ QT_BEGIN_NAMESPACE
Installs a QPictureIO picture I/O handler for the picture format \a
format. Returns \c true on success.
-
- \sa keys()
*/
diff --git a/src/gui/kernel/qgenericplugin.cpp b/src/gui/kernel/qgenericplugin.cpp
index 98709804de..6939087e59 100644
--- a/src/gui/kernel/qgenericplugin.cpp
+++ b/src/gui/kernel/qgenericplugin.cpp
@@ -95,8 +95,6 @@ QGenericPlugin::~QGenericPlugin()
Implement this function to create a driver matching the type
specified by the given \a key and \a specification parameters. Note that
keys are case-insensitive.
-
- \sa keys()
*/
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 5cfe034dbe..76cebcb00c 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -60,6 +60,7 @@
#include <QtCore/private/qthread_p.h>
#include <QtCore/qdir.h>
#include <QtCore/qlibraryinfo.h>
+#include <QtCore/qnumeric.h>
#include <QtDebug>
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
@@ -111,7 +112,7 @@ Q_GUI_EXPORT bool qt_is_gui_used = true;
Qt::MouseButtons QGuiApplicationPrivate::mouse_buttons = Qt::NoButton;
Qt::KeyboardModifiers QGuiApplicationPrivate::modifier_buttons = Qt::NoModifier;
-QPointF QGuiApplicationPrivate::lastCursorPosition(0.0, 0.0);
+QPointF QGuiApplicationPrivate::lastCursorPosition(qInf(), qInf());
bool QGuiApplicationPrivate::tabletState = false;
QWindow *QGuiApplicationPrivate::tabletPressTarget = 0;
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 4c74a0b834..8ec74fdf31 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -79,8 +79,8 @@ QT_BEGIN_NAMESPACE
QWindow directly. Still, it is possible to render directly to a QWindow
with QBackingStore or QOpenGLContext, when wanting to keep dependencies to
a minimum or when wanting to use OpenGL directly. The
- \l{gui/rasterwindow}{Raster Window} and \l{gui/openglwindow}{OpenGL Window}
- examples are useful reference examples for how to render to a QWindow using
+ \l{Raster Window Example} and \l{OpenGL Window Example}
+ are useful reference examples for how to render to a QWindow using
either approach.
\section1 Resource management
diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp
index a1c4cf2a29..d67524810d 100644
--- a/src/gui/opengl/qopenglframebufferobject.cpp
+++ b/src/gui/opengl/qopenglframebufferobject.cpp
@@ -432,9 +432,11 @@ void QOpenGLFramebufferObjectPrivate::init(QOpenGLFramebufferObject *, const QSi
samples = 0;
}
+#ifndef QT_OPENGL_ES_2
GLint maxSamples;
glGetIntegerv(GL_MAX_SAMPLES, &maxSamples);
samples = qBound(0, int(samples), int(maxSamples));
+#endif
size = sz;
target = texture_target;
diff --git a/src/gui/opengl/qopengltexturecache.cpp b/src/gui/opengl/qopengltexturecache.cpp
index 4238f63cd8..750264935b 100644
--- a/src/gui/opengl/qopengltexturecache.cpp
+++ b/src/gui/opengl/qopengltexturecache.cpp
@@ -40,6 +40,7 @@
****************************************************************************/
#include "qopengltexturecache_p.h"
+#include <qopenglfunctions.h>
#include <private/qopenglcontext_p.h>
#include <private/qimagepixmapcleanuphooks_p.h>
#include <qpa/qplatformpixmap.h>
@@ -128,6 +129,20 @@ GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, const QPixmap &
return id;
}
+// returns the highest number closest to v, which is a power of 2
+// NB! assumes 32 bit ints
+static int qt_next_power_of_two(int v)
+{
+ v--;
+ v |= v >> 1;
+ v |= v >> 2;
+ v |= v >> 4;
+ v |= v >> 8;
+ v |= v >> 16;
+ ++v;
+ return v;
+}
+
GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, const QImage &image)
{
if (image.isNull())
@@ -144,7 +159,19 @@ GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, const QImage &i
}
}
- GLuint id = bindTexture(context, key, image);
+ QImage img = image;
+ if (!context->functions()->hasOpenGLFeature(QOpenGLFunctions::NPOTTextures)) {
+ // Scale the pixmap if needed. GL textures needs to have the
+ // dimensions 2^n+2(border) x 2^m+2(border), unless we're using GL
+ // 2.0 or use the GL_TEXTURE_RECTANGLE texture target
+ int tx_w = qt_next_power_of_two(image.width());
+ int tx_h = qt_next_power_of_two(image.height());
+ if (tx_w != image.width() || tx_h != image.height()) {
+ img = img.scaled(tx_w, tx_h);
+ }
+ }
+
+ GLuint id = bindTexture(context, key, img);
if (id > 0)
QImagePixmapCleanupHooks::enableCleanupHooks(image);
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp
index 32225750e4..71866119d4 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -198,7 +198,8 @@ static const HB_FontClass hb_fontClass = {
static HB_Error hb_getSFntTable(void *font, HB_Tag tableTag, HB_Byte *buffer, HB_UInt *length)
{
QFontEngine *fe = (QFontEngine *)font;
- if (!fe->getSfntTableData(tableTag, buffer, length))
+ Q_ASSERT(fe->faceData.get_font_table);
+ if (!fe->faceData.get_font_table(fe->faceData.user_data, tableTag, buffer, length))
return HB_Err_Invalid_Argument;
return HB_Err_Ok;
}
@@ -209,6 +210,13 @@ static void hb_freeFace(void *face)
}
+static bool qt_get_font_table_default(void *user_data, uint tag, uchar *buffer, uint *length)
+{
+ QFontEngine *fe = (QFontEngine *)user_data;
+ return fe->getSfntTableData(tag, buffer, length);
+}
+
+
#ifdef QT_BUILD_INTERNAL
// for testing purpose only, not thread-safe!
static QList<QFontEngine *> *enginesCollector = 0;
@@ -237,6 +245,9 @@ QFontEngine::QFontEngine()
font_(0), font_destroy_func(0),
face_(0), face_destroy_func(0)
{
+ faceData.user_data = this;
+ faceData.get_font_table = qt_get_font_table_default;
+
cache_cost = 0;
fsType = 0;
symbol = false;
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp
index 438c7b2141..5499757c3b 100644
--- a/src/gui/text/qfontengine_ft.cpp
+++ b/src/gui/text/qfontengine_ft.cpp
@@ -116,6 +116,21 @@ QT_BEGIN_NAMESPACE
#define TRUNC(x) ((x) >> 6)
#define ROUND(x) (((x)+32) & -64)
+static bool ft_getSfntTable(void *user_data, uint tag, uchar *buffer, uint *length)
+{
+ FT_Face face = (FT_Face)user_data;
+
+ bool result = false;
+ if (FT_IS_SFNT(face)) {
+ FT_ULong len = *length;
+ result = FT_Load_Sfnt_Table(face, tag, 0, buffer, &len) == FT_Err_Ok;
+ *length = len;
+ }
+
+ return result;
+}
+
+
// -------------------------- Freetype support ------------------------------
class QtFreetypeData
@@ -408,15 +423,7 @@ QFontEngine::Properties QFreetypeFace::properties() const
bool QFreetypeFace::getSfntTable(uint tag, uchar *buffer, uint *length) const
{
- bool result = false;
-#if (FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) > 20103
- if (FT_IS_SFNT(face)) {
- FT_ULong len = *length;
- result = FT_Load_Sfnt_Table(face, tag, 0, buffer, &len) == FT_Err_Ok;
- *length = len;
- }
-#endif
- return result;
+ return ft_getSfntTable(face, tag, buffer, length);
}
/* Some fonts (such as MingLiu rely on hinting to scale different
@@ -761,6 +768,8 @@ bool QFontEngineFT::init(FaceId faceId, bool antialias, GlyphFormat format,
fontDef.styleName = QString::fromUtf8(face->style_name);
if (!freetype->hbFace) {
+ faceData.user_data = face;
+ faceData.get_font_table = ft_getSfntTable;
freetype->hbFace = harfbuzzFace();
freetype->hbFace_destroy_func = face_destroy_func;
} else {
@@ -1179,7 +1188,7 @@ QFixed QFontEngineFT::emSquareSize() const
bool QFontEngineFT::getSfntTableData(uint tag, uchar *buffer, uint *length) const
{
- return freetype->getSfntTable(tag, buffer, length);
+ return ft_getSfntTable(freetype->face, tag, buffer, length);
}
int QFontEngineFT::synthesized() const
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h
index 9bc1900b99..532ebaf8ff 100644
--- a/src/gui/text/qfontengine_p.h
+++ b/src/gui/text/qfontengine_p.h
@@ -85,6 +85,7 @@ enum HB_Compat_Error {
};
typedef void (*qt_destroy_func_t) (void *user_data);
+typedef bool (*qt_get_font_table_func_t) (void *user_data, uint tag, uchar *buffer, uint *length);
class Q_GUI_EXPORT QFontEngine
{
@@ -279,6 +280,10 @@ public:
mutable qt_destroy_func_t font_destroy_func;
mutable void *face_;
mutable qt_destroy_func_t face_destroy_func;
+ struct FaceData {
+ void *user_data;
+ qt_get_font_table_func_t get_font_table;
+ } faceData;
uint cache_cost; // amount of mem used in kb by the font
uint fsType : 16;
diff --git a/src/gui/text/qharfbuzzng.cpp b/src/gui/text/qharfbuzzng.cpp
index bf34c74b49..010f955c60 100644
--- a/src/gui/text/qharfbuzzng.cpp
+++ b/src/gui/text/qharfbuzzng.cpp
@@ -619,19 +619,22 @@ hb_font_funcs_t *hb_qt_get_font_funcs()
static hb_blob_t *
-_hb_qt_get_font_table(hb_face_t * /*face*/, hb_tag_t tag, void *user_data)
+_hb_qt_reference_table(hb_face_t * /*face*/, hb_tag_t tag, void *user_data)
{
- QFontEngine *fe = (QFontEngine *)user_data;
- Q_ASSERT(fe);
+ QFontEngine::FaceData *data = (QFontEngine::FaceData *)user_data;
+ Q_ASSERT(data);
+
+ qt_get_font_table_func_t get_font_table = data->get_font_table;
+ Q_ASSERT(get_font_table);
uint length = 0;
- if (Q_UNLIKELY(!fe->getSfntTableData(tag, 0, &length) || length == 0))
+ if (Q_UNLIKELY(!get_font_table(data->user_data, tag, 0, &length) || length == 0))
return hb_blob_get_empty();
char *buffer = (char *)malloc(length);
Q_CHECK_PTR(buffer);
- if (Q_UNLIKELY(!fe->getSfntTableData(tag, reinterpret_cast<uchar *>(buffer), &length)))
+ if (Q_UNLIKELY(!get_font_table(data->user_data, tag, reinterpret_cast<uchar *>(buffer), &length)))
length = 0;
return hb_blob_create(const_cast<const char *>(buffer), length,
@@ -642,9 +645,14 @@ _hb_qt_get_font_table(hb_face_t * /*face*/, hb_tag_t tag, void *user_data)
static inline hb_face_t *
_hb_qt_face_create(QFontEngine *fe)
{
- hb_face_t *face;
+ Q_ASSERT(fe);
+
+ QFontEngine::FaceData *data = (QFontEngine::FaceData *)malloc(sizeof(QFontEngine::FaceData));
+ Q_CHECK_PTR(data);
+ data->user_data = fe->faceData.user_data;
+ data->get_font_table = fe->faceData.get_font_table;
- face = hb_face_create_for_tables(_hb_qt_get_font_table, (void *)fe, NULL);
+ hb_face_t *face = hb_face_create_for_tables(_hb_qt_reference_table, (void *)data, free);
if (Q_UNLIKELY(hb_face_is_immutable(face))) {
hb_face_destroy(face);
return NULL;
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 14bdc3167e..2893d8b9b2 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -1880,8 +1880,10 @@ QFontEngine *QTextEngine::fontEngine(const QScriptItem &si, QFixed *ascent, QFix
feCache.prevFontEngine = engine;
feCache.prevScript = script;
engine->ref.ref();
- if (feCache.prevScaledFontEngine)
+ if (feCache.prevScaledFontEngine) {
releaseCachedFontEngine(feCache.prevScaledFontEngine);
+ feCache.prevScaledFontEngine = 0;
+ }
}
if (si.analysis.flags & QFont::SmallCaps) {
if (feCache.prevScaledFontEngine) {
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index 980b19b7e4..c89419091f 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -224,12 +224,7 @@ static void ensureInitialized()
\note The network and roaming support in QNetworkAccessManager is conditional
upon the platform supporting connection management. The
\l QNetworkConfigurationManager::NetworkSessionRequired can be used to
- detect whether QNetworkAccessManager utilizes this feature. Currently only
- Meego/Harmattan platforms provide connection management support.
-
- \note This feature cannot be used in combination with the Bearer Management
- API as provided by QtMobility. Applications have to migrate to the Qt version
- of Bearer Management.
+ detect whether QNetworkAccessManager utilizes this feature.
\sa QNetworkRequest, QNetworkReply, QNetworkProxy
*/
diff --git a/src/network/access/qnetworkdiskcache.cpp b/src/network/access/qnetworkdiskcache.cpp
index d64d697013..2f2d1ab9a9 100644
--- a/src/network/access/qnetworkdiskcache.cpp
+++ b/src/network/access/qnetworkdiskcache.cpp
@@ -559,6 +559,20 @@ qint64 QNetworkDiskCache::expire()
break;
QString name = i.value();
QFile file(name);
+
+ if (name.contains(PREPARED_SLASH)) {
+ QHashIterator<QIODevice*, QCacheItem*> iterator(d->inserting);
+ while (iterator.hasNext()) {
+ iterator.next();
+ QCacheItem *item = iterator.value();
+ if (item && item->file && item->file->fileName() == name) {
+ delete item->file;
+ item->file = 0;
+ break;
+ }
+ }
+ }
+
qint64 size = file.size();
file.remove();
totalSize -= size;
diff --git a/src/network/access/qnetworkreplyfileimpl.cpp b/src/network/access/qnetworkreplyfileimpl.cpp
index f7555f8fc3..2724a54309 100644
--- a/src/network/access/qnetworkreplyfileimpl.cpp
+++ b/src/network/access/qnetworkreplyfileimpl.cpp
@@ -161,6 +161,8 @@ void QNetworkReplyFileImpl::abort()
qint64 QNetworkReplyFileImpl::bytesAvailable() const
{
Q_D(const QNetworkReplyFileImpl);
+ if (!d->realFile.isOpen())
+ return QNetworkReply::bytesAvailable();
return QNetworkReply::bytesAvailable() + d->realFile.bytesAvailable();
}
@@ -181,7 +183,11 @@ qint64 QNetworkReplyFileImpl::size() const
qint64 QNetworkReplyFileImpl::readData(char *data, qint64 maxlen)
{
Q_D(QNetworkReplyFileImpl);
+ if (!d->realFile.isOpen())
+ return -1;
qint64 ret = d->realFile.read(data, maxlen);
+ if (bytesAvailable() == 0 && d->realFile.isOpen())
+ d->realFile.close();
if (ret == 0 && bytesAvailable() == 0)
return -1;
else
diff --git a/src/network/kernel/qdnslookup_unix.cpp b/src/network/kernel/qdnslookup_unix.cpp
index 052c492f07..9fb488cee6 100644
--- a/src/network/kernel/qdnslookup_unix.cpp
+++ b/src/network/kernel/qdnslookup_unix.cpp
@@ -52,7 +52,7 @@
#include <arpa/nameser_compat.h>
#include <resolv.h>
-#ifdef __GNU_LIBRARY__
+#if defined(__GNU_LIBRARY__) && !defined(__UCLIBC__)
# include <gnu/lib-names.h>
#endif
diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp
index 9c7712800d..df8c8b145a 100644
--- a/src/network/kernel/qhostinfo_unix.cpp
+++ b/src/network/kernel/qhostinfo_unix.cpp
@@ -63,7 +63,7 @@
# include <resolv.h>
#endif
-#ifdef __GNU_LIBRARY__
+#if defined(__GNU_LIBRARY__) && !defined(__UCLIBC__)
# include <gnu/lib-names.h>
#endif
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index 1906166257..0345537d1c 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -2221,7 +2221,7 @@ bool QAbstractSocket::waitForBytesWritten(int msecs)
if (readyToWrite) {
if (d->canWriteNotification()) {
#if defined (QABSTRACTSOCKET_DEBUG)
- qDebug("QAbstractSocket::waitForBytesWritten returns \c true");
+ qDebug("QAbstractSocket::waitForBytesWritten returns true");
#endif
return true;
}
diff --git a/src/opengl/doc/src/qtopengl-examples.qdoc b/src/opengl/doc/src/qtopengl-examples.qdoc
index 67c6aa3c0d..68adcda173 100644
--- a/src/opengl/doc/src/qtopengl-examples.qdoc
+++ b/src/opengl/doc/src/qtopengl-examples.qdoc
@@ -33,9 +33,8 @@
\image opengl-examples.png
- These examples describe how to use the Qt OpenGL Module. For new code,
- please use the OpenGL classes in the \l {Qt GUI Module}.
-
+ These examples describe how to use the \l {Qt OpenGL} module. For new code,
+ please use the OpenGL classes in the \l {Qt GUI} module.
Qt provides support for integration with OpenGL implementations on all
platforms, giving developers the opportunity to display hardware accelerated
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp
index ae50366fc7..66e1aca9bc 100644
--- a/src/opengl/qglframebufferobject.cpp
+++ b/src/opengl/qglframebufferobject.cpp
@@ -554,7 +554,6 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz,
&& funcs.hasOpenGLExtension(QOpenGLExtensions::PackedDepthStencil)) {
// depth and stencil buffer needs another extension
funcs.glGenRenderbuffers(1, &depth_buffer);
- Q_ASSERT(!funcs.glIsRenderbuffer(depth_buffer));
funcs.glBindRenderbuffer(GL_RENDERBUFFER, depth_buffer);
Q_ASSERT(funcs.glIsRenderbuffer(depth_buffer));
if (samples != 0 && funcs.hasOpenGLExtension(QOpenGLExtensions::FramebufferMultisample))
@@ -581,7 +580,6 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz,
|| (attachment == QGLFramebufferObject::Depth)))
{
funcs.glGenRenderbuffers(1, &depth_buffer);
- Q_ASSERT(!funcs.glIsRenderbuffer(depth_buffer));
funcs.glBindRenderbuffer(GL_RENDERBUFFER, depth_buffer);
Q_ASSERT(funcs.glIsRenderbuffer(depth_buffer));
if (samples != 0 && funcs.hasOpenGLExtension(QOpenGLExtensions::FramebufferMultisample)) {
@@ -621,7 +619,6 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz,
if (stencil_buffer == 0 && (attachment == QGLFramebufferObject::CombinedDepthStencil)) {
funcs.glGenRenderbuffers(1, &stencil_buffer);
- Q_ASSERT(!funcs.glIsRenderbuffer(stencil_buffer));
funcs.glBindRenderbuffer(GL_RENDERBUFFER, stencil_buffer);
Q_ASSERT(funcs.glIsRenderbuffer(stencil_buffer));
if (samples != 0 && funcs.hasOpenGLExtension(QOpenGLExtensions::FramebufferMultisample)) {
@@ -779,7 +776,7 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz,
\note This class has been deprecated in favor of QOpenGLFramebufferObject.
- \sa {Framebuffer Object Example}
+ \sa {Framebuffer Object 2 Example}
*/
diff --git a/src/opengl/qglpixelbuffer.cpp b/src/opengl/qglpixelbuffer.cpp
index bcb2dd53db..ebc9f296eb 100644
--- a/src/opengl/qglpixelbuffer.cpp
+++ b/src/opengl/qglpixelbuffer.cpp
@@ -90,7 +90,7 @@
Pbuffers are provided by the OpenGL \c pbuffer extension; call
hasOpenGLPbuffer() to find out if the system provides pbuffers.
- \sa {opengl/pbuffers}{Pbuffers Example}
+ \sa {Pixel Buffers Example}
*/
#include <private/qopenglextensions_p.h>
diff --git a/src/platformsupport/devicediscovery/qdevicediscovery_static.cpp b/src/platformsupport/devicediscovery/qdevicediscovery_static.cpp
index a333d2c0c7..cbcc0ff5b1 100644
--- a/src/platformsupport/devicediscovery/qdevicediscovery_static.cpp
+++ b/src/platformsupport/devicediscovery/qdevicediscovery_static.cpp
@@ -102,23 +102,27 @@ QDeviceDiscovery::~QDeviceDiscovery()
QStringList QDeviceDiscovery::scanConnectedDevices()
{
QStringList devices;
-
- // check for input devices
- QDir dir(QString::fromLatin1(QT_EVDEV_DEVICE_PATH));
+ QDir dir;
dir.setFilter(QDir::System);
- foreach (const QString &deviceFile, dir.entryList()) {
- QString absoluteFilePath = dir.absolutePath() + QString::fromLatin1("/") + deviceFile;
- if (checkDeviceType(absoluteFilePath))
- devices << absoluteFilePath;
+ // check for input devices
+ if (m_types & Device_InputMask) {
+ dir.setPath(QString::fromLatin1(QT_EVDEV_DEVICE_PATH));
+ foreach (const QString &deviceFile, dir.entryList()) {
+ QString absoluteFilePath = dir.absolutePath() + QString::fromLatin1("/") + deviceFile;
+ if (checkDeviceType(absoluteFilePath))
+ devices << absoluteFilePath;
+ }
}
// check for drm devices
- dir.setPath(QString::fromLatin1(QT_DRM_DEVICE_PATH));
- foreach (const QString &deviceFile, dir.entryList()) {
- QString absoluteFilePath = dir.absolutePath() + QString::fromLatin1("/") + deviceFile;
- if (checkDeviceType(absoluteFilePath))
- devices << absoluteFilePath;
+ if (m_types & Device_VideoMask) {
+ dir.setPath(QString::fromLatin1(QT_DRM_DEVICE_PATH));
+ foreach (const QString &deviceFile, dir.entryList()) {
+ QString absoluteFilePath = dir.absolutePath() + QString::fromLatin1("/") + deviceFile;
+ if (checkDeviceType(absoluteFilePath))
+ devices << absoluteFilePath;
+ }
}
#ifdef QT_QPA_DEVICE_DISCOVERY_DEBUG
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp
index d9468ae1b8..563edf4fd7 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp
+++ b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp
@@ -157,10 +157,12 @@ void QEvdevTouchScreenData::registerDevice()
#define LONG_BITS (sizeof(long) << 3)
#define NUM_LONGS(bits) (((bits) + LONG_BITS - 1) / LONG_BITS)
+#if defined(QT_NO_MTDEV)
static inline bool testBit(long bit, const long *array)
{
return (array[bit / LONG_BITS] >> bit % LONG_BITS) & 1;
}
+#endif
QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &specification, QObject *parent)
: QObject(parent), m_notify(0), m_fd(-1), d(0)
@@ -345,40 +347,61 @@ QEvdevTouchScreenHandler::~QEvdevTouchScreenHandler()
void QEvdevTouchScreenHandler::readData()
{
::input_event buffer[32];
- int n = 0;
- for (; ;) {
+ int events = 0;
+
#if !defined(QT_NO_MTDEV)
- int result = mtdev_get(m_mtdev, m_fd, buffer, sizeof(buffer) / sizeof(::input_event));
- if (result > 0)
- result *= sizeof(::input_event);
+ forever {
+ do {
+ events = mtdev_get(m_mtdev, m_fd, buffer, sizeof(buffer) / sizeof(::input_event));
+ // keep trying mtdev_get if we get interrupted. note that we do not
+ // (and should not) handle EAGAIN; EAGAIN means that reading would
+ // block and we'll get back here later to try again anyway.
+ } while (events == -1 && errno == EINTR);
+
+ // 0 events is EOF, -1 means error, handle both in the same place
+ if (events <= 0)
+ goto err;
+
+ // process our shiny new events
+ for (int i = 0; i < events; ++i)
+ d->processInputEvent(&buffer[i]);
+
+ // and try to get more
+ }
#else
- int result = QT_READ(m_fd, reinterpret_cast<char*>(buffer) + n, sizeof(buffer) - n);
-#endif
- if (!result) {
- qWarning("evdevtouch: Got EOF from input device");
- return;
- } else if (result < 0) {
- if (errno != EINTR && errno != EAGAIN) {
- qErrnoWarning(errno, "evdevtouch: Could not read from input device");
- if (errno == ENODEV) { // device got disconnected -> stop reading
- delete m_notify;
- m_notify = 0;
- QT_CLOSE(m_fd);
- m_fd = -1;
- }
- return;
- }
- } else {
- n += result;
- if (n % sizeof(::input_event) == 0)
- break;
- }
+ int n = 0;
+ for (; ;) {
+ events = QT_READ(m_fd, reinterpret_cast<char*>(buffer) + n, sizeof(buffer) - n);
+ if (events <= 0)
+ goto err;
+ n += events;
+ if (n % sizeof(::input_event) == 0)
+ break;
}
n /= sizeof(::input_event);
for (int i = 0; i < n; ++i)
d->processInputEvent(&buffer[i]);
+#endif
+ return;
+
+err:
+ if (!events) {
+ qWarning("evdevtouch: Got EOF from input device");
+ return;
+ } else if (events < 0) {
+ if (errno != EINTR && errno != EAGAIN) {
+ qErrnoWarning(errno, "evdevtouch: Could not read from input device");
+ if (errno == ENODEV) { // device got disconnected -> stop reading
+ delete m_notify;
+ m_notify = 0;
+ QT_CLOSE(m_fd);
+ m_fd = -1;
+ }
+ return;
+ }
+ }
}
void QEvdevTouchScreenData::addTouchPoint(const Contact &contact, Qt::TouchPointStates *combinedStates)
@@ -412,19 +435,31 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data)
if (data->code == ABS_MT_POSITION_X || (m_singleTouch && data->code == ABS_X)) {
m_currentData.x = qBound(hw_range_x_min, data->value, hw_range_x_max);
- if (m_typeB || m_singleTouch)
+ if (m_singleTouch)
+ m_contacts[m_currentSlot].x = m_currentData.x;
+ if (m_typeB) {
m_contacts[m_currentSlot].x = m_currentData.x;
+ if (m_contacts[m_currentSlot].state == Qt::TouchPointStationary)
+ m_contacts[m_currentSlot].state = Qt::TouchPointMoved;
+ }
} else if (data->code == ABS_MT_POSITION_Y || (m_singleTouch && data->code == ABS_Y)) {
m_currentData.y = qBound(hw_range_y_min, data->value, hw_range_y_max);
- if (m_typeB || m_singleTouch)
+ if (m_singleTouch)
m_contacts[m_currentSlot].y = m_currentData.y;
+ if (m_typeB) {
+ m_contacts[m_currentSlot].y = m_currentData.y;
+ if (m_contacts[m_currentSlot].state == Qt::TouchPointStationary)
+ m_contacts[m_currentSlot].state = Qt::TouchPointMoved;
+ }
} else if (data->code == ABS_MT_TRACKING_ID) {
m_currentData.trackingId = data->value;
if (m_typeB) {
- if (m_currentData.trackingId == -1)
+ if (m_currentData.trackingId == -1) {
m_contacts[m_currentSlot].state = Qt::TouchPointReleased;
- else
+ } else {
+ m_contacts[m_currentSlot].state = Qt::TouchPointPressed;
m_contacts[m_currentSlot].trackingId = m_currentData.trackingId;
+ }
}
} else if (data->code == ABS_MT_TOUCH_MAJOR) {
m_currentData.maj = data->value;
@@ -468,8 +503,11 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data)
it.next();
Contact &contact(it.value());
+ if (!contact.state)
+ continue;
+
int key = m_typeB ? it.key() : contact.trackingId;
- if (m_lastContacts.contains(key)) {
+ if (!m_typeB && m_lastContacts.contains(key)) {
const Contact &prev(m_lastContacts.value(key));
if (contact.state == Qt::TouchPointReleased) {
// Copy over the previous values for released points, just in case.
@@ -483,7 +521,7 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data)
}
// Avoid reporting a contact in released state more than once.
- if (contact.state == Qt::TouchPointReleased
+ if (!m_typeB && contact.state == Qt::TouchPointReleased
&& !m_lastContacts.contains(key)) {
it.remove();
continue;
@@ -509,8 +547,14 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data)
while (it.hasNext()) {
it.next();
Contact &contact(it.value());
- if (contact.state == Qt::TouchPointReleased)
- it.remove();
+ if (contact.state == Qt::TouchPointReleased) {
+ if (m_typeB)
+ contact.state = static_cast<Qt::TouchPointState>(0);
+ else
+ it.remove();
+ } else {
+ contact.state = Qt::TouchPointStationary;
+ }
}
m_lastContacts = m_contacts;
diff --git a/src/platformsupport/linuxaccessibility/constant_mappings.cpp b/src/platformsupport/linuxaccessibility/constant_mappings.cpp
index 3524fca052..f8bfaf4753 100644
--- a/src/platformsupport/linuxaccessibility/constant_mappings.cpp
+++ b/src/platformsupport/linuxaccessibility/constant_mappings.cpp
@@ -61,17 +61,12 @@ quint64 spiStatesFromQState(QAccessible::State state)
{
quint64 spiState = 0;
- setSpiStateBit(&spiState, ATSPI_STATE_EDITABLE);
- setSpiStateBit(&spiState, ATSPI_STATE_ENABLED);
- setSpiStateBit(&spiState, ATSPI_STATE_SHOWING);
- setSpiStateBit(&spiState, ATSPI_STATE_VISIBLE);
- setSpiStateBit(&spiState, ATSPI_STATE_SENSITIVE);
-
- if (state.disabled) {
- unsetSpiStateBit(&spiState, ATSPI_STATE_ENABLED);
- unsetSpiStateBit(&spiState, ATSPI_STATE_SENSITIVE);
+ if (state.editable)
+ setSpiStateBit(&spiState, ATSPI_STATE_EDITABLE);
+ if (!state.disabled) {
+ setSpiStateBit(&spiState, ATSPI_STATE_ENABLED);
+ setSpiStateBit(&spiState, ATSPI_STATE_SENSITIVE);
}
-
if (state.selected)
setSpiStateBit(&spiState, ATSPI_STATE_SELECTED);
if (state.focused)
@@ -95,9 +90,9 @@ quint64 spiStatesFromQState(QAccessible::State state)
setSpiStateBit(&spiState, ATSPI_STATE_BUSY);
if (state.marqueed || state.animated)
setSpiStateBit(&spiState, ATSPI_STATE_ANIMATED);
- if (state.invisible || state.offscreen) {
- unsetSpiStateBit(&spiState, ATSPI_STATE_SHOWING);
- unsetSpiStateBit(&spiState, ATSPI_STATE_VISIBLE);
+ if (!state.invisible && !state.offscreen) {
+ setSpiStateBit(&spiState, ATSPI_STATE_SHOWING);
+ setSpiStateBit(&spiState, ATSPI_STATE_VISIBLE);
}
if (state.sizeable)
setSpiStateBit(&spiState, ATSPI_STATE_RESIZABLE);
@@ -118,10 +113,8 @@ quint64 spiStatesFromQState(QAccessible::State state)
// if (state.HasPopup)
if (state.modal)
setSpiStateBit(&spiState, ATSPI_STATE_MODAL);
-
- // Not implemented in Qt
- // if (state.singleLine)
- // setSpiStateBit(&spiState, ATSPI_STATE_SINGLE_LINE);
+ if (state.multiLine)
+ setSpiStateBit(&spiState, ATSPI_STATE_MULTI_LINE);
return spiState;
}
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
index 42b3d64a47..c72815ca1b 100644
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
@@ -318,19 +318,23 @@ void QKdeThemePrivate::readKdeSystemPalette(const QSettings &kdeSettings, QPalet
const QBrush buttonBrushDark = QBrush(button.darker(v > 128 ? 200 : 50));
const QBrush buttonBrushDark150 = QBrush(button.darker(v > 128 ? 150 : 75));
const QBrush buttonBrushLight150 = QBrush(button.lighter(v > 128 ? 150 : 75));
+ const QBrush buttonBrushLight = QBrush(button.lighter(v > 128 ? 200 : 50));
pal->setBrush(QPalette::Disabled, QPalette::WindowText, buttonBrushDark);
pal->setBrush(QPalette::Disabled, QPalette::ButtonText, buttonBrushDark);
pal->setBrush(QPalette::Disabled, QPalette::Button, buttonBrush);
- pal->setBrush(QPalette::Disabled, QPalette::Light, buttonBrushLight150);
- pal->setBrush(QPalette::Disabled, QPalette::Dark, buttonBrushDark);
- pal->setBrush(QPalette::Disabled, QPalette::Mid, buttonBrushDark150);
pal->setBrush(QPalette::Disabled, QPalette::Text, buttonBrushDark);
pal->setBrush(QPalette::Disabled, QPalette::BrightText, whiteBrush);
pal->setBrush(QPalette::Disabled, QPalette::Base, buttonBrush);
pal->setBrush(QPalette::Disabled, QPalette::Window, buttonBrush);
pal->setBrush(QPalette::Disabled, QPalette::Highlight, buttonBrushDark150);
pal->setBrush(QPalette::Disabled, QPalette::HighlightedText, buttonBrushLight150);
+
+ // set calculated colors for all groups
+ pal->setBrush(QPalette::Light, buttonBrushLight);
+ pal->setBrush(QPalette::Midlight, buttonBrushLight150);
+ pal->setBrush(QPalette::Mid, buttonBrushDark150);
+ pal->setBrush(QPalette::Dark, buttonBrushDark);
}
/*!
diff --git a/src/plugins/accessible/widgets/main.cpp b/src/plugins/accessible/widgets/main.cpp
index 36ee784aac..717c15edd1 100644
--- a/src/plugins/accessible/widgets/main.cpp
+++ b/src/plugins/accessible/widgets/main.cpp
@@ -247,6 +247,8 @@ QAccessibleInterface *AccessibleFactory::create(const QString &classname, QObjec
iface = 0;
} else if (classname == QLatin1String("QWidget")) {
iface = new QAccessibleWidget(widget);
+ } else if (classname == QLatin1String("QWindowContainer")) {
+ iface = new QAccessibleWindowContainer(widget);
}
return iface;
diff --git a/src/plugins/accessible/widgets/simplewidgets.cpp b/src/plugins/accessible/widgets/simplewidgets.cpp
index 1dac199a09..c275ec071d 100644
--- a/src/plugins/accessible/widgets/simplewidgets.cpp
+++ b/src/plugins/accessible/widgets/simplewidgets.cpp
@@ -57,6 +57,8 @@
#include <qstyle.h>
#include <qstyleoption.h>
#include <qtextdocument.h>
+#include <qwindow.h>
+#include <private/qwindowcontainer_p.h>
#include <QtCore/qvarlengtharray.h>
#ifdef Q_OS_MAC
@@ -845,7 +847,38 @@ QProgressBar *QAccessibleProgressBar::progressBar() const
}
#endif
+
+QAccessibleWindowContainer::QAccessibleWindowContainer(QWidget *w)
+ : QAccessibleWidget(w)
+{
+}
+
+int QAccessibleWindowContainer::childCount() const
+{
+ if (container()->containedWindow())
+ return 1;
+ return 0;
+}
+
+int QAccessibleWindowContainer::indexOfChild(const QAccessibleInterface *child) const
+{
+ if (child->object() == container()->containedWindow())
+ return 0;
+ return -1;
+}
+
+QAccessibleInterface *QAccessibleWindowContainer::child(int i) const
+{
+ if (i == 0)
+ return QAccessible::queryAccessibleInterface(container()->containedWindow());
+ return 0;
+}
+
+QWindowContainer *QAccessibleWindowContainer::container() const
+{
+ return static_cast<QWindowContainer *>(widget());
+}
+
#endif // QT_NO_ACCESSIBILITY
QT_END_NAMESPACE
-
diff --git a/src/plugins/accessible/widgets/simplewidgets.h b/src/plugins/accessible/widgets/simplewidgets.h
index 6024788048..be19d8324f 100644
--- a/src/plugins/accessible/widgets/simplewidgets.h
+++ b/src/plugins/accessible/widgets/simplewidgets.h
@@ -195,6 +195,19 @@ protected:
};
#endif
+class QWindowContainer;
+class QAccessibleWindowContainer : public QAccessibleWidget
+{
+public:
+ QAccessibleWindowContainer(QWidget *w);
+ int childCount() const Q_DECL_OVERRIDE;
+ int indexOfChild(const QAccessibleInterface *child) const Q_DECL_OVERRIDE;
+ QAccessibleInterface *child(int i) const Q_DECL_OVERRIDE;
+
+private:
+ QWindowContainer *container() const;
+};
+
#endif // QT_NO_ACCESSIBILITY
QT_END_NAMESPACE
diff --git a/src/plugins/accessible/widgets/widgets.json b/src/plugins/accessible/widgets/widgets.json
index 3969fcd527..9ebcc89d35 100644
--- a/src/plugins/accessible/widgets/widgets.json
+++ b/src/plugins/accessible/widgets/widgets.json
@@ -48,6 +48,7 @@
"QScrollArea",
"QCalendarWidget",
"QDockWidget",
- "QDesktopScreenWidget"
+ "QDesktopScreenWidget",
+ "QWindowContainer"
]
}
diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp
index 1653c0ffdd..e997a49a25 100644
--- a/src/plugins/platforms/android/androidjnimain.cpp
+++ b/src/plugins/platforms/android/androidjnimain.cpp
@@ -325,6 +325,14 @@ namespace QtAndroid
return m_qtTag;
}
+ QString deviceName()
+ {
+ QString manufacturer = QJNIObjectPrivate::getStaticObjectField("android/os/Build", "MANUFACTURER", "Ljava/lang/String;").toString();
+ QString model = QJNIObjectPrivate::getStaticObjectField("android/os/Build", "MODEL", "Ljava/lang/String;").toString();
+
+ return manufacturer + QStringLiteral(" ") + model;
+ }
+
int createSurface(AndroidSurfaceClient *client, const QRect &geometry, bool onTop)
{
QJNIEnvironmentPrivate env;
@@ -369,6 +377,7 @@ namespace QtAndroid
x, y, w, h);
}
+
void destroySurface(int surfaceId)
{
QMutexLocker lock(&m_surfacesMutex);
@@ -385,7 +394,8 @@ namespace QtAndroid
m_destroySurfaceMethodID,
surfaceId);
}
-}
+} // namespace QtAndroid
+
static jboolean startQtAndroidPlugin(JNIEnv* /*env*/, jobject /*object*//*, jobject applicationAssetManager*/)
{
diff --git a/src/plugins/platforms/android/androidjnimain.h b/src/plugins/platforms/android/androidjnimain.h
index 24287df474..eb8dd87ae0 100644
--- a/src/plugins/platforms/android/androidjnimain.h
+++ b/src/plugins/platforms/android/androidjnimain.h
@@ -116,5 +116,6 @@ namespace QtAndroid
const char *methodErrorMsgFmt();
const char *qtTagText();
+ QString deviceName();
}
#endif // ANDROID_APP_H
diff --git a/src/plugins/platforms/android/qandroidplatformintegration.cpp b/src/plugins/platforms/android/qandroidplatformintegration.cpp
index 8925f04818..3dc8632374 100644
--- a/src/plugins/platforms/android/qandroidplatformintegration.cpp
+++ b/src/plugins/platforms/android/qandroidplatformintegration.cpp
@@ -47,20 +47,21 @@
#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
-#include <qpa/qplatformwindow.h>
#include <qpa/qwindowsysteminterface.h>
+#include <qpa/qplatformwindow.h>
+#warning sort the headers
#include "androidjnimain.h"
#include "qabstracteventdispatcher.h"
-#include "qandroidplatformaccessibility.h"
-#include "qandroidplatformclipboard.h"
-#include "qandroidplatformfontdatabase.h"
+#include "qandroidplatformrasterwindow.h"
+#include "qandroidplatformopenglwindow.h"
#include "qandroidplatformbackingstore.h"
+#include "qandroidplatformservices.h"
+#include "qandroidplatformfontdatabase.h"
+#include "qandroidplatformclipboard.h"
+#include "qandroidplatformaccessibility.h"
#include "qandroidplatformopenglcontext.h"
-#include "qandroidplatformopenglwindow.h"
-#include "qandroidplatformrasterwindow.h"
#include "qandroidplatformscreen.h"
-#include "qandroidplatformservices.h"
#include "qandroidplatformtheme.h"
#include "qandroidsystemlocale.h"
@@ -85,6 +86,10 @@ void *QAndroidPlatformNativeInterface::nativeResourceForIntegration(const QByteA
return &m_palettes;
if (resource == "AndroidStyleFonts")
return &m_fonts;
+ if (resource == "AndroidDeviceName") {
+ static QString deviceName = QtAndroid::deviceName();
+ return &deviceName;
+ }
return 0;
}
@@ -119,11 +124,23 @@ QAndroidPlatformIntegration::QAndroidPlatformIntegration(const QStringList &para
m_androidFDB = new QAndroidPlatformFontDatabase();
m_androidPlatformServices = new QAndroidPlatformServices();
+
+#ifndef QT_NO_CLIPBOARD
m_androidPlatformClipboard = new QAndroidPlatformClipboard();
+#endif
m_androidSystemLocale = new QAndroidSystemLocale;
}
+bool QAndroidPlatformIntegration::needsWorkaround()
+{
+ static bool needsWorkaround =
+ QtAndroid::deviceName().compare(QStringLiteral("samsung SM-T211"), Qt::CaseInsensitive) == 0
+ || QtAndroid::deviceName().compare(QStringLiteral("samsung SM-T210"), Qt::CaseInsensitive) == 0
+ || QtAndroid::deviceName().compare(QStringLiteral("samsung SM-T215"), Qt::CaseInsensitive) == 0;
+ return needsWorkaround;
+}
+
bool QAndroidPlatformIntegration::hasCapability(Capability cap) const
{
switch (cap) {
@@ -131,7 +148,10 @@ bool QAndroidPlatformIntegration::hasCapability(Capability cap) const
case ApplicationState: return true;
case NativeWidgets: return true;
case OpenGL: return true;
- case ThreadedOpenGL: return true;
+ case ThreadedOpenGL:
+ if (needsWorkaround())
+ return false;
+ // fall through
default:
return QPlatformIntegration::hasCapability(cap);
}
@@ -173,6 +193,11 @@ QAndroidPlatformIntegration::~QAndroidPlatformIntegration()
delete m_androidPlatformNativeInterface;
delete m_androidFDB;
delete m_androidSystemLocale;
+
+#ifndef QT_NO_CLIPBOARD
+ delete m_androidPlatformClipboard;
+#endif
+
QtAndroid::setAndroidPlatformIntegration(NULL);
}
@@ -184,11 +209,7 @@ QPlatformFontDatabase *QAndroidPlatformIntegration::fontDatabase() const
#ifndef QT_NO_CLIPBOARD
QPlatformClipboard *QAndroidPlatformIntegration::clipboard() const
{
-static QAndroidPlatformClipboard *clipboard = 0;
- if (!clipboard)
- clipboard = new QAndroidPlatformClipboard;
-
- return clipboard;
+ return m_androidPlatformClipboard;
}
#endif
diff --git a/src/plugins/platforms/android/qandroidplatformintegration.h b/src/plugins/platforms/android/qandroidplatformintegration.h
index a6cba7ac16..0dc2415337 100644
--- a/src/plugins/platforms/android/qandroidplatformintegration.h
+++ b/src/plugins/platforms/android/qandroidplatformintegration.h
@@ -121,8 +121,9 @@ public:
QTouchDevice *touchDevice() const { return m_touchDevice; }
void setTouchDevice(QTouchDevice *touchDevice) { m_touchDevice = touchDevice; }
-private:
+ static bool needsWorkaround();
EGLDisplay m_eglDisplay;
+private:
QTouchDevice *m_touchDevice;
@@ -143,7 +144,11 @@ private:
QPainter *m_compositePainter;
QAndroidPlatformNativeInterface *m_androidPlatformNativeInterface;
QAndroidPlatformServices *m_androidPlatformServices;
+
+#ifndef QT_NO_CLIPBOARD
QPlatformClipboard *m_androidPlatformClipboard;
+#endif
+
QAndroidSystemLocale *m_androidSystemLocale;
#ifndef QT_NO_ACCESSIBILITY
mutable QPlatformAccessibility *m_accessibility;
diff --git a/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp b/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp
index d99cafe6b7..59ca69c004 100644
--- a/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp
+++ b/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp
@@ -42,6 +42,7 @@
#include "qandroidplatformopenglcontext.h"
#include "qandroidplatformopenglwindow.h"
+#include "qandroidplatformintegration.h"
#include <QSurface>
#include <QtGui/private/qopenglcontext_p.h>
@@ -64,12 +65,14 @@ void QAndroidPlatformOpenGLContext::swapBuffers(QPlatformSurface *surface)
bool QAndroidPlatformOpenGLContext::makeCurrent(QPlatformSurface *surface)
{
bool ret = QEGLPlatformContext::makeCurrent(surface);
+ QOpenGLContextPrivate *ctx_d = QOpenGLContextPrivate::get(context());
const char *rendererString = reinterpret_cast<const char *>(glGetString(GL_RENDERER));
- if (rendererString != 0 && qstrncmp(rendererString, "Android Emulator", 16) == 0) {
- QOpenGLContextPrivate *ctx_d = QOpenGLContextPrivate::get(context());
+ if (rendererString != 0 && qstrncmp(rendererString, "Android Emulator", 16) == 0)
ctx_d->workaround_missingPrecisionQualifiers = true;
- }
+
+ if (!ctx_d->workaround_brokenFBOReadBack && QAndroidPlatformIntegration::needsWorkaround())
+ ctx_d->workaround_brokenFBOReadBack = true;
return ret;
}
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
index 08505d91a2..f401459cc3 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
@@ -665,8 +665,10 @@ void QCocoaFileDialogHelper::selectNameFilter(const QString &filter)
const int index = options()->nameFilters().indexOf(filter);
if (index != -1) {
QNSOpenSavePanelDelegate *delegate = static_cast<QNSOpenSavePanelDelegate *>(mDelegate);
- if (!delegate)
+ if (!delegate) {
+ options()->setInitiallySelectedNameFilter(filter);
return;
+ }
[delegate->mPopUpButton selectItemAtIndex:index];
[delegate filterChanged:nil];
}
@@ -676,7 +678,7 @@ QString QCocoaFileDialogHelper::selectedNameFilter() const
{
QNSOpenSavePanelDelegate *delegate = static_cast<QNSOpenSavePanelDelegate *>(mDelegate);
if (!delegate)
- return QString();
+ return options()->initiallySelectedNameFilter();
int index = [delegate->mPopUpButton indexOfSelectedItem];
if (index >= options()->nameFilters().count())
return QString();
diff --git a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
index 194394d11a..1c08d4bcb7 100644
--- a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
+++ b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
@@ -254,6 +254,7 @@ QHash<QPlatformTheme::Font, QFont *> qt_mac_createRoleFonts()
fonts.insert(QPlatformTheme::ListBoxFont, qt_mac_qfontForThemeFont(kThemeViewsFont));
fonts.insert(QPlatformTheme::TitleBarFont, qt_mac_qfontForThemeFont(kThemeWindowTitleFont));
fonts.insert(QPlatformTheme::MenuFont, qt_mac_qfontForThemeFont(kThemeMenuItemFont));
+ fonts.insert(QPlatformTheme::MenuBarFont, qt_mac_qfontForThemeFont(kThemeMenuItemFont));
fonts.insert(QPlatformTheme::ComboMenuItemFont, qt_mac_qfontForThemeFont(kThemeSystemFont));
fonts.insert(QPlatformTheme::HeaderViewFont, qt_mac_qfontForThemeFont(kThemeSmallSystemFont));
fonts.insert(QPlatformTheme::TipLabelFont, qt_mac_qfontForThemeFont(kThemeSmallSystemFont));
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h
index 9fbd10dea5..7b9768fcd9 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.h
+++ b/src/plugins/platforms/cocoa/qcocoawindow.h
@@ -219,7 +219,6 @@ public: // for QNSView
QRect m_exposedGeometry;
int m_registerTouchCount;
bool m_resizableTransientParent;
- bool m_overrideBecomeKey;
bool m_hiddenByClipping;
bool m_hiddenByAncestor;
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 8becfb1cc2..70a08bbea5 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -125,8 +125,7 @@ static bool isMouseEvent(NSEvent *ev)
// Only tool or dialog windows should become key:
if (m_cocoaPlatformWindow && m_cocoaPlatformWindow->windowShouldBehaveAsPanel()) {
Qt::WindowType type = m_cocoaPlatformWindow->window()->type();
- if (m_cocoaPlatformWindow->m_overrideBecomeKey
- || type == Qt::Tool || type == Qt::Dialog)
+ if (type == Qt::Tool || type == Qt::Dialog)
return YES;
return NO;
}
@@ -224,7 +223,6 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw)
, m_isExposed(false)
, m_registerTouchCount(0)
, m_resizableTransientParent(false)
- , m_overrideBecomeKey(false)
, m_hiddenByClipping(false)
, m_hiddenByAncestor(false)
, m_alertRequest(NoAlertRequest)
@@ -290,6 +288,7 @@ QCocoaWindow::~QCocoaWindow()
[m_contentView release];
[m_nsWindow release];
[m_nsWindowDelegate release];
+ [m_windowCursor release];
}
QSurfaceFormat QCocoaWindow::format() const
@@ -583,7 +582,7 @@ NSInteger QCocoaWindow::windowLevel(Qt::WindowFlags flags)
// StayOnTop window should appear above Tool windows.
if (flags & Qt::WindowStaysOnTopHint)
- windowLevel = NSPopUpMenuWindowLevel;
+ windowLevel = NSModalPanelWindowLevel;
// Tooltips should appear above StayOnTop windows.
if (type == Qt::ToolTip)
windowLevel = NSScreenSaverWindowLevel;
@@ -882,8 +881,6 @@ bool QCocoaWindow::setKeyboardGrabEnabled(bool grab)
if (!m_nsWindow)
return false;
- m_overrideBecomeKey = grab;
-
if (grab && ![m_nsWindow isKeyWindow])
[m_nsWindow makeKeyWindow];
else if (!grab && [m_nsWindow isKeyWindow])
@@ -896,8 +893,6 @@ bool QCocoaWindow::setMouseGrabEnabled(bool grab)
if (!m_nsWindow)
return false;
- m_overrideBecomeKey = grab;
-
if (grab && ![m_nsWindow isKeyWindow])
[m_nsWindow makeKeyWindow];
else if (!grab && [m_nsWindow isKeyWindow])
@@ -1313,8 +1308,10 @@ void QCocoaWindow::setWindowCursor(NSCursor *cursor)
// for a popup window.) Qt expects the set cursor to "stick":
// it should be accociated with the window until a different
// cursor is set.
-
- m_windowCursor = cursor;
+ if (m_windowCursor != cursor) {
+ [m_windowCursor release];
+ m_windowCursor = [cursor retain];
+ }
// Use the built in cursor rect API if the QCocoaWindow has a NSWindow.
// Othervise, set the cursor if this window is under the mouse. In
diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h
index 403f8dc78a..7e146c5f58 100644
--- a/src/plugins/platforms/cocoa/qnsview.h
+++ b/src/plugins/platforms/cocoa/qnsview.h
@@ -71,6 +71,7 @@ QT_END_NAMESPACE
bool m_subscribesForGlobalFrameNotifications;
QCocoaGLContext *m_glContext;
bool m_shouldSetGLContextinDrawRect;
+ NSString *m_inputSource;
}
- (id)init;
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index b272b4920b..58c732de98 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -90,6 +90,7 @@ static QTouchDevice *touchDevice = 0;
m_shouldSetGLContextinDrawRect = false;
currentCustomDragTypes = 0;
m_sendUpAsRightButton = false;
+ m_inputSource = 0;
if (!touchDevice) {
touchDevice = new QTouchDevice;
@@ -108,6 +109,7 @@ static QTouchDevice *touchDevice = 0;
m_maskData = 0;
m_window = 0;
m_subscribesForGlobalFrameNotifications = false;
+ [m_inputSource release];
[[NSNotificationCenter defaultCenter] removeObserver:self];
delete currentCustomDragTypes;
@@ -859,6 +861,12 @@ Q_GLOBAL_STATIC(QCocoaTabletDeviceDataHash, tabletDeviceDataHash)
uint deviceId = [theEvent deviceID];
if (!tabletDeviceDataHash->contains(deviceId)) {
+ // 10.6 sends tablet events for trackpad interaction, but
+ // not proximity events. Silence the warning to prevent
+ // flooding the console.
+ if (QSysInfo::QSysInfo::MacintoshVersion == QSysInfo::MV_10_6)
+ return;
+
qWarning("QNSView handleTabletEvent: This tablet device is unknown"
" (received no proximity event for it). Discarding event.");
return;
@@ -1245,6 +1253,10 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
Qt::KeyboardModifiers modifiers = [QNSView convertKeyModifiers: nativeModifiers];
NSString *charactersIgnoringModifiers = [nsevent charactersIgnoringModifiers];
NSString *characters = [nsevent characters];
+ if (m_inputSource != characters) {
+ [m_inputSource release];
+ m_inputSource = [characters retain];
+ }
// There is no way to get the scan code from carbon/cocoa. But we cannot
// use the value 0, since it indicates that the event originates from somewhere
@@ -1375,6 +1387,11 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
{
Q_UNUSED(replacementRange)
+ if (m_sendKeyEvent && m_composingText.isEmpty() && [aString isEqualToString:m_inputSource]) {
+ // don't send input method events for simple text input (let handleKeyEvent send key events instead)
+ return;
+ }
+
QString commitString;
if ([aString length]) {
if ([aString isKindOfClass:[NSAttributedString class]]) {
diff --git a/src/plugins/platforms/minimalegl/main.cpp b/src/plugins/platforms/minimalegl/main.cpp
index be85fa082e..ce8838ced0 100644
--- a/src/plugins/platforms/minimalegl/main.cpp
+++ b/src/plugins/platforms/minimalegl/main.cpp
@@ -49,17 +49,9 @@ class QMinimalEglIntegrationPlugin : public QPlatformIntegrationPlugin
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.2" FILE "minimalegl.json")
public:
- QStringList keys() const;
QPlatformIntegration *create(const QString&, const QStringList&);
};
-QStringList QMinimalEglIntegrationPlugin::keys() const
-{
- QStringList list;
- list << "MinimalEgl";
- return list;
-}
-
QPlatformIntegration* QMinimalEglIntegrationPlugin::create(const QString& system, const QStringList& paramList)
{
Q_UNUSED(paramList);
diff --git a/src/plugins/platforms/qnx/qqnxeglwindow.cpp b/src/plugins/platforms/qnx/qqnxeglwindow.cpp
index 931fe0b288..45a7bab871 100644
--- a/src/plugins/platforms/qnx/qqnxeglwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxeglwindow.cpp
@@ -63,6 +63,13 @@ QQnxEglWindow::QQnxEglWindow(QWindow *window, screen_context_t context, bool nee
m_eglSurface(EGL_NO_SURFACE)
{
initWindow();
+
+ // Set window usage
+ const int val = SCREEN_USAGE_OPENGL_ES2;
+ const int result = screen_set_window_property_iv(nativeHandle(), SCREEN_PROPERTY_USAGE, &val);
+ if (result != 0)
+ qFatal("QQnxEglWindow: failed to set window alpha usage, errno=%d", errno);
+
m_requestedBufferSize = screen()->rootWindow() == this ?
screen()->geometry().size() : window->geometry().size();
}
diff --git a/src/plugins/platforms/qnx/qqnxrasterwindow.cpp b/src/plugins/platforms/qnx/qqnxrasterwindow.cpp
index e5d7846253..2c0639e8e3 100644
--- a/src/plugins/platforms/qnx/qqnxrasterwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxrasterwindow.cpp
@@ -62,6 +62,12 @@ QQnxRasterWindow::QQnxRasterWindow(QWindow *window, screen_context_t context, bo
m_previousBufferIndex(-1)
{
initWindow();
+
+ // Set window usage
+ const int val = SCREEN_USAGE_NATIVE | SCREEN_USAGE_READ | SCREEN_USAGE_WRITE;
+ const int result = screen_set_window_property_iv(nativeHandle(), SCREEN_PROPERTY_USAGE, &val);
+ if (result != 0)
+ qFatal("QQnxEglWindow: failed to set window alpha usage, errno=%d", errno);
}
void QQnxRasterWindow::post(const QRegion &dirty)
diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp
index 1bffeca154..a6c69164c7 100644
--- a/src/plugins/platforms/qnx/qqnxscreen.cpp
+++ b/src/plugins/platforms/qnx/qqnxscreen.cpp
@@ -564,7 +564,7 @@ void QQnxScreen::updateHierarchy()
// After a hierarchy update, we need to force a flush on all screens.
// Right now, all screens share a context.
- screen_flush_context( m_screenContext, 0 );
+ screen_flush_context(m_screenContext, 0);
}
void QQnxScreen::adjustOrientation()
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp
index 00782ed050..0b257cc48f 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.cpp
+++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp
@@ -747,10 +747,10 @@ bool QWindowsKeyMapper::translateKeyEvent(QWindow *widget, HWND hwnd,
return true;
}
- // WM_CHAR messages already contain the character in question so there is
+ // WM_(IME_)CHAR messages already contain the character in question so there is
// no need to fiddle with our key map. In any other case add this key to the
// keymap if it is not present yet.
- if (msg.message != WM_CHAR)
+ if (msg.message != WM_CHAR && msg.message != WM_IME_CHAR)
updateKeyMap(msg);
MSG peekedMsg;
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 433d6d5948..3d79f742b3 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -1548,7 +1548,7 @@ void QXcbWindow::handleClientMessageEvent(const xcb_client_message_event_t *even
handleXEmbedMessage(event);
} else if (event->type == atom(QXcbAtom::_NET_ACTIVE_WINDOW)) {
connection()->setFocusWindow(this);
- QWindowSystemInterface::handleWindowActivated(window());
+ QWindowSystemInterface::handleWindowActivated(window(), Qt::ActiveWindowFocusReason);
} else if (event->type == atom(QXcbAtom::MANAGER)
|| event->type == atom(QXcbAtom::_NET_WM_STATE)
|| event->type == atom(QXcbAtom::WM_CHANGE_STATE)) {
@@ -1865,14 +1865,14 @@ void QXcbWindow::handleFocusInEvent(const xcb_focus_in_event_t *)
QWindow *w = window();
w = static_cast<QWindowPrivate *>(QObjectPrivate::get(w))->eventReceiver();
connection()->setFocusWindow(static_cast<QXcbWindow *>(w->handle()));
- QWindowSystemInterface::handleWindowActivated(w);
+ QWindowSystemInterface::handleWindowActivated(w, Qt::ActiveWindowFocusReason);
}
static bool focusInPeeker(QXcbConnection *connection, xcb_generic_event_t *event)
{
if (!event) {
// FocusIn event is not in the queue, proceed with FocusOut normally.
- QWindowSystemInterface::handleWindowActivated(0);
+ QWindowSystemInterface::handleWindowActivated(0, Qt::ActiveWindowFocusReason);
return true;
}
uint response_type = event->response_type & ~0x80;
diff --git a/src/sql/doc/src/sql-driver.qdoc b/src/sql/doc/src/sql-driver.qdoc
index b7617792f8..9858e30ff9 100644
--- a/src/sql/doc/src/sql-driver.qdoc
+++ b/src/sql/doc/src/sql-driver.qdoc
@@ -175,73 +175,6 @@
built in release mode only. If you are expecting a debug version
to be built as well, don't use the \c{"-o Makefile"} option.
- \section3 How to build the MySQL driver for MinGW users
-
- The following steps have been used successfully for WinXP SP3. In
- this example, Qt 4.6.2 is shown.
-
- \list
-
- \li Download the following components:
- \list
- \li \c{MinGW-5.1.6.exe}
- \li \c{mingw-utils-0.3.tar.gz}
- \li Qt sources, e.g. \c{qt-everywhere-opensource-src-4.6.2.zip}
- \li \c{mysql-5.1.35-win32.msi}
- \endlist
-
- \li Install \c{MinGW-5.1.6.exe} in, e.g. \c{C:\MinGW}.
-
- \li Extract \c{mingw-utils-0.3.tar.gz} into, e.g. \c{C:\MinGW}.
-
- \li Add the path for \c{MinGW-5.1.6.exe} to your \c{PATH} variable,
- e.g. \c{C:\MinGW\bin;}
-
- \li Extract the Qt sources, (\c{qt-everywhere-opensource-src-4.6.2.zip}),
- into, e.g. \c{C:\Qt}.
-
- \li Add the path for the eventual Qt binary to your \c{PATH} variable,
- e.g. \c{C:\Qt\4.6.2\bin;}.
-
- \li Install MySQL (\c{mysql-5.1.35-win32.msi}), customizing the
- components. Select only the headers and libraries. Install in,
- e.g. \c{C:\MySQL\MySQL51}.
-
- \li Open the DOS prompt, go to \c{C:\MySQL\MySQL51\lib\opt}, and run
- the following commands:
- \list
- \li \c{reimp -d libmysql.lib}
- \li \c{dlltool -k -d libmysql.def -l libmysql.a}
- \endlist
-
- \li Open the DOS prompt, go to \c{C:\Qt\4.6.2} and run the following commands:
- \list
- \li \c{configure.exe -debug-and-release -platform win32-g++ -qt-sql-mysql
- -l mysql -I C:\MySQL\MySQL51\include -L C:\MySQL\MySQL51\lib\opt}
- \li \c{mingw32-make sub-src}
- \endlist
- This step takes a long time.
-
- \li Open the DOS prompt, go to
- \c{C:\Qt\4.6.2\src\plugins\sqldrivers\mysql} and run the
- following command:
- \list
- \li \c{qmake "INCLUDEPATH+=C:/MySQL/MySQL51/include" "LIBS+=-L. mysql" mysql.pro}
- \endlist
-
- \li Now the following libraries are ready in \c{C:\Qt\4.6.2\plugins\sqldrivers}.
- \list
- \li \c{libqsqlmysql4.a}
- \li \c{libqsqlmysqld4.a}
- \li \c{qsqlmysql4.dll}
- \li \c{qsqlmysqld4.dll}
- \endlist
- To use the SDK and QtCreator directly, copy these libraries to
- your \c{C:\Qt\...\qt\plugins\sqldrivers\}, and copy
- \c{C:\MySQL\MySQL51\lib\opt\libmysql.dll} to your \c{C:\Qt\...\qt\bin\}.
-
- \endlist
-
\target QOCI
\section2 QOCI for the Oracle Call Interface (OCI)
diff --git a/src/testlib/doc/qttestlib.qdocconf b/src/testlib/doc/qttestlib.qdocconf
index 250d237f12..92e5c97aab 100644
--- a/src/testlib/doc/qttestlib.qdocconf
+++ b/src/testlib/doc/qttestlib.qdocconf
@@ -27,7 +27,7 @@ qhp.QtTestLib.subprojects.classes.sortPages = true
tagfile = ../../../doc/qttestlib/qttestlib.tags
-depends += qtcore qtdoc qtwidgets qtgui qtquick
+depends += qtcore qtdoc qtwidgets qtgui qmake qtquick
headerdirs += ..
diff --git a/src/testlib/doc/src/qttest-index.qdoc b/src/testlib/doc/src/qttest-index.qdoc
index 4cf0726429..8dc51f8696 100644
--- a/src/testlib/doc/src/qttest-index.qdoc
+++ b/src/testlib/doc/src/qttest-index.qdoc
@@ -56,7 +56,7 @@
\list
\li \l{Qt Test C++ Classes}{C++ Classes}
- \li \l{Qt Quick Test}{QML Types}
+ \li \l{Qt Quick Test QML Types}{QML Types}
\endlist
*/
diff --git a/src/testlib/doc/src/qttestlib-manual.qdoc b/src/testlib/doc/src/qttestlib-manual.qdoc
index 613d2c220c..bdd9769175 100644
--- a/src/testlib/doc/src/qttestlib-manual.qdoc
+++ b/src/testlib/doc/src/qttestlib-manual.qdoc
@@ -120,7 +120,7 @@
\snippet code/doc_src_qtestlib.pro 2
- See \l{qmake Common Projects#building-a-testcase}{the qmake manual} for
+ See the \l{Building a Testcase}{qmake manual} for
more information about \c{make check}.
If you are using other build tools, make sure that you add the location
diff --git a/src/testlib/qtestresult.cpp b/src/testlib/qtestresult.cpp
index d94b2bf85c..a9abca0ef8 100644
--- a/src/testlib/qtestresult.cpp
+++ b/src/testlib/qtestresult.cpp
@@ -46,8 +46,10 @@
#include <QtTest/qtestdata.h>
#include <QtTest/qtestassert.h>
+#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <wchar.h>
QT_BEGIN_NAMESPACE
@@ -268,8 +270,8 @@ bool QTestResult::compare(bool success, const char *failureMsg,
if (success && QTest::expectFailMode) {
qsnprintf(msg, 1024, "QCOMPARE(%s, %s) returned TRUE unexpectedly.", actual, expected);
} else if (val1 || val2) {
- size_t len1 = strlen(actual);
- size_t len2 = strlen(expected);
+ size_t len1 = mbstowcs(NULL, actual, 0);
+ size_t len2 = mbstowcs(NULL, expected, 0);
qsnprintf(msg, 1024, "%s\n Actual (%s)%*s %s\n Expected (%s)%*s %s",
failureMsg,
actual, qMax(len1, len2) - len1 + 1, ":", val1 ? val1 : "<null>",
diff --git a/src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc b/src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc
index 1f777ea441..446b441675 100644
--- a/src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc
+++ b/src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc
@@ -314,8 +314,7 @@
\endcode
See how QDoc renders this property on the reference page for the
- \l {changes-prop} {State}
- type.
+ \l {State::changes}{State} type.
\target obsolete-command
\section1 \\obsolete
diff --git a/src/tools/qdoc/doc/qdoc-manual-intro.qdoc b/src/tools/qdoc/doc/qdoc-manual-intro.qdoc
index ad3779048a..f681c0a574 100644
--- a/src/tools/qdoc/doc/qdoc-manual-intro.qdoc
+++ b/src/tools/qdoc/doc/qdoc-manual-intro.qdoc
@@ -79,9 +79,8 @@
* /
\endcode
- From the QDoc comment above, QDoc generates the HTML page
- \l {details}
- {QObject Class Reference}.
+ From the QDoc comment above, QDoc generates the HTML \l {QObject}
+ {QObject class reference} page.
This manual explains how to use the QDoc commands in QDoc comments
to embed good documentation in your source files. It also explains
diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp
index 3cbba788c8..b14a79dfab 100644
--- a/src/tools/qdoc/generator.cpp
+++ b/src/tools/qdoc/generator.cpp
@@ -1013,12 +1013,13 @@ void Generator::generateInnerNode(InnerNode* node)
}
}
- NodeList::ConstIterator c = node->childNodes().constBegin();
- while (c != node->childNodes().constEnd()) {
- if ((*c)->isInnerNode() && (*c)->access() != Node::Private) {
- generateInnerNode((InnerNode*)*c);
+ int i = 0;
+ while (i < node->childNodes().count()) {
+ Node *c = node->childNodes().at(i);
+ if (c->isInnerNode() && c->access() != Node::Private) {
+ generateInnerNode((InnerNode*)c);
}
- ++c;
+ ++i;
}
}
diff --git a/src/tools/qdoc/helpprojectwriter.cpp b/src/tools/qdoc/helpprojectwriter.cpp
index 44292f84bb..d46f887518 100644
--- a/src/tools/qdoc/helpprojectwriter.cpp
+++ b/src/tools/qdoc/helpprojectwriter.cpp
@@ -657,7 +657,8 @@ void HelpProjectWriter::generateProject(HelpProject &project)
if (node == 0)
node = qdb_->findNode(QStringList("index.html"));
QString indexPath;
- if (node)
+ // Never use a collision node as a landing page
+ if (node && !node->isCollisionNode())
indexPath = gen_->fullDocumentLocation(node,Generator::useOutputSubdirs());
else
indexPath = "index.html";
diff --git a/src/widgets/doc/qtwidgets.qdocconf b/src/widgets/doc/qtwidgets.qdocconf
index b742856892..508a257fa5 100644
--- a/src/widgets/doc/qtwidgets.qdocconf
+++ b/src/widgets/doc/qtwidgets.qdocconf
@@ -27,7 +27,7 @@ qhp.QtWidgets.subprojects.classes.sortPages = true
tagfile = ../../../doc/qtwidgets/qtwidgets.tags
-depends += qtcore qtgui qtdoc qtsql qtdesigner
+depends += qtcore qtgui qtdoc qtsql qtdesigner qtquick
headerdirs += ..
diff --git a/src/widgets/doc/src/gestures.qdoc b/src/widgets/doc/src/gestures.qdoc
index ed7e78ec5a..9126152c42 100644
--- a/src/widgets/doc/src/gestures.qdoc
+++ b/src/widgets/doc/src/gestures.qdoc
@@ -67,7 +67,7 @@
required gesture type. The standard types are defined by the Qt::GestureType
enum and include many commonly used gestures.
- \snippet ../../../examples/gestures/imagegestures/imagewidget.cpp enable gestures
+ \snippet gestures/imagegestures/imagewidget.cpp enable gestures
In the above code, the gestures are set up in the constructor of the target object
itself.
@@ -124,18 +124,18 @@
\l{QWidget::}{event()} handler function and delegates gesture events to a
specialized gestureEvent() function:
- \snippet ../../../examples/gestures/imagegestures/imagewidget.cpp event handler
+ \snippet gestures/imagegestures/imagewidget.cpp event handler
The gesture events delivered to the target object can be examined individually
and dealt with appropriately:
- \snippet ../../../examples/gestures/imagegestures/imagewidget.cpp gesture event handler
+ \snippet gestures/imagegestures/imagewidget.cpp gesture event handler
Responding to a gesture is simply a matter of obtaining the QGesture object
delivered in the QGestureEvent sent to the target object and examining the
information it contains.
- \snippet ../../../examples/gestures/imagegestures/imagewidget.cpp swipe function
+ \snippet gestures/imagegestures/imagewidget.cpp swipe function
Here, we examine the direction in which the user swiped the widget and modify
its contents accordingly.
diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp
index 8238e5f6d4..135f89d4ac 100644
--- a/src/widgets/itemviews/qlistview.cpp
+++ b/src/widgets/itemviews/qlistview.cpp
@@ -1842,18 +1842,18 @@ void QCommonListViewBase::paintDragDrop(QPainter *painter)
}
#endif
-void QCommonListViewBase::updateHorizontalScrollBar(const QSize & /*step*/)
+void QCommonListViewBase::updateHorizontalScrollBar(const QSize &step)
{
+ horizontalScrollBar()->setSingleStep(step.width() + spacing());
horizontalScrollBar()->setPageStep(viewport()->width());
horizontalScrollBar()->setRange(0, contentsSize.width() - viewport()->width());
- // we do not want to overwrite (a possible user set) single step
}
-void QCommonListViewBase::updateVerticalScrollBar(const QSize & /*step*/)
+void QCommonListViewBase::updateVerticalScrollBar(const QSize &step)
{
+ verticalScrollBar()->setSingleStep(step.height() + spacing());
verticalScrollBar()->setPageStep(viewport()->height());
verticalScrollBar()->setRange(0, contentsSize.height() - viewport()->height());
- // we do not want to overwrite (a possible user set) single step
}
void QCommonListViewBase::scrollContentsBy(int dx, int dy, bool /*scrollElasticBand*/)
diff --git a/src/widgets/itemviews/qtableview.cpp b/src/widgets/itemviews/qtableview.cpp
index 08600b3ef7..a252428a81 100644
--- a/src/widgets/itemviews/qtableview.cpp
+++ b/src/widgets/itemviews/qtableview.cpp
@@ -2170,7 +2170,7 @@ void QTableView::updateGeometries()
} else { // ScrollPerPixel
horizontalScrollBar()->setPageStep(vsize.width());
horizontalScrollBar()->setRange(0, horizontalLength - vsize.width());
- // here we do not want to overwrite (a possible user set) single step
+ horizontalScrollBar()->setSingleStep(qMax(vsize.width() / (columnsInViewport + 1), 2));
}
// vertical scroll bar
@@ -2198,7 +2198,7 @@ void QTableView::updateGeometries()
} else { // ScrollPerPixel
verticalScrollBar()->setPageStep(vsize.height());
verticalScrollBar()->setRange(0, verticalLength - vsize.height());
- // here we do not want to overwrite (a possible user set) single step
+ verticalScrollBar()->setSingleStep(qMax(vsize.height() / (rowsInViewport + 1), 2));
}
d->geometryRecursionBlock = false;
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp
index 624408289e..dd430435f3 100644
--- a/src/widgets/itemviews/qtreeview.cpp
+++ b/src/widgets/itemviews/qtreeview.cpp
@@ -1586,7 +1586,7 @@ int QTreeViewPrivate::widthHintForIndex(const QModelIndex &index, int hint, cons
/*!
Draws the row in the tree view that contains the model item \a index,
- using the \a painter given. The \a option control how the item is
+ using the \a painter given. The \a option controls how the item is
displayed.
\sa setAlternatingRowColors()
@@ -3685,7 +3685,7 @@ void QTreeViewPrivate::updateScrollBars()
}
vbar->setRange(0, contentsHeight - viewportSize.height());
vbar->setPageStep(viewportSize.height());
- // here we do not want to overwrite (a possible user set) single step
+ vbar->setSingleStep(qMax(viewportSize.height() / (itemsInViewport + 1), 2));
}
const int columnCount = header->count();
@@ -3711,7 +3711,7 @@ void QTreeViewPrivate::updateScrollBars()
viewportSize = maxSize;
hbar->setPageStep(viewportSize.width());
hbar->setRange(0, qMax(horizontalLength - viewportSize.width(), 0));
- // here we do not want to overwrite (a possible user set) single step
+ hbar->setSingleStep(qMax(viewportSize.width() / (columnsInViewport + 1), 2));
}
}
diff --git a/src/widgets/kernel/qaction.cpp b/src/widgets/kernel/qaction.cpp
index 3e76699aca..c0e3e98ae1 100644
--- a/src/widgets/kernel/qaction.cpp
+++ b/src/widgets/kernel/qaction.cpp
@@ -270,7 +270,7 @@ void QActionPrivate::setShortcutEnabled(bool enable, QShortcutMap &map)
\value AboutQtRole This action matches handles the "About Qt" menu item.
\value AboutRole This action should be placed where the "About" menu item is in the application menu. The text of
the menu item will be set to "About <application name>". The application name is fetched from the
- \c{Info.plist} file in the application's bundle (See \l{Deploying an Application on Mac OS X}).
+ \c{Info.plist} file in the application's bundle (See \l{Qt for Mac OS X - Deployment}).
\value PreferencesRole This action should be placed where the "Preferences..." menu item is in the application menu.
\value QuitRole This action should be placed where the Quit menu item is in the application menu.
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index dbeaef5bee..def3589d9a 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -7004,7 +7004,7 @@ void QWidget::setUpdatesEnabled(bool enable)
depending on the platform's default behavior for the window flags.
\sa raise(), showEvent(), hide(), setVisible(), showMinimized(), showMaximized(),
- showNormal(), isVisible(), windowFlags(), flags()
+ showNormal(), isVisible(), windowFlags()
*/
void QWidget::show()
{
diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp
index 0fd794cc02..0a4bc990e6 100644
--- a/src/widgets/kernel/qwidget_qpa.cpp
+++ b/src/widgets/kernel/qwidget_qpa.cpp
@@ -768,7 +768,10 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
}
}
- if (isMove) {
+ // generate a move event for QWidgets without window handles. QWidgets with native
+ // window handles already receive a move event from
+ // QGuiApplicationPrivate::processGeometryChangeEvent.
+ if (isMove && (!q->windowHandle() || q->testAttribute(Qt::WA_DontShowOnScreen))) {
QMoveEvent e(q->pos(), oldPos);
QApplication::sendEvent(q, &e);
}
@@ -876,9 +879,15 @@ int QWidget::metric(PaintDeviceMetric m) const
}
/*!
- \preliminary
+ If this is a native widget, return the associated QWindow.
+ Otherwise return null.
- Returns the QPlatformWindow this widget will be drawn into.
+ Native widgets include toplevel widgets, QGLWidget, and child widgets
+ on which winId() was called.
+
+ \since 5.0
+
+ \sa winId()
*/
QWindow *QWidget::windowHandle() const
{
diff --git a/src/widgets/kernel/qwindowcontainer.cpp b/src/widgets/kernel/qwindowcontainer.cpp
index 399f089e0f..a4b3caf78d 100644
--- a/src/widgets/kernel/qwindowcontainer.cpp
+++ b/src/widgets/kernel/qwindowcontainer.cpp
@@ -200,7 +200,11 @@ QWindowContainer::QWindowContainer(QWindow *embeddedWindow, QWidget *parent, Qt:
connect(QGuiApplication::instance(), SIGNAL(focusWindowChanged(QWindow *)), this, SLOT(focusWindowChanged(QWindow *)));
}
-
+QWindow *QWindowContainer::containedWindow() const
+{
+ Q_D(const QWindowContainer);
+ return d->window;
+}
/*!
\internal
diff --git a/src/widgets/kernel/qwindowcontainer_p.h b/src/widgets/kernel/qwindowcontainer_p.h
index a21f9bd35a..014b163f97 100644
--- a/src/widgets/kernel/qwindowcontainer_p.h
+++ b/src/widgets/kernel/qwindowcontainer_p.h
@@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
class QWindowContainerPrivate;
-class QWindowContainer : public QWidget
+class Q_WIDGETS_EXPORT QWindowContainer : public QWidget
{
Q_OBJECT
Q_DECLARE_PRIVATE(QWindowContainer)
@@ -56,6 +56,7 @@ class QWindowContainer : public QWidget
public:
explicit QWindowContainer(QWindow *embeddedWindow, QWidget *parent = 0, Qt::WindowFlags f = 0);
~QWindowContainer();
+ QWindow *containedWindow() const;
static void toplevelAboutToBeDestroyed(QWidget *parent);
static void parentWasChanged(QWidget *parent);
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 2d7107598f..9c2163ac8f 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -1598,7 +1598,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
if (toolbutton->toolButtonStyle == Qt::ToolButtonTextUnderIcon) {
pr.setHeight(pmSize.height() + 6);
- tr.adjust(0, pr.height() - 1, 0, -2);
+ tr.adjust(0, pr.height() - 1, 0, -1);
pr.translate(shiftX, shiftY);
if (!hasArrow) {
proxy()->drawItemPixmap(p, pr, Qt::AlignCenter, pm);
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index d13339b555..fa49bcb884 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -2077,6 +2077,10 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW
ret = 0;
break;
+ case PM_MenuBarPanelWidth:
+ ret = 0;
+ break;
+
case QStyle::PM_MenuDesktopFrameWidth:
ret = 5;
break;
@@ -6259,6 +6263,10 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
sz = QSize(w, h);
}
break;
+ case CT_MenuBarItem:
+ if (!sz.isEmpty())
+ sz += QSize(12, 4); // Constants from QWindowsStyle
+ break;
case CT_ToolButton:
sz.rwidth() += 10;
sz.rheight() += 10;
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 2f36e0e53c..6bd0ba37c8 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -4710,7 +4710,9 @@ int QStyleSheetStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const
break;
case PM_TabBarBaseOverlap: {
- const QWidget *tabWidget = qobject_cast<const QTabWidget *>(w) ? w : w->parentWidget();
+ const QWidget *tabWidget = qobject_cast<const QTabWidget *>(w);
+ if (!tabWidget && w)
+ tabWidget = w->parentWidget();
if (hasStyleRule(tabWidget, PseudoElement_TabWidgetPane)) {
return 0;
}
diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp
index 5827a01151..6c7b71bd74 100644
--- a/src/widgets/styles/qwindowsvistastyle.cpp
+++ b/src/widgets/styles/qwindowsvistastyle.cpp
@@ -1879,7 +1879,11 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle
XPThemeData ftheme(widget, painter,
QWindowsXPStylePrivate::EditTheme,
partId, stateId, r);
- ftheme.noContent = true;
+ // The spinbox in Windows QStyle is drawn with frameless QLineEdit inside it
+ // That however breaks with QtQuickControls where this results in transparent
+ // spinbox background, so if there's no "widget" passed (QtQuickControls case),
+ // let ftheme.noContent be false, which fixes the spinbox rendering in QQC
+ ftheme.noContent = (widget != NULL);
d->drawBackground(ftheme);
}
if (sub & SC_SpinBoxUp) {
diff --git a/src/widgets/widgets.pro b/src/widgets/widgets.pro
index e3222b49e8..0b289c75ae 100644
--- a/src/widgets/widgets.pro
+++ b/src/widgets/widgets.pro
@@ -1,4 +1,5 @@
TARGET = QtWidgets
+wince*:ORIG_TARGET = $$TARGET
QT = core-private gui-private
MODULE_CONFIG = uic
diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp
index 0638981a9c..07db78c06c 100644
--- a/src/widgets/widgets/qmainwindow.cpp
+++ b/src/widgets/widgets/qmainwindow.cpp
@@ -60,6 +60,9 @@
#include <private/qwidget_p.h>
#include "qtoolbar_p.h"
#include "qwidgetanimator_p.h"
+#ifdef Q_OS_OSX
+#include <qpa/qplatformnativeinterface.h>
+#endif
#ifdef Q_WS_MAC
#include <private/qt_mac_p.h>
#include <private/qt_cocoa_helpers_mac_p.h>
@@ -76,6 +79,9 @@ class QMainWindowPrivate : public QWidgetPrivate
public:
inline QMainWindowPrivate()
: layout(0), explicitIconSize(false), toolButtonStyle(Qt::ToolButtonIconOnly)
+#ifdef Q_OS_OSX
+ , useUnifiedToolBar(false)
+#endif
#ifdef Q_WS_MAC
, useHIToolBar(false)
, activateUnifiedToolbarAfterFullScreen(false)
@@ -88,6 +94,9 @@ public:
QSize iconSize;
bool explicitIconSize;
Qt::ToolButtonStyle toolButtonStyle;
+#ifdef Q_OS_OSX
+ bool useUnifiedToolBar;
+#endif
#ifdef Q_WS_MAC
bool useHIToolBar;
bool activateUnifiedToolbarAfterFullScreen;
@@ -1492,16 +1501,29 @@ bool QMainWindow::event(QEvent *event)
/*!
\property QMainWindow::unifiedTitleAndToolBarOnMac
\brief whether the window uses the unified title and toolbar look on Mac OS X
- \since 4.3
- \obsolete
-
- This property is not implemented in Qt 5. Setting it has no effect.
-
- A replacement API (QtMacUnifiedToolBar) is available in QtMacExtras at
- http://qt.gitorious.org/qtplayground/qtmacextras
+ \since 5.2
*/
void QMainWindow::setUnifiedTitleAndToolBarOnMac(bool set)
{
+#ifdef Q_OS_OSX
+ Q_D(QMainWindow);
+ if (isWindow()) {
+ QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface();
+ QPlatformNativeInterface::NativeResourceForIntegrationFunction function =
+ nativeInterface->nativeResourceFunctionForIntegration("setContentBorderThickness");
+ if (!function)
+ return; // Not Cocoa platform plugin.
+
+ createWinId();
+
+ d->useUnifiedToolBar = set;
+
+ const int toolBarHeight = 50;
+ typedef void (*SetContentBorderThicknessFunction)(QWindow *window, int topThickness, int bottomThickness);
+ (reinterpret_cast<SetContentBorderThicknessFunction>(function))(window()->windowHandle(), toolBarHeight, 0);
+ }
+#endif
+
#ifdef Q_WS_MAC
Q_D(QMainWindow);
if (!isWindow() || d->useHIToolBar == set || QSysInfo::MacintoshVersion < QSysInfo::MV_10_3)
@@ -1534,6 +1556,9 @@ void QMainWindow::setUnifiedTitleAndToolBarOnMac(bool set)
bool QMainWindow::unifiedTitleAndToolBarOnMac() const
{
+#ifdef Q_OS_OSX
+ return d_func()->useUnifiedToolBar;
+#endif
#ifdef Q_WS_MAC
return d_func()->useHIToolBar && !testAttribute(Qt::WA_MacBrushedMetal) && !(windowFlags() & Qt::FramelessWindowHint);
#endif
@@ -1655,9 +1680,7 @@ QMenu *QMainWindow::createPopupMenu()
for (int i = 0; i < toolbars.size(); ++i) {
QToolBar *toolBar = toolbars.at(i);
if (toolBar->parentWidget() == this
- && (!d->layout->layoutState.toolBarAreaLayout.indexOf(toolBar).isEmpty()
- || (unifiedTitleAndToolBarOnMac()
- && toolBarArea(toolBar) == Qt::TopToolBarArea))) {
+ && (!d->layout->layoutState.toolBarAreaLayout.indexOf(toolBar).isEmpty())) {
menu->addAction(toolbars.at(i)->toggleViewAction());
}
}
diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp
index 189f4c456b..03ab490823 100644
--- a/src/widgets/widgets/qmenubar.cpp
+++ b/src/widgets/widgets/qmenubar.cpp
@@ -666,8 +666,8 @@ void QMenuBar::initStyleOption(QStyleOptionMenuItem *option, const QAction *acti
\b{Note:} The text used for the application name in the menu
bar is obtained from the value set in the \c{Info.plist} file in
- the application's bundle. See \l{Deploying an Application on
- Mac OS X} for more information.
+ the application's bundle. See \l{Qt for Mac OS X - Deployment}
+ for more information.
\section1 QMenuBar on Windows CE
diff --git a/src/widgets/widgets/qplaintextedit.cpp b/src/widgets/widgets/qplaintextedit.cpp
index 6b9e2640db..89374b1c41 100644
--- a/src/widgets/widgets/qplaintextedit.cpp
+++ b/src/widgets/widgets/qplaintextedit.cpp
@@ -803,6 +803,7 @@ void QPlainTextEditPrivate::init(const QString &txt)
q->setFocusPolicy(Qt::WheelFocus);
q->setAttribute(Qt::WA_KeyCompression);
q->setAttribute(Qt::WA_InputMethodEnabled);
+ q->setInputMethodHints(Qt::ImhMultiLine);
#ifndef QT_NO_CURSOR
viewport->setCursor(Qt::IBeamCursor);
diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp
index dfd1f1022c..b47d65f561 100644
--- a/src/widgets/widgets/qtabbar.cpp
+++ b/src/widgets/widgets/qtabbar.cpp
@@ -1681,6 +1681,7 @@ void QTabBar::moveTab(int from, int to)
d->tabList[i].lastTab = d->calculateNewPosition(from, to, d->tabList[i].lastTab);
// update external variables
+ int previousIndex = d->currentIndex;
d->currentIndex = d->calculateNewPosition(from, to, d->currentIndex);
// If we are in the middle of a drag update the dragStartPosition
@@ -1699,6 +1700,8 @@ void QTabBar::moveTab(int from, int to)
d->layoutWidgets(start);
update();
emit tabMoved(from, to);
+ if (previousIndex != d->currentIndex)
+ emit currentChanged(d->currentIndex);
emit tabLayoutChange();
}
diff --git a/src/widgets/widgets/qtoolbararealayout.cpp b/src/widgets/widgets/qtoolbararealayout.cpp
index afb4244d0c..5ec76569aa 100644
--- a/src/widgets/widgets/qtoolbararealayout.cpp
+++ b/src/widgets/widgets/qtoolbararealayout.cpp
@@ -655,9 +655,7 @@ QRect QToolBarAreaLayout::fitLayout()
docks[QInternal::BottomDock].rect = QRect(rect.left(), center.bottom() + 1,
rect.width(), bottom_hint.height());
- if (!mainWindow->unifiedTitleAndToolBarOnMac()) {
- docks[QInternal::TopDock].fitLayout();
- }
+ docks[QInternal::TopDock].fitLayout();
docks[QInternal::LeftDock].fitLayout();
docks[QInternal::RightDock].fitLayout();
docks[QInternal::BottomDock].fitLayout();
@@ -1307,8 +1305,6 @@ bool QToolBarAreaLayout::restoreState(QDataStream &stream, const QList<QToolBar*
QList<QToolBar*> toolBars = _toolBars;
int lines;
stream >> lines;
- if (!testing)
- testing = mainWindow->unifiedTitleAndToolBarOnMac();
for (int j = 0; j < lines; ++j) {
int pos;
@@ -1319,7 +1315,7 @@ bool QToolBarAreaLayout::restoreState(QDataStream &stream, const QList<QToolBar*
stream >> cnt;
QToolBarAreaLayoutInfo &dock = docks[pos];
- const bool applyingLayout = !testing && !(pos == QInternal::TopDock && mainWindow->unifiedTitleAndToolBarOnMac());
+ const bool applyingLayout = !testing;
QToolBarAreaLayoutLine line(dock.o);
for (int k = 0; k < cnt; ++k) {
diff --git a/src/widgets/widgets/widgets.pri b/src/widgets/widgets/widgets.pri
index 1bae87ebcc..a924ba9acc 100644
--- a/src/widgets/widgets/widgets.pri
+++ b/src/widgets/widgets/widgets.pri
@@ -160,4 +160,13 @@ wince*: {
HEADERS += widgets/qmenu_wince_resource_p.h
RC_FILE = widgets/qmenu_wince.rc
!static: QMAKE_WRITE_DEFAULT_RC = 1
+ !isEmpty(QT_LIBINFIX) {
+ ORIG_RCFILE = $${TARGET}_resource.rc
+ copyrcc.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
+ copyrcc.input = ORIG_RCFILE
+ CONFIG(debug, debug|release):copyrcc.output = $${ORIG_TARGET}d_resource.rc
+ else:copyrcc.output = $${ORIG_TARGET}_resource.rc
+ copyrcc.CONFIG = target_predeps no_link
+ QMAKE_EXTRA_COMPILERS += copyrcc
+ }
}