summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xconfigure2
-rw-r--r--dist/changes-5.3.298
-rw-r--r--examples/touch/fingerpaint/scribblearea.cpp8
-rw-r--r--examples/widgets/painting/fontsampler/mainwindow.cpp6
-rw-r--r--mkspecs/devices/linux-imx53qsb-g++/qmake.conf7
-rw-r--r--mkspecs/devices/linux-imx6-g++/qmake.conf7
-rw-r--r--mkspecs/freebsd-g++/qmake.conf4
-rw-r--r--mkspecs/freebsd-g++46/qmake.conf4
-rw-r--r--mkspecs/unsupported/freebsd-clang/qmake.conf5
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java5
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtNative.java19
-rw-r--r--src/angle/src/common/common.pri5
-rw-r--r--src/corelib/arch/qatomic_mips.h2
-rw-r--r--src/corelib/global/qlogging.cpp9
-rw-r--r--src/corelib/global/qnamespace.qdoc2
-rw-r--r--src/corelib/global/qprocessordetection.h1
-rw-r--r--src/corelib/io/qdir_p.h11
-rw-r--r--src/corelib/io/qfile.cpp6
-rw-r--r--src/corelib/io/qfiledevice.cpp2
-rw-r--r--src/corelib/io/qfilesystemwatcher_fsevents.mm1
-rw-r--r--src/corelib/io/qfsfileengine.cpp3
-rw-r--r--src/corelib/io/qiodevice.cpp18
-rw-r--r--src/corelib/io/qprocess.cpp10
-rw-r--r--src/corelib/io/qtemporaryfile.cpp10
-rw-r--r--src/corelib/io/qtemporaryfile_p.h11
-rw-r--r--src/corelib/io/qtextstream.cpp2
-rw-r--r--src/corelib/io/qurl.cpp29
-rw-r--r--src/corelib/json/qjsonvalue.cpp12
-rw-r--r--src/corelib/kernel/kernel.pri2
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp8
-rw-r--r--src/corelib/kernel/qeventloop_p.h11
-rw-r--r--src/corelib/kernel/qjni.cpp9
-rw-r--r--src/corelib/kernel/qmetaobject_moc_p.h11
-rw-r--r--src/corelib/kernel/qobject.cpp3
-rw-r--r--src/corelib/mimetypes/qmimedatabase_p.h11
-rw-r--r--src/corelib/mimetypes/qmimeglobpattern_p.h11
-rw-r--r--src/corelib/mimetypes/qmimemagicrule_p.h11
-rw-r--r--src/corelib/mimetypes/qmimemagicrulematcher_p.h11
-rw-r--r--src/corelib/mimetypes/qmimeprovider_p.h11
-rw-r--r--src/corelib/mimetypes/qmimetype_p.h11
-rw-r--r--src/corelib/mimetypes/qmimetypeparser_p.h11
-rw-r--r--src/corelib/plugin/qsystemlibrary_p.h11
-rw-r--r--src/corelib/thread/qbasicatomic.h2
-rw-r--r--src/corelib/tools/qcollator_macx.cpp2
-rw-r--r--src/corelib/tools/qcollator_p.h11
-rw-r--r--src/corelib/tools/qregularexpression.cpp4
-rw-r--r--src/corelib/tools/qsimd_p.h11
-rw-r--r--src/corelib/tools/qstring.cpp10
-rw-r--r--src/corelib/tools/qstringiterator_p.h11
-rw-r--r--src/corelib/tools/qunicodetools.cpp6
-rw-r--r--src/gui/image/qgifhandler_p.h11
-rw-r--r--src/gui/image/qimage.cpp2
-rw-r--r--src/gui/image/qimage_conversions.cpp4
-rw-r--r--src/gui/image/qjpeghandler_p.h11
-rw-r--r--src/gui/image/qpixmap_blitter_p.h11
-rw-r--r--src/gui/kernel/qguiapplication.cpp5
-rw-r--r--src/gui/kernel/qplatforminputcontextfactory.cpp2
-rw-r--r--src/gui/kernel/qplatformscreen.cpp6
-rw-r--r--src/gui/kernel/qplatformtheme_p.h8
-rw-r--r--src/gui/kernel/qshapedpixmapdndwindow_p.h11
-rw-r--r--src/gui/kernel/qsimpledrag_p.h15
-rw-r--r--src/gui/kernel/qwindow.cpp34
-rw-r--r--src/gui/kernel/qwindow.h2
-rw-r--r--src/gui/kernel/qwindow_p.h1
-rw-r--r--src/gui/opengl/qopengl_p.h11
-rw-r--r--src/gui/opengl/qopenglqueryhelper_p.h11
-rw-r--r--src/gui/opengl/qopengltexture_p.h11
-rw-r--r--src/gui/opengl/qopengltextureblitter_p.h11
-rw-r--r--src/gui/opengl/qopengltexturehelper_p.h11
-rw-r--r--src/gui/opengl/qopenglversionfunctionsfactory_p.h11
-rw-r--r--src/gui/opengl/qtriangulatingstroker_p.h11
-rw-r--r--src/gui/painting/qblittable_p.h11
-rw-r--r--src/gui/painting/qcosmeticstroker.cpp8
-rw-r--r--src/gui/painting/qcosmeticstroker_p.h11
-rw-r--r--src/gui/painting/qpaintengine_blitter_p.h11
-rw-r--r--src/gui/text/qfontdatabase.cpp15
-rw-r--r--src/gui/text/qplatformfontdatabase.cpp104
-rw-r--r--src/gui/text/qtextengine.cpp4
-rw-r--r--src/gui/text/qtextlayout.cpp2
-rw-r--r--src/gui/util/qabstractlayoutstyleinfo_p.h11
-rw-r--r--src/gui/util/qlayoutpolicy_p.h11
-rw-r--r--src/network/access/qnetworkaccessauthenticationmanager.cpp2
-rw-r--r--src/network/access/qnetworkaccessftpbackend.cpp20
-rw-r--r--src/network/access/qnetworkaccessftpbackend_p.h7
-rw-r--r--src/network/kernel/qauthenticator.cpp4
-rw-r--r--src/network/kernel/qurlinfo_p.h11
-rw-r--r--src/network/socket/qhttpsocketengine.cpp10
-rw-r--r--src/network/ssl/qsslcertificateextension_p.h11
-rw-r--r--src/network/ssl/qsslcontext_openssl_p.h11
-rw-r--r--src/platformsupport/cfsocketnotifier/qcfsocketnotifier_p.h11
-rw-r--r--src/platformsupport/cglconvenience/cglconvenience_p.h11
-rw-r--r--src/platformsupport/clipboard/qmacmime_p.h11
-rw-r--r--src/platformsupport/devicediscovery/qdevicediscovery_p.h11
-rw-r--r--src/platformsupport/eglconvenience/qeglcompositor_p.h11
-rw-r--r--src/platformsupport/eglconvenience/qeglconvenience_p.h11
-rw-r--r--src/platformsupport/eglconvenience/qeglpbuffer_p.h11
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformbackingstore_p.h11
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformcontext_p.h11
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformcursor_p.h11
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformintegration_p.h11
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformscreen_p.h11
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformwindow_p.h11
-rw-r--r--src/platformsupport/eglconvenience/qxlibeglintegration_p.h11
-rw-r--r--src/platformsupport/eventdispatchers/qeventdispatcher_cf_p.h11
-rw-r--r--src/platformsupport/fbconvenience/qfbbackingstore_p.h11
-rw-r--r--src/platformsupport/fbconvenience/qfbcursor_p.h11
-rw-r--r--src/platformsupport/fbconvenience/qfbscreen_p.h11
-rw-r--r--src/platformsupport/fbconvenience/qfbvthandler_p.h11
-rw-r--r--src/platformsupport/fbconvenience/qfbwindow_p.h11
-rw-r--r--src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h11
-rw-r--r--src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h11
-rw-r--r--src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h11
-rw-r--r--src/platformsupport/fontdatabases/genericunix/qgenericunixfontdatabase_p.h11
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm3
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h11
-rw-r--r--src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h11
-rw-r--r--src/platformsupport/glxconvenience/qglxconvenience_p.h11
-rw-r--r--src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h11
-rw-r--r--src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h11
-rw-r--r--src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager_p.h11
-rw-r--r--src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h11
-rw-r--r--src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h11
-rw-r--r--src/platformsupport/input/evdevtablet/qevdevtablet_p.h11
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouch_p.h11
-rw-r--r--src/platformsupport/linuxaccessibility/application_p.h11
-rw-r--r--src/platformsupport/linuxaccessibility/atspiadaptor_p.h11
-rw-r--r--src/platformsupport/linuxaccessibility/bridge_p.h11
-rw-r--r--src/platformsupport/linuxaccessibility/cache_p.h11
-rw-r--r--src/platformsupport/linuxaccessibility/constant_mappings_p.h10
-rw-r--r--src/platformsupport/linuxaccessibility/dbusconnection_p.h11
-rw-r--r--src/platformsupport/linuxaccessibility/struct_marshallers_p.h11
-rw-r--r--src/platformsupport/services/genericunix/qgenericunixservices_p.h11
-rw-r--r--src/platformsupport/themes/genericunix/qgenericunixthemes_p.h11
-rw-r--r--src/plugins/bearer/connman/connman.pro1
-rw-r--r--src/plugins/bearer/connman/qconnmanengine.cpp60
-rw-r--r--src/plugins/bearer/connman/qconnmanengine.h5
-rw-r--r--src/plugins/bearer/corewlan/qcorewlanengine.mm3
-rw-r--r--src/plugins/bearer/corewlan/qcorewlanengine_10_6.mm3
-rw-r--r--src/plugins/bearer/generic/qgenericengine.cpp1
-rw-r--r--src/plugins/platforms/android/androidjniinput.cpp19
-rw-r--r--src/plugins/platforms/android/androidjnimain.cpp8
-rw-r--r--src/plugins/platforms/android/qandroidplatformintegration.cpp2
-rw-r--r--src/plugins/platforms/android/qandroidplatformopenglcontext.cpp25
-rw-r--r--src/plugins/platforms/android/qandroidplatformopenglcontext.h2
-rw-r--r--src/plugins/platforms/cocoa/messages.cpp26
-rw-r--r--src/plugins/platforms/cocoa/qcocoaapplication.mm10
-rw-r--r--src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm3
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.mm8
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenu.mm5
-rw-r--r--src/plugins/platforms/cocoa/qnsview.h7
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm12
-rw-r--r--src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp66
-rw-r--r--src/plugins/platforms/qnx/qqnxrasterbackingstore.h12
-rw-r--r--src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp8
-rw-r--r--src/plugins/platforms/windows/qwindowsfontdatabase.cpp8
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp2
-rw-r--r--src/plugins/platforms/xcb/qglxintegration.cpp61
-rw-r--r--src/plugins/platforms/xcb/qglxintegration.h1
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp5
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection_xi2.cpp5
-rw-r--r--src/plugins/platforms/xcb/qxcbkeyboard.cpp27
-rw-r--r--src/plugins/platforms/xcb/qxcbkeyboard.h6
-rw-r--r--src/plugins/platforms/xcb/xcb-plugin.pro1
-rw-r--r--src/plugins/platforms/xcb/xcb-static/xcb-static.pro3
-rw-r--r--src/plugins/printsupport/cups/qcupsprintersupport_p.h11
-rw-r--r--src/sql/drivers/ibase/qsql_ibase.cpp14
-rw-r--r--src/sql/kernel/qsqlquery.cpp6
-rw-r--r--src/sql/kernel/qsqlresult.cpp6
-rw-r--r--src/testlib/qtestcase.cpp1
-rw-r--r--src/testlib/qtestlog_p.h2
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsglobal_p.h11
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp21
-rw-r--r--src/widgets/dialogs/qfiledialog_p.h5
-rw-r--r--src/widgets/graphicsview/qgraphicsgridlayoutengine_p.h11
-rw-r--r--src/widgets/graphicsview/qgraphicslayoutstyleinfo_p.h11
-rw-r--r--src/widgets/itemviews/qfileiconprovider_p.h11
-rw-r--r--src/widgets/itemviews/qstyleditemdelegate.cpp3
-rw-r--r--src/widgets/kernel/qboxlayout.cpp18
-rw-r--r--src/widgets/kernel/qformlayout.cpp22
-rw-r--r--src/widgets/kernel/qgridlayout.cpp23
-rw-r--r--src/widgets/kernel/qlayout.cpp41
-rw-r--r--src/widgets/kernel/qlayout_p.h2
-rw-r--r--src/widgets/kernel/qwidgetwindow_p.h11
-rw-r--r--src/widgets/kernel/qwindowcontainer.cpp10
-rw-r--r--src/widgets/kernel/qwindowcontainer_p.h11
-rw-r--r--src/widgets/styles/qcommonstyle.cpp2
-rw-r--r--src/widgets/styles/qcommonstyle.h2
-rw-r--r--src/widgets/styles/qcommonstyle_p.h4
-rw-r--r--src/widgets/styles/qfusionstyle.cpp2
-rw-r--r--src/widgets/styles/qfusionstyle_p.h11
-rw-r--r--src/widgets/styles/qgtkstyle_p.h11
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm348
-rw-r--r--src/widgets/styles/qmacstyle_mac_p.h11
-rw-r--r--src/widgets/styles/qmacstyle_mac_p_p.h8
-rw-r--r--src/widgets/styles/qstyleanimation.cpp5
-rw-r--r--src/widgets/styles/qstyleanimation_p.h4
-rw-r--r--src/widgets/styles/qstylehelper.cpp10
-rw-r--r--src/widgets/styles/qstylehelper_p.h2
-rw-r--r--src/widgets/styles/qwindowscestyle_p.h11
-rw-r--r--src/widgets/styles/qwindowsmobilestyle_p.h11
-rw-r--r--src/widgets/styles/qwindowsstyle_p.h11
-rw-r--r--src/widgets/styles/qwindowsvistastyle_p.h11
-rw-r--r--src/widgets/styles/qwindowsxpstyle_p.h11
-rw-r--r--src/widgets/widgets/qkeysequenceedit_p.h11
-rw-r--r--src/widgets/widgets/qlineedit_p.cpp7
-rw-r--r--src/widgets/widgets/qlineedit_p.h4
-rw-r--r--src/widgets/widgets/qplaintextedit.cpp3
-rw-r--r--src/widgets/widgets/qsizegrip.cpp2
-rw-r--r--src/widgets/widgets/qtoolbutton.cpp4
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp40
-rw-r--r--tests/auto/corelib/tools/qcollator/tst_qcollator.cpp62
-rw-r--r--tests/auto/gui/text/qglyphrun/test.ttfbin3712 -> 2008 bytes
-rw-r--r--tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp20
-rw-r--r--tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp23
-rw-r--r--tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp22
-rw-r--r--tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp44
-rw-r--r--tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp32
-rw-r--r--tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp24
-rw-r--r--tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp32
-rwxr-xr-x[-rw-r--r--]tests/auto/widgets/kernel/qwidget_window/qwidget_window.pro0
-rwxr-xr-x[-rw-r--r--]tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp35
-rw-r--r--tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp5
-rw-r--r--tests/auto/widgets/widgets/qsizegrip/tst_qsizegrip.cpp25
-rw-r--r--tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp28
-rw-r--r--tests/manual/qlayout/gridwidget.cpp8
-rw-r--r--tests/manual/qlayout/hbwidget.cpp8
-rw-r--r--tests/manual/qlayout/vbwidget.cpp8
227 files changed, 2396 insertions, 609 deletions
diff --git a/configure b/configure
index 0c65aac14a..16a82b5303 100755
--- a/configure
+++ b/configure
@@ -195,7 +195,7 @@ expandQMakeConf()
extractQMakeVariables()
{
- $AWK '
+ LC_ALL=C $AWK '
BEGIN {
values["LITERAL_WHITESPACE"] = " "
values["LITERAL_DOLLAR"] = "$"
diff --git a/dist/changes-5.3.2 b/dist/changes-5.3.2
new file mode 100644
index 0000000000..dd0aeff80e
--- /dev/null
+++ b/dist/changes-5.3.2
@@ -0,0 +1,98 @@
+Qt 5.3.2 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.3.0 and Qt 5.3.1.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+ http://qt-project.org/doc/qt-5.3
+
+The Qt version 5.3 series is binary compatible with the 5.2.x series.
+Applications compiled for 5.2 will continue to run with 5.3.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+ http://bugreports.qt-project.org/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* Library *
+****************************************************************************
+
+QtCore
+------
+
+ - QObject:
+ * [QTBUG-40638] Fixed disconnecting from pointer to member signal that
+ belongs in the base class but whose type is explicitly given as a
+ pointer to a member in the derived class
+
+QtGui
+-----
+
+ - Fonts:
+ * [QTBUG-39846] Fixed regression in font families returned by
+ QFontDatabase::families() for certain writing systems.
+
+ - QImage:
+ * QImage::fill(uint) now fills the given pixel value unconverted when
+ used on RGBA8888 image, making it consistent with the documentation
+ and treatment of all other image formats.
+
+ - Text:
+ * [QTBUG-39832] Fixed lines breaking on non-breaking spaces.
+ * [QTBUG-39930][QTBUG-39860] Fixed several regressions in font selection
+ when combining different writing systems in the same text.
+
+QtNetwork
+---------
+
+ - [QTBUG-30829][QTBUG-35101] Fixed NTLM (SSPI) Proxy Authentication
+ (HTTP/HTTPS)
+
+ - QNetworkAccessManager:
+ * Fixed high CPU load when handling POST/upload QIODevice that generates
+ data on readyRead().
+ * [QTBUG-40797] QNetworkAccessManager now properly handles FTP transfer
+ failures by removing failed cached ftp connections.
+
+
+****************************************************************************
+* Platform Specific Changes *
+****************************************************************************
+
+Android
+-------
+
+ - [QTBUG-39978] Fixed regression where QScreen::physicalSize() would
+ return 0x0.
+ - Added support for building libraries with spaces in name.
+ - [QTBUG-39377] Fixed common characters like digits and punctuation
+ showing as boxes when positioned next to non-latin scripts.
+ - [QTBUG-39377] Fixed common characters like digits and punctuation
+ showing as boxes when positioned next to non-latin scripts.
+ - Fixed font selection to prefer "Droid Serif" when Serif style hint is
+ set on QFont.
+ - [QTBUG-40957] Fixed bug on some devices where the application would
+ crash at shutdown if the virtual keyboard was open.
+
+EGLFS
+-----
+
+ - Double click events are now sent correctly on eglfs.
+
+Windows
+-------
+
+ - [QTBUG-39172] Fixed using QRawFont with fallback fonts, e.g. in the case
+ of text rendering in Qt Quick.
+
+X11 / XCB
+---------
+
+ - [QTBUG-39666][QTBUG-39573][QTBUG-39570] QTabletEvents and proximity
+ events correctly identify the tool in use; the meaning of certain
+ valuators depends on the tool; and the valuators' current values are
+ not lost between events
diff --git a/examples/touch/fingerpaint/scribblearea.cpp b/examples/touch/fingerpaint/scribblearea.cpp
index 0d13e4579d..1630f6f112 100644
--- a/examples/touch/fingerpaint/scribblearea.cpp
+++ b/examples/touch/fingerpaint/scribblearea.cpp
@@ -46,6 +46,9 @@
#include "scribblearea.h"
+static const qreal MinimumDiameter = 3.0;
+static const qreal MaximumDiameter = 50.0;
+
//! [0]
ScribbleArea::ScribbleArea(QWidget *parent)
: QWidget(parent)
@@ -179,6 +182,7 @@ bool ScribbleArea::event(QEvent *event)
case QEvent::TouchUpdate:
case QEvent::TouchEnd:
{
+ QTouchEvent *touch = static_cast<QTouchEvent *>(event);
QList<QTouchEvent::TouchPoint> touchPoints = static_cast<QTouchEvent *>(event)->touchPoints();
foreach (const QTouchEvent::TouchPoint &touchPoint, touchPoints) {
switch (touchPoint.state()) {
@@ -189,7 +193,9 @@ bool ScribbleArea::event(QEvent *event)
{
QRectF rect = touchPoint.rect();
if (rect.isEmpty()) {
- qreal diameter = qreal(50) * touchPoint.pressure();
+ qreal diameter = MinimumDiameter;
+ if (touch->device()->capabilities() & QTouchDevice::Pressure)
+ diameter = MinimumDiameter + (MaximumDiameter - MinimumDiameter) * touchPoint.pressure();
rect.setSize(QSizeF(diameter, diameter));
}
diff --git a/examples/widgets/painting/fontsampler/mainwindow.cpp b/examples/widgets/painting/fontsampler/mainwindow.cpp
index 516ba5e2bc..bb7b7c7c28 100644
--- a/examples/widgets/painting/fontsampler/mainwindow.cpp
+++ b/examples/widgets/painting/fontsampler/mainwindow.cpp
@@ -143,7 +143,9 @@ void MainWindow::showFont(QTreeWidgetItem *item)
QString oldText = textEdit->toPlainText().trimmed();
bool modified = textEdit->document()->isModified();
textEdit->clear();
- textEdit->document()->setDefaultFont(QFont(family, 32, weight, italic));
+ QFont font(family, 32, weight, italic);
+ font.setStyleName(style);
+ textEdit->document()->setDefaultFont(font);
QTextCursor cursor = textEdit->textCursor();
QTextBlockFormat blockFormat;
@@ -324,6 +326,7 @@ void MainWindow::printPage(int index, QPainter *painter, QPrinter *printer)
// Calculate the maximum width and total height of the text.
foreach (int size, sampleSizes) {
QFont font(family, size, weight, italic);
+ font.setStyleName(style);
font = QFont(font, painter->device());
QFontMetricsF fontMetrics(font);
QRectF rect = fontMetrics.boundingRect(
@@ -357,6 +360,7 @@ void MainWindow::printPage(int index, QPainter *painter, QPrinter *printer)
// Draw each line of text.
foreach (int size, sampleSizes) {
QFont font(family, size, weight, italic);
+ font.setStyleName(style);
font = QFont(font, painter->device());
QFontMetricsF fontMetrics(font);
QRectF rect = fontMetrics.boundingRect(QString("%1 %2").arg(
diff --git a/mkspecs/devices/linux-imx53qsb-g++/qmake.conf b/mkspecs/devices/linux-imx53qsb-g++/qmake.conf
index 3a9766c4cb..937bbf2416 100644
--- a/mkspecs/devices/linux-imx53qsb-g++/qmake.conf
+++ b/mkspecs/devices/linux-imx53qsb-g++/qmake.conf
@@ -26,11 +26,8 @@ QMAKE_LIBS_OPENVG += -lOpenVG -lEGL
QMAKE_LFLAGS += -Wl,-rpath-link,$$[QT_SYSROOT]/usr/lib
IMX5_CFLAGS = -march=armv7-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1 -Wno-psabi
-IMX5_CFLAGS_RELEASE = -O2 $$IMX5_CFLAGS
-QMAKE_CFLAGS_RELEASE += $$IMX5_CFLAGS_RELEASE
-QMAKE_CXXFLAGS_RELEASE += $$IMX5_CFLAGS_RELEASE
-QMAKE_CFLAGS_DEBUG += $$IMX5_CFLAGS
-QMAKE_CXXFLAGS_DEBUG += $$IMX5_CFLAGS
+QMAKE_CFLAGS += $$IMX5_CFLAGS
+QMAKE_CXXFLAGS += $$IMX5_CFLAGS
include(../common/linux_arm_device_post.conf)
diff --git a/mkspecs/devices/linux-imx6-g++/qmake.conf b/mkspecs/devices/linux-imx6-g++/qmake.conf
index 2b8dbf6b67..4f464ffa83 100644
--- a/mkspecs/devices/linux-imx6-g++/qmake.conf
+++ b/mkspecs/devices/linux-imx6-g++/qmake.conf
@@ -28,11 +28,8 @@ QMAKE_LIBS_OPENVG += -lOpenVG -lEGL -lGAL
QMAKE_LFLAGS += -Wl,-rpath-link,$$[QT_SYSROOT]/usr/lib
IMX6_CFLAGS = -march=armv7-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1
-IMX6_CFLAGS_RELEASE = -O2 $$IMX6_CFLAGS
-QMAKE_CFLAGS_RELEASE += $$IMX6_CFLAGS_RELEASE
-QMAKE_CXXFLAGS_RELEASE += $$IMX6_CFLAGS_RELEASE
-QMAKE_CFLAGS_DEBUG += $$IMX6_CFLAGS
-QMAKE_CXXFLAGS_DEBUG += $$IMX6_CFLAGS
+QMAKE_CFLAGS += $$IMX6_CFLAGS
+QMAKE_CXXFLAGS += $$IMX6_CFLAGS
include(../common/linux_arm_device_post.conf)
diff --git a/mkspecs/freebsd-g++/qmake.conf b/mkspecs/freebsd-g++/qmake.conf
index f736e183ec..3d2a0e9090 100644
--- a/mkspecs/freebsd-g++/qmake.conf
+++ b/mkspecs/freebsd-g++/qmake.conf
@@ -12,10 +12,6 @@ QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
# Addon software goes into /usr/local on the BSDs, by default we will look there
QMAKE_INCDIR = /usr/local/include
QMAKE_LIBDIR = /usr/local/lib
-QMAKE_INCDIR_X11 = /usr/X11R6/include
-QMAKE_LIBDIR_X11 = /usr/X11R6/lib
-QMAKE_INCDIR_OPENGL = /usr/X11R6/include
-QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib
QMAKE_LFLAGS_THREAD = -pthread
diff --git a/mkspecs/freebsd-g++46/qmake.conf b/mkspecs/freebsd-g++46/qmake.conf
index b94b1393e6..b15e689cde 100644
--- a/mkspecs/freebsd-g++46/qmake.conf
+++ b/mkspecs/freebsd-g++46/qmake.conf
@@ -12,10 +12,6 @@ QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
# Addon software goes into /usr/local on the BSDs, by default we will look there
QMAKE_INCDIR = /usr/local/include
QMAKE_LIBDIR = /usr/local/lib
-QMAKE_INCDIR_X11 = /usr/X11R6/include
-QMAKE_LIBDIR_X11 = /usr/X11R6/lib
-QMAKE_INCDIR_OPENGL = /usr/X11R6/include
-QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib
QMAKE_LFLAGS_THREAD = -pthread
diff --git a/mkspecs/unsupported/freebsd-clang/qmake.conf b/mkspecs/unsupported/freebsd-clang/qmake.conf
index 0769983097..ad4fa3487e 100644
--- a/mkspecs/unsupported/freebsd-clang/qmake.conf
+++ b/mkspecs/unsupported/freebsd-clang/qmake.conf
@@ -4,7 +4,6 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = freebsd bsd
-CONFIG += gdb_dwarf_index
QMAKE_CFLAGS_THREAD = -pthread -D_THREAD_SAFE
@@ -13,10 +12,6 @@ QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
# Addon software goes into /usr/local on the BSDs, by default we will look there
QMAKE_INCDIR = /usr/local/include
QMAKE_LIBDIR = /usr/local/lib
-QMAKE_INCDIR_X11 = /usr/X11R6/include
-QMAKE_LIBDIR_X11 = /usr/X11R6/lib
-QMAKE_INCDIR_OPENGL = /usr/X11R6/include
-QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib
QMAKE_LFLAGS_THREAD = -pthread
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
index c85104b11e..db970b6656 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
@@ -366,11 +366,6 @@ public class QtActivityDelegate
});
}
- public boolean isSoftwareKeyboardVisible()
- {
- return m_keyboardIsVisible;
- }
-
String getAppIconSize(Activity a)
{
int size = a.getResources().getDimensionPixelSize(android.R.dimen.app_icon_size);
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
index 014023ecb1..8b0febe641 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
@@ -397,25 +397,6 @@ public class QtNative
});
}
- private static boolean isSoftwareKeyboardVisible()
- {
- final Semaphore semaphore = new Semaphore(0);
- final Boolean[] ret = {false};
- runAction(new Runnable() {
- @Override
- public void run() {
- ret[0] = m_activityDelegate.isSoftwareKeyboardVisible();
- semaphore.release();
- }
- });
- try {
- semaphore.acquire();
- } catch (Exception e) {
- e.printStackTrace();
- }
- return ret[0];
- }
-
private static void setFullScreen(final boolean fullScreen)
{
runAction(new Runnable() {
diff --git a/src/angle/src/common/common.pri b/src/angle/src/common/common.pri
index dfe15546f5..43ac3ee8db 100644
--- a/src/angle/src/common/common.pri
+++ b/src/angle/src/common/common.pri
@@ -7,6 +7,11 @@ INCLUDEPATH += \
LIBS_PRIVATE = $$QMAKE_LIBS_CORE $$QMAKE_LIBS_GUI
+lib_replace.match = $$[QT_INSTALL_LIBS/get]
+lib_replace.replace = $$[QT_INSTALL_LIBS/raw]
+lib_replace.CONFIG = path
+QMAKE_PRL_INSTALL_REPLACE += lib_replace
+
# DirectX is included in the Windows 8 Kit, but everything else requires the DX SDK.
win32-msvc2012|win32-msvc2013|winrt {
FXC = fxc.exe
diff --git a/src/corelib/arch/qatomic_mips.h b/src/corelib/arch/qatomic_mips.h
index 7bfe16a450..33e7053234 100644
--- a/src/corelib/arch/qatomic_mips.h
+++ b/src/corelib/arch/qatomic_mips.h
@@ -121,7 +121,7 @@ void QBasicAtomicOps<size>::releaseMemoryFence(const T &) Q_DECL_NOTHROW
{
asm volatile (".set push\n"
".set mips32\n"
- "sync 0x11\n"
+ "sync 0x12\n"
".set pop\n" ::: "memory");
}
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index 465e2a4b45..8b4245ccdc 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -1345,12 +1345,9 @@ static void qDefaultMsgHandler(QtMsgType type, const char *buf)
qDefaultMessageHandler(type, emptyContext, QString::fromLocal8Bit(buf));
}
-#if defined(Q_COMPILER_THREAD_LOCAL) || (defined(Q_CC_MSVC) && !defined(Q_OS_WINCE))
-#if defined(Q_CC_MSVC)
-static __declspec(thread) bool msgHandlerGrabbed = false;
-#else
+#if defined(Q_COMPILER_THREAD_LOCAL)
+
static thread_local bool msgHandlerGrabbed = false;
-#endif
static bool grabMessageHandler()
{
@@ -1369,7 +1366,7 @@ static void ungrabMessageHandler()
#else
static bool grabMessageHandler() { return true; }
static void ungrabMessageHandler() { }
-#endif // (Q_COMPILER_THREAD_LOCAL) || ((Q_CC_MSVC) && !(Q_OS_WINCE))
+#endif // (Q_COMPILER_THREAD_LOCAL)
static void qt_message_print(QtMsgType msgType, const QMessageLogContext &context, const QString &message)
{
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 8dca48d80d..044ba66a4c 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -125,7 +125,7 @@
to author a plugin. This includes avoiding loading our nib for the main
menu and not taking possession of the native menu bar. When setting this
attribute to true will also set the AA_DontUseNativeMenuBar attribute
- to true.
+ to true. It also disables native event filters.
\value AA_DontUseNativeMenuBar All menubars created while this attribute is
set to true won't be used as a native menubar (e.g, the menubar at
diff --git a/src/corelib/global/qprocessordetection.h b/src/corelib/global/qprocessordetection.h
index c9fb728593..47d6dcd7f6 100644
--- a/src/corelib/global/qprocessordetection.h
+++ b/src/corelib/global/qprocessordetection.h
@@ -169,6 +169,7 @@
#elif defined(__i386) || defined(__i386__) || defined(_M_IX86)
# define Q_PROCESSOR_X86_32
# define Q_BYTE_ORDER Q_LITTLE_ENDIAN
+# define Q_PROCESSOR_WORDSIZE 4
/*
* We define Q_PROCESSOR_X86 == 6 for anything above a equivalent or better
diff --git a/src/corelib/io/qdir_p.h b/src/corelib/io/qdir_p.h
index bf7726db2f..4d2f25f9ba 100644
--- a/src/corelib/io/qdir_p.h
+++ b/src/corelib/io/qdir_p.h
@@ -42,6 +42,17 @@
#ifndef QDIR_P_H
#define QDIR_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qfilesystementry_p.h"
#include "qfilesystemmetadata_p.h"
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index 82aee331c5..feecbd0281 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -167,7 +167,7 @@ QAbstractFileEngine *QFilePrivate::engine() const
disk into a 16-bit Unicode QString. By default, it assumes that
the user system's local 8-bit encoding is used (e.g., UTF-8
on most unix based operating systems; see QTextCodec::codecForLocale() for
- details). This can be changed using setCodec().
+ details). This can be changed using \l QTextStream::setCodec().
To write text, we can use operator<<(), which is overloaded to
take a QTextStream on the left and various data types (including
@@ -987,8 +987,8 @@ bool QFile::open(FILE *fh, OpenMode mode, FileHandleFlags handleFlags)
those cases, size() returns \c 0. See QIODevice::isSequential()
for more information.
- \warning For Windows CE you may not be able to call seek(), setSize(),
- fileTime(). size() returns \c 0.
+ \warning For Windows CE you may not be able to call seek(), and size()
+ returns \c 0.
\warning Since this function opens the file without specifying the file name,
you cannot use this QFile with a QFileInfo.
diff --git a/src/corelib/io/qfiledevice.cpp b/src/corelib/io/qfiledevice.cpp
index 33cb6037f5..bb81877857 100644
--- a/src/corelib/io/qfiledevice.cpp
+++ b/src/corelib/io/qfiledevice.cpp
@@ -269,7 +269,7 @@ int QFileDevice::handle() const
/*!
Returns the name of the file.
- The default implementation in QFileDevice returns QString().
+ The default implementation in QFileDevice returns a null string.
*/
QString QFileDevice::fileName() const
{
diff --git a/src/corelib/io/qfilesystemwatcher_fsevents.mm b/src/corelib/io/qfilesystemwatcher_fsevents.mm
index 085396da6d..e713769735 100644
--- a/src/corelib/io/qfilesystemwatcher_fsevents.mm
+++ b/src/corelib/io/qfilesystemwatcher_fsevents.mm
@@ -496,6 +496,7 @@ QStringList QFseventsFileSystemWatcherEngine::removePaths(const QStringList &pat
bool QFseventsFileSystemWatcherEngine::startStream()
{
Q_ASSERT(stream == 0);
+ Q_AUTORELEASE_POOL(pool)
if (stream) // This shouldn't happen, but let's be nice and handle it.
stopStream();
diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp
index 3c4a2fac0b..de39f0b619 100644
--- a/src/corelib/io/qfsfileengine.cpp
+++ b/src/corelib/io/qfsfileengine.cpp
@@ -752,6 +752,9 @@ qint64 QFSFileEnginePrivate::writeFdFh(const char *data, qint64 len)
if (len && writtenBytes == 0) {
writtenBytes = -1;
q->setError(errno == ENOSPC ? QFile::ResourceError : QFile::WriteError, qt_error_string(errno));
+ } else {
+ // reset the cached size, if any
+ metaData.clearFlags(QFileSystemMetaData::SizeAttribute);
}
return writtenBytes;
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index 51a574987e..06f7fb17cd 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -217,7 +217,7 @@ QIODevicePrivate::~QIODevicePrivate()
\li waitFor....() - Subclasses of QIODevice implement blocking
functions for device-specific operations. For example, QProcess
- has a function called waitForStarted() which suspends operation in
+ has a function called \l {QProcess::}{waitForStarted()} which suspends operation in
the calling thread until the process has started.
\endlist
@@ -730,8 +730,7 @@ qint64 QIODevice::bytesAvailable() const
return d->buffer.size();
}
-/*!
- For buffered devices, this function returns the number of bytes
+/*! For buffered devices, this function returns the number of bytes
waiting to be written. For devices with no buffer, this function
returns 0.
@@ -943,9 +942,10 @@ qint64 QIODevice::read(char *data, qint64 maxSize)
data read as a QByteArray.
This function has no way of reporting errors; returning an empty
- QByteArray() can mean either that no data was currently available
+ QByteArray can mean either that no data was currently available
for reading, or that an error occurred.
*/
+
QByteArray QIODevice::read(qint64 maxSize)
{
Q_D(QIODevice);
@@ -994,10 +994,10 @@ QByteArray QIODevice::read(qint64 maxSize)
\overload
Reads all available data from the device, and returns it as a
- QByteArray.
+ byte array.
This function has no way of reporting errors; returning an empty
- QByteArray() can mean either that no data was currently available
+ QByteArray can mean either that no data was currently available
for reading, or that an error occurred.
*/
QByteArray QIODevice::readAll()
@@ -1177,10 +1177,10 @@ qint64 QIODevice::readLine(char *data, qint64 maxSize)
\overload
Reads a line from the device, but no more than \a maxSize characters,
- and returns the result as a QByteArray.
+ and returns the result as a byte array.
This function has no way of reporting errors; returning an empty
- QByteArray() can mean either that no data was currently available
+ QByteArray can mean either that no data was currently available
for reading, or that an error occurred.
*/
QByteArray QIODevice::readLine(qint64 maxSize)
@@ -1531,7 +1531,7 @@ qint64 QIODevice::peek(char *data, qint64 maxSize)
\snippet code/src_corelib_io_qiodevice.cpp 5
This function has no way of reporting errors; returning an empty
- QByteArray() can mean either that no data was currently available
+ QByteArray can mean either that no data was currently available
for peeking, or that an error occurred.
\sa read()
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index b03e96d0f6..66036fca90 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -1689,8 +1689,8 @@ void QProcess::setEnvironment(const QStringList &environment)
\deprecated
Returns the environment that QProcess will use when starting a
process, or an empty QStringList if no environment has been set
- using setEnvironment() or setEnvironmentHash(). If no environment
- has been set, the environment of the calling process will be used.
+ using setEnvironment(). If no environment has been set, the
+ environment of the calling process will be used.
\note The environment settings are ignored on Windows CE,
as there is no concept of an environment.
@@ -2016,7 +2016,7 @@ QByteArray QProcess::readAllStandardError()
\note No further splitting of the arguments is performed.
\b{Windows:} The arguments are quoted and joined into a command line
- that is compatible with the CommandLineToArgvW() Windows function.
+ that is compatible with the \c CommandLineToArgvW() Windows function.
For programs that have different command line quoting requirements,
you need to use setNativeArguments().
@@ -2320,8 +2320,8 @@ int QProcess::exitCode() const
Returns the exit status of the last process that finished.
- On Windows, if the process was terminated with TerminateProcess()
- from another application this function will still return NormalExit
+ On Windows, if the process was terminated with TerminateProcess() from
+ another application, this function will still return NormalExit
unless the exit code is less than 0.
*/
QProcess::ExitStatus QProcess::exitStatus() const
diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp
index bc6c2f1f06..54b59e802e 100644
--- a/src/corelib/io/qtemporaryfile.cpp
+++ b/src/corelib/io/qtemporaryfile.cpp
@@ -703,18 +703,20 @@ void QTemporaryFile::setFileTemplate(const QString &name)
/*!
- If \a file is not already a native file then a QTemporaryFile is created
- in the tempPath() and \a file is copied into the temporary file, then a
- pointer to the temporary file is returned. If \a file is already a native
- file, a QTemporaryFile is not created, no copy is made and 0 is returned.
+ If \a file is not already a native file, then a QTemporaryFile is created
+ in QDir::tempPath(), the contents of \a file is copied into it, and a pointer
+ to the temporary file is returned. Does nothing and returns \c 0 if \a file
+ is already a native file.
For example:
+ \code
QFile f(":/resources/file.txt");
QTemporaryFile::createNativeFile(f); // Returns a pointer to a temporary file
QFile f("/users/qt/file.txt");
QTemporaryFile::createNativeFile(f); // Returns 0
+ \endcode
\sa QFileInfo::isNativePath()
*/
diff --git a/src/corelib/io/qtemporaryfile_p.h b/src/corelib/io/qtemporaryfile_p.h
index fe637c8dfd..46e9d169f4 100644
--- a/src/corelib/io/qtemporaryfile_p.h
+++ b/src/corelib/io/qtemporaryfile_p.h
@@ -42,6 +42,17 @@
#ifndef QTEMPORARYFILE_P_H
#define QTEMPORARYFILE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qglobal.h>
#ifndef QT_NO_TEMPORARYFILE
diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp
index 4002ce8694..974a7c2be4 100644
--- a/src/corelib/io/qtextstream.cpp
+++ b/src/corelib/io/qtextstream.cpp
@@ -2824,7 +2824,7 @@ QTextStream &reset(QTextStream &stream)
/*!
\relates QTextStream
- Calls skipWhiteSpace() on \a stream and returns \a stream.
+ Calls \l {QTextStream::}{skipWhiteSpace()} on \a stream and returns \a stream.
\sa {QTextStream manipulators}
*/
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 51c48b88d7..5700b9ab24 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -2338,7 +2338,7 @@ void QUrl::setHost(const QString &host, ParsingMode mode)
as DNS requests or in HTTP request headers). If that flag is not present,
this function returns the International Domain Name (IDN) in Unicode form,
according to the list of permissible top-level domains (see
- idnWhiteList()).
+ idnWhitelist()).
All other flags are ignored. Host names cannot contain control or percent
characters, so the returned value can be considered fully decoded.
@@ -2679,8 +2679,8 @@ void QUrl::setQuery(const QUrlQuery &query)
Sets the query string of the URL to an encoded version of \a
query. The contents of \a query are converted to a string
internally, each pair delimited by the character returned by
- pairDelimiter(), and the key and value are delimited by
- valueDelimiter().
+ queryPairDelimiter(), and the key and value are delimited by
+ queryValueDelimiter().
\note This method does not encode spaces (ASCII 0x20) as plus (+) signs,
like HTML forms do. If you need that kind of encoding, you must encode
@@ -2699,8 +2699,8 @@ void QUrl::setQuery(const QUrlQuery &query)
Sets the query string of the URL to the encoded version of \a
query. The contents of \a query are converted to a string
internally, each pair delimited by the character returned by
- pairDelimiter(), and the key and value are delimited by
- valueDelimiter().
+ queryPairDelimiter(), and the key and value are delimited by
+ queryValueDelimiter().
\obsolete Use QUrlQuery and setQuery().
@@ -2714,11 +2714,11 @@ void QUrl::setQuery(const QUrlQuery &query)
Inserts the pair \a key = \a value into the query string of the
URL.
- The key/value pair is encoded before it is added to the query. The
+ The key-value pair is encoded before it is added to the query. The
pair is converted into separate strings internally. The \a key and
\a value is first encoded into UTF-8 and then delimited by the
- character returned by valueDelimiter(). Each key/value pair is
- delimited by the character returned by pairDelimiter().
+ character returned by queryValueDelimiter(). Each key-value pair is
+ delimited by the character returned by queryPairDelimiter().
\note This method does not encode spaces (ASCII 0x20) as plus (+) signs,
like HTML forms do. If you need that kind of encoding, you must encode
@@ -2952,9 +2952,8 @@ QString QUrl::query(ComponentFormattingOptions options) const
The fragment is sometimes also referred to as the URL "reference".
Passing an argument of QString() (a null QString) will unset the fragment.
- Passing an argument of QString("") (an empty but not null QString)
- will set the fragment to an empty string (as if the original URL
- had a lone "#").
+ Passing an argument of QString("") (an empty but not null QString) will set the
+ fragment to an empty string (as if the original URL had a lone "#").
The \a fragment data is interpreted according to \a mode: in StrictMode,
any '%' characters must be followed by exactly two hexadecimal characters
@@ -3029,10 +3028,10 @@ QString QUrl::fragment(ComponentFormattingOptions options) const
The fragment is sometimes also referred to as the URL "reference".
- Passing an argument of QByteArray() (a null QByteArray) will unset
- the fragment. Passing an argument of QByteArray("") (an empty but
- not null QByteArray) will set the fragment to an empty string (as
- if the original URL had a lone "#").
+ Passing an argument of QByteArray() (a null QByteArray) will unset the fragment.
+ Passing an argument of QByteArray("") (an empty but not null QByteArray)
+ will set the fragment to an empty string (as if the original URL
+ had a lone "#").
\obsolete Use setFragment(), which has the same behavior of null / empty.
diff --git a/src/corelib/json/qjsonvalue.cpp b/src/corelib/json/qjsonvalue.cpp
index 2d957070ab..de4336d728 100644
--- a/src/corelib/json/qjsonvalue.cpp
+++ b/src/corelib/json/qjsonvalue.cpp
@@ -420,17 +420,17 @@ QJsonValue QJsonValue::fromVariant(const QVariant &variant)
}
/*!
- Converts the value to a QVariant.
+ Converts the value to a \l {QVariant::}{QVariant()}.
The QJsonValue types will be converted as follows:
- \value Null QVariant()
+ \value Null {QVariant::}{QVariant()}
\value Bool QMetaType::Bool
\value Double QMetaType::Double
\value String QString
\value Array QVariantList
\value Object QVariantMap
- \value Undefined QVariant()
+ \value Undefined {QVariant::}{QVariant()}
\sa fromVariant()
*/
@@ -553,7 +553,7 @@ QJsonArray QJsonValue::toArray(const QJsonArray &defaultValue) const
Converts the value to an array and returns it.
- If type() is not Array, a QJsonArray() will be returned.
+ If type() is not Array, a \l{QJsonArray::}{QJsonArray()} will be returned.
*/
QJsonArray QJsonValue::toArray() const
{
@@ -578,8 +578,8 @@ QJsonObject QJsonValue::toObject(const QJsonObject &defaultValue) const
Converts the value to an object and returns it.
- If type() is not Object, the QJsonObject() will be returned.
- */
+ If type() is not Object, the \l {QJsonObject::}{QJsonObject()} will be returned.
+*/
QJsonObject QJsonValue::toObject() const
{
return toObject(QJsonObject());
diff --git a/src/corelib/kernel/kernel.pri b/src/corelib/kernel/kernel.pri
index 819c10e99f..55625f3571 100644
--- a/src/corelib/kernel/kernel.pri
+++ b/src/corelib/kernel/kernel.pri
@@ -169,7 +169,7 @@ blackberry {
kernel/qeventdispatcher_blackberry_p.h
}
-qqnx_pps {
+qqnx_pps:!blackberry-playbook {
LIBS_PRIVATE += -lpps
SOURCES += \
kernel/qppsattribute.cpp \
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 7f2e28e800..436bb59bbc 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -2533,6 +2533,9 @@ void QCoreApplication::removeLibraryPath(const QString &path)
\note The filter function set here receives native messages,
i.e. MSG or XCB event structs.
+ \note Native event filters will be disabled when the application the
+ Qt::AA_MacPluginApplication attribute is set.
+
For maximum portability, you should always try to use QEvents
and QObject::installEventFilter() whenever possible.
@@ -2542,6 +2545,11 @@ void QCoreApplication::removeLibraryPath(const QString &path)
*/
void QCoreApplication::installNativeEventFilter(QAbstractNativeEventFilter *filterObj)
{
+ if (QCoreApplication::testAttribute(Qt::AA_MacPluginApplication)) {
+ qWarning("Native event filters are not applied when the Qt::AA_MacPluginApplication attribute is set");
+ return;
+ }
+
QAbstractEventDispatcher *eventDispatcher = QAbstractEventDispatcher::instance(QCoreApplicationPrivate::theMainThread);
if (!filterObj || !eventDispatcher)
return;
diff --git a/src/corelib/kernel/qeventloop_p.h b/src/corelib/kernel/qeventloop_p.h
index 30c61ca759..1a1743260b 100644
--- a/src/corelib/kernel/qeventloop_p.h
+++ b/src/corelib/kernel/qeventloop_p.h
@@ -42,6 +42,17 @@
#ifndef QEVENTLOOP_P_H
#define QEVENTLOOP_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qobject_p.h"
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/kernel/qjni.cpp b/src/corelib/kernel/qjni.cpp
index 4581b70ca7..b240185d7e 100644
--- a/src/corelib/kernel/qjni.cpp
+++ b/src/corelib/kernel/qjni.cpp
@@ -86,15 +86,14 @@ Q_GLOBAL_STATIC(JClassHash, cachedClasses)
static jclass getCachedClass(JNIEnv *env, const char *className)
{
jclass clazz = 0;
- QString key = QLatin1String(className);
- QHash<QString, jclass>::iterator it = cachedClasses->find(key);
+ QString classDotEnc = QString::fromLatin1(className).replace(QLatin1Char('/'), QLatin1Char('.'));
+ QHash<QString, jclass>::iterator it = cachedClasses->find(classDotEnc);
if (it == cachedClasses->end()) {
QJNIObjectPrivate classLoader = QtAndroidPrivate::classLoader();
if (!classLoader.isValid())
return 0;
- QJNIObjectPrivate stringName = QJNIObjectPrivate::fromString(QString::fromLatin1(className).replace(QLatin1Char('/'),
- QLatin1Char('.')));
+ QJNIObjectPrivate stringName = QJNIObjectPrivate::fromString(classDotEnc);
QJNIObjectPrivate classObject = classLoader.callObjectMethod("loadClass",
"(Ljava/lang/String;)Ljava/lang/Class;",
stringName.object());
@@ -102,7 +101,7 @@ static jclass getCachedClass(JNIEnv *env, const char *className)
if (!exceptionCheckAndClear(env) && classObject.isValid())
clazz = static_cast<jclass>(env->NewGlobalRef(classObject.object()));
- cachedClasses->insert(key, clazz);
+ cachedClasses->insert(classDotEnc, clazz);
} else {
clazz = it.value();
}
diff --git a/src/corelib/kernel/qmetaobject_moc_p.h b/src/corelib/kernel/qmetaobject_moc_p.h
index d26cd54e5d..1a7ca63ae1 100644
--- a/src/corelib/kernel/qmetaobject_moc_p.h
+++ b/src/corelib/kernel/qmetaobject_moc_p.h
@@ -43,6 +43,17 @@
# error "Include qmetaobject_p.h (or moc's utils.h) before including this file."
#endif
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
QT_BEGIN_NAMESPACE
// This function is shared with moc.cpp. This file should be included where needed.
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 45bf4b62c5..2c53ed8f17 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -1644,9 +1644,10 @@ void QObject::killTimer(int id)
int at = d->extraData ? d->extraData->runningTimers.indexOf(id) : -1;
if (at == -1) {
// timer isn't owned by this object
- qWarning("QObject::killTimer(): Error: timer id %d is not valid for object %p (%s), timer has not been killed",
+ qWarning("QObject::killTimer(): Error: timer id %d is not valid for object %p (%s, %s), timer has not been killed",
id,
this,
+ metaObject()->className(),
qPrintable(objectName()));
return;
}
diff --git a/src/corelib/mimetypes/qmimedatabase_p.h b/src/corelib/mimetypes/qmimedatabase_p.h
index 78bb6c2780..d0546cf5ce 100644
--- a/src/corelib/mimetypes/qmimedatabase_p.h
+++ b/src/corelib/mimetypes/qmimedatabase_p.h
@@ -42,6 +42,17 @@
#ifndef QMIMEDATABASE_P_H
#define QMIMEDATABASE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qhash.h>
#include <QtCore/qmutex.h>
diff --git a/src/corelib/mimetypes/qmimeglobpattern_p.h b/src/corelib/mimetypes/qmimeglobpattern_p.h
index ca22aa9588..05d701e787 100644
--- a/src/corelib/mimetypes/qmimeglobpattern_p.h
+++ b/src/corelib/mimetypes/qmimeglobpattern_p.h
@@ -42,6 +42,17 @@
#ifndef QMIMEGLOBPATTERN_P_H
#define QMIMEGLOBPATTERN_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qstringlist.h>
#include <QtCore/qhash.h>
diff --git a/src/corelib/mimetypes/qmimemagicrule_p.h b/src/corelib/mimetypes/qmimemagicrule_p.h
index c252440d6c..aeed1908a7 100644
--- a/src/corelib/mimetypes/qmimemagicrule_p.h
+++ b/src/corelib/mimetypes/qmimemagicrule_p.h
@@ -42,6 +42,17 @@
#ifndef QMIMEMAGICRULE_P_H
#define QMIMEMAGICRULE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qbytearray.h>
#include <QtCore/qscopedpointer.h>
#include <QtCore/qlist.h>
diff --git a/src/corelib/mimetypes/qmimemagicrulematcher_p.h b/src/corelib/mimetypes/qmimemagicrulematcher_p.h
index 159342482f..49de59f55a 100644
--- a/src/corelib/mimetypes/qmimemagicrulematcher_p.h
+++ b/src/corelib/mimetypes/qmimemagicrulematcher_p.h
@@ -42,6 +42,17 @@
#ifndef QMIMEMAGICRULEMATCHER_P_H
#define QMIMEMAGICRULEMATCHER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qbytearray.h>
#include <QtCore/qlist.h>
#include <QtCore/qstring.h>
diff --git a/src/corelib/mimetypes/qmimeprovider_p.h b/src/corelib/mimetypes/qmimeprovider_p.h
index 4a263093bd..f79373bb0a 100644
--- a/src/corelib/mimetypes/qmimeprovider_p.h
+++ b/src/corelib/mimetypes/qmimeprovider_p.h
@@ -42,6 +42,17 @@
#ifndef QMIMEPROVIDER_P_H
#define QMIMEPROVIDER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qdatetime.h>
#include "qmimedatabase_p.h"
#include <QtCore/qset.h>
diff --git a/src/corelib/mimetypes/qmimetype_p.h b/src/corelib/mimetypes/qmimetype_p.h
index c500520fe1..637c85d8ca 100644
--- a/src/corelib/mimetypes/qmimetype_p.h
+++ b/src/corelib/mimetypes/qmimetype_p.h
@@ -42,6 +42,17 @@
#ifndef QMIMETYPE_P_H
#define QMIMETYPE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qmimetype.h"
#include <QtCore/qhash.h>
diff --git a/src/corelib/mimetypes/qmimetypeparser_p.h b/src/corelib/mimetypes/qmimetypeparser_p.h
index c92bb81be4..ef7a12cdd5 100644
--- a/src/corelib/mimetypes/qmimetypeparser_p.h
+++ b/src/corelib/mimetypes/qmimetypeparser_p.h
@@ -43,6 +43,17 @@
#ifndef QMIMETYPEPARSER_P_H
#define QMIMETYPEPARSER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qmimedatabase_p.h"
#include "qmimeprovider_p.h"
diff --git a/src/corelib/plugin/qsystemlibrary_p.h b/src/corelib/plugin/qsystemlibrary_p.h
index 4a2c86990f..8b0fd57faf 100644
--- a/src/corelib/plugin/qsystemlibrary_p.h
+++ b/src/corelib/plugin/qsystemlibrary_p.h
@@ -42,6 +42,17 @@
#ifndef QSYSTEMLIBRARY_P_H
#define QSYSTEMLIBRARY_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qglobal.h>
#ifdef Q_OS_WIN
# include <QtCore/qstring.h>
diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h
index cf69d34589..0fe4d20bc5 100644
--- a/src/corelib/thread/qbasicatomic.h
+++ b/src/corelib/thread/qbasicatomic.h
@@ -62,8 +62,6 @@
# include "QtCore/qatomic_ia64.h"
#elif defined(Q_PROCESSOR_MIPS)
# include "QtCore/qatomic_mips.h"
-#elif defined(Q_PROCESSOR_SPARC)
-# include "QtCore/qatomic_sparc.h"
#elif defined(Q_PROCESSOR_X86)
# include <QtCore/qatomic_x86.h>
diff --git a/src/corelib/tools/qcollator_macx.cpp b/src/corelib/tools/qcollator_macx.cpp
index 52fb059a9e..151ddc8778 100644
--- a/src/corelib/tools/qcollator_macx.cpp
+++ b/src/corelib/tools/qcollator_macx.cpp
@@ -64,7 +64,7 @@ void QCollatorPrivate::init()
if (caseSensitivity == Qt::CaseInsensitive)
options |= kUCCollateCaseInsensitiveMask;
if (numericMode)
- options |= kUCCollateDigitsAsNumberMask;
+ options |= kUCCollateDigitsAsNumberMask | kUCCollateDigitsOverrideMask;
if (ignorePunctuation)
options |= kUCCollatePunctuationSignificantMask;
diff --git a/src/corelib/tools/qcollator_p.h b/src/corelib/tools/qcollator_p.h
index 00b6ce7290..62e3eeb576 100644
--- a/src/corelib/tools/qcollator_p.h
+++ b/src/corelib/tools/qcollator_p.h
@@ -43,6 +43,17 @@
#ifndef QCOLLATOR_P_H
#define QCOLLATOR_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qcollator.h"
#include <QVector>
#ifdef QT_USE_ICU
diff --git a/src/corelib/tools/qregularexpression.cpp b/src/corelib/tools/qregularexpression.cpp
index 7c1c1efaee..cafa1a1070 100644
--- a/src/corelib/tools/qregularexpression.cpp
+++ b/src/corelib/tools/qregularexpression.cpp
@@ -43,6 +43,8 @@
#include "qregularexpression.h"
+#ifndef QT_NO_REGULAREXPRESSION
+
#include <QtCore/qcoreapplication.h>
#include <QtCore/qmutex.h>
#include <QtCore/qvector.h>
@@ -2582,3 +2584,5 @@ static const char *pcreCompileErrorCodes[] =
#endif // #if 0
QT_END_NAMESPACE
+
+#endif // QT_NO_REGULAREXPRESSION
diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
index 084e09db63..f0c4c7ad52 100644
--- a/src/corelib/tools/qsimd_p.h
+++ b/src/corelib/tools/qsimd_p.h
@@ -42,6 +42,17 @@
#ifndef QSIMD_P_H
#define QSIMD_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qglobal.h>
#include <qatomic.h>
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 2ce8a3a45b..33326f141b 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -1327,9 +1327,6 @@ const QString::Null QString::null = { };
Returns a copy of the \a str string. The given string is converted
to Unicode using the fromUtf8() function.
- This constructor is only available if Qt is configured with STL
- compatibility enabled.
-
\sa fromLatin1(), fromLocal8Bit(), fromUtf8(), QByteArray::fromStdString()
*/
@@ -1362,7 +1359,7 @@ const QString::Null QString::null = { };
wchar_t is 2 bytes wide (e.g. windows) and in ucs4 on platforms
where wchar_t is 4 bytes wide (most Unix systems).
- This operator is mostly useful to pass a QString to a function
+ This method is mostly useful to pass a QString to a function
that accepts a std::wstring object.
\sa utf16(), toLatin1(), toUtf8(), toLocal8Bit()
@@ -7861,12 +7858,9 @@ bool QString::isRightToLeft() const
QString. The Unicode data is converted into 8-bit characters using
the toUtf8() function.
- This operator is mostly useful to pass a QString to a function
+ This method is mostly useful to pass a QString to a function
that accepts a std::string object.
- If the QString contains non-Latin1 Unicode characters, using this
- can lead to loss of information.
-
\sa toLatin1(), toUtf8(), toLocal8Bit(), QByteArray::toStdString()
*/
diff --git a/src/corelib/tools/qstringiterator_p.h b/src/corelib/tools/qstringiterator_p.h
index c3986f0477..4ae705b085 100644
--- a/src/corelib/tools/qstringiterator_p.h
+++ b/src/corelib/tools/qstringiterator_p.h
@@ -43,6 +43,17 @@
#ifndef QSTRINGITERATOR_H
#define QSTRINGITERATOR_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qstring.h>
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/tools/qunicodetools.cpp b/src/corelib/tools/qunicodetools.cpp
index fc36d07a4a..bb2c032e57 100644
--- a/src/corelib/tools/qunicodetools.cpp
+++ b/src/corelib/tools/qunicodetools.cpp
@@ -710,6 +710,7 @@ Q_CORE_EXPORT void initScripts(const ushort *string, int length, uchar *scripts)
script = QChar::Script(prop->script);
}
+#if 0 // ### Disabled due to regressions. The font selection algorithm is not prepared for this change.
if (Q_LIKELY(script != QChar::Script_Common)) {
// override preceding Common-s
while (sor > 0 && scripts[sor - 1] == QChar::Script_Common)
@@ -719,6 +720,7 @@ Q_CORE_EXPORT void initScripts(const ushort *string, int length, uchar *scripts)
if (sor > 0)
script = scripts[sor - 1];
}
+#endif
while (sor < eor)
scripts[sor++] = script;
@@ -726,6 +728,8 @@ Q_CORE_EXPORT void initScripts(const ushort *string, int length, uchar *scripts)
script = prop->script;
}
eor = length;
+
+#if 0 // ### Disabled due to regressions. The font selection algorithm is not prepared for this change.
if (Q_LIKELY(script != QChar::Script_Common)) {
// override preceding Common-s
while (sor > 0 && scripts[sor - 1] == QChar::Script_Common)
@@ -735,6 +739,8 @@ Q_CORE_EXPORT void initScripts(const ushort *string, int length, uchar *scripts)
if (sor > 0)
script = scripts[sor - 1];
}
+#endif
+
while (sor < eor)
scripts[sor++] = script;
}
diff --git a/src/gui/image/qgifhandler_p.h b/src/gui/image/qgifhandler_p.h
index bf4ba30e20..80c9e145c5 100644
--- a/src/gui/image/qgifhandler_p.h
+++ b/src/gui/image/qgifhandler_p.h
@@ -47,6 +47,17 @@
#ifndef QGIFHANDLER_P_H
#define QGIFHANDLER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtGui/qimageiohandler.h>
#include <QtGui/qimage.h>
#include <QtCore/qbytearray.h>
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 32c81e39fa..72972ff163 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -2927,6 +2927,8 @@ QImage QImage::mirrored_helper(bool horizontal, bool vertical) const
result.d->colortable = d->colortable;
result.d->has_alpha_clut = d->has_alpha_clut;
result.d->devicePixelRatio = d->devicePixelRatio;
+ result.d->dpmx = d->dpmx;
+ result.d->dpmy = d->dpmy;
do_mirror(result.d, d, horizontal, vertical);
diff --git a/src/gui/image/qimage_conversions.cpp b/src/gui/image/qimage_conversions.cpp
index 195b56afbe..4fd598a6fe 100644
--- a/src/gui/image/qimage_conversions.cpp
+++ b/src/gui/image/qimage_conversions.cpp
@@ -163,7 +163,9 @@ bool convert_generic_inplace(QImageData *data, QImage::Format dst_format, Qt::Im
const uint *ptr = fetch(buffer, srcData, x, l);
ptr = srcLayout->convertToARGB32PM(buffer, ptr, l, srcLayout, 0);
ptr = destLayout->convertFromARGB32PM(buffer, ptr, l, destLayout, 0);
- store(srcData, ptr, x, l);
+ // The conversions might be passthrough and not use the buffer, in that case we are already done.
+ if (srcData != (const uchar*)ptr)
+ store(srcData, ptr, x, l);
x += l;
}
srcData += data->bytes_per_line;
diff --git a/src/gui/image/qjpeghandler_p.h b/src/gui/image/qjpeghandler_p.h
index f5676d9b14..4342782f03 100644
--- a/src/gui/image/qjpeghandler_p.h
+++ b/src/gui/image/qjpeghandler_p.h
@@ -42,6 +42,17 @@
#ifndef QJPEGHANDLER_P_H
#define QJPEGHANDLER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtGui/qimageiohandler.h>
#include <QtCore/QSize>
#include <QtCore/QRect>
diff --git a/src/gui/image/qpixmap_blitter_p.h b/src/gui/image/qpixmap_blitter_p.h
index 1f723178d8..481fb0bc24 100644
--- a/src/gui/image/qpixmap_blitter_p.h
+++ b/src/gui/image/qpixmap_blitter_p.h
@@ -42,6 +42,17 @@
#ifndef QPIXMAP_BLITTER_P_H
#define QPIXMAP_BLITTER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformpixmap.h>
#include <private/qpaintengine_blitter_p.h>
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 6f688c09aa..51b1db8cf1 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -176,7 +176,9 @@ bool QGuiApplicationPrivate::noGrab = false;
static qreal fontSmoothingGamma = 1.7;
extern void qRegisterGuiVariant();
+#ifndef QT_NO_ANIMATION
extern void qRegisterGuiGetInterpolator();
+#endif
extern void qInitDrawhelperAsm();
extern void qInitImageConversions();
@@ -588,6 +590,7 @@ QGuiApplication::~QGuiApplication()
#endif //QT_NO_SESSIONMANAGER
clearPalette();
+ QFontDatabase::removeAllApplicationFonts();
#ifndef QT_NO_CURSOR
d->cursor_list.clear();
@@ -1312,8 +1315,10 @@ void QGuiApplicationPrivate::init()
// trigger registering of QVariant's GUI types
qRegisterGuiVariant();
+#ifndef QT_NO_ANIMATION
// trigger registering of animation interpolators
qRegisterGuiGetInterpolator();
+#endif
// set a global share context when enabled unless there is already one
#ifndef QT_NO_OPENGL
diff --git a/src/gui/kernel/qplatforminputcontextfactory.cpp b/src/gui/kernel/qplatforminputcontextfactory.cpp
index ee80a70939..3e2f234d99 100644
--- a/src/gui/kernel/qplatforminputcontextfactory.cpp
+++ b/src/gui/kernel/qplatforminputcontextfactory.cpp
@@ -83,7 +83,7 @@ QPlatformInputContext *QPlatformInputContextFactory::create()
QString icString = QString::fromLatin1(qgetenv("QT_IM_MODULE"));
if (icString == QLatin1String("none"))
- icString = QStringLiteral("compose");
+ return 0;
ic = create(icString);
if (ic && ic->isValid())
diff --git a/src/gui/kernel/qplatformscreen.cpp b/src/gui/kernel/qplatformscreen.cpp
index 0c47005807..a7ff94ac4f 100644
--- a/src/gui/kernel/qplatformscreen.cpp
+++ b/src/gui/kernel/qplatformscreen.cpp
@@ -305,10 +305,10 @@ void QPlatformScreen::resizeMaximizedWindows()
if (platformScreenForWindow(w) != this)
continue;
- if (w->windowState() & Qt::WindowFullScreen || w->geometry() == oldGeometry)
- w->setGeometry(newGeometry);
- else if (w->windowState() & Qt::WindowMaximized || w->geometry() == oldAvailableGeometry)
+ if (w->windowState() & Qt::WindowMaximized || w->geometry() == oldAvailableGeometry)
w->setGeometry(newAvailableGeometry);
+ else if (w->windowState() & Qt::WindowFullScreen || w->geometry() == oldGeometry)
+ w->setGeometry(newGeometry);
}
}
diff --git a/src/gui/kernel/qplatformtheme_p.h b/src/gui/kernel/qplatformtheme_p.h
index 217c284a9e..f493037ddd 100644
--- a/src/gui/kernel/qplatformtheme_p.h
+++ b/src/gui/kernel/qplatformtheme_p.h
@@ -46,9 +46,11 @@
// W A R N I N G
// -------------
//
-// This file is part of the QPA API and is not meant to be used
-// in applications. Usage of this API may make your code
-// source and binary incompatible with future versions of Qt.
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
//
#include <QtCore/QtGlobal>
diff --git a/src/gui/kernel/qshapedpixmapdndwindow_p.h b/src/gui/kernel/qshapedpixmapdndwindow_p.h
index 20674b6b19..1b56f47bd5 100644
--- a/src/gui/kernel/qshapedpixmapdndwindow_p.h
+++ b/src/gui/kernel/qshapedpixmapdndwindow_p.h
@@ -42,6 +42,17 @@
#ifndef QSHAPEDPIXMAPDNDWINDOW_H
#define QSHAPEDPIXMAPDNDWINDOW_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtGui/QWindow>
#include <QtGui/QPixmap>
#include <QtGui/QBackingStore>
diff --git a/src/gui/kernel/qsimpledrag_p.h b/src/gui/kernel/qsimpledrag_p.h
index 36ea4c1ec5..d17440f7a2 100644
--- a/src/gui/kernel/qsimpledrag_p.h
+++ b/src/gui/kernel/qsimpledrag_p.h
@@ -39,8 +39,19 @@
**
****************************************************************************/
-#ifndef QSIMPLEDRAG_H
-#define QSIMPLEDRAG_H
+#ifndef QSIMPLEDRAG_P_H
+#define QSIMPLEDRAG_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
#include <qpa/qplatformdrag.h>
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 8c0db2c0c7..2cf4f41126 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -391,11 +391,30 @@ void QWindowPrivate::setTopLevelScreen(QScreen *newScreen, bool recreate)
q->destroy();
connectToScreen(newScreen);
if (newScreen && shouldRecreate)
- q->create();
+ create(true);
emitScreenChangedRecursion(newScreen);
}
}
+void QWindowPrivate::create(bool recursive)
+{
+ Q_Q(QWindow);
+ if (!platformWindow) {
+ platformWindow = QGuiApplicationPrivate::platformIntegration()->createPlatformWindow(q);
+ QObjectList childObjects = q->children();
+ for (int i = 0; i < childObjects.size(); i ++) {
+ QObject *object = childObjects.at(i);
+ if (object->isWindowType()) {
+ QWindow *window = static_cast<QWindow *>(object);
+ if (recursive)
+ window->d_func()->create(true);
+ if (window->d_func()->platformWindow)
+ window->d_func()->platformWindow->setParent(platformWindow);
+ }
+ }
+ }
+}
+
void QWindowPrivate::clearFocusObject()
{
}
@@ -516,18 +535,7 @@ bool QWindow::isVisible() const
void QWindow::create()
{
Q_D(QWindow);
- if (!d->platformWindow) {
- d->platformWindow = QGuiApplicationPrivate::platformIntegration()->createPlatformWindow(this);
- QObjectList childObjects = children();
- for (int i = 0; i < childObjects.size(); i ++) {
- QObject *object = childObjects.at(i);
- if(object->isWindowType()) {
- QWindow *window = static_cast<QWindow *>(object);
- if (window->d_func()->platformWindow)
- window->d_func()->platformWindow->setParent(d->platformWindow);
- }
- }
- }
+ d->create(false);
}
/*!
diff --git a/src/gui/kernel/qwindow.h b/src/gui/kernel/qwindow.h
index 0d13cfa648..40bfad908f 100644
--- a/src/gui/kernel/qwindow.h
+++ b/src/gui/kernel/qwindow.h
@@ -85,6 +85,7 @@ class QPlatformWindow;
class QBackingStore;
class QScreen;
class QAccessibleInterface;
+class QWindowContainer;
class Q_GUI_EXPORT QWindow : public QObject, public QSurface
{
@@ -359,6 +360,7 @@ private:
friend class QGuiApplication;
friend class QGuiApplicationPrivate;
+ friend class QWindowContainer;
friend Q_GUI_EXPORT QWindowPrivate *qt_window_private(QWindow *window);
};
diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h
index 808181d48c..cd789a6b71 100644
--- a/src/gui/kernel/qwindow_p.h
+++ b/src/gui/kernel/qwindow_p.h
@@ -133,6 +133,7 @@ public:
void _q_clearAlert();
bool windowRecreationRequired(QScreen *newScreen) const;
+ void create(bool recursive);
void setTopLevelScreen(QScreen *newScreen, bool recreate);
void connectToScreen(QScreen *topLevelScreen);
void disconnectFromScreen();
diff --git a/src/gui/opengl/qopengl_p.h b/src/gui/opengl/qopengl_p.h
index 3cf636751a..5926fc8fba 100644
--- a/src/gui/opengl/qopengl_p.h
+++ b/src/gui/opengl/qopengl_p.h
@@ -42,6 +42,17 @@
#ifndef QOPENGL_P_H
#define QOPENGL_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qopengl.h>
#include <private/qopenglcontext_p.h>
#include <QtCore/qset.h>
diff --git a/src/gui/opengl/qopenglqueryhelper_p.h b/src/gui/opengl/qopenglqueryhelper_p.h
index a7136c1cb7..bfafb30518 100644
--- a/src/gui/opengl/qopenglqueryhelper_p.h
+++ b/src/gui/opengl/qopenglqueryhelper_p.h
@@ -42,6 +42,17 @@
#ifndef QOPENGLQUERYHELPER_P_H
#define QOPENGLQUERYHELPER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qglobal.h>
#if !defined(QT_OPENGL_ES_2)
diff --git a/src/gui/opengl/qopengltexture_p.h b/src/gui/opengl/qopengltexture_p.h
index a732805f55..c50139ee59 100644
--- a/src/gui/opengl/qopengltexture_p.h
+++ b/src/gui/opengl/qopengltexture_p.h
@@ -42,6 +42,17 @@
#ifndef QABSTRACTOPENGLTEXTURE_P_H
#define QABSTRACTOPENGLTEXTURE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#ifndef QT_NO_OPENGL
#include "private/qobject_p.h"
diff --git a/src/gui/opengl/qopengltextureblitter_p.h b/src/gui/opengl/qopengltextureblitter_p.h
index b4310e5f94..75f85093ec 100644
--- a/src/gui/opengl/qopengltextureblitter_p.h
+++ b/src/gui/opengl/qopengltextureblitter_p.h
@@ -42,6 +42,17 @@
#ifndef QOPENGLTEXTUREBLITTER_P_H
#define QOPENGLTEXTUREBLITTER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtGui/qopengl.h>
#include <QtGui/QMatrix3x3>
diff --git a/src/gui/opengl/qopengltexturehelper_p.h b/src/gui/opengl/qopengltexturehelper_p.h
index 782486b90d..a920a08c71 100644
--- a/src/gui/opengl/qopengltexturehelper_p.h
+++ b/src/gui/opengl/qopengltexturehelper_p.h
@@ -42,6 +42,17 @@
#ifndef QOPENGLTEXTUREHELPER_P_H
#define QOPENGLTEXTUREHELPER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qglobal.h>
#ifndef QT_NO_OPENGL
diff --git a/src/gui/opengl/qopenglversionfunctionsfactory_p.h b/src/gui/opengl/qopenglversionfunctionsfactory_p.h
index 2312e900f9..c644bc9082 100644
--- a/src/gui/opengl/qopenglversionfunctionsfactory_p.h
+++ b/src/gui/opengl/qopenglversionfunctionsfactory_p.h
@@ -51,6 +51,17 @@
#ifndef QOPENGLVERSIONFUNCTIONFACTORY_P_H
#define QOPENGLVERSIONFUNCTIONFACTORY_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#ifndef QT_NO_OPENGL
#include <QtCore/QtGlobal>
diff --git a/src/gui/opengl/qtriangulatingstroker_p.h b/src/gui/opengl/qtriangulatingstroker_p.h
index 2328f75af8..dc3a13e698 100644
--- a/src/gui/opengl/qtriangulatingstroker_p.h
+++ b/src/gui/opengl/qtriangulatingstroker_p.h
@@ -42,6 +42,17 @@
#ifndef QTRIANGULATINGSTROKER_P_H
#define QTRIANGULATINGSTROKER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <private/qdatabuffer_p.h>
#include <qvarlengtharray.h>
#include <private/qvectorpath_p.h>
diff --git a/src/gui/painting/qblittable_p.h b/src/gui/painting/qblittable_p.h
index 0f846741b3..b13b793a3d 100644
--- a/src/gui/painting/qblittable_p.h
+++ b/src/gui/painting/qblittable_p.h
@@ -42,6 +42,17 @@
#ifndef QBLITTABLE_P_H
#define QBLITTABLE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qsize.h>
#include <QtGui/private/qpixmap_blitter_p.h>
diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp
index a2301e3cd8..926a1696b0 100644
--- a/src/gui/painting/qcosmeticstroker.cpp
+++ b/src/gui/painting/qcosmeticstroker.cpp
@@ -533,8 +533,8 @@ void QCosmeticStroker::drawPath(const QVectorPath &path)
QPointF p = QPointF(points[0], points[1]) * state->matrix;
patternOffset = state->lastPen.dashOffset()*64;
- lastPixel.x = -1;
- lastPixel.y = -1;
+ lastPixel.x = INT_MIN;
+ lastPixel.y = INT_MIN;
bool closed;
const QPainterPath::ElementType *e = subPath(type, end, points, &closed);
@@ -588,8 +588,8 @@ void QCosmeticStroker::drawPath(const QVectorPath &path)
QPointF p = QPointF(points[0], points[1]) * state->matrix;
QPointF movedTo = p;
patternOffset = state->lastPen.dashOffset()*64;
- lastPixel.x = -1;
- lastPixel.y = -1;
+ lastPixel.x = INT_MIN;
+ lastPixel.y = INT_MIN;
const qreal *begin = points;
const qreal *end = points + 2*path.elementCount();
diff --git a/src/gui/painting/qcosmeticstroker_p.h b/src/gui/painting/qcosmeticstroker_p.h
index 5fc3559da4..84e22b2653 100644
--- a/src/gui/painting/qcosmeticstroker_p.h
+++ b/src/gui/painting/qcosmeticstroker_p.h
@@ -42,6 +42,17 @@
#ifndef QCOSMETICSTROKER_P_H
#define QCOSMETICSTROKER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <private/qdrawhelper_p.h>
#include <private/qvectorpath_p.h>
#include <private/qpaintengine_raster_p.h>
diff --git a/src/gui/painting/qpaintengine_blitter_p.h b/src/gui/painting/qpaintengine_blitter_p.h
index 56661a7d90..72dba8e49e 100644
--- a/src/gui/painting/qpaintengine_blitter_p.h
+++ b/src/gui/painting/qpaintengine_blitter_p.h
@@ -42,6 +42,17 @@
#ifndef QPAINTENGINE_BLITTER_P_H
#define QPAINTENGINE_BLITTER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "private/qpaintengine_raster_p.h"
#ifndef QT_NO_BLITTABLE
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index 86a0bf1066..c3be9da2f7 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -822,6 +822,13 @@ QFontEngine *loadSingleEngine(int script,
QFontCache::Key key(def,script);
QFontEngine *engine = QFontCache::instance()->findEngine(key);
if (!engine) {
+ // If the font data's native stretch matches the requested stretch we need to set stretch to 100
+ // to avoid the fontengine synthesizing stretch. If they didn't match exactly we need to calculate
+ // the new stretch factor. This only done if not matched by styleName.
+ bool styleNameMatch = !request.styleName.isEmpty() && request.styleName == style->styleName;
+ if (!styleNameMatch && style->key.stretch != 0 && request.stretch != 0)
+ def.stretch = (request.stretch * 100 + 50) / style->key.stretch;
+
engine = pfdb->fontEngine(def, size->handle);
if (engine) {
Q_ASSERT(engine->type() != QFontEngine::Multi);
@@ -931,7 +938,7 @@ static
unsigned int bestFoundry(int script, unsigned int score, int styleStrategy,
const QtFontFamily *family, const QString &foundry_name,
QtFontStyle::Key styleKey, int pixelSize, char pitch,
- QtFontDesc *desc, int force_encoding_id)
+ QtFontDesc *desc, int force_encoding_id, QString styleName = QString())
{
Q_UNUSED(force_encoding_id);
Q_UNUSED(script);
@@ -953,7 +960,7 @@ unsigned int bestFoundry(int script, unsigned int score, int styleStrategy,
FM_DEBUG(" looking for matching style in foundry '%s' %d",
foundry->name.isEmpty() ? "-- none --" : foundry->name.toLatin1().constData(), foundry->count);
- QtFontStyle *style = bestStyle(foundry, styleKey);
+ QtFontStyle *style = bestStyle(foundry, styleKey, styleName);
if (!style->smoothScalable && (styleStrategy & QFont::ForceOutline)) {
FM_DEBUG(" ForceOutline set, but not smoothly scalable");
@@ -1140,13 +1147,13 @@ static int match(int script, const QFontDef &request,
unsigned int newscore =
bestFoundry(script, score, request.styleStrategy,
test.family, foundry_name, styleKey, request.pixelSize, pitch,
- &test, force_encoding_id);
+ &test, force_encoding_id, request.styleName);
if (test.foundry == 0) {
// the specific foundry was not found, so look for
// any foundry matching our requirements
newscore = bestFoundry(script, score, request.styleStrategy, test.family,
QString(), styleKey, request.pixelSize,
- pitch, &test, force_encoding_id);
+ pitch, &test, force_encoding_id, request.styleName);
}
if (newscore < score) {
diff --git a/src/gui/text/qplatformfontdatabase.cpp b/src/gui/text/qplatformfontdatabase.cpp
index 5dc81d241d..e1d58a0d05 100644
--- a/src/gui/text/qplatformfontdatabase.cpp
+++ b/src/gui/text/qplatformfontdatabase.cpp
@@ -550,60 +550,58 @@ QSupportedWritingSystems QPlatformFontDatabase::writingSystemsFromTrueTypeBits(q
}
}
}
- if (!hasScript) {
- if (codePageRange[0] & ((1 << Latin1CsbBit) | (1 << CentralEuropeCsbBit) | (1 << TurkishCsbBit) | (1 << BalticCsbBit))) {
- writingSystems.setSupported(QFontDatabase::Latin);
- hasScript = true;
- //qDebug("font %s supports Latin", familyName.latin1());
- }
- if (codePageRange[0] & (1 << CyrillicCsbBit)) {
- writingSystems.setSupported(QFontDatabase::Cyrillic);
- hasScript = true;
- //qDebug("font %s supports Cyrillic", familyName.latin1());
- }
- if (codePageRange[0] & (1 << GreekCsbBit)) {
- writingSystems.setSupported(QFontDatabase::Greek);
- hasScript = true;
- //qDebug("font %s supports Greek", familyName.latin1());
- }
- if (codePageRange[0] & (1 << HebrewCsbBit)) {
- writingSystems.setSupported(QFontDatabase::Hebrew);
- hasScript = true;
- //qDebug("font %s supports Hebrew", familyName.latin1());
- }
- if (codePageRange[0] & (1 << ArabicCsbBit)) {
- writingSystems.setSupported(QFontDatabase::Arabic);
- hasScript = true;
- //qDebug("font %s supports Arabic", familyName.latin1());
- }
- if (codePageRange[0] & (1 << VietnameseCsbBit)) {
- writingSystems.setSupported(QFontDatabase::Vietnamese);
- hasScript = true;
- //qDebug("font %s supports Vietnamese", familyName.latin1());
- }
- if (codePageRange[0] & (1 << SimplifiedChineseCsbBit)) {
- writingSystems.setSupported(QFontDatabase::SimplifiedChinese);
- hasScript = true;
- //qDebug("font %s supports Simplified Chinese", familyName.latin1());
- }
- if (codePageRange[0] & (1 << TraditionalChineseCsbBit)) {
- writingSystems.setSupported(QFontDatabase::TraditionalChinese);
- hasScript = true;
- //qDebug("font %s supports Traditional Chinese", familyName.latin1());
- }
- if (codePageRange[0] & (1 << JapaneseCsbBit)) {
- writingSystems.setSupported(QFontDatabase::Japanese);
- hasScript = true;
- //qDebug("font %s supports Japanese", familyName.latin1());
- }
- if (codePageRange[0] & ((1 << KoreanCsbBit) | (1 << KoreanJohabCsbBit))) {
- writingSystems.setSupported(QFontDatabase::Korean);
- hasScript = true;
- //qDebug("font %s supports Korean", familyName.latin1());
- }
- if (!hasScript)
- writingSystems.setSupported(QFontDatabase::Symbol);
+ if (codePageRange[0] & ((1 << Latin1CsbBit) | (1 << CentralEuropeCsbBit) | (1 << TurkishCsbBit) | (1 << BalticCsbBit))) {
+ writingSystems.setSupported(QFontDatabase::Latin);
+ hasScript = true;
+ //qDebug("font %s supports Latin", familyName.latin1());
+ }
+ if (codePageRange[0] & (1 << CyrillicCsbBit)) {
+ writingSystems.setSupported(QFontDatabase::Cyrillic);
+ hasScript = true;
+ //qDebug("font %s supports Cyrillic", familyName.latin1());
+ }
+ if (codePageRange[0] & (1 << GreekCsbBit)) {
+ writingSystems.setSupported(QFontDatabase::Greek);
+ hasScript = true;
+ //qDebug("font %s supports Greek", familyName.latin1());
+ }
+ if (codePageRange[0] & (1 << HebrewCsbBit)) {
+ writingSystems.setSupported(QFontDatabase::Hebrew);
+ hasScript = true;
+ //qDebug("font %s supports Hebrew", familyName.latin1());
+ }
+ if (codePageRange[0] & (1 << ArabicCsbBit)) {
+ writingSystems.setSupported(QFontDatabase::Arabic);
+ hasScript = true;
+ //qDebug("font %s supports Arabic", familyName.latin1());
+ }
+ if (codePageRange[0] & (1 << VietnameseCsbBit)) {
+ writingSystems.setSupported(QFontDatabase::Vietnamese);
+ hasScript = true;
+ //qDebug("font %s supports Vietnamese", familyName.latin1());
+ }
+ if (codePageRange[0] & (1 << SimplifiedChineseCsbBit)) {
+ writingSystems.setSupported(QFontDatabase::SimplifiedChinese);
+ hasScript = true;
+ //qDebug("font %s supports Simplified Chinese", familyName.latin1());
+ }
+ if (codePageRange[0] & (1 << TraditionalChineseCsbBit)) {
+ writingSystems.setSupported(QFontDatabase::TraditionalChinese);
+ hasScript = true;
+ //qDebug("font %s supports Traditional Chinese", familyName.latin1());
+ }
+ if (codePageRange[0] & (1 << JapaneseCsbBit)) {
+ writingSystems.setSupported(QFontDatabase::Japanese);
+ hasScript = true;
+ //qDebug("font %s supports Japanese", familyName.latin1());
+ }
+ if (codePageRange[0] & ((1 << KoreanCsbBit) | (1 << KoreanJohabCsbBit))) {
+ writingSystems.setSupported(QFontDatabase::Korean);
+ hasScript = true;
+ //qDebug("font %s supports Korean", familyName.latin1());
}
+ if (!hasScript)
+ writingSystems.setSupported(QFontDatabase::Symbol);
return writingSystems;
}
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 452b263670..b192460f07 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -118,7 +118,9 @@ private:
return;
const int end = start + length;
for (int i = start + 1; i < end; ++i) {
- if (m_analysis[i] == m_analysis[start]
+ if (m_analysis[i].bidiLevel == m_analysis[start].bidiLevel
+ && m_analysis[i].flags == m_analysis[start].flags
+ && (m_analysis[i].script == m_analysis[start].script || m_string[i] == QLatin1Char('.'))
&& m_analysis[i].flags < QScriptAnalysis::SpaceTabOrObject
&& i - start < MaxItemLength)
continue;
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index ad00396553..5056319b9d 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -2501,7 +2501,7 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const
}
int lineEnd = line.from + line.length + line.trailingSpaces;
- int pos = *cursorPos;
+ int pos = qBound(0, *cursorPos, lineEnd);
int itm;
const QCharAttributes *attributes = eng->attributes();
if (!attributes) {
diff --git a/src/gui/util/qabstractlayoutstyleinfo_p.h b/src/gui/util/qabstractlayoutstyleinfo_p.h
index 52f151c5d2..b0f901d0ac 100644
--- a/src/gui/util/qabstractlayoutstyleinfo_p.h
+++ b/src/gui/util/qabstractlayoutstyleinfo_p.h
@@ -42,6 +42,17 @@
#ifndef QABSTRACTLAYOUTSTYLEINFO_P_H
#define QABSTRACTLAYOUTSTYLEINFO_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qnamespace.h>
#include "qlayoutpolicy_p.h"
diff --git a/src/gui/util/qlayoutpolicy_p.h b/src/gui/util/qlayoutpolicy_p.h
index 664afef1a4..2d98bcd84c 100644
--- a/src/gui/util/qlayoutpolicy_p.h
+++ b/src/gui/util/qlayoutpolicy_p.h
@@ -42,6 +42,17 @@
#ifndef QLAYOUTPOLICY_H
#define QLAYOUTPOLICY_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qobject.h>
#include <QtCore/qnamespace.h>
diff --git a/src/network/access/qnetworkaccessauthenticationmanager.cpp b/src/network/access/qnetworkaccessauthenticationmanager.cpp
index ea7bdc198a..b92f9c1b9b 100644
--- a/src/network/access/qnetworkaccessauthenticationmanager.cpp
+++ b/src/network/access/qnetworkaccessauthenticationmanager.cpp
@@ -231,6 +231,8 @@ void QNetworkAccessAuthenticationManager::cacheCredentials(const QUrl &url,
const QAuthenticator *authenticator)
{
Q_ASSERT(authenticator);
+ if (authenticator->isNull())
+ return;
QString domain = QString::fromLatin1("/"); // FIXME: make QAuthenticator return the domain
QString realm = authenticator->realm();
diff --git a/src/network/access/qnetworkaccessftpbackend.cpp b/src/network/access/qnetworkaccessftpbackend.cpp
index 246eb41657..e8695f9b56 100644
--- a/src/network/access/qnetworkaccessftpbackend.cpp
+++ b/src/network/access/qnetworkaccessftpbackend.cpp
@@ -211,7 +211,7 @@ void QNetworkAccessFtpBackend::ftpConnectionReady(QNetworkAccessCache::Cacheable
// no, defer the actual operation until after we've logged in
}
-void QNetworkAccessFtpBackend::disconnectFromFtp()
+void QNetworkAccessFtpBackend::disconnectFromFtp(CacheCleanupMode mode)
{
state = Disconnecting;
@@ -219,7 +219,12 @@ void QNetworkAccessFtpBackend::disconnectFromFtp()
disconnect(ftp, 0, this, 0);
QByteArray key = makeCacheKey(url());
- QNetworkAccessManagerPrivate::getObjectCache(this)->releaseEntry(key);
+ if (mode == RemoveCachedConnection) {
+ QNetworkAccessManagerPrivate::getObjectCache(this)->removeEntry(key);
+ ftp->dispose();
+ } else {
+ QNetworkAccessManagerPrivate::getObjectCache(this)->releaseEntry(key);
+ }
ftp = 0;
}
@@ -274,14 +279,7 @@ void QNetworkAccessFtpBackend::ftpDone()
}
// we're not connected, so remove the cache entry:
- QByteArray key = makeCacheKey(url());
- QNetworkAccessManagerPrivate::getObjectCache(this)->removeEntry(key);
-
- disconnect(ftp, 0, this, 0);
- ftp->dispose();
- ftp = 0;
-
- state = Disconnecting;
+ disconnectFromFtp(RemoveCachedConnection);
finished();
return;
}
@@ -301,7 +299,7 @@ void QNetworkAccessFtpBackend::ftpDone()
else
error(QNetworkReply::ContentAccessDenied, msg);
- disconnectFromFtp();
+ disconnectFromFtp(RemoveCachedConnection);
finished();
}
diff --git a/src/network/access/qnetworkaccessftpbackend_p.h b/src/network/access/qnetworkaccessftpbackend_p.h
index c006d450b8..534efad676 100644
--- a/src/network/access/qnetworkaccessftpbackend_p.h
+++ b/src/network/access/qnetworkaccessftpbackend_p.h
@@ -90,7 +90,12 @@ public:
virtual void downstreamReadyWrite();
- void disconnectFromFtp();
+ enum CacheCleanupMode {
+ ReleaseCachedConnection,
+ RemoveCachedConnection
+ };
+
+ void disconnectFromFtp(CacheCleanupMode mode = ReleaseCachedConnection);
public slots:
void ftpConnectionReady(QNetworkAccessCache::CacheableObject *object);
diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp
index ea935869fb..c4c7abb240 100644
--- a/src/network/kernel/qauthenticator.cpp
+++ b/src/network/kernel/qauthenticator.cpp
@@ -439,9 +439,7 @@ void QAuthenticatorPrivate::parseHttpResponse(const QList<QPair<QByteArray, QByt
phase = Done;
break;
case Ntlm:
- // #### extract from header
- if (user.isEmpty() && password.isEmpty())
- phase = Done;
+ // work is done in calculateResponse()
break;
case DigestMd5: {
this->options[QLatin1String("realm")] = realm = QString::fromLatin1(options.value("realm"));
diff --git a/src/network/kernel/qurlinfo_p.h b/src/network/kernel/qurlinfo_p.h
index 1aa59f25ad..31eb0730d3 100644
--- a/src/network/kernel/qurlinfo_p.h
+++ b/src/network/kernel/qurlinfo_p.h
@@ -42,6 +42,17 @@
#ifndef QURLINFO_H
#define QURLINFO_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qdatetime.h>
#include <QtCore/qstring.h>
#include <QtCore/qiodevice.h>
diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp
index 0a25815752..9f3c29e207 100644
--- a/src/network/socket/qhttpsocketengine.cpp
+++ b/src/network/socket/qhttpsocketengine.cpp
@@ -594,16 +594,18 @@ void QHttpSocketEngine::slotSocketReadNotification()
priv = QAuthenticatorPrivate::getPrivate(d->authenticator);
priv->hasFailed = false;
} else if (statusCode == 407) {
- if (d->credentialsSent) {
+ if (d->authenticator.isNull())
+ d->authenticator.detach();
+ priv = QAuthenticatorPrivate::getPrivate(d->authenticator);
+
+ if (d->credentialsSent && priv->phase != QAuthenticatorPrivate::Phase2) {
+ // Remember that (e.g.) NTLM is two-phase, so only reset when the authentication is not currently in progress.
//407 response again means the provided username/password were invalid.
d->authenticator = QAuthenticator(); //this is needed otherwise parseHttpResponse won't set the state, and then signal isn't emitted.
d->authenticator.detach();
priv = QAuthenticatorPrivate::getPrivate(d->authenticator);
priv->hasFailed = true;
}
- else if (d->authenticator.isNull())
- d->authenticator.detach();
- priv = QAuthenticatorPrivate::getPrivate(d->authenticator);
priv->parseHttpResponse(d->reply->header(), true);
diff --git a/src/network/ssl/qsslcertificateextension_p.h b/src/network/ssl/qsslcertificateextension_p.h
index cc04e76634..6891733174 100644
--- a/src/network/ssl/qsslcertificateextension_p.h
+++ b/src/network/ssl/qsslcertificateextension_p.h
@@ -42,6 +42,17 @@
#ifndef QSSLCERTIFICATEEXTENSION_P_H
#define QSSLCERTIFICATEEXTENSION_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qsslcertificateextension.h"
QT_BEGIN_NAMESPACE
diff --git a/src/network/ssl/qsslcontext_openssl_p.h b/src/network/ssl/qsslcontext_openssl_p.h
index 9fb9bd2204..d4ab91f8ec 100644
--- a/src/network/ssl/qsslcontext_openssl_p.h
+++ b/src/network/ssl/qsslcontext_openssl_p.h
@@ -44,6 +44,17 @@
#ifndef QSSLCONTEXT_OPENSSL_P_H
#define QSSLCONTEXT_OPENSSL_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qvariant.h>
#include <QtNetwork/qsslcertificate.h>
#include <QtNetwork/qsslconfiguration.h>
diff --git a/src/platformsupport/cfsocketnotifier/qcfsocketnotifier_p.h b/src/platformsupport/cfsocketnotifier/qcfsocketnotifier_p.h
index cd1eb8e4ca..dcd1b12ad7 100644
--- a/src/platformsupport/cfsocketnotifier/qcfsocketnotifier_p.h
+++ b/src/platformsupport/cfsocketnotifier/qcfsocketnotifier_p.h
@@ -42,6 +42,17 @@
#ifndef QCFSOCKETNOTIFIER_P_H
#define QCFSOCKETNOTIFIER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qabstracteventdispatcher.h>
#include <QtCore/qhash.h>
diff --git a/src/platformsupport/cglconvenience/cglconvenience_p.h b/src/platformsupport/cglconvenience/cglconvenience_p.h
index 82842a78f0..674753d878 100644
--- a/src/platformsupport/cglconvenience/cglconvenience_p.h
+++ b/src/platformsupport/cglconvenience/cglconvenience_p.h
@@ -42,6 +42,17 @@
#ifndef QMACGLCONVENIENCE_H
#define QMACGLCONVENIENCE_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QSurfaceFormat>
#include <QString>
#include <OpenGL/OpenGL.h>
diff --git a/src/platformsupport/clipboard/qmacmime_p.h b/src/platformsupport/clipboard/qmacmime_p.h
index 0802987fab..6bdb90232c 100644
--- a/src/platformsupport/clipboard/qmacmime_p.h
+++ b/src/platformsupport/clipboard/qmacmime_p.h
@@ -42,6 +42,17 @@
#ifndef QMACMIME_H
#define QMACMIME_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore>
#include <CoreFoundation/CoreFoundation.h>
diff --git a/src/platformsupport/devicediscovery/qdevicediscovery_p.h b/src/platformsupport/devicediscovery/qdevicediscovery_p.h
index 0e21118324..fd44cdd8da 100644
--- a/src/platformsupport/devicediscovery/qdevicediscovery_p.h
+++ b/src/platformsupport/devicediscovery/qdevicediscovery_p.h
@@ -42,6 +42,17 @@
#ifndef QDEVICEDISCOVERY_H
#define QDEVICEDISCOVERY_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QObject>
#include <QSocketNotifier>
#include <QStringList>
diff --git a/src/platformsupport/eglconvenience/qeglcompositor_p.h b/src/platformsupport/eglconvenience/qeglcompositor_p.h
index 370345ada6..2e0a3adaf3 100644
--- a/src/platformsupport/eglconvenience/qeglcompositor_p.h
+++ b/src/platformsupport/eglconvenience/qeglcompositor_p.h
@@ -42,6 +42,17 @@
#ifndef QEGLCOMPOSITOR_H
#define QEGLCOMPOSITOR_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/QTimer>
QT_BEGIN_NAMESPACE
diff --git a/src/platformsupport/eglconvenience/qeglconvenience_p.h b/src/platformsupport/eglconvenience/qeglconvenience_p.h
index 8616275e53..41d392e43a 100644
--- a/src/platformsupport/eglconvenience/qeglconvenience_p.h
+++ b/src/platformsupport/eglconvenience/qeglconvenience_p.h
@@ -42,6 +42,17 @@
#ifndef QEGLCONVENIENCE_H
#define QEGLCONVENIENCE_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtGui/QSurfaceFormat>
#include <QtCore/QVector>
#include <QtCore/QSizeF>
diff --git a/src/platformsupport/eglconvenience/qeglpbuffer_p.h b/src/platformsupport/eglconvenience/qeglpbuffer_p.h
index 1b4ac6f991..92d89198a4 100644
--- a/src/platformsupport/eglconvenience/qeglpbuffer_p.h
+++ b/src/platformsupport/eglconvenience/qeglpbuffer_p.h
@@ -42,6 +42,17 @@
#ifndef QEGLPBUFFER_H
#define QEGLPBUFFER_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <EGL/egl.h>
#include <qpa/qplatformoffscreensurface.h>
diff --git a/src/platformsupport/eglconvenience/qeglplatformbackingstore_p.h b/src/platformsupport/eglconvenience/qeglplatformbackingstore_p.h
index f3c4b9e559..664e637193 100644
--- a/src/platformsupport/eglconvenience/qeglplatformbackingstore_p.h
+++ b/src/platformsupport/eglconvenience/qeglplatformbackingstore_p.h
@@ -42,6 +42,17 @@
#ifndef QEGLPLATFORMBACKINGSTORE_H
#define QEGLPLATFORMBACKINGSTORE_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformbackingstore.h>
#include <QImage>
diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext_p.h b/src/platformsupport/eglconvenience/qeglplatformcontext_p.h
index 82f062c4a4..369359fc50 100644
--- a/src/platformsupport/eglconvenience/qeglplatformcontext_p.h
+++ b/src/platformsupport/eglconvenience/qeglplatformcontext_p.h
@@ -42,6 +42,17 @@
#ifndef QEGLPLATFORMCONTEXT_H
#define QEGLPLATFORMCONTEXT_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformwindow.h>
#include <qpa/qplatformopenglcontext.h>
#include <QtCore/QVariant>
diff --git a/src/platformsupport/eglconvenience/qeglplatformcursor_p.h b/src/platformsupport/eglconvenience/qeglplatformcursor_p.h
index 440bcc40eb..55c87859be 100644
--- a/src/platformsupport/eglconvenience/qeglplatformcursor_p.h
+++ b/src/platformsupport/eglconvenience/qeglplatformcursor_p.h
@@ -42,6 +42,17 @@
#ifndef QEGLPLATFORMCURSOR_H
#define QEGLPLATFORMCURSOR_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformcursor.h>
#include <qpa/qplatformscreen.h>
#include <QtGui/QOpenGLFunctions>
diff --git a/src/platformsupport/eglconvenience/qeglplatformintegration_p.h b/src/platformsupport/eglconvenience/qeglplatformintegration_p.h
index 36f79e2997..b0c3865b25 100644
--- a/src/platformsupport/eglconvenience/qeglplatformintegration_p.h
+++ b/src/platformsupport/eglconvenience/qeglplatformintegration_p.h
@@ -42,6 +42,17 @@
#ifndef QEGLPLATFORMINTEGRATION_H
#define QEGLPLATFORMINTEGRATION_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformintegration.h>
#include <qpa/qplatformnativeinterface.h>
#include <QtCore/QVariant>
diff --git a/src/platformsupport/eglconvenience/qeglplatformscreen_p.h b/src/platformsupport/eglconvenience/qeglplatformscreen_p.h
index d0d8a52a87..955d9db5de 100644
--- a/src/platformsupport/eglconvenience/qeglplatformscreen_p.h
+++ b/src/platformsupport/eglconvenience/qeglplatformscreen_p.h
@@ -42,6 +42,17 @@
#ifndef QEGLPLATFORMSCREEN_H
#define QEGLPLATFORMSCREEN_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/QList>
#include <qpa/qplatformscreen.h>
#include <EGL/egl.h>
diff --git a/src/platformsupport/eglconvenience/qeglplatformwindow_p.h b/src/platformsupport/eglconvenience/qeglplatformwindow_p.h
index 8c77d31fef..536b97e419 100644
--- a/src/platformsupport/eglconvenience/qeglplatformwindow_p.h
+++ b/src/platformsupport/eglconvenience/qeglplatformwindow_p.h
@@ -42,6 +42,17 @@
#ifndef QEGLPLATFORMWINDOW_H
#define QEGLPLATFORMWINDOW_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformwindow.h>
#include <EGL/egl.h>
diff --git a/src/platformsupport/eglconvenience/qxlibeglintegration_p.h b/src/platformsupport/eglconvenience/qxlibeglintegration_p.h
index a1360fe74e..2ee63d4fbc 100644
--- a/src/platformsupport/eglconvenience/qxlibeglintegration_p.h
+++ b/src/platformsupport/eglconvenience/qxlibeglintegration_p.h
@@ -42,6 +42,17 @@
#ifndef QTESTLITEEGLINTEGRATION_H
#define QTESTLITEEGLINTEGRATION_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qeglconvenience_p.h"
#include <X11/X.h>
#include <X11/Xlib.h>
diff --git a/src/platformsupport/eventdispatchers/qeventdispatcher_cf_p.h b/src/platformsupport/eventdispatchers/qeventdispatcher_cf_p.h
index 1742a9b939..fe911be510 100644
--- a/src/platformsupport/eventdispatchers/qeventdispatcher_cf_p.h
+++ b/src/platformsupport/eventdispatchers/qeventdispatcher_cf_p.h
@@ -76,6 +76,17 @@
#ifndef QEVENTDISPATCHER_CF_P_H
#define QEVENTDISPATCHER_CF_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#define DEBUG_EVENT_DISPATCHER 0
#include <QtCore/qabstracteventdispatcher.h>
diff --git a/src/platformsupport/fbconvenience/qfbbackingstore_p.h b/src/platformsupport/fbconvenience/qfbbackingstore_p.h
index 8e560ee46a..2a8597e5d9 100644
--- a/src/platformsupport/fbconvenience/qfbbackingstore_p.h
+++ b/src/platformsupport/fbconvenience/qfbbackingstore_p.h
@@ -42,6 +42,17 @@
#ifndef QFBBACKINGSTORE_P_H
#define QFBBACKINGSTORE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformbackingstore.h>
QT_BEGIN_NAMESPACE
diff --git a/src/platformsupport/fbconvenience/qfbcursor_p.h b/src/platformsupport/fbconvenience/qfbcursor_p.h
index 40377e2075..4196cad96f 100644
--- a/src/platformsupport/fbconvenience/qfbcursor_p.h
+++ b/src/platformsupport/fbconvenience/qfbcursor_p.h
@@ -42,6 +42,17 @@
#ifndef QFBCURSOR_P_H
#define QFBCURSOR_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformcursor.h>
QT_BEGIN_NAMESPACE
diff --git a/src/platformsupport/fbconvenience/qfbscreen_p.h b/src/platformsupport/fbconvenience/qfbscreen_p.h
index 924b49afda..874702fd47 100644
--- a/src/platformsupport/fbconvenience/qfbscreen_p.h
+++ b/src/platformsupport/fbconvenience/qfbscreen_p.h
@@ -42,6 +42,17 @@
#ifndef QFBSCREEN_P_H
#define QFBSCREEN_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformscreen.h>
#include <QtCore/QTimer>
#include <QtCore/QSize>
diff --git a/src/platformsupport/fbconvenience/qfbvthandler_p.h b/src/platformsupport/fbconvenience/qfbvthandler_p.h
index d98cd5a9d1..ddaedca3e0 100644
--- a/src/platformsupport/fbconvenience/qfbvthandler_p.h
+++ b/src/platformsupport/fbconvenience/qfbvthandler_p.h
@@ -42,6 +42,17 @@
#ifndef QFBVTHANDLER_H
#define QFBVTHANDLER_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QObject>
QT_BEGIN_NAMESPACE
diff --git a/src/platformsupport/fbconvenience/qfbwindow_p.h b/src/platformsupport/fbconvenience/qfbwindow_p.h
index a2e0785c96..8e526404e0 100644
--- a/src/platformsupport/fbconvenience/qfbwindow_p.h
+++ b/src/platformsupport/fbconvenience/qfbwindow_p.h
@@ -42,6 +42,17 @@
#ifndef QFBWINDOW_P_H
#define QFBWINDOW_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformwindow.h>
QT_BEGIN_NAMESPACE
diff --git a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h
index 247a2855e2..a512644966 100644
--- a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h
+++ b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h
@@ -42,6 +42,17 @@
#ifndef QBASICFONTDATABASE_H
#define QBASICFONTDATABASE_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformfontdatabase.h>
#include <QtCore/QByteArray>
#include <QtCore/QString>
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h
index ba706dc59e..fc929e464d 100644
--- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h
@@ -42,6 +42,17 @@
#ifndef QFONTCONFIGDATABASE_H
#define QFONTCONFIGDATABASE_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformfontdatabase.h>
#include <QtPlatformSupport/private/qbasicfontdatabase_p.h>
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h b/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h
index 9fb273f692..e6fdef37b0 100644
--- a/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h
@@ -42,6 +42,17 @@
#ifndef QFONTENGINEMULTIFONTCONFIG_H
#define QFONTENGINEMULTIFONTCONFIG_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtGui/private/qfontengine_p.h>
#include <fontconfig/fontconfig.h>
diff --git a/src/platformsupport/fontdatabases/genericunix/qgenericunixfontdatabase_p.h b/src/platformsupport/fontdatabases/genericunix/qgenericunixfontdatabase_p.h
index a8a0b8fe9c..42fd677cf7 100644
--- a/src/platformsupport/fontdatabases/genericunix/qgenericunixfontdatabase_p.h
+++ b/src/platformsupport/fontdatabases/genericunix/qgenericunixfontdatabase_p.h
@@ -42,6 +42,17 @@
#ifndef QGENERICUNIXFONTDATABASE_H
#define QGENERICUNIXFONTDATABASE_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qglobal.h>
#ifdef Q_FONTCONFIGDATABASE
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
index c3553c79f9..f213f6b04c 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
@@ -809,6 +809,9 @@ QList<int> QCoreTextFontDatabase::standardSizes() const
void QCoreTextFontDatabase::removeApplicationFonts()
{
+ if (m_applicationFonts.isEmpty())
+ return;
+
foreach (const QVariant &font, m_applicationFonts) {
#if HAVE_CORETEXT
if (&CTFontManagerUnregisterGraphicsFont && &CTFontManagerUnregisterFontsForURL) {
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
index a3da27b28d..10f54310a8 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
@@ -42,6 +42,17 @@
#ifndef QCORETEXTFONTDATABASE_H
#define QCORETEXTFONTDATABASE_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qglobal.h>
#define HAVE_CORETEXT QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_8, __IPHONE_4_1)
#define HAVE_ATS QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_5, __IPHONE_NA)
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
index e39f514878..380b3a711d 100644
--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
@@ -42,6 +42,17 @@
#ifndef QFONTENGINE_CORETEXT_P_H
#define QFONTENGINE_CORETEXT_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <private/qfontengine_p.h>
#include <private/qcore_mac_p.h>
diff --git a/src/platformsupport/glxconvenience/qglxconvenience_p.h b/src/platformsupport/glxconvenience/qglxconvenience_p.h
index 04fa8595ef..bba177b14b 100644
--- a/src/platformsupport/glxconvenience/qglxconvenience_p.h
+++ b/src/platformsupport/glxconvenience/qglxconvenience_p.h
@@ -42,6 +42,17 @@
#ifndef QGLXCONVENIENCE_H
#define QGLXCONVENIENCE_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QSurfaceFormat>
#include <QVector>
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h b/src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h
index 5e919ebeb7..ff34ad346b 100644
--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h
+++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h
@@ -42,6 +42,17 @@
#ifndef QEVDEVKEYBOARDHANDLER_DEFAULTMAP_P_H
#define QEVDEVKEYBOARDHANDLER_DEFAULTMAP_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qnamespace.h"
#include "linux/input.h"
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h
index 164b1c3863..06b7818135 100644
--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h
+++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h
@@ -42,6 +42,17 @@
#ifndef QEVDEVKEYBOARDHANDLER_P_H
#define QEVDEVKEYBOARDHANDLER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qobject.h>
#include <QTimer>
#include <QDataStream>
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager_p.h b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager_p.h
index e7a07f17a4..c59de3ca09 100644
--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager_p.h
+++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager_p.h
@@ -42,6 +42,17 @@
#ifndef QEVDEVKEYBOARDMANAGER_P_H
#define QEVDEVKEYBOARDMANAGER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qevdevkeyboardhandler_p.h"
#include <QtPlatformSupport/private/qdevicediscovery_p.h>
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h b/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h
index 027d2862b0..ee284bd7ed 100644
--- a/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h
+++ b/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h
@@ -42,6 +42,17 @@
#ifndef QEVDEVMOUSEHANDLER_P_H
#define QEVDEVMOUSEHANDLER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QObject>
#include <QString>
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h b/src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h
index 5280b5efbd..83d8b314aa 100644
--- a/src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h
+++ b/src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h
@@ -42,6 +42,17 @@
#ifndef QEVDEVMOUSEMANAGER_P_H
#define QEVDEVMOUSEMANAGER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qevdevmousehandler_p.h"
#include <QtPlatformSupport/private/qdevicediscovery_p.h>
diff --git a/src/platformsupport/input/evdevtablet/qevdevtablet_p.h b/src/platformsupport/input/evdevtablet/qevdevtablet_p.h
index 9222db9907..f168d8200b 100644
--- a/src/platformsupport/input/evdevtablet/qevdevtablet_p.h
+++ b/src/platformsupport/input/evdevtablet/qevdevtablet_p.h
@@ -42,6 +42,17 @@
#ifndef QEVDEVTABLET_P_H
#define QEVDEVTABLET_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QObject>
#include <QString>
#include <QThread>
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouch_p.h b/src/platformsupport/input/evdevtouch/qevdevtouch_p.h
index d0ea839f51..a5d9e73200 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouch_p.h
+++ b/src/platformsupport/input/evdevtouch/qevdevtouch_p.h
@@ -42,6 +42,17 @@
#ifndef QEVDEVTOUCH_P_H
#define QEVDEVTOUCH_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QObject>
#include <QString>
#include <QList>
diff --git a/src/platformsupport/linuxaccessibility/application_p.h b/src/platformsupport/linuxaccessibility/application_p.h
index 72c27c0d88..32036eb2c4 100644
--- a/src/platformsupport/linuxaccessibility/application_p.h
+++ b/src/platformsupport/linuxaccessibility/application_p.h
@@ -42,6 +42,17 @@
#ifndef Q_SPI_APPLICATION_H
#define Q_SPI_APPLICATION_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/QPointer>
#include <QtCore/QQueue>
#include <QtDBus/QDBusConnection>
diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor_p.h b/src/platformsupport/linuxaccessibility/atspiadaptor_p.h
index 5ce3f735d7..eae30c7d7b 100644
--- a/src/platformsupport/linuxaccessibility/atspiadaptor_p.h
+++ b/src/platformsupport/linuxaccessibility/atspiadaptor_p.h
@@ -43,6 +43,17 @@
#ifndef ATSPIADAPTOR_H
#define ATSPIADAPTOR_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <atspi/atspi-constants.h>
#include <QtCore/qsharedpointer.h>
diff --git a/src/platformsupport/linuxaccessibility/bridge_p.h b/src/platformsupport/linuxaccessibility/bridge_p.h
index 56018ef14c..bcf73a489a 100644
--- a/src/platformsupport/linuxaccessibility/bridge_p.h
+++ b/src/platformsupport/linuxaccessibility/bridge_p.h
@@ -43,6 +43,17 @@
#ifndef QSPIACCESSIBLEBRIDGE_H
#define QSPIACCESSIBLEBRIDGE_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtDBus/qdbusconnection.h>
#include <qpa/qplatformaccessibility.h>
diff --git a/src/platformsupport/linuxaccessibility/cache_p.h b/src/platformsupport/linuxaccessibility/cache_p.h
index dd7ef24e5e..661e775e4c 100644
--- a/src/platformsupport/linuxaccessibility/cache_p.h
+++ b/src/platformsupport/linuxaccessibility/cache_p.h
@@ -43,6 +43,17 @@
#ifndef Q_SPI_CACHE_H
#define Q_SPI_CACHE_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/QObject>
#include "struct_marshallers_p.h"
diff --git a/src/platformsupport/linuxaccessibility/constant_mappings_p.h b/src/platformsupport/linuxaccessibility/constant_mappings_p.h
index 50b7864836..15554dd8e4 100644
--- a/src/platformsupport/linuxaccessibility/constant_mappings_p.h
+++ b/src/platformsupport/linuxaccessibility/constant_mappings_p.h
@@ -39,6 +39,16 @@
**
****************************************************************************/
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
/*
* This file contains AT-SPI constants and mappings between QAccessible
diff --git a/src/platformsupport/linuxaccessibility/dbusconnection_p.h b/src/platformsupport/linuxaccessibility/dbusconnection_p.h
index b4d1bea8af..90b07f45b7 100644
--- a/src/platformsupport/linuxaccessibility/dbusconnection_p.h
+++ b/src/platformsupport/linuxaccessibility/dbusconnection_p.h
@@ -43,6 +43,17 @@
#ifndef DBUSCONNECTION_H
#define DBUSCONNECTION_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/QString>
#include <QtDBus/QDBusConnection>
#include <QtDBus/QDBusVariant>
diff --git a/src/platformsupport/linuxaccessibility/struct_marshallers_p.h b/src/platformsupport/linuxaccessibility/struct_marshallers_p.h
index fb1e6756eb..5043a28bb2 100644
--- a/src/platformsupport/linuxaccessibility/struct_marshallers_p.h
+++ b/src/platformsupport/linuxaccessibility/struct_marshallers_p.h
@@ -43,6 +43,17 @@
#ifndef Q_SPI_STRUCT_MARSHALLERS_H
#define Q_SPI_STRUCT_MARSHALLERS_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qlist.h>
#include <QtCore/qpair.h>
#include <QtDBus/QDBusArgument>
diff --git a/src/platformsupport/services/genericunix/qgenericunixservices_p.h b/src/platformsupport/services/genericunix/qgenericunixservices_p.h
index 92166caf7b..d758c71b79 100644
--- a/src/platformsupport/services/genericunix/qgenericunixservices_p.h
+++ b/src/platformsupport/services/genericunix/qgenericunixservices_p.h
@@ -42,6 +42,17 @@
#ifndef QGENERICUNIXDESKTOPSERVICES_H
#define QGENERICUNIXDESKTOPSERVICES_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformservices.h>
#include <QtCore/QString>
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
index 509a26d1db..0810d4ce12 100644
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
@@ -42,6 +42,17 @@
#ifndef QGENERICUNIXTHEMES_H
#define QGENERICUNIXTHEMES_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformtheme.h>
#include <QtCore/QString>
#include <QtCore/QStringList>
diff --git a/src/plugins/bearer/connman/connman.pro b/src/plugins/bearer/connman/connman.pro
index 0da2dfacf6..bc4efe8b62 100644
--- a/src/plugins/bearer/connman/connman.pro
+++ b/src/plugins/bearer/connman/connman.pro
@@ -6,7 +6,6 @@ load(qt_plugin)
QT = core network-private dbus
CONFIG += link_pkgconfig
-packagesExist(connectionagent) { DEFINES += QT_HAS_CONNECTIONAGENT }
HEADERS += qconnmanservice_linux_p.h \
qofonoservice_linux_p.h \
diff --git a/src/plugins/bearer/connman/qconnmanengine.cpp b/src/plugins/bearer/connman/qconnmanengine.cpp
index adefb7504e..3d7daedeb0 100644
--- a/src/plugins/bearer/connman/qconnmanengine.cpp
+++ b/src/plugins/bearer/connman/qconnmanengine.cpp
@@ -54,11 +54,6 @@
#include <QtDBus/QDBusInterface>
#include <QtDBus/QDBusMessage>
#include <QtDBus/QDBusReply>
-#ifdef QT_HAS_CONNECTIONAGENT
-#include <sys/inotify.h>
-#include <fcntl.h>
-#include <qcore_unix_p.h>
-#endif
#ifndef QT_NO_BEARERMANAGEMENT
#ifndef QT_NO_DBUS
@@ -78,9 +73,6 @@ QConnmanEngine::QConnmanEngine(QObject *parent)
QConnmanEngine::~QConnmanEngine()
{
-#ifdef QT_HAS_CONNECTIONAGENT
- qt_safe_close(inotifyFileDescriptor);
-#endif
}
bool QConnmanEngine::connmanAvailable() const
@@ -108,16 +100,6 @@ void QConnmanEngine::initialize()
addServiceConfiguration(servPath);
}
Q_EMIT updateCompleted();
-#ifdef QT_HAS_CONNECTIONAGENT
- QSettings confFile(QStringLiteral("nemomobile"),QStringLiteral("connectionagent"));
-
- inotifyFileDescriptor = ::inotify_init();
- inotifyWatcher = ::inotify_add_watch(inotifyFileDescriptor, QFile::encodeName(confFile.fileName()), IN_MODIFY);
- if (inotifyWatcher > 0) {
- QSocketNotifier *notifier = new QSocketNotifier(inotifyFileDescriptor, QSocketNotifier::Read, this);
- connect(notifier, SIGNAL(activated(int)), this, SLOT(inotifyActivated()));
- }
-#endif
}
void QConnmanEngine::changedModem()
@@ -195,10 +177,6 @@ void QConnmanEngine::connectToId(const QString &id)
emit connectionError(id, QBearerEngineImpl::OperationNotSupported);
return;
}
- if (isAlwaysAskRoaming()) {
- emit connectionError(id, QBearerEngineImpl::OperationNotSupported);
- return;
- }
}
}
if (serv->autoConnect())
@@ -272,12 +250,11 @@ QNetworkSession::State QConnmanEngine::sessionStateForId(const QString &id)
return QNetworkSession::Disconnected;
}
- if (servState == QLatin1String("association") || servState == QLatin1String("configuration")
- || servState == QLatin1String("ready")) {
+ if (servState == QLatin1String("association") || servState == QLatin1String("configuration")) {
return QNetworkSession::Connecting;
}
- if (servState == QLatin1String("online")) {
+ if (servState == QLatin1String("online") || servState == QLatin1String("ready")) {
return QNetworkSession::Connected;
}
@@ -421,9 +398,8 @@ QNetworkConfiguration::StateFlags QConnmanEngine::getStateForService(const QStri
if (serv->type() == QLatin1String("cellular")) {
- if (!serv->autoConnect()
- || (serv->roaming()
- && (isAlwaysAskRoaming() || !isRoamingAllowed(serv->path())))) {
+ if (!serv->autoConnect()|| (serv->roaming()
+ && !isRoamingAllowed(serv->path()))) {
flag = (flag | QNetworkConfiguration::Defined);
} else {
flag = (flag | QNetworkConfiguration::Discovered);
@@ -437,7 +413,7 @@ QNetworkConfiguration::StateFlags QConnmanEngine::getStateForService(const QStri
flag = QNetworkConfiguration::Undefined;
}
}
- if (state == QLatin1String("online")) {
+ if (state == QLatin1String("online") || state == QLatin1String("ready")) {
flag = (flag | QNetworkConfiguration::Active);
}
@@ -576,17 +552,6 @@ bool QConnmanEngine::requiresPolling() const
return false;
}
-bool QConnmanEngine::isAlwaysAskRoaming()
-{
-#ifdef QT_HAS_CONNECTIONAGENT
- QSettings confFile(QStringLiteral("nemomobile"),QStringLiteral("connectionagent"));
- confFile.beginGroup(QStringLiteral("Connectionagent"));
- return confFile.value(QStringLiteral("askForRoaming")).toBool();
-#else
- return false;
-#endif
-}
-
void QConnmanEngine::reEvaluateCellular()
{
Q_FOREACH (const QString &servicePath, connmanManager->getServices()) {
@@ -596,21 +561,6 @@ void QConnmanEngine::reEvaluateCellular()
}
}
-void QConnmanEngine::inotifyActivated()
-{
-#ifdef QT_HAS_CONNECTIONAGENT
-
- char buffer[1024];
- int len = qt_safe_read(inotifyFileDescriptor, (void *)buffer, sizeof(buffer));
- if (len > 0) {
- struct inotify_event *event = (struct inotify_event *)buffer;
- if (event->wd == inotifyWatcher && (event->mask & IN_MODIFY) == 0) {
- QTimer::singleShot(1000, this, SLOT(reEvaluateCellular())); //give this time to finish write
- }
- }
-#endif
-}
-
QT_END_NAMESPACE
#endif // QT_NO_DBUS
diff --git a/src/plugins/bearer/connman/qconnmanengine.h b/src/plugins/bearer/connman/qconnmanengine.h
index 4a4e91659b..4d5495ae86 100644
--- a/src/plugins/bearer/connman/qconnmanengine.h
+++ b/src/plugins/bearer/connman/qconnmanengine.h
@@ -108,7 +108,6 @@ private Q_SLOTS:
void serviceStateChanged(const QString &state);
void configurationChange(QConnmanServiceInterface * service);
void reEvaluateCellular();
- void inotifyActivated();
private:
QConnmanManagerInterface *connmanManager;
@@ -134,12 +133,8 @@ private:
QNetworkConfiguration::BearerType ofonoTechToBearerType(const QString &type);
bool isRoamingAllowed(const QString &context);
- bool isAlwaysAskRoaming();
QMap <QString,QConnmanServiceInterface *> connmanServiceInterfaces;
- int inotifyWatcher;
- int inotifyFileDescriptor;
-
protected:
bool requiresPolling() const;
};
diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm
index 554ad26e51..65e70876f2 100644
--- a/src/plugins/bearer/corewlan/qcorewlanengine.mm
+++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm
@@ -419,7 +419,8 @@ QCoreWlanEngine::QCoreWlanEngine(QObject *parent)
QCoreWlanEngine::~QCoreWlanEngine()
{
- scanThread->wait(5000);
+ scanThread->terminate();
+ scanThread->wait();
while (!foundConfigurations.isEmpty())
delete foundConfigurations.takeFirst();
diff --git a/src/plugins/bearer/corewlan/qcorewlanengine_10_6.mm b/src/plugins/bearer/corewlan/qcorewlanengine_10_6.mm
index ba1cf33258..6cf614cb30 100644
--- a/src/plugins/bearer/corewlan/qcorewlanengine_10_6.mm
+++ b/src/plugins/bearer/corewlan/qcorewlanengine_10_6.mm
@@ -404,7 +404,8 @@ QCoreWlanEngine::QCoreWlanEngine(QObject *parent)
QCoreWlanEngine::~QCoreWlanEngine()
{
- scanThread->wait(5000);
+ scanThread->terminate();
+ scanThread->wait();
while (!foundConfigurations.isEmpty())
delete foundConfigurations.takeFirst();
diff --git a/src/plugins/bearer/generic/qgenericengine.cpp b/src/plugins/bearer/generic/qgenericengine.cpp
index d2579372c7..d687539d84 100644
--- a/src/plugins/bearer/generic/qgenericengine.cpp
+++ b/src/plugins/bearer/generic/qgenericengine.cpp
@@ -165,6 +165,7 @@ static QNetworkConfiguration::BearerType qGetInterfaceType(const QString &interf
ifreq request;
strncpy(request.ifr_name, interface.toLocal8Bit().data(), sizeof(request.ifr_name));
+ request.ifr_name[sizeof(request.ifr_name) - 1] = '\0';
int result = ioctl(sock, SIOCGIFHWADDR, &request);
close(sock);
diff --git a/src/plugins/platforms/android/androidjniinput.cpp b/src/plugins/platforms/android/androidjniinput.cpp
index defc59abf0..2c4b664487 100644
--- a/src/plugins/platforms/android/androidjniinput.cpp
+++ b/src/plugins/platforms/android/androidjniinput.cpp
@@ -47,6 +47,7 @@
#include <QTouchEvent>
#include <QPointer>
+#include <QGuiApplication>
#include <QDebug>
QT_BEGIN_NAMESPACE
@@ -58,10 +59,10 @@ namespace QtAndroidInput
static jmethodID m_showSoftwareKeyboardMethodID = 0;
static jmethodID m_resetSoftwareKeyboardMethodID = 0;
static jmethodID m_hideSoftwareKeyboardMethodID = 0;
- static jmethodID m_isSoftwareKeyboardVisibleMethodID = 0;
static jmethodID m_updateSelectionMethodID = 0;
static bool m_ignoreMouseEvents = false;
+ static bool m_softwareKeyboardVisible = false;
static QList<QWindowSystemInterface::TouchPoint> m_touchPoints;
@@ -124,15 +125,7 @@ namespace QtAndroidInput
bool isSoftwareKeyboardVisible()
{
- AttachedJNIEnv env;
- if (!env.jniEnv)
- return false;
-
- bool visibility = env.jniEnv->CallStaticBooleanMethod(applicationClass(), m_isSoftwareKeyboardVisibleMethodID);
-#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
- qDebug() << "@@@ ISSOFTWAREKEYBOARDVISIBLE" << visibility;
-#endif
- return visibility;
+ return m_softwareKeyboardVisible;
}
@@ -713,10 +706,11 @@ namespace QtAndroidInput
false);
}
- static void keyboardVisibilityChanged(JNIEnv */*env*/, jobject /*thiz*/, jboolean /*visibility*/)
+ static void keyboardVisibilityChanged(JNIEnv */*env*/, jobject /*thiz*/, jboolean visibility)
{
+ m_softwareKeyboardVisible = visibility;
QAndroidInputContext *inputContext = QAndroidInputContext::androidInputContext();
- if (inputContext)
+ if (inputContext && qGuiApp)
inputContext->emitInputPanelVisibleChanged();
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
qDebug() << "@@@ KEYBOARDVISIBILITYCHANGED" << inputContext;
@@ -755,7 +749,6 @@ namespace QtAndroidInput
GET_AND_CHECK_STATIC_METHOD(m_showSoftwareKeyboardMethodID, appClass, "showSoftwareKeyboard", "(IIIII)V");
GET_AND_CHECK_STATIC_METHOD(m_resetSoftwareKeyboardMethodID, appClass, "resetSoftwareKeyboard", "()V");
GET_AND_CHECK_STATIC_METHOD(m_hideSoftwareKeyboardMethodID, appClass, "hideSoftwareKeyboard", "()V");
- GET_AND_CHECK_STATIC_METHOD(m_isSoftwareKeyboardVisibleMethodID, appClass, "isSoftwareKeyboardVisible", "()Z");
GET_AND_CHECK_STATIC_METHOD(m_updateSelectionMethodID, appClass, "updateSelection", "(IIII)V");
return true;
}
diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp
index 7b76177141..6df9f56c2c 100644
--- a/src/plugins/platforms/android/androidjnimain.cpp
+++ b/src/plugins/platforms/android/androidjnimain.cpp
@@ -559,6 +559,12 @@ static void setDisplayMetrics(JNIEnv */*env*/, jclass /*clazz*/,
jint desktopWidthPixels, jint desktopHeightPixels,
jdouble xdpi, jdouble ydpi, jdouble scaledDensity)
{
+ // Android does not give us the correct screen size for immersive mode, but
+ // the surface does have the right size
+
+ widthPixels = qMax(widthPixels, desktopWidthPixels);
+ heightPixels = qMax(heightPixels, desktopHeightPixels);
+
m_desktopWidthPixels = desktopWidthPixels;
m_desktopHeightPixels = desktopHeightPixels;
m_scaledDensity = scaledDensity;
@@ -573,8 +579,8 @@ static void setDisplayMetrics(JNIEnv */*env*/, jclass /*clazz*/,
} else {
m_androidPlatformIntegration->setDisplayMetrics(qRound(double(widthPixels) / xdpi * 25.4),
qRound(double(heightPixels) / ydpi * 25.4));
- m_androidPlatformIntegration->setDesktopSize(desktopWidthPixels, desktopHeightPixels);
m_androidPlatformIntegration->setScreenSize(widthPixels, heightPixels);
+ m_androidPlatformIntegration->setDesktopSize(desktopWidthPixels, desktopHeightPixels);
}
}
diff --git a/src/plugins/platforms/android/qandroidplatformintegration.cpp b/src/plugins/platforms/android/qandroidplatformintegration.cpp
index 53cb3588f6..cbf13e81d5 100644
--- a/src/plugins/platforms/android/qandroidplatformintegration.cpp
+++ b/src/plugins/platforms/android/qandroidplatformintegration.cpp
@@ -121,8 +121,8 @@ QAndroidPlatformIntegration::QAndroidPlatformIntegration(const QStringList &para
m_primaryScreen = new QAndroidPlatformScreen();
screenAdded(m_primaryScreen);
m_primaryScreen->setPhysicalSize(QSize(m_defaultPhysicalSizeWidth, m_defaultPhysicalSizeHeight));
- m_primaryScreen->setAvailableGeometry(QRect(0, 0, m_defaultGeometryWidth, m_defaultGeometryHeight));
m_primaryScreen->setSize(QSize(m_defaultScreenWidth, m_defaultScreenHeight));
+ m_primaryScreen->setAvailableGeometry(QRect(0, 0, m_defaultGeometryWidth, m_defaultGeometryHeight));
m_mainThread = QThread::currentThread();
QtAndroid::setAndroidPlatformIntegration(this);
diff --git a/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp b/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp
index 2c6e8370ce..e8dc8a9c5c 100644
--- a/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp
+++ b/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp
@@ -64,17 +64,28 @@ void QAndroidPlatformOpenGLContext::swapBuffers(QPlatformSurface *surface)
QEGLPlatformContext::swapBuffers(surface);
}
-bool QAndroidPlatformOpenGLContext::needsFBOReadBackWorkaroud()
+bool QAndroidPlatformOpenGLContext::needsFBOReadBackWorkaround()
{
static bool set = false;
static bool needsWorkaround = false;
if (!set) {
- const char *rendererString = reinterpret_cast<const char *>(glGetString(GL_RENDERER));
- needsWorkaround =
- qstrncmp(rendererString, "Mali-4xx", 6) == 0 // Mali-400, Mali-450
- || qstrncmp(rendererString, "Adreno (TM) 2xx", 13) == 0 // Adreno 200, 203, 205
- || qstrcmp(rendererString, "GC1000 core") == 0;
+ QByteArray env = qgetenv("QT_ANDROID_DISABLE_GLYPH_CACHE_WORKAROUND");
+ needsWorkaround = env.isEmpty() || env == "0" || env == "false";
+
+ if (!needsWorkaround) {
+ const char *rendererString = reinterpret_cast<const char *>(glGetString(GL_RENDERER));
+ needsWorkaround =
+ qstrncmp(rendererString, "Mali-4xx", 6) == 0 // Mali-400, Mali-450
+ || qstrncmp(rendererString, "Adreno (TM) 2xx", 13) == 0 // Adreno 200, 203, 205
+ || qstrncmp(rendererString, "Adreno 2xx", 8) == 0 // Same as above but without the '(TM)'
+ || qstrncmp(rendererString, "Adreno (TM) 30x", 14) == 0 // Adreno 302, 305
+ || qstrncmp(rendererString, "Adreno 30x", 9) == 0 // Same as above but without the '(TM)'
+ || qstrcmp(rendererString, "GC800 core") == 0
+ || qstrcmp(rendererString, "GC1000 core") == 0
+ || qstrcmp(rendererString, "Immersion.16") == 0;
+ }
+
set = true;
}
@@ -90,7 +101,7 @@ bool QAndroidPlatformOpenGLContext::makeCurrent(QPlatformSurface *surface)
if (rendererString != 0 && qstrncmp(rendererString, "Android Emulator", 16) == 0)
ctx_d->workaround_missingPrecisionQualifiers = true;
- if (!ctx_d->workaround_brokenFBOReadBack && needsFBOReadBackWorkaroud())
+ if (!ctx_d->workaround_brokenFBOReadBack && needsFBOReadBackWorkaround())
ctx_d->workaround_brokenFBOReadBack = true;
return ret;
diff --git a/src/plugins/platforms/android/qandroidplatformopenglcontext.h b/src/plugins/platforms/android/qandroidplatformopenglcontext.h
index 10a89d541b..b734cb4db9 100644
--- a/src/plugins/platforms/android/qandroidplatformopenglcontext.h
+++ b/src/plugins/platforms/android/qandroidplatformopenglcontext.h
@@ -57,7 +57,7 @@ public:
private:
virtual EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface);
- static bool needsFBOReadBackWorkaroud();
+ static bool needsFBOReadBackWorkaround();
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/messages.cpp b/src/plugins/platforms/cocoa/messages.cpp
index 8fc8b312f5..4f7b038c6f 100644
--- a/src/plugins/platforms/cocoa/messages.cpp
+++ b/src/plugins/platforms/cocoa/messages.cpp
@@ -76,27 +76,29 @@ QString qt_mac_applicationmenu_string(int type)
QPlatformMenuItem::MenuRole detectMenuRole(const QString &caption)
{
+ QString captionNoAmpersand(caption);
+ captionNoAmpersand.remove(QChar('&'));
const QString aboutString = QCoreApplication::translate("QCocoaMenuItem", "About");
- if (caption.startsWith(aboutString, Qt::CaseInsensitive) || caption.endsWith(aboutString, Qt::CaseInsensitive))
+ if (captionNoAmpersand.startsWith(aboutString, Qt::CaseInsensitive) || caption.endsWith(aboutString, Qt::CaseInsensitive))
return QPlatformMenuItem::AboutRole;
- if (caption.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Config"), Qt::CaseInsensitive)
- || caption.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Preference"), Qt::CaseInsensitive)
- || caption.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Options"), Qt::CaseInsensitive)
- || caption.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Setting"), Qt::CaseInsensitive)
- || caption.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Setup"), Qt::CaseInsensitive)) {
+ if (captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Config"), Qt::CaseInsensitive)
+ || captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Preference"), Qt::CaseInsensitive)
+ || captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Options"), Qt::CaseInsensitive)
+ || captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Setting"), Qt::CaseInsensitive)
+ || captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Setup"), Qt::CaseInsensitive)) {
return QPlatformMenuItem::PreferencesRole;
}
- if (caption.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Quit"), Qt::CaseInsensitive)
- || caption.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Exit"), Qt::CaseInsensitive)) {
+ if (captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Quit"), Qt::CaseInsensitive)
+ || captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Exit"), Qt::CaseInsensitive)) {
return QPlatformMenuItem::QuitRole;
}
- if (!caption.compare(QCoreApplication::translate("QCocoaMenuItem", "Cut"), Qt::CaseInsensitive))
+ if (!captionNoAmpersand.compare(QCoreApplication::translate("QCocoaMenuItem", "Cut"), Qt::CaseInsensitive))
return QPlatformMenuItem::CutRole;
- if (!caption.compare(QCoreApplication::translate("QCocoaMenuItem", "Copy"), Qt::CaseInsensitive))
+ if (!captionNoAmpersand.compare(QCoreApplication::translate("QCocoaMenuItem", "Copy"), Qt::CaseInsensitive))
return QPlatformMenuItem::CopyRole;
- if (!caption.compare(QCoreApplication::translate("QCocoaMenuItem", "Paste"), Qt::CaseInsensitive))
+ if (!captionNoAmpersand.compare(QCoreApplication::translate("QCocoaMenuItem", "Paste"), Qt::CaseInsensitive))
return QPlatformMenuItem::PasteRole;
- if (!caption.compare(QCoreApplication::translate("QCocoaMenuItem", "Select All"), Qt::CaseInsensitive))
+ if (!captionNoAmpersand.compare(QCoreApplication::translate("QCocoaMenuItem", "Select All"), Qt::CaseInsensitive))
return QPlatformMenuItem::SelectAllRole;
return QPlatformMenuItem::NoRole;
}
diff --git a/src/plugins/platforms/cocoa/qcocoaapplication.mm b/src/plugins/platforms/cocoa/qcocoaapplication.mm
index 551a59823c..bac76357da 100644
--- a/src/plugins/platforms/cocoa/qcocoaapplication.mm
+++ b/src/plugins/platforms/cocoa/qcocoaapplication.mm
@@ -189,6 +189,12 @@ QT_BEGIN_NAMESPACE
void qt_redirectNSApplicationSendEvent()
{
+ if (QCoreApplication::testAttribute(Qt::AA_MacPluginApplication))
+ // In a plugin we cannot chain sendEvent hooks: a second plugin could
+ // store the implementation of the first, which during the program flow
+ // can be unloaded.
+ return;
+
if ([NSApp isMemberOfClass:[QNSApplication class]]) {
// No need to change implementation since Qt
// already controls a subclass of NSApplication
@@ -209,6 +215,10 @@ void qt_redirectNSApplicationSendEvent()
void qt_resetNSApplicationSendEvent()
{
+ if (QCoreApplication::testAttribute(Qt::AA_MacPluginApplication))
+ return;
+
+
qt_cocoa_change_back_implementation([NSApplication class],
@selector(sendEvent:),
@selector(QT_MANGLE_NAMESPACE(qt_sendEvent_original):));
diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
index efe3269d42..326628a261 100644
--- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
+++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
@@ -163,6 +163,9 @@ static void cleanupCocoaApplicationDelegate()
- (NSMenu *)applicationDockMenu:(NSApplication *)sender
{
Q_UNUSED(sender);
+ // Manually invoke the delegate's -menuWillOpen: method.
+ // See QTBUG-39604 (and its fix) for details.
+ [[dockMenu delegate] menuWillOpen:dockMenu];
return [[dockMenu retain] autorelease];
}
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm
index ebe58be155..e0838cb342 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.mm
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm
@@ -369,11 +369,15 @@ void QCocoaIntegration::updateScreens()
return;
QSet<QCocoaScreen*> remainingScreens = QSet<QCocoaScreen*>::fromList(mScreens);
QList<QPlatformScreen *> siblings;
- for (uint i = 0; i < [screens count]; i++) {
+ uint screenCount = [screens count];
+ for (uint i = 0; i < screenCount; i++) {
NSScreen* scr = [screens objectAtIndex:i];
CGDirectDisplayID dpy = [[[scr deviceDescription] objectForKey:@"NSScreenNumber"] unsignedIntValue];
// If this screen is a mirror and is not the primary one of the mirror set, ignore it.
- if (CGDisplayIsInMirrorSet(dpy)) {
+ // Exception: The NSScreen API has been observed to a return a screen list with one
+ // mirrored, non-primary screen when Qt is running as a startup item. Always use the
+ // screen if there's only one screen in the list.
+ if (screenCount > 1 && CGDisplayIsInMirrorSet(dpy)) {
CGDirectDisplayID primary = CGDisplayMirrorsDisplay(dpy);
if (primary != kCGNullDirectDisplay && primary != dpy)
continue;
diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm
index a89979a8ea..3d0201e1a0 100644
--- a/src/plugins/platforms/cocoa/qcocoamenu.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenu.mm
@@ -463,9 +463,8 @@ void QCocoaMenu::showPopup(const QWindow *parentWindow, QPoint pos, const QPlatf
// Else, we need to transform 'pos' to window or screen coordinates.
NSPoint nsPos = NSMakePoint(pos.x() - 1, pos.y());
if (view) {
- // Flip y-coordinate first, the convert to content view space.
- nsPos.y = view.frame.size.height - nsPos.y;
- nsPos = [view convertPoint:nsPos toView:view.window.contentView];
+ // convert coordinates from view to the view's window
+ nsPos = [view convertPoint:nsPos toView:nil];
} else if (!QGuiApplication::screens().isEmpty()) {
QScreen *screen = QGuiApplication::screens().at(0);
nsPos.y = screen->availableVirtualSize().height() - nsPos.y;
diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h
index a75e366a73..dc38bcb83d 100644
--- a/src/plugins/platforms/cocoa/qnsview.h
+++ b/src/plugins/platforms/cocoa/qnsview.h
@@ -48,6 +48,8 @@
#include <QtGui/QImage>
#include <QtGui/QAccessible>
+#include "private/qcore_mac_p.h"
+
QT_BEGIN_NAMESPACE
class QCocoaWindow;
class QCocoaBackingStore;
@@ -56,7 +58,7 @@ QT_END_NAMESPACE
Q_FORWARD_DECLARE_OBJC_CLASS(QNSViewMouseMoveHelper);
-@interface QNSView : NSView <NSTextInputClient> {
+@interface QT_MANGLE_NAMESPACE(QNSView) : NSView <NSTextInputClient> {
QCocoaBackingStore* m_backingStore;
QPoint m_backingStoreOffset;
CGImageRef m_maskImage;
@@ -78,6 +80,7 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QNSViewMouseMoveHelper);
#endif
NSString *m_inputSource;
QNSViewMouseMoveHelper *m_mouseMoveHelper;
+ bool m_resendKeyEvent;
}
- (id)init;
@@ -138,4 +141,6 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QNSViewMouseMoveHelper);
@end
+QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSView);
+
#endif //QNSVIEW_H
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index cfcbb8053c..d72664f0a0 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -130,7 +130,7 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil;
@end
-@implementation QNSView
+@implementation QT_MANGLE_NAMESPACE(QNSView)
+ (void)initialize
{
@@ -159,6 +159,7 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil;
m_sendUpAsRightButton = false;
m_inputSource = 0;
m_mouseMoveHelper = [[QNSViewMouseMoveHelper alloc] initWithView:self];
+ m_resendKeyEvent = false;
if (!touchDevice) {
touchDevice = new QTouchDevice;
@@ -1425,6 +1426,8 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
}
}
}
+ if (m_resendKeyEvent)
+ m_sendKeyEvent = true;
}
if (m_sendKeyEvent && m_composingText.isEmpty())
@@ -1432,6 +1435,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
nativeScanCode, nativeVirtualKey, nativeModifiers, text, [nsevent isARepeat]);
m_sendKeyEvent = false;
+ m_resendKeyEvent = false;
}
- (void)keyDown:(NSEvent *)nsevent
@@ -1502,6 +1506,12 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
}
}
+- (void) insertNewline:(id)sender
+{
+ Q_UNUSED(sender);
+ m_resendKeyEvent = true;
+}
+
- (void) doCommandBySelector:(SEL)aSelector
{
[self tryToPerform:aSelector with:self];
diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
index 7ae042cb50..c986a960f3 100644
--- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
+++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
@@ -58,7 +58,8 @@ QT_BEGIN_NAMESPACE
QQnxRasterBackingStore::QQnxRasterBackingStore(QWindow *window)
: QPlatformBackingStore(window),
- m_hasUnflushedPaintOperations(false)
+ m_needsPosting(false),
+ m_scrolled(false)
{
qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window;
@@ -85,10 +86,10 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion &region, const
qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << this->window();
// Sometimes this method is called even though there is nothing to be
- // flushed, for instance, after an expose event directly follows a
- // geometry change event.
- if (!m_hasUnflushedPaintOperations)
- return;
+ // flushed (posted in "screen" parlance), for instance, after an expose
+ // event directly follows a geometry change event.
+ if (!m_needsPosting)
+ return;
QQnxWindow *targetWindow = 0;
if (window)
@@ -99,25 +100,11 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion &region, const
// child windows, are performed; conceptually ,child windows have no buffers
// (actually they do have a 1x1 placeholder buffer due to libscreen limitations),
// since Qt will only draw to the backing store of the top-level window.
- if (!targetWindow || targetWindow == platformWindow()) {
+ if (!targetWindow || targetWindow == platformWindow())
+ platformWindow()->post(region); // update the display with newly rendered content
- // visit all pending scroll operations
- for (int i = m_scrollOpList.size() - 1; i >= 0; i--) {
-
- // do the scroll operation
- ScrollOp &op = m_scrollOpList[i];
- QRegion srcArea = op.totalArea.intersected( op.totalArea.translated(-op.dx, -op.dy) );
- platformWindow()->scroll(srcArea, op.dx, op.dy);
- }
-
- // clear all pending scroll operations
- m_scrollOpList.clear();
-
- // update the display with newly rendered content
- platformWindow()->post(region);
- }
-
- m_hasUnflushedPaintOperations = false;
+ m_needsPosting = false;
+ m_scrolled = false;
}
void QQnxRasterBackingStore::resize(const QSize &size, const QRegion &staticContents)
@@ -134,31 +121,14 @@ bool QQnxRasterBackingStore::scroll(const QRegion &area, int dx, int dy)
{
qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window();
- // calculate entire region affected by scroll operation (src + dst)
- QRegion totalArea = area.translated(dx, dy);
- totalArea += area;
- m_hasUnflushedPaintOperations = true;
-
- // visit all pending scroll operations
- for (int i = m_scrollOpList.size() - 1; i >= 0; i--) {
-
- ScrollOp &op = m_scrollOpList[i];
- if (op.totalArea == totalArea) {
- // same area is being scrolled again - update delta
- op.dx += dx;
- op.dy += dy;
- return true;
- } else if (op.totalArea.intersects(totalArea)) {
- // current scroll overlaps previous scroll but is
- // not equal in area - just paint everything
- qWarning("QQNX: pending scroll operations overlap but not equal");
- return false;
- }
- }
+ m_needsPosting = true;
- // create new scroll operation
- m_scrollOpList.append( ScrollOp(totalArea, dx, dy) );
- return true;
+ if (!m_scrolled) {
+ platformWindow()->scroll(area, dx, dy, true);
+ m_scrolled = true;
+ return true;
+ }
+ return false;
}
void QQnxRasterBackingStore::beginPaint(const QRegion &region)
@@ -166,7 +136,7 @@ void QQnxRasterBackingStore::beginPaint(const QRegion &region)
Q_UNUSED(region);
qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window();
- m_hasUnflushedPaintOperations = true;
+ m_needsPosting = true;
platformWindow()->adjustBufferSize();
diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.h b/src/plugins/platforms/qnx/qqnxrasterbackingstore.h
index 35efd68571..d71e274a1d 100644
--- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.h
+++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.h
@@ -64,19 +64,11 @@ public:
void endPaint();
private:
- class ScrollOp {
- public:
- ScrollOp(const QRegion &a, int x, int y) : totalArea(a), dx(x), dy(y) {}
- QRegion totalArea;
- int dx;
- int dy;
- };
-
QQnxRasterWindow *platformWindow() const;
QWindow *m_window;
- QList<ScrollOp> m_scrollOpList;
- bool m_hasUnflushedPaintOperations;
+ bool m_needsPosting;
+ bool m_scrolled;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp b/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp
index 08de94a082..232bd80fd0 100644
--- a/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp
+++ b/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp
@@ -46,7 +46,7 @@
#include <bps/event.h>
#include <bps/locale.h>
#include <bps/virtualkeyboard.h>
-#if defined(Q_OS_BLACKBERRY)
+#if defined(Q_OS_BLACKBERRY) && !defined(Q_OS_BLACKBERRY_TABLET)
#include <bbndk.h>
#endif
@@ -126,17 +126,21 @@ virtualkeyboard_layout_t QQnxVirtualKeyboardBps::keyboardLayout() const
return VIRTUALKEYBOARD_LAYOUT_WEB;
case NumPunc:
return VIRTUALKEYBOARD_LAYOUT_NUM_PUNC;
+#ifndef Q_OS_BLACKBERRY_TABLET
case Number:
return VIRTUALKEYBOARD_LAYOUT_NUMBER;
+#endif
case Symbol:
return VIRTUALKEYBOARD_LAYOUT_SYMBOL;
case Phone:
return VIRTUALKEYBOARD_LAYOUT_PHONE;
case Pin:
return VIRTUALKEYBOARD_LAYOUT_PIN;
+#ifndef Q_OS_BLACKBERRY_TABLET
case Password:
return VIRTUALKEYBOARD_LAYOUT_PASSWORD;
-#if defined(Q_OS_BLACKBERRY)
+#endif
+#if defined(Q_OS_BLACKBERRY) && !defined(Q_OS_BLACKBERRY_TABLET)
#if BBNDK_VERSION_AT_LEAST(10, 2, 1)
case Alphanumeric:
return VIRTUALKEYBOARD_LAYOUT_ALPHANUMERIC;
diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
index b22c35137d..7dbca6c089 100644
--- a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
@@ -1583,11 +1583,11 @@ QStringList QWindowsFontDatabase::extraTryFontsForFamily(const QString &family)
if (!tryFonts) {
LANGID lid = GetUserDefaultLangID();
switch (lid&0xff) {
- case LANG_CHINESE: // Chinese (Taiwan)
- if ( lid == 0x0804 ) // Taiwan
- tryFonts = ch_TW_tryFonts;
- else
+ case LANG_CHINESE: // Chinese
+ if ( lid == 0x0804 || lid == 0x1004) // China mainland and Singapore
tryFonts = ch_CN_tryFonts;
+ else
+ tryFonts = ch_TW_tryFonts; // Taiwan, Hong Kong and Macau
break;
case LANG_JAPANESE:
tryFonts = jp_tryFonts;
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index f6b1eefc13..06b566629b 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -1971,7 +1971,7 @@ void QWindowsWindow::getSizeHints(MINMAXINFO *mmi) const
mmi->ptMaxPosition.x = screen->availableGeometry().x();
mmi->ptMaxPosition.y = screen->availableGeometry().y();
} else if (!screen){
- qWarning() << "effectiveScreen() returned a null screen";
+ qWarning() << "window()->screen() returned a null screen";
}
}
diff --git a/src/plugins/platforms/xcb/qglxintegration.cpp b/src/plugins/platforms/xcb/qglxintegration.cpp
index 3b13df863e..bcb35f6cf0 100644
--- a/src/plugins/platforms/xcb/qglxintegration.cpp
+++ b/src/plugins/platforms/xcb/qglxintegration.cpp
@@ -165,7 +165,7 @@ static void updateFormatFromContext(QSurfaceFormat &format)
QGLXContext::QGLXContext(QXcbScreen *screen, const QSurfaceFormat &format, QPlatformOpenGLContext *share,
const QVariant &nativeHandle)
: QPlatformOpenGLContext()
- , m_screen(screen)
+ , m_display(DISPLAY_FROM_XCB(screen))
, m_config(0)
, m_context(0)
, m_shareContext(0)
@@ -200,7 +200,7 @@ void QGLXContext::init(QXcbScreen *screen, QPlatformOpenGLContext *share)
glXCreateContextAttribsARBProc glXCreateContextAttribsARB = 0;
glXCreateContextAttribsARB = (glXCreateContextAttribsARBProc) glXGetProcAddress((const GLubyte*)"glXCreateContextAttribsARB");
- QList<QByteArray> glxExt = QByteArray(glXQueryExtensionsString(DISPLAY_FROM_XCB(m_screen), m_screen->screenNumber())).split(' ');
+ QList<QByteArray> glxExt = QByteArray(glXQueryExtensionsString(m_display, screen->screenNumber())).split(' ');
bool supportsProfiles = glxExt.contains("GLX_ARB_create_context_profile");
// Use glXCreateContextAttribsARB if available
@@ -269,10 +269,10 @@ void QGLXContext::init(QXcbScreen *screen, QPlatformOpenGLContext *share)
contextAttributes << None;
- m_context = glXCreateContextAttribsARB(DISPLAY_FROM_XCB(screen), config, m_shareContext, true, contextAttributes.data());
+ m_context = glXCreateContextAttribsARB(m_display, config, m_shareContext, true, contextAttributes.data());
if (!m_context && m_shareContext) {
// re-try without a shared glx context
- m_context = glXCreateContextAttribsARB(DISPLAY_FROM_XCB(screen), config, 0, true, contextAttributes.data());
+ m_context = glXCreateContextAttribsARB(m_display, config, 0, true, contextAttributes.data());
if (m_context)
m_shareContext = 0;
}
@@ -285,10 +285,10 @@ void QGLXContext::init(QXcbScreen *screen, QPlatformOpenGLContext *share)
if (m_format.renderableType() == QSurfaceFormat::OpenGLES)
return;
- m_context = glXCreateNewContext(DISPLAY_FROM_XCB(screen), config, GLX_RGBA_TYPE, m_shareContext, true);
+ m_context = glXCreateNewContext(m_display, config, GLX_RGBA_TYPE, m_shareContext, true);
if (!m_context && m_shareContext) {
// re-try without a shared glx context
- m_context = glXCreateNewContext(DISPLAY_FROM_XCB(screen), config, GLX_RGBA_TYPE, 0, true);
+ m_context = glXCreateNewContext(m_display, config, GLX_RGBA_TYPE, 0, true);
if (m_context)
m_shareContext = 0;
}
@@ -306,14 +306,14 @@ void QGLXContext::init(QXcbScreen *screen, QPlatformOpenGLContext *share)
return;
// Note that m_format gets updated with the used surface format
- visualInfo = qglx_findVisualInfo(DISPLAY_FROM_XCB(screen), screen->screenNumber(), &m_format);
+ visualInfo = qglx_findVisualInfo(m_display, screen->screenNumber(), &m_format);
if (!visualInfo)
qFatal("Could not initialize GLX");
- m_context = glXCreateContext(DISPLAY_FROM_XCB(screen), visualInfo, m_shareContext, true);
+ m_context = glXCreateContext(m_display, visualInfo, m_shareContext, true);
if (!m_context && m_shareContext) {
// re-try without a shared glx context
m_shareContext = 0;
- m_context = glXCreateContext(DISPLAY_FROM_XCB(screen), visualInfo, 0, true);
+ m_context = glXCreateContext(m_display, visualInfo, Q_NULLPTR, true);
}
// Create a temporary window so that we can make the new context current
@@ -325,13 +325,15 @@ void QGLXContext::init(QXcbScreen *screen, QPlatformOpenGLContext *share)
if (m_context && window) {
GLXContext prevContext = glXGetCurrentContext();
GLXDrawable prevDrawable = glXGetCurrentDrawable();
- glXMakeCurrent(DISPLAY_FROM_XCB(screen), window, m_context);
+ glXMakeCurrent(m_display, window, m_context);
updateFormatFromContext(m_format);
- glXMakeCurrent(DISPLAY_FROM_XCB(screen), prevDrawable, prevContext);
+
+ // Make our context non-current
+ glXMakeCurrent(m_display, prevDrawable, prevContext);
}
// Destroy our temporary window
- XDestroyWindow(DISPLAY_FROM_XCB(screen), window);
+ XDestroyWindow(m_display, window);
}
void QGLXContext::init(QXcbScreen *screen, QPlatformOpenGLContext *share, const QVariant &nativeHandle)
@@ -449,7 +451,18 @@ void QGLXContext::init(QXcbScreen *screen, QPlatformOpenGLContext *share, const
QGLXContext::~QGLXContext()
{
if (m_ownsContext)
- glXDestroyContext(DISPLAY_FROM_XCB(m_screen), m_context);
+ glXDestroyContext(m_display, m_context);
+}
+
+static QXcbScreen *screenForPlatformSurface(QPlatformSurface *surface)
+{
+ QSurface::SurfaceClass surfaceClass = surface->surface()->surfaceClass();
+ if (surfaceClass == QSurface::Window) {
+ return static_cast<QXcbScreen *>(static_cast<QXcbWindow *>(surface)->screen());
+ } else if (surfaceClass == QSurface::Offscreen) {
+ return static_cast<QXcbScreen *>(static_cast<QGLXPbuffer *>(surface)->screen());
+ }
+ return Q_NULLPTR;
}
QVariant QGLXContext::nativeHandle() const
@@ -462,24 +475,24 @@ bool QGLXContext::makeCurrent(QPlatformSurface *surface)
bool success = false;
Q_ASSERT(surface->surface()->supportsOpenGL());
- Display *dpy = DISPLAY_FROM_XCB(m_screen);
GLXDrawable glxDrawable = 0;
QSurface::SurfaceClass surfaceClass = surface->surface()->surfaceClass();
if (surfaceClass == QSurface::Window) {
m_isPBufferCurrent = false;
QXcbWindow *window = static_cast<QXcbWindow *>(surface);
glxDrawable = window->xcb_window();
- success = glXMakeCurrent(dpy, glxDrawable, m_context);
+ success = glXMakeCurrent(m_display, glxDrawable, m_context);
} else if (surfaceClass == QSurface::Offscreen) {
m_isPBufferCurrent = true;
QGLXPbuffer *pbuffer = static_cast<QGLXPbuffer *>(surface);
glxDrawable = pbuffer->pbuffer();
- success = glXMakeContextCurrent(dpy, glxDrawable, glxDrawable, m_context);
+ success = glXMakeContextCurrent(m_display, glxDrawable, glxDrawable, m_context);
}
if (success) {
int interval = surface->format().swapInterval();
- if (interval >= 0 && m_swapInterval != interval) {
+ QXcbScreen *screen = screenForPlatformSurface(surface);
+ if (interval >= 0 && m_swapInterval != interval && screen) {
m_swapInterval = interval;
typedef void (*qt_glXSwapIntervalEXT)(Display *, GLXDrawable, int);
typedef void (*qt_glXSwapIntervalMESA)(unsigned int);
@@ -488,15 +501,15 @@ bool QGLXContext::makeCurrent(QPlatformSurface *surface)
static bool resolved = false;
if (!resolved) {
resolved = true;
- QList<QByteArray> glxExt = QByteArray(glXQueryExtensionsString(dpy,
- m_screen->screenNumber())).split(' ');
+ QList<QByteArray> glxExt = QByteArray(glXQueryExtensionsString(m_display,
+ screen->screenNumber())).split(' ');
if (glxExt.contains("GLX_EXT_swap_control"))
glXSwapIntervalEXT = (qt_glXSwapIntervalEXT) getProcAddress("glXSwapIntervalEXT");
if (glxExt.contains("GLX_MESA_swap_control"))
glXSwapIntervalMESA = (qt_glXSwapIntervalMESA) getProcAddress("glXSwapIntervalMESA");
}
if (glXSwapIntervalEXT)
- glXSwapIntervalEXT(dpy, glxDrawable, interval);
+ glXSwapIntervalEXT(m_display, glxDrawable, interval);
else if (glXSwapIntervalMESA)
glXSwapIntervalMESA(interval);
}
@@ -508,9 +521,9 @@ bool QGLXContext::makeCurrent(QPlatformSurface *surface)
void QGLXContext::doneCurrent()
{
if (m_isPBufferCurrent)
- glXMakeContextCurrent(DISPLAY_FROM_XCB(m_screen), 0, 0, 0);
+ glXMakeContextCurrent(m_display, 0, 0, 0);
else
- glXMakeCurrent(DISPLAY_FROM_XCB(m_screen), 0, 0);
+ glXMakeCurrent(m_display, 0, 0);
m_isPBufferCurrent = false;
}
@@ -521,7 +534,7 @@ void QGLXContext::swapBuffers(QPlatformSurface *surface)
glxDrawable = static_cast<QGLXPbuffer *>(surface)->pbuffer();
else
glxDrawable = static_cast<QXcbWindow *>(surface)->xcb_window();
- glXSwapBuffers(DISPLAY_FROM_XCB(m_screen), glxDrawable);
+ glXSwapBuffers(m_display, glxDrawable);
if (surface->surface()->surfaceClass() == QSurface::Window) {
QXcbWindow *platformWindow = static_cast<QXcbWindow *>(surface);
@@ -542,7 +555,7 @@ void (*QGLXContext::getProcAddress(const QByteArray &procName)) ()
if (resolved && !glXGetProcAddressARB)
return 0;
if (!glXGetProcAddressARB) {
- QList<QByteArray> glxExt = QByteArray(glXGetClientString(DISPLAY_FROM_XCB(m_screen), GLX_EXTENSIONS)).split(' ');
+ QList<QByteArray> glxExt = QByteArray(glXGetClientString(m_display, GLX_EXTENSIONS)).split(' ');
if (glxExt.contains("GLX_ARB_get_proc_address")) {
#if defined(Q_OS_LINUX) || defined(Q_OS_BSD4)
void *handle = dlopen(NULL, RTLD_LAZY);
diff --git a/src/plugins/platforms/xcb/qglxintegration.h b/src/plugins/platforms/xcb/qglxintegration.h
index abe3216ad7..2acf262bd0 100644
--- a/src/plugins/platforms/xcb/qglxintegration.h
+++ b/src/plugins/platforms/xcb/qglxintegration.h
@@ -84,6 +84,7 @@ private:
void init(QXcbScreen *screen, QPlatformOpenGLContext *share, const QVariant &nativeHandle);
QXcbScreen *m_screen;
+ Display *m_display;
GLXFBConfig m_config;
GLXContext m_context;
GLXContext m_shareContext;
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index ed5fe6d7c0..636914fd07 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -414,6 +414,9 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra
qunsetenv("DESKTOP_STARTUP_ID");
sync();
+
+ if (qEnvironmentVariableIsEmpty("QT_IM_MODULE"))
+ qputenv("QT_IM_MODULE", QByteArray("compose"));
}
QXcbConnection::~QXcbConnection()
@@ -494,7 +497,7 @@ break;
if (QXcbWindowEventListener *eventListener = windowEventListenerFromId(e->event)) { \
handled = eventListener->handleGenericEvent(event, &result); \
if (!handled) \
- m_keyboard->handler(m_focusWindow ? m_focusWindow : eventListener, e); \
+ m_keyboard->handler(e); \
} \
} \
break;
diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
index 60a36a8da1..bd62b07a09 100644
--- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
@@ -164,7 +164,10 @@ void QXcbConnection::xi2SetupDevices()
if (bci->num_buttons >= 5) {
Atom label4 = bci->labels[3];
Atom label5 = bci->labels[4];
- if ((!label4 || qatom(label4) == QXcbAtom::ButtonWheelUp) && (!label5 || qatom(label5) == QXcbAtom::ButtonWheelDown))
+ // Some drivers have no labels on the wheel buttons, some have no label on just one and some have no label on
+ // button 4 and the wrong one on button 5. So we just check that they are not labelled with unrelated buttons.
+ if ((!label4 || qatom(label4) == QXcbAtom::ButtonWheelUp || qatom(label4) == QXcbAtom::ButtonWheelDown) &&
+ (!label5 || qatom(label5) == QXcbAtom::ButtonWheelUp || qatom(label5) == QXcbAtom::ButtonWheelDown))
scrollingDevice.legacyOrientations |= Qt::Vertical;
}
if (bci->num_buttons >= 7) {
diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
index c52714b456..dd2a9fcaed 100644
--- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp
+++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
@@ -1299,7 +1299,7 @@ private:
bool m_release;
};
-void QXcbKeyboard::handleKeyEvent(QWindow *window, QEvent::Type type, xcb_keycode_t code,
+void QXcbKeyboard::handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code,
quint16 state, xcb_timestamp_t time)
{
Q_XCB_NOOP(connection());
@@ -1307,6 +1307,13 @@ void QXcbKeyboard::handleKeyEvent(QWindow *window, QEvent::Type type, xcb_keycod
if (!m_config)
return;
+ QXcbWindow *source = connection()->platformWindowFromId(sourceWindow);
+ QXcbWindow *targetWindow = connection()->focusWindow() ? connection()->focusWindow() : source;
+ if (!targetWindow || !source)
+ return;
+ if (type == QEvent::KeyPress)
+ targetWindow->updateNetWmUserTime(time);
+
// It is crucial the order of xkb_state_key_get_one_sym & xkb_state_update_key operations is not reversed!
xcb_keysym_t sym = xkb_state_key_get_one_sym(xkb_state, code);
@@ -1347,7 +1354,7 @@ void QXcbKeyboard::handleKeyEvent(QWindow *window, QEvent::Type type, xcb_keycod
}
} else {
// look ahead for auto-repeat
- KeyChecker checker(((QXcbWindow *)window->handle())->xcb_window(), code, time);
+ KeyChecker checker(source->xcb_window(), code, time);
xcb_generic_event_t *event = connection()->checkEvent(checker);
if (event) {
isAutoRepeat = true;
@@ -1363,6 +1370,7 @@ void QXcbKeyboard::handleKeyEvent(QWindow *window, QEvent::Type type, xcb_keycod
filtered = inputContext->filterEvent(&event);
}
+ QWindow *window = targetWindow->window();
if (!filtered) {
if (type == QEvent::KeyPress && qtcode == Qt::Key_Menu) {
const QPoint globalPos = window->screen()->handle()->cursor()->pos();
@@ -1405,21 +1413,14 @@ QString QXcbKeyboard::lookupString(struct xkb_state *state, xcb_keycode_t code)
return QString::fromUtf8(chars);
}
-void QXcbKeyboard::handleKeyPressEvent(QXcbWindowEventListener *eventListener, const xcb_key_press_event_t *event)
+void QXcbKeyboard::handleKeyPressEvent(const xcb_key_press_event_t *event)
{
- QXcbWindow *window = eventListener->toWindow();
- if (!window)
- return;
- window->updateNetWmUserTime(event->time);
- handleKeyEvent(window->window(), QEvent::KeyPress, event->detail, event->state, event->time);
+ handleKeyEvent(event->event, QEvent::KeyPress, event->detail, event->state, event->time);
}
-void QXcbKeyboard::handleKeyReleaseEvent(QXcbWindowEventListener *eventListener, const xcb_key_release_event_t *event)
+void QXcbKeyboard::handleKeyReleaseEvent(const xcb_key_release_event_t *event)
{
- QXcbWindow *window = eventListener->toWindow();
- if (!window)
- return;
- handleKeyEvent(window->window(), QEvent::KeyRelease, event->detail, event->state, event->time);
+ handleKeyEvent(event->event, QEvent::KeyRelease, event->detail, event->state, event->time);
}
void QXcbKeyboard::handleMappingNotifyEvent(const void *event)
diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.h b/src/plugins/platforms/xcb/qxcbkeyboard.h
index 11b7429aca..e816d3c003 100644
--- a/src/plugins/platforms/xcb/qxcbkeyboard.h
+++ b/src/plugins/platforms/xcb/qxcbkeyboard.h
@@ -64,8 +64,8 @@ public:
~QXcbKeyboard();
- void handleKeyPressEvent(QXcbWindowEventListener *eventListener, const xcb_key_press_event_t *event);
- void handleKeyReleaseEvent(QXcbWindowEventListener *eventListener, const xcb_key_release_event_t *event);
+ void handleKeyPressEvent(const xcb_key_press_event_t *event);
+ void handleKeyReleaseEvent(const xcb_key_release_event_t *event);
void handleMappingNotifyEvent(const void *event);
Qt::KeyboardModifiers translateModifiers(int s) const;
@@ -83,7 +83,7 @@ public:
#endif
protected:
- void handleKeyEvent(QWindow *window, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time);
+ void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time);
void resolveMaskConflicts();
QString lookupString(struct xkb_state *state, xcb_keycode_t code) const;
diff --git a/src/plugins/platforms/xcb/xcb-plugin.pro b/src/plugins/platforms/xcb/xcb-plugin.pro
index f227076b3b..9aaafadcad 100644
--- a/src/plugins/platforms/xcb/xcb-plugin.pro
+++ b/src/plugins/platforms/xcb/xcb-plugin.pro
@@ -95,6 +95,7 @@ contains(QT_CONFIG, opengl) {
DEFINES += $$QMAKE_DEFINES_XCB
LIBS += $$QMAKE_LIBS_XCB
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_XCB
+QMAKE_CFLAGS += $$QMAKE_CFLAGS_XCB
CONFIG += qpa/genericunixfontdatabase
diff --git a/src/plugins/platforms/xcb/xcb-static/xcb-static.pro b/src/plugins/platforms/xcb/xcb-static/xcb-static.pro
index dfdcb2e83a..d0fe282b14 100644
--- a/src/plugins/platforms/xcb/xcb-static/xcb-static.pro
+++ b/src/plugins/platforms/xcb/xcb-static/xcb-static.pro
@@ -10,6 +10,9 @@ XCB_DIR = ../../../../3rdparty/xcb
INCLUDEPATH += $$XCB_DIR/include $$XCB_DIR/include/xcb $$XCB_DIR/sysinclude
+QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_XCB
+QMAKE_CFLAGS += $$QMAKE_CFLAGS_XCB
+
# ignore compiler warnings in 3rdparty code
QMAKE_CFLAGS_STATIC_LIB+=-w
diff --git a/src/plugins/printsupport/cups/qcupsprintersupport_p.h b/src/plugins/printsupport/cups/qcupsprintersupport_p.h
index 1cba4e997b..9fe5f28850 100644
--- a/src/plugins/printsupport/cups/qcupsprintersupport_p.h
+++ b/src/plugins/printsupport/cups/qcupsprintersupport_p.h
@@ -43,6 +43,17 @@
#ifndef QCUPSPRINTERSUPPORT_H
#define QCUPSPRINTERSUPPORT_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <qpa/qplatformprintersupport.h>
#ifndef QT_NO_PRINTER
diff --git a/src/sql/drivers/ibase/qsql_ibase.cpp b/src/sql/drivers/ibase/qsql_ibase.cpp
index cc26bfe7e8..c751fea825 100644
--- a/src/sql/drivers/ibase/qsql_ibase.cpp
+++ b/src/sql/drivers/ibase/qsql_ibase.cpp
@@ -1030,11 +1030,15 @@ bool QIBaseResult::exec()
*((qint64*)d->inda->sqlvar[para].sqldata) = val.toLongLong();
break;
case SQL_LONG:
- if (d->inda->sqlvar[para].sqlscale < 0)
- *((long*)d->inda->sqlvar[para].sqldata) =
- (long)floor(0.5 + val.toDouble() * pow(10.0, d->inda->sqlvar[para].sqlscale * -1));
- else
- *((long*)d->inda->sqlvar[para].sqldata) = (long)val.toLongLong();
+ if (d->inda->sqlvar[para].sqllen == 4) {
+ if (d->inda->sqlvar[para].sqlscale < 0)
+ *((qint32*)d->inda->sqlvar[para].sqldata) =
+ (qint32)floor(0.5 + val.toDouble() * pow(10.0, d->inda->sqlvar[para].sqlscale * -1));
+ else
+ *((qint32*)d->inda->sqlvar[para].sqldata) = (qint32)val.toInt();
+ } else {
+ *((qint64*)d->inda->sqlvar[para].sqldata) = val.toLongLong();
+ }
break;
case SQL_SHORT:
if (d->inda->sqlvar[para].sqlscale < 0)
diff --git a/src/sql/kernel/qsqlquery.cpp b/src/sql/kernel/qsqlquery.cpp
index 2b1bd5feb1..abbea0d4a7 100644
--- a/src/sql/kernel/qsqlquery.cpp
+++ b/src/sql/kernel/qsqlquery.cpp
@@ -1083,12 +1083,6 @@ bool QSqlQuery::execBatch(BatchExecutionMode mode)
To bind a NULL value, use a null QVariant; for example, use
\c {QVariant(QVariant::String)} if you are binding a string.
- Values cannot be bound to multiple locations in the query, eg:
- \code
- INSERT INTO testtable (id, name, samename) VALUES (:id, :name, :name)
- \endcode
- Binding to name will bind to the first :name, but not the second.
-
\sa addBindValue(), prepare(), exec(), boundValue(), boundValues()
*/
void QSqlQuery::bindValue(const QString& placeholder, const QVariant& val,
diff --git a/src/sql/kernel/qsqlresult.cpp b/src/sql/kernel/qsqlresult.cpp
index 09b8f8d889..f933e6eeb1 100644
--- a/src/sql/kernel/qsqlresult.cpp
+++ b/src/sql/kernel/qsqlresult.cpp
@@ -704,12 +704,6 @@ void QSqlResult::bindValue(int index, const QVariant& val, QSql::ParamType param
Binds the value \a val of parameter type \a paramType to the \a
placeholder name in the current record (row).
- Values cannot be bound to multiple locations in the query, eg:
- \code
- INSERT INTO testtable (id, name, samename) VALUES (:id, :name, :name)
- \endcode
- Binding to name will bind to the first :name, but not the second.
-
\note Binding an undefined placeholder will result in undefined behavior.
\sa QSqlQuery::bindValue()
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 5d5b298740..877be81fb9 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -2630,7 +2630,6 @@ void QTest::ignoreMessage(QtMsgType type, const char *message)
\since 5.3
*/
-
void QTest::ignoreMessage(QtMsgType type, const QRegularExpression &messagePattern)
{
QTestLog::ignoreMessage(type, messagePattern);
diff --git a/src/testlib/qtestlog_p.h b/src/testlib/qtestlog_p.h
index 540ffe75eb..5d5ffd3f6f 100644
--- a/src/testlib/qtestlog_p.h
+++ b/src/testlib/qtestlog_p.h
@@ -78,7 +78,9 @@ public:
static void addBenchmarkResult(const QBenchmarkResult &result);
static void ignoreMessage(QtMsgType type, const char *msg);
+#ifndef QT_NO_REGULAREXPRESSION
static void ignoreMessage(QtMsgType type, const QRegularExpression &expression);
+#endif
static int unhandledIgnoreMessages();
static void printUnhandledIgnoreMessages();
static void clearIgnoreMessages();
diff --git a/src/tools/qdoc/qmlparser/qqmljsglobal_p.h b/src/tools/qdoc/qmlparser/qqmljsglobal_p.h
index c53e12ea56..f9e5aa9643 100644
--- a/src/tools/qdoc/qmlparser/qqmljsglobal_p.h
+++ b/src/tools/qdoc/qmlparser/qqmljsglobal_p.h
@@ -41,6 +41,17 @@
#ifndef QQMLJSGLOBAL_P_H
#define QQMLJSGLOBAL_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qglobal.h>
#ifdef QT_CREATOR
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index 77b94c02a4..0ead8a6797 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -456,15 +456,15 @@ QByteArray QFileDialog::saveState() const
stream << d->qFileDialogUi->splitter->saveState();
stream << d->qFileDialogUi->sidebar->urls();
} else {
- stream << QByteArray();
- stream << QList<QUrl>();
+ stream << d->splitterState;
+ stream << d->sidebarUrls;
}
stream << history();
stream << *lastVisitedDir();
if (d->usingWidgets())
stream << d->qFileDialogUi->treeView->header()->saveState();
else
- stream << QByteArray();
+ stream << d->headerData;
stream << qint32(viewMode());
return data;
}
@@ -485,9 +485,6 @@ bool QFileDialog::restoreState(const QByteArray &state)
QDataStream stream(&sd, QIODevice::ReadOnly);
if (stream.atEnd())
return false;
- QByteArray splitterState;
- QByteArray headerData;
- QList<QUrl> bookmarks;
QStringList history;
QUrl currentDirectory;
qint32 marker;
@@ -499,8 +496,8 @@ bool QFileDialog::restoreState(const QByteArray &state)
if (marker != QFileDialogMagic || (v != 3 && v != 4))
return false;
- stream >> splitterState
- >> bookmarks
+ stream >> d->splitterState
+ >> d->sidebarUrls
>> history;
if (v == 3) {
QString currentDirectoryString;
@@ -509,7 +506,7 @@ bool QFileDialog::restoreState(const QByteArray &state)
} else {
stream >> currentDirectory;
}
- stream >> headerData
+ stream >> d->headerData
>> viewMode;
setDirectoryUrl(lastVisitedDir()->isEmpty() ? currentDirectory : *lastVisitedDir());
@@ -518,7 +515,7 @@ bool QFileDialog::restoreState(const QByteArray &state)
if (!d->usingWidgets())
return true;
- if (!d->qFileDialogUi->splitter->restoreState(splitterState))
+ if (!d->qFileDialogUi->splitter->restoreState(d->splitterState))
return false;
QList<int> list = d->qFileDialogUi->splitter->sizes();
if (list.count() >= 2 && list.at(0) == 0 && list.at(1) == 0) {
@@ -527,12 +524,12 @@ bool QFileDialog::restoreState(const QByteArray &state)
d->qFileDialogUi->splitter->setSizes(list);
}
- d->qFileDialogUi->sidebar->setUrls(bookmarks);
+ d->qFileDialogUi->sidebar->setUrls(d->sidebarUrls);
while (history.count() > 5)
history.pop_front();
setHistory(history);
QHeaderView *headerView = d->qFileDialogUi->treeView->header();
- if (!headerView->restoreState(headerData))
+ if (!headerView->restoreState(d->headerData))
return false;
QList<QAction*> actions = headerView->actions();
diff --git a/src/widgets/dialogs/qfiledialog_p.h b/src/widgets/dialogs/qfiledialog_p.h
index eccc0779f2..15bbd43446 100644
--- a/src/widgets/dialogs/qfiledialog_p.h
+++ b/src/widgets/dialogs/qfiledialog_p.h
@@ -273,6 +273,11 @@ public:
QSharedPointer<QFileDialogOptions> options;
+ // Memory of what was read from QSettings in restoreState() in case widgets are not used
+ QByteArray splitterState;
+ QByteArray headerData;
+ QList<QUrl> sidebarUrls;
+
~QFileDialogPrivate();
private:
diff --git a/src/widgets/graphicsview/qgraphicsgridlayoutengine_p.h b/src/widgets/graphicsview/qgraphicsgridlayoutengine_p.h
index 1338114d96..1c12f15744 100644
--- a/src/widgets/graphicsview/qgraphicsgridlayoutengine_p.h
+++ b/src/widgets/graphicsview/qgraphicsgridlayoutengine_p.h
@@ -42,6 +42,17 @@
#ifndef QGRAPHICSGRIDLAYOUTENGINE_P_H
#define QGRAPHICSGRIDLAYOUTENGINE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtGui/private/qgridlayoutengine_p.h>
#ifndef QT_NO_GRAPHICSVIEW
diff --git a/src/widgets/graphicsview/qgraphicslayoutstyleinfo_p.h b/src/widgets/graphicsview/qgraphicslayoutstyleinfo_p.h
index 275ebab6a1..8770e96136 100644
--- a/src/widgets/graphicsview/qgraphicslayoutstyleinfo_p.h
+++ b/src/widgets/graphicsview/qgraphicslayoutstyleinfo_p.h
@@ -41,6 +41,17 @@
#ifndef QGRAPHICSLAYOUTSTYLEINFO_P_H
#define QGRAPHICSLAYOUTSTYLEINFO_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtGui/private/qabstractlayoutstyleinfo_p.h>
#include <QtWidgets/qstyleoption.h>
diff --git a/src/widgets/itemviews/qfileiconprovider_p.h b/src/widgets/itemviews/qfileiconprovider_p.h
index 9b2d536258..1c50a7e772 100644
--- a/src/widgets/itemviews/qfileiconprovider_p.h
+++ b/src/widgets/itemviews/qfileiconprovider_p.h
@@ -42,6 +42,17 @@
#ifndef QFILEICONPROVIDER_P_H
#define QFILEICONPROVIDER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qfileiconprovider.h"
#include <QtCore/qstring.h>
diff --git a/src/widgets/itemviews/qstyleditemdelegate.cpp b/src/widgets/itemviews/qstyleditemdelegate.cpp
index da5aeb3290..b5fc8d7d63 100644
--- a/src/widgets/itemviews/qstyleditemdelegate.cpp
+++ b/src/widgets/itemviews/qstyleditemdelegate.cpp
@@ -627,6 +627,9 @@ void QStyledItemDelegate::setItemEditorFactory(QItemEditorFactory *factory)
\li \uicontrol Esc
\endlist
+ If the \a editor's type is QTextEdit or QPlainTextEdit then \uicontrol Enter and
+ \uicontrol Return keys are \e not handled.
+
In the case of \uicontrol Tab, \uicontrol Backtab, \uicontrol Enter and \uicontrol Return
key press events, the \a editor's data is comitted to the model
and the editor is closed. If the \a event is a \uicontrol Tab key press
diff --git a/src/widgets/kernel/qboxlayout.cpp b/src/widgets/kernel/qboxlayout.cpp
index 157fa55d2e..a186326551 100644
--- a/src/widgets/kernel/qboxlayout.cpp
+++ b/src/widgets/kernel/qboxlayout.cpp
@@ -51,20 +51,6 @@
QT_BEGIN_NAMESPACE
-/*
- Returns \c true if the \a widget can be added to the \a layout;
- otherwise returns \c false.
-*/
-static bool checkWidget(QLayout *layout, QWidget *widget)
-{
- if (!widget) {
- qWarning("QLayout: Cannot add null widget to %s/%s", layout->metaObject()->className(),
- layout->objectName().toLocal8Bit().data());
- return false;
- }
- return true;
-}
-
struct QBoxLayoutItem
{
QBoxLayoutItem(QLayoutItem *it, int stretch_ = 0)
@@ -958,6 +944,8 @@ void QBoxLayout::insertSpacerItem(int index, QSpacerItem *spacerItem)
void QBoxLayout::insertLayout(int index, QLayout *layout, int stretch)
{
Q_D(QBoxLayout);
+ if (!d->checkLayout(layout))
+ return;
if (!adoptLayout(layout))
return;
if (index < 0) // append
@@ -991,7 +979,7 @@ void QBoxLayout::insertWidget(int index, QWidget *widget, int stretch,
Qt::Alignment alignment)
{
Q_D(QBoxLayout);
- if (!checkWidget(this, widget))
+ if (!d->checkWidget(widget))
return;
addChildWidget(widget);
if (index < 0) // append
diff --git a/src/widgets/kernel/qformlayout.cpp b/src/widgets/kernel/qformlayout.cpp
index 239e1ce1e2..9f545b858a 100644
--- a/src/widgets/kernel/qformlayout.cpp
+++ b/src/widgets/kernel/qformlayout.cpp
@@ -1280,6 +1280,8 @@ void QFormLayout::addRow(QLayout *layout)
void QFormLayout::insertRow(int row, QWidget *label, QWidget *field)
{
Q_D(QFormLayout);
+ if ((label && !d->checkWidget(label)) || (field && !d->checkWidget(field)))
+ return;
row = d->insertRow(row);
if (label)
@@ -1295,6 +1297,8 @@ void QFormLayout::insertRow(int row, QWidget *label, QWidget *field)
void QFormLayout::insertRow(int row, QWidget *label, QLayout *field)
{
Q_D(QFormLayout);
+ if ((label && !d->checkWidget(label)) || (field && !d->checkLayout(field)))
+ return;
row = d->insertRow(row);
if (label)
@@ -1313,6 +1317,10 @@ void QFormLayout::insertRow(int row, QWidget *label, QLayout *field)
*/
void QFormLayout::insertRow(int row, const QString &labelText, QWidget *field)
{
+ Q_D(QFormLayout);
+ if (field && !d->checkWidget(field))
+ return;
+
QLabel *label = 0;
if (!labelText.isEmpty()) {
label = new QLabel(labelText);
@@ -1331,6 +1339,10 @@ void QFormLayout::insertRow(int row, const QString &labelText, QWidget *field)
*/
void QFormLayout::insertRow(int row, const QString &labelText, QLayout *field)
{
+ Q_D(QFormLayout);
+ if (field && !d->checkLayout(field))
+ return;
+
insertRow(row, labelText.isEmpty() ? 0 : new QLabel(labelText), field);
}
@@ -1344,11 +1356,8 @@ void QFormLayout::insertRow(int row, const QString &labelText, QLayout *field)
void QFormLayout::insertRow(int row, QWidget *widget)
{
Q_D(QFormLayout);
-
- if (!widget) {
- qWarning("QFormLayout: Cannot add null field to %s", qPrintable(objectName()));
+ if (!d->checkWidget(widget))
return;
- }
row = d->insertRow(row);
d->setWidget(row, SpanningRole, widget);
@@ -1365,11 +1374,8 @@ void QFormLayout::insertRow(int row, QWidget *widget)
void QFormLayout::insertRow(int row, QLayout *layout)
{
Q_D(QFormLayout);
-
- if (!layout) {
- qWarning("QFormLayout: Cannot add null field to %s", qPrintable(objectName()));
+ if (!d->checkLayout(layout))
return;
- }
row = d->insertRow(row);
d->setLayout(row, SpanningRole, layout);
diff --git a/src/widgets/kernel/qgridlayout.cpp b/src/widgets/kernel/qgridlayout.cpp
index 5434c40f97..6782e4a9f8 100644
--- a/src/widgets/kernel/qgridlayout.cpp
+++ b/src/widgets/kernel/qgridlayout.cpp
@@ -1430,20 +1430,6 @@ void QGridLayout::addItem(QLayoutItem *item, int row, int column, int rowSpan, i
invalidate();
}
-/*
- Returns \c true if the widget \a w can be added to the layout \a l;
- otherwise returns \c false.
-*/
-static bool checkWidget(QLayout *l, QWidget *w)
-{
- if (!w) {
- qWarning("QLayout: Cannot add null widget to %s/%s", l->metaObject()->className(),
- l->objectName().toLocal8Bit().data());
- return false;
- }
- return true;
-}
-
/*!
Adds the given \a widget to the cell grid at \a row, \a column. The
top-left position is (0, 0) by default.
@@ -1454,7 +1440,8 @@ static bool checkWidget(QLayout *l, QWidget *w)
*/
void QGridLayout::addWidget(QWidget *widget, int row, int column, Qt::Alignment alignment)
{
- if (!checkWidget(this, widget))
+ Q_D(QGridLayout);
+ if (!d->checkWidget(widget))
return;
if (row < 0 || column < 0) {
qWarning("QGridLayout: Cannot add %s/%s to %s/%s at row %d column %d",
@@ -1483,7 +1470,7 @@ void QGridLayout::addWidget(QWidget *widget, int fromRow, int fromColumn,
int rowSpan, int columnSpan, Qt::Alignment alignment)
{
Q_D(QGridLayout);
- if (!checkWidget(this, widget))
+ if (!d->checkWidget(widget))
return;
int toRow = (rowSpan < 0) ? -1 : fromRow + rowSpan - 1;
int toColumn = (columnSpan < 0) ? -1 : fromColumn + columnSpan - 1;
@@ -1518,6 +1505,8 @@ void QGridLayout::addWidget(QWidget *widget, int fromRow, int fromColumn,
void QGridLayout::addLayout(QLayout *layout, int row, int column, Qt::Alignment alignment)
{
Q_D(QGridLayout);
+ if (!d->checkLayout(layout))
+ return;
if (!adoptLayout(layout))
return;
QGridBox *b = new QGridBox(layout);
@@ -1538,6 +1527,8 @@ void QGridLayout::addLayout(QLayout *layout, int row, int column,
int rowSpan, int columnSpan, Qt::Alignment alignment)
{
Q_D(QGridLayout);
+ if (!d->checkLayout(layout))
+ return;
if (!adoptLayout(layout))
return;
QGridBox *b = new QGridBox(layout);
diff --git a/src/widgets/kernel/qlayout.cpp b/src/widgets/kernel/qlayout.cpp
index eb21a580b1..778514f47a 100644
--- a/src/widgets/kernel/qlayout.cpp
+++ b/src/widgets/kernel/qlayout.cpp
@@ -858,6 +858,47 @@ void QLayoutPrivate::reparentChildWidgets(QWidget *mw)
}
/*!
+ Returns \c true if the \a widget can be added to the \a layout;
+ otherwise returns \c false.
+*/
+bool QLayoutPrivate::checkWidget(QWidget *widget) const
+{
+ Q_Q(const QLayout);
+ if (!widget) {
+ qWarning("QLayout: Cannot add a null widget to %s/%s", q->metaObject()->className(),
+ qPrintable(q->objectName()));
+ return false;
+ }
+ if (widget == q->parentWidget()) {
+ qWarning("QLayout: Cannot add parent widget %s/%s to its child layout %s/%s",
+ widget->metaObject()->className(), qPrintable(widget->objectName()),
+ q->metaObject()->className(), qPrintable(q->objectName()));
+ return false;
+ }
+ return true;
+}
+
+/*!
+ Returns \c true if the \a otherLayout can be added to the \a layout;
+ otherwise returns \c false.
+*/
+bool QLayoutPrivate::checkLayout(QLayout *otherLayout) const
+{
+ Q_Q(const QLayout);
+ if (!otherLayout) {
+ qWarning("QLayout: Cannot add a null layout to %s/%s", q->metaObject()->className(),
+ qPrintable(q->objectName()));
+ return false;
+ }
+ if (otherLayout == q) {
+ qWarning("QLayout: Cannot add layout %s/%s to itself", q->metaObject()->className(),
+ qPrintable(q->objectName()));
+ return false;
+ }
+ return true;
+}
+
+/*!
This function is called from \c addWidget() functions in
subclasses to add \a w as a managed widget of a layout.
diff --git a/src/widgets/kernel/qlayout_p.h b/src/widgets/kernel/qlayout_p.h
index 2100d86aba..71e0f9bcd3 100644
--- a/src/widgets/kernel/qlayout_p.h
+++ b/src/widgets/kernel/qlayout_p.h
@@ -76,6 +76,8 @@ public:
void getMargin(int *result, int userMargin, QStyle::PixelMetric pm) const;
void doResize(const QSize &);
void reparentChildWidgets(QWidget *mw);
+ bool checkWidget(QWidget *widget) const;
+ bool checkLayout(QLayout *otherLayout) const;
static QWidgetItem *createWidgetItem(const QLayout *layout, QWidget *widget);
static QSpacerItem *createSpacerItem(const QLayout *layout, int w, int h, QSizePolicy::Policy hPolicy = QSizePolicy::Minimum, QSizePolicy::Policy vPolicy = QSizePolicy::Minimum);
diff --git a/src/widgets/kernel/qwidgetwindow_p.h b/src/widgets/kernel/qwidgetwindow_p.h
index 87ad7a4bd4..1db1a4b600 100644
--- a/src/widgets/kernel/qwidgetwindow_p.h
+++ b/src/widgets/kernel/qwidgetwindow_p.h
@@ -42,6 +42,17 @@
#ifndef QWIDGETWINDOW_P_H
#define QWIDGETWINDOW_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtGui/qwindow.h>
#include <QtCore/private/qobject_p.h>
diff --git a/src/widgets/kernel/qwindowcontainer.cpp b/src/widgets/kernel/qwindowcontainer.cpp
index fa906a5aa2..065f6c86cf 100644
--- a/src/widgets/kernel/qwindowcontainer.cpp
+++ b/src/widgets/kernel/qwindowcontainer.cpp
@@ -92,8 +92,11 @@ public:
Q_Q(QWindowContainer);
QWidget *p = q->parentWidget();
while (p) {
- if (qobject_cast<QMdiSubWindow *>(p) != 0
- || qobject_cast<QAbstractScrollArea *>(p) != 0) {
+ if (
+#ifndef QT_NO_MDIAREA
+ qobject_cast<QMdiSubWindow *>(p) != 0 ||
+#endif
+ qobject_cast<QAbstractScrollArea *>(p) != 0) {
q->winId();
usesNativeWidgets = true;
break;
@@ -203,6 +206,7 @@ QWindowContainer::QWindowContainer(QWindow *embeddedWindow, QWidget *parent, Qt:
d->window = embeddedWindow;
d->window->setParent(&d->fakeParent);
+ setAcceptDrops(true);
connect(QGuiApplication::instance(), SIGNAL(focusWindowChanged(QWindow*)), this, SLOT(focusWindowChanged(QWindow*)));
}
@@ -295,6 +299,7 @@ bool QWindowContainer::event(QEvent *e)
}
}
break;
+#ifndef QT_NO_DRAGANDDROP
case QEvent::Drop:
case QEvent::DragMove:
case QEvent::DragLeave:
@@ -306,6 +311,7 @@ bool QWindowContainer::event(QEvent *e)
QCoreApplication::sendEvent(d->window, e);
e->accept();
return true;
+#endif
default:
break;
}
diff --git a/src/widgets/kernel/qwindowcontainer_p.h b/src/widgets/kernel/qwindowcontainer_p.h
index 014b163f97..45b3cc021f 100644
--- a/src/widgets/kernel/qwindowcontainer_p.h
+++ b/src/widgets/kernel/qwindowcontainer_p.h
@@ -42,6 +42,17 @@
#ifndef QWINDOWCONTAINER_H
#define QWINDOWCONTAINER_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtWidgets/qwidget.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 08d87a3afd..6fbae53804 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -1139,6 +1139,7 @@ void QCommonStylePrivate::tabLayout(const QStyleOptionTabV3 *opt, const QWidget
}
#endif //QT_NO_TABBAR
+#ifndef QT_NO_ANIMATION
/*! \internal */
QList<const QObject*> QCommonStylePrivate::animationTargets() const
{
@@ -1179,6 +1180,7 @@ void QCommonStylePrivate::_q_removeAnimation()
if (animation)
animations.remove(animation->parent());
}
+#endif
/*!
\reimp
diff --git a/src/widgets/styles/qcommonstyle.h b/src/widgets/styles/qcommonstyle.h
index 942721a6a3..ef5634a94d 100644
--- a/src/widgets/styles/qcommonstyle.h
+++ b/src/widgets/styles/qcommonstyle.h
@@ -98,7 +98,9 @@ protected:
private:
Q_DECLARE_PRIVATE(QCommonStyle)
Q_DISABLE_COPY(QCommonStyle)
+#ifndef QT_NO_ANIMATION
Q_PRIVATE_SLOT(d_func(), void _q_removeAnimation())
+#endif
};
QT_END_NAMESPACE
diff --git a/src/widgets/styles/qcommonstyle_p.h b/src/widgets/styles/qcommonstyle_p.h
index 8f8a97a2dc..1f5d8b8a81 100644
--- a/src/widgets/styles/qcommonstyle_p.h
+++ b/src/widgets/styles/qcommonstyle_p.h
@@ -77,7 +77,9 @@ public:
~QCommonStylePrivate()
{
+#ifndef QT_NO_ANIMATION
qDeleteAll(animations);
+#endif
#ifndef QT_NO_ITEMVIEWS
delete cachedOption;
#endif
@@ -114,6 +116,7 @@ public:
#endif
int animationFps;
+#ifndef QT_NO_ANIMATION
void _q_removeAnimation();
QList<const QObject*> animationTargets() const;
@@ -123,6 +126,7 @@ public:
private:
mutable QHash<const QObject*, QStyleAnimation*> animations;
+#endif // QT_NO_ANIMATION
};
QT_END_NAMESPACE
diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp
index 001a032f9b..989f277c58 100644
--- a/src/widgets/styles/qfusionstyle.cpp
+++ b/src/widgets/styles/qfusionstyle.cpp
@@ -2894,7 +2894,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
clipRect = QRect(groove.left(), groove.top(), groove.width(), handle.top() - groove.top());
}
painter->save();
- painter->setClipRect(clipRect.adjusted(0, 0, 1, 1));
+ painter->setClipRect(clipRect.adjusted(0, 0, 1, 1), Qt::IntersectClip);
painter->drawPixmap(groove.topLeft(), cache);
painter->restore();
}
diff --git a/src/widgets/styles/qfusionstyle_p.h b/src/widgets/styles/qfusionstyle_p.h
index 9e5a55918d..ceee6f8b03 100644
--- a/src/widgets/styles/qfusionstyle_p.h
+++ b/src/widgets/styles/qfusionstyle_p.h
@@ -42,6 +42,17 @@
#ifndef QFUSIONSTYLE_P_H
#define QFUSIONSTYLE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtWidgets/qcommonstyle.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/styles/qgtkstyle_p.h b/src/widgets/styles/qgtkstyle_p.h
index 525d7f840a..93bb0d309b 100644
--- a/src/widgets/styles/qgtkstyle_p.h
+++ b/src/widgets/styles/qgtkstyle_p.h
@@ -42,6 +42,17 @@
#ifndef QGTKSTYLE_P_H
#define QGTKSTYLE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <private/qwindowsstyle_p.h>
#include <QtGui/QPalette>
#include <QtGui/QFont>
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index a1838ef1d3..f0a45548f6 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -1109,6 +1109,19 @@ static QAquaWidgetSize qt_aqua_guess_size(const QWidget *widg, QSize large, QSiz
}
#endif
+static void qt_drawFocusRingOnPath(CGContextRef cg, NSBezierPath *focusRingPath)
+{
+ CGContextSaveGState(cg);
+ [NSGraphicsContext setCurrentContext:[NSGraphicsContext
+ graphicsContextWithGraphicsPort:(CGContextRef)cg flipped:NO]];
+ [NSGraphicsContext saveGraphicsState];
+ NSSetFocusRingStyle(NSFocusRingOnly);
+ [focusRingPath setClip]; // Clear clip path to avoid artifacts when rendering the cursor at zero pos
+ [focusRingPath fill];
+ [NSGraphicsContext restoreGraphicsState];
+ CGContextRestoreGState(cg);
+}
+
QAquaWidgetSize QMacStylePrivate::aquaSizeConstrain(const QStyleOption *option, const QWidget *widg,
QStyle::ContentsType ct, QSize szHint, QSize *insz) const
{
@@ -1333,7 +1346,7 @@ void QMacStylePrivate::initComboboxBdi(const QStyleOptionComboBox *combo, HIThem
bdi->adornment = kThemeAdornmentFocus;
if (combo->activeSubControls & QStyle::SC_ComboBoxArrow)
bdi->state = kThemeStatePressed;
- else if (tds == kThemeStateInactive)
+ else if (tds == kThemeStateInactive && QSysInfo::MacintoshVersion <= QSysInfo::MV_10_9)
bdi->state = kThemeStateActive;
else
bdi->state = tds;
@@ -1700,7 +1713,7 @@ void QMacStylePrivate::setAutoDefaultButton(QObject *button) const
}
QMacStylePrivate::QMacStylePrivate()
- : mouseDown(false)
+ : mouseDown(false), backingStoreNSView(nil)
{
defaultButtonStart = CFAbsoluteTimeGetCurrent();
memset(&buttonState, 0, sizeof(ButtonState));
@@ -1713,6 +1726,12 @@ QMacStylePrivate::QMacStylePrivate()
}
+QMacStylePrivate::~QMacStylePrivate()
+{
+ Q_FOREACH (NSView *b, buttons)
+ [b release];
+}
+
ThemeDrawState QMacStylePrivate::getDrawState(QStyle::State flags)
{
ThemeDrawState tds = kThemeStateActive;
@@ -1730,6 +1749,97 @@ ThemeDrawState QMacStylePrivate::getDrawState(QStyle::State flags)
return tds;
}
+NSView *QMacStylePrivate::buttonOfKind(ThemeButtonKind kind) const
+{
+ NSView *bv = buttons[kind];
+ if (!bv) {
+ if (kind == kThemePopupButton)
+ bv = [[NSPopUpButton alloc] init];
+ else if (kind == kThemeComboBox)
+ bv = [[NSComboBox alloc] init];
+ else
+ bv = [[NSButton alloc] init];
+
+ switch (kind) {
+ case kThemeArrowButton: {
+ NSButton *bc = (NSButton *)bv;
+ bc.buttonType = NSOnOffButton;
+ bc.bezelStyle = NSDisclosureBezelStyle;
+ break;
+ }
+ case kThemeCheckBox:
+ case kThemeCheckBoxSmall:
+ case kThemeCheckBoxMini: {
+ NSButton *bc = (NSButton *)bv;
+ bc.buttonType = NSSwitchButton;
+ break;
+ }
+ case kThemeRadioButton:
+ case kThemeRadioButtonSmall:
+ case kThemeRadioButtonMini: {
+ NSButton *bc = (NSButton *)bv;
+ bc.buttonType = NSRadioButton;
+ break;
+ }
+ case kThemePushButton:
+ case kThemePushButtonSmall:
+ case kThemePushButtonMini: {
+ NSButton *bc = (NSButton *)bv;
+ bc.buttonType = NSMomentaryPushButton;
+ bc.bezelStyle = NSRoundedBezelStyle;
+ break;
+ }
+ default:
+ break;
+ }
+
+// if (kind == kThemePushButtonSmall
+// || kind == kThemePopupButtonSmall
+// || kind == kThemeCheckBoxSmall
+// || kind == kThemeRadioButtonSmall)
+// bc.controlSize = NSSmallControlSize;
+// else if (kind == kThemePushButtonMini
+// || kind == kThemePopupButtonMini
+// || kind == kThemeCheckBoxMini
+// || kind == kThemeRadioButtonMini)
+// bc.controlSize = NSMiniControlSize;
+
+ if ([bv isKindOfClass:[NSButton class]]) {
+ NSButton *bc = (NSButton *)bv;
+ bc.title = nil;
+ }
+
+ const_cast<QMacStylePrivate *>(this)->buttons.insert(kind, bv);
+ }
+
+ return bv;
+}
+
+void QMacStylePrivate::drawNSViewInRect(NSView *view, const QRect &qtRect, QPainter *p) const
+{
+ QMacCGContext ctx(p);
+ CGContextSaveGState(ctx);
+
+ [NSGraphicsContext saveGraphicsState];
+ [NSGraphicsContext setCurrentContext:[NSGraphicsContext
+ graphicsContextWithGraphicsPort:ctx flipped:YES]];
+
+ CGRect rect = CGRectMake(qtRect.x() + 1, qtRect.y(), qtRect.width(), qtRect.height());
+
+ [backingStoreNSView addSubview:view];
+ view.frame = rect;
+ [view drawRect:rect];
+ [view removeFromSuperviewWithoutNeedingDisplay];
+
+ [NSGraphicsContext restoreGraphicsState];
+ CGContextRestoreGState(ctx);
+}
+
+void QMacStylePrivate::resolveCurrentNSView(QWindow *window)
+{
+ backingStoreNSView = window ? (NSView *)window->winId() : nil;
+}
+
void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonDrawInfo *bdi,
QPainter *p, const QStyleOption *opt) const
{
@@ -1740,8 +1850,12 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD
finalyoff = 0;
const bool combo = opt->type == QStyleOption::SO_ComboBox;
+ const bool editableCombo = bdi->kind == kThemeComboBox
+ || bdi->kind == kThemeComboBoxSmall
+ || bdi->kind == kThemeComboBoxMini;
const bool button = opt->type == QStyleOption::SO_Button;
const bool pressed = bdi->state == kThemeStatePressed;
+ const bool usingYosemiteOrLater = QSysInfo::MacintoshVersion > QSysInfo::MV_10_9;
if (button && pressed) {
if (bdi->kind == kThemePushButton) {
@@ -1786,7 +1900,7 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD
if (!combo && !button && bdi->value == kThemeButtonOff) {
pm = activePixmap;
- } else if (combo || button) {
+ } else if (!usingYosemiteOrLater && (combo || button)) {
QImage image = activePixmap.toImage();
for (int y = 0; y < height; ++y) {
@@ -1813,6 +1927,40 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD
}
}
pm = QPixmap::fromImage(image);
+ } else if ((usingYosemiteOrLater && combo && !editableCombo) || button) {
+ NSButton *bc = (NSButton *)buttonOfKind(bdi->kind);
+ [bc highlight:pressed];
+ bc.enabled = bdi->state != kThemeStateUnavailable && bdi->state != kThemeStateUnavailableInactive;
+ bc.state = bdi->value == kThemeButtonOn ? NSOnState :
+ bdi->value == kThemeButtonMixed ? NSMixedState : NSOffState;
+ p->translate(0, 1);
+ drawNSViewInRect(bc, opt->rect, p);
+ p->translate(0, -1);
+ return;
+ } else if (usingYosemiteOrLater && editableCombo) {
+ QImage image = activePixmap.toImage();
+
+ for (int y = 0; y < height; ++y) {
+ QRgb *scanLine = reinterpret_cast<QRgb *>(image.scanLine(y));
+
+ for (int x = 0; x < width; ++x) {
+ QRgb &pixel = scanLine[x];
+ int gray = qRed(pixel); // We know the image is grayscale
+ int alpha = qAlpha(pixel);
+
+ if (gray == 128 && alpha == 128) {
+ pixel = qRgba(255, 255, 255, 255);
+ } else if (alpha == 0) {
+ pixel = 0;
+ } else {
+ bool belowThreshold = (alpha * gray) / 255 + 255 - alpha < 128;
+ gray = belowThreshold ? 0 : 2 * gray - 255;
+ alpha = belowThreshold ? 0 : 2 * alpha - 255;
+ pixel = qRgba(gray, gray, gray, alpha);
+ }
+ }
+ }
+ pm = QPixmap::fromImage(image);
} else {
QImage activeImage = activePixmap.toImage();
QImage colorlessImage;
@@ -2917,6 +3065,9 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
Q_D(const QMacStyle);
ThemeDrawState tds = d->getDrawState(opt->state);
QMacCGContext cg(p);
+ QWindow *window = w && w->window() ? w->window()->windowHandle() :
+ QStyleHelper::styleObjectWindow(opt->styleObject);
+ const_cast<QMacStylePrivate *>(d)->resolveCurrentNSView(window);
switch (pe) {
case PE_IndicatorArrowUp:
case PE_IndicatorArrowDown:
@@ -3333,6 +3484,9 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
Q_D(const QMacStyle);
ThemeDrawState tds = d->getDrawState(opt->state);
QMacCGContext cg(p);
+ QWindow *window = w && w->window() ? w->window()->windowHandle() :
+ QStyleHelper::styleObjectWindow(opt->styleObject);
+ const_cast<QMacStylePrivate *>(d)->resolveCurrentNSView(window);
switch (ce) {
case CE_HeaderSection:
if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
@@ -3545,11 +3699,18 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
break;
}
+ // No default button pulsating animation on Yosemite,
+ // so we have to do few things differently.
+ const bool yosemiteOrLater = QSysInfo::QSysInfo::MacintoshVersion > QSysInfo::MV_10_9;
+
// a focused auto-default button within an active window
// takes precedence over a normal default button
if (btn->features & QStyleOptionButton::AutoDefaultButton
&& opt->state & State_Active && opt->state & State_HasFocus) {
- d->setAutoDefaultButton(opt->styleObject);
+ if (yosemiteOrLater)
+ d->autoDefaultButton = opt->styleObject;
+ else
+ d->setAutoDefaultButton(opt->styleObject);
} else if (d->autoDefaultButton == opt->styleObject) {
d->setAutoDefaultButton(0);
}
@@ -3557,7 +3718,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
if (!d->autoDefaultButton) {
if (btn->features & QStyleOptionButton::DefaultButton && opt->state & State_Active) {
d->defaultButton = opt->styleObject;
- if (!d->animation(opt->styleObject))
+ if (!yosemiteOrLater && !d->animation(opt->styleObject))
d->startAnimation(new QStyleAnimation(opt->styleObject));
} else if (d->defaultButton == opt->styleObject) {
if (QStyleAnimation *animation = d->animation(opt->styleObject)) {
@@ -3575,29 +3736,45 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
else if (d->pressedButton == opt->styleObject)
d->pressedButton = 0;
- // the default button animation is paused meanwhile any button
- // is pressed or an auto-default button is animated instead
- if (QStyleAnimation *defaultAnimation = d->animation(d->defaultButton)) {
- if (d->pressedButton || d->autoDefaultButton) {
- if (defaultAnimation->state() == QStyleAnimation::Running) {
- defaultAnimation->pause();
- defaultAnimation->updateTarget();
- }
- } else if (defaultAnimation->state() == QStyleAnimation::Paused) {
- defaultAnimation->resume();
- }
- }
-
HIThemeButtonDrawInfo bdi;
d->initHIThemePushButton(btn, w, tds, &bdi);
- if (!d->pressedButton) {
- QStyleAnimation* animation = d->animation(opt->styleObject);
- if (animation && animation->state() == QStyleAnimation::Running) {
+
+ if (yosemiteOrLater) {
+ // HITheme is not drawing a nice focus frame around buttons.
+ // We'll do it ourselves further down.
+ bdi.adornment &= ~kThemeAdornmentFocus;
+
+ // We can't rely on an animation existing to test for the default look. That means a bit
+ // more logic (notice that the logic is slightly different for the bevel and the label).
+ if (tds == kThemeStateActive
+ && (btn->features & QStyleOptionButton::DefaultButton
+ || (btn->features & QStyleOptionButton::AutoDefaultButton
+ && d->autoDefaultButton == btn->styleObject)))
bdi.adornment |= kThemeAdornmentDefault;
- bdi.animation.time.start = d->defaultButtonStart;
- bdi.animation.time.current = CFAbsoluteTimeGetCurrent();
+ } else {
+ // the default button animation is paused meanwhile any button
+ // is pressed or an auto-default button is animated instead
+ if (QStyleAnimation *defaultAnimation = d->animation(d->defaultButton)) {
+ if (d->pressedButton || d->autoDefaultButton) {
+ if (defaultAnimation->state() == QStyleAnimation::Running) {
+ defaultAnimation->pause();
+ defaultAnimation->updateTarget();
+ }
+ } else if (defaultAnimation->state() == QStyleAnimation::Paused) {
+ defaultAnimation->resume();
+ }
+ }
+
+ if (!d->pressedButton) {
+ QStyleAnimation* animation = d->animation(opt->styleObject);
+ if (animation && animation->state() == QStyleAnimation::Running) {
+ bdi.adornment |= kThemeAdornmentDefault;
+ bdi.animation.time.start = d->defaultButtonStart;
+ bdi.animation.time.current = CFAbsoluteTimeGetCurrent();
+ }
}
}
+
// Unlike Carbon, we want the button to always be drawn inside its bounds.
// Therefore, make the button a bit smaller, so that even if it got focus,
// the focus 'shadow' will be inside.
@@ -3619,6 +3796,37 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
else
HIThemeDrawButton(&newRect, &bdi, cg, kHIThemeOrientationNormal, 0);
+ if (yosemiteOrLater && btn->state & State_HasFocus) {
+ CGRect focusRect = newRect;
+ if (bdi.kind == kThemePushButton)
+ focusRect.size.height += 1; // Another thing HITheme and Cocoa seem to disagree about.
+ else if (bdi.kind == kThemePushButtonMini)
+ focusRect.size.height = 15; // Our QPushButton sizes are really weird
+
+ if (bdi.adornment & kThemeAdornmentDefault || bdi.state == kThemeStatePressed) {
+ if (bdi.kind == kThemePushButtonSmall) {
+ focusRect = CGRectInset(focusRect, -1, 0);
+ } else if (bdi.kind == kThemePushButtonMini) {
+ focusRect = CGRectInset(focusRect, 1, 0);
+ }
+ } else {
+ if (bdi.kind == kThemePushButton) {
+ focusRect = CGRectInset(focusRect, 1, 1);
+ } else if (bdi.kind == kThemePushButtonSmall) {
+ focusRect = CGRectInset(focusRect, 0, 2);
+ } else if (bdi.kind == kThemePushButtonMini) {
+ focusRect = CGRectInset(focusRect, 2, 1);
+ }
+ }
+
+ NSBezierPath *pushButtonFocusRingPath;
+ if (bdi.kind == kThemeBevelButton)
+ pushButtonFocusRingPath = [NSBezierPath bezierPathWithRect:focusRect];
+ else
+ pushButtonFocusRingPath = [NSBezierPath bezierPathWithRoundedRect:focusRect xRadius:4 yRadius:4];
+ qt_drawFocusRingOnPath(cg, pushButtonFocusRingPath);
+ }
+
if (hasMenu) {
int mbi = proxy()->pixelMetric(QStyle::PM_MenuButtonIndicator, btn, w);
QRect ir = btn->rect;
@@ -3663,14 +3871,24 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
}
break;
case CE_PushButtonLabel:
- if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
+ if (const QStyleOptionButton *b = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
+ QStyleOptionButton btn(*b);
// We really don't want the label to be drawn the same as on
// windows style if it has an icon and text, then it should be more like a
// tab. So, cheat a little here. However, if it *is* only an icon
// the windows style works great, so just use that implementation.
- bool hasMenu = btn->features & QStyleOptionButton::HasMenu;
- bool hasIcon = !btn->icon.isNull();
- bool hasText = !btn->text.isEmpty();
+ bool hasMenu = btn.features & QStyleOptionButton::HasMenu;
+ bool hasIcon = !btn.icon.isNull();
+ bool hasText = !btn.text.isEmpty();
+
+ if (QSysInfo::QSysInfo::MacintoshVersion > QSysInfo::MV_10_9) {
+ if (tds == kThemeStatePressed
+ || (tds == kThemeStateActive
+ && ((btn.features & QStyleOptionButton::DefaultButton && !d->autoDefaultButton)
+ || d->autoDefaultButton == btn.styleObject)))
+ btn.palette.setColor(QPalette::ButtonText, Qt::white);
+ }
+
if (!hasIcon && !hasMenu) {
// ### this is really overly difficult, simplify.
// It basically tries to get the right font for "small" and "mini" icons.
@@ -3689,8 +3907,9 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
break;
}
}
+
if (themeId == kThemePushButtonFont) {
- QCommonStyle::drawControl(ce, btn, p, w);
+ QCommonStyle::drawControl(ce, &btn, p, w);
} else {
p->save();
CGContextSetShouldAntialias(cg, true);
@@ -3698,7 +3917,8 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
HIThemeTextInfo tti;
tti.version = qt_mac_hitheme_version;
tti.state = tds;
- QColor textColor = btn->palette.buttonText().color();
+ QColor textColor;
+ textColor = btn.palette.buttonText().color();
CGFloat colorComp[] = { static_cast<CGFloat>(textColor.redF()), static_cast<CGFloat>(textColor.greenF()),
static_cast<CGFloat>(textColor.blueF()), static_cast<CGFloat>(textColor.alphaF()) };
CGContextSetFillColorSpace(cg, qt_mac_genericColorSpace());
@@ -3708,9 +3928,9 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
tti.verticalFlushness = kHIThemeTextVerticalFlushCenter;
tti.options = kHIThemeTextBoxOptionNone;
tti.truncationPosition = kHIThemeTextTruncationNone;
- tti.truncationMaxLines = 1 + btn->text.count(QLatin1Char('\n'));
- QCFString buttonText = qt_mac_removeMnemonics(btn->text);
- QRect r = btn->rect;
+ tti.truncationMaxLines = 1 + btn.text.count(QLatin1Char('\n'));
+ QCFString buttonText = qt_mac_removeMnemonics(btn.text);
+ QRect r = btn.rect;
HIRect bounds = qt_hirectForQRect(r);
HIThemeDrawTextBox(buttonText, &bounds, &tti,
cg, kHIThemeOrientationNormal);
@@ -3718,11 +3938,11 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
}
} else {
if (hasIcon && !hasText) {
- QCommonStyle::drawControl(ce, btn, p, w);
+ QCommonStyle::drawControl(ce, &btn, p, w);
} else {
- QRect freeContentRect = btn->rect;
+ QRect freeContentRect = btn.rect;
QRect textRect = itemTextRect(
- btn->fontMetrics, freeContentRect, Qt::AlignCenter, btn->state & State_Enabled, btn->text);
+ btn.fontMetrics, freeContentRect, Qt::AlignCenter, btn.state & State_Enabled, btn.text);
if (hasMenu) {
if (QSysInfo::macVersion() > QSysInfo::MV_10_6)
textRect.moveTo(w ? 15 : 11, textRect.top()); // Supports Qt Quick Controls
@@ -3734,21 +3954,21 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
int contentW = textRect.width();
if (hasMenu)
contentW += proxy()->pixelMetric(PM_MenuButtonIndicator) + 4;
- QIcon::Mode mode = btn->state & State_Enabled ? QIcon::Normal : QIcon::Disabled;
- if (mode == QIcon::Normal && btn->state & State_HasFocus)
+ QIcon::Mode mode = btn.state & State_Enabled ? QIcon::Normal : QIcon::Disabled;
+ if (mode == QIcon::Normal && btn.state & State_HasFocus)
mode = QIcon::Active;
// Decide if the icon is should be on or off:
QIcon::State state = QIcon::Off;
- if (btn->state & State_On)
+ if (btn.state & State_On)
state = QIcon::On;
- QPixmap pixmap = btn->icon.pixmap(btn->iconSize, mode, state);
+ QPixmap pixmap = btn.icon.pixmap(btn.iconSize, mode, state);
int pixmapWidth = pixmap.width() / pixmap.devicePixelRatio();
int pixmapHeight = pixmap.height() / pixmap.devicePixelRatio();
contentW += pixmapWidth + QMacStylePrivate::PushButtonContentPadding;
int iconLeftOffset = freeContentRect.x() + (freeContentRect.width() - contentW) / 2;
int iconTopOffset = freeContentRect.y() + (freeContentRect.height() - pixmapHeight) / 2;
QRect iconDestRect(iconLeftOffset, iconTopOffset, pixmapWidth, pixmapHeight);
- QRect visualIconDestRect = visualRect(btn->direction, freeContentRect, iconDestRect);
+ QRect visualIconDestRect = visualRect(btn.direction, freeContentRect, iconDestRect);
proxy()->drawItemPixmap(p, visualIconDestRect, Qt::AlignLeft | Qt::AlignVCenter, pixmap);
int newOffset = iconDestRect.x() + iconDestRect.width()
+ QMacStylePrivate::PushButtonContentPadding - textRect.x();
@@ -3756,9 +3976,9 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
}
// Draw the text:
if (hasText) {
- textRect = visualRect(btn->direction, freeContentRect, textRect);
- proxy()->drawItemText(p, textRect, Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic, btn->palette,
- (btn->state & State_Enabled), btn->text, QPalette::ButtonText);
+ textRect = visualRect(btn.direction, freeContentRect, textRect);
+ proxy()->drawItemText(p, textRect, Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic, btn.palette,
+ (btn.state & State_Enabled), btn.text, QPalette::ButtonText);
}
}
}
@@ -3793,6 +4013,9 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
return;
}
}
+
+ bool usingYosemiteOrLater = QSysInfo::MacintoshVersion > QSysInfo::MV_10_9;
+
HIThemeTabDrawInfo tdi;
tdi.version = 1;
tdi.style = kThemeTabNonFront;
@@ -3833,10 +4056,13 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
else
tdi.adornment = kHIThemeTabAdornmentNone;
tdi.kind = kHIThemeTabKindNormal;
- if (!verticalTabs)
- tabRect.setY(tabRect.y() - 1);
- else
- tabRect.setX(tabRect.x() - 1);
+
+ if (!usingYosemiteOrLater) {
+ if (!verticalTabs)
+ tabRect.setY(tabRect.y() - 1);
+ else
+ tabRect.setX(tabRect.x() - 1);
+ }
QStyleOptionTab::TabPosition tp = tabOpt->position;
QStyleOptionTab::SelectedPosition sp = tabOpt->selectedPosition;
if (tabOpt->direction == Qt::RightToLeft && !verticalTabs) {
@@ -3901,18 +4127,21 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
ThemeTabDirection ttd = getTabDirection(myTab.shape);
bool verticalTabs = ttd == kThemeTabWest || ttd == kThemeTabEast;
bool selected = (myTab.state & QStyle::State_Selected);
- bool usingModernOSX = QSysInfo::MacintoshVersion > QSysInfo::MV_10_6;
+ bool usingLionOrLater = QSysInfo::MacintoshVersion > QSysInfo::MV_10_6;
+ bool usingYosemiteOrLater = QSysInfo::MacintoshVersion > QSysInfo::MV_10_9;
- if (usingModernOSX && selected && !myTab.documentMode)
- myTab.palette.setColor(QPalette::WindowText, QColor(Qt::white));
+ if (usingLionOrLater && selected && !myTab.documentMode
+ && (!usingYosemiteOrLater || myTab.state & State_Active))
+ myTab.palette.setColor(QPalette::WindowText, Qt::white);
// Check to see if we use have the same as the system font
// (QComboMenuItem is internal and should never be seen by the
// outside world, unless they read the source, in which case, it's
// their own fault).
bool nonDefaultFont = p->font() != qt_app_fonts_hash()->value("QComboMenuItem");
- if ((usingModernOSX && selected) || verticalTabs || nonDefaultFont || !tab->icon.isNull()
- || !myTab.leftButtonSize.isNull() || !myTab.rightButtonSize.isNull()) {
+ bool isSelectedAndNeedsShadow = selected && usingLionOrLater && !usingYosemiteOrLater;
+ if (isSelectedAndNeedsShadow || verticalTabs || nonDefaultFont || !tab->icon.isNull()
+ || !myTab.leftButtonSize.isEmpty() || !myTab.rightButtonSize.isEmpty()) {
int heightOffset = 0;
if (verticalTabs) {
heightOffset = -1;
@@ -3922,7 +4151,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
}
myTab.rect.setHeight(myTab.rect.height() + heightOffset);
- if (myTab.documentMode || (usingModernOSX && selected)) {
+ if (myTab.documentMode || isSelectedAndNeedsShadow) {
p->save();
rotateTabPainter(p, myTab.shape, myTab.rect);
@@ -4062,16 +4291,8 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
int yOff = proxy()->pixelMetric(PM_FocusFrameVMargin, opt, w);
NSRect rect = NSMakeRect(xOff+opt->rect.x(), yOff+opt->rect.y(), opt->rect.width() - 2 * xOff,
opt->rect.height() - 2 * yOff);
- CGContextSaveGState(cg);
- [NSGraphicsContext setCurrentContext:[NSGraphicsContext
- graphicsContextWithGraphicsPort:(CGContextRef)cg flipped:NO]];
- [NSGraphicsContext saveGraphicsState];
- NSSetFocusRingStyle(NSFocusRingOnly);
NSBezierPath *focusFramePath = [NSBezierPath bezierPathWithRect:rect];
- [focusFramePath setClip]; // Clear clip path to avoid artifacts when rendering the cursor at zero pos
- [focusFramePath fill];
- [NSGraphicsContext restoreGraphicsState];
- CGContextRestoreGState(cg);
+ qt_drawFocusRingOnPath(cg, focusFramePath);
break; }
case CE_MenuItem:
case CE_MenuEmptyArea:
@@ -4983,6 +5204,9 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
Q_D(const QMacStyle);
ThemeDrawState tds = d->getDrawState(opt->state);
QMacCGContext cg(p);
+ QWindow *window = widget && widget->window() ? widget->window()->windowHandle() :
+ QStyleHelper::styleObjectWindow(opt->styleObject);
+ const_cast<QMacStylePrivate *>(d)->resolveCurrentNSView(window);
switch (cc) {
case CC_Slider:
case CC_ScrollBar:
diff --git a/src/widgets/styles/qmacstyle_mac_p.h b/src/widgets/styles/qmacstyle_mac_p.h
index 305bcf871c..b0fb9e06be 100644
--- a/src/widgets/styles/qmacstyle_mac_p.h
+++ b/src/widgets/styles/qmacstyle_mac_p.h
@@ -42,6 +42,17 @@
#ifndef QMACSTYLE_MAC_P_H
#define QMACSTYLE_MAC_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtWidgets/qcommonstyle.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/styles/qmacstyle_mac_p_p.h b/src/widgets/styles/qmacstyle_mac_p_p.h
index 6f42f0ea79..3bbff61340 100644
--- a/src/widgets/styles/qmacstyle_mac_p_p.h
+++ b/src/widgets/styles/qmacstyle_mac_p_p.h
@@ -145,6 +145,7 @@ class QMacStylePrivate : public QCommonStylePrivate
Q_DECLARE_PUBLIC(QMacStyle)
public:
QMacStylePrivate();
+ ~QMacStylePrivate();
// Ideally these wouldn't exist, but since they already exist we need some accessors.
static const int PushButtonLeftOffset;
@@ -194,6 +195,11 @@ public:
void setAutoDefaultButton(QObject *button) const;
+ NSView *buttonOfKind(ThemeButtonKind kind) const;
+
+ void drawNSViewInRect(NSView *view, const QRect &rect, QPainter *p) const;
+ void resolveCurrentNSView(QWindow *window);
+
public:
mutable QPointer<QObject> pressedButton;
mutable QPointer<QObject> defaultButton;
@@ -212,6 +218,8 @@ public:
void *nsscroller;
#endif
void *indicatorBranchButtonCell;
+ NSView *backingStoreNSView;
+ QHash<ThemeButtonKind , NSView *> buttons;
};
QT_END_NAMESPACE
diff --git a/src/widgets/styles/qstyleanimation.cpp b/src/widgets/styles/qstyleanimation.cpp
index e6e47a98e9..65d011f01f 100644
--- a/src/widgets/styles/qstyleanimation.cpp
+++ b/src/widgets/styles/qstyleanimation.cpp
@@ -40,6 +40,9 @@
****************************************************************************/
#include "qstyleanimation_p.h"
+
+#ifndef QT_NO_ANIMATION
+
#include <qcoreapplication.h>
#include <qwidget.h>
#include <qevent.h>
@@ -363,3 +366,5 @@ void QScrollbarStyleAnimation::updateCurrentTime(int time)
}
QT_END_NAMESPACE
+
+#endif //QT_NO_ANIMATION
diff --git a/src/widgets/styles/qstyleanimation_p.h b/src/widgets/styles/qstyleanimation_p.h
index 19e629cb25..526722d09a 100644
--- a/src/widgets/styles/qstyleanimation_p.h
+++ b/src/widgets/styles/qstyleanimation_p.h
@@ -48,6 +48,8 @@
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_ANIMATION
+
//
// W A R N I N G
// -------------
@@ -199,6 +201,8 @@ private:
bool _active;
};
+#endif // QT_NO_ANIMATION
+
QT_END_NAMESPACE
#endif // QSTYLEANIMATION_P_H
diff --git a/src/widgets/styles/qstylehelper.cpp b/src/widgets/styles/qstylehelper.cpp
index 6be07a3f45..49e406a8b7 100644
--- a/src/widgets/styles/qstylehelper.cpp
+++ b/src/widgets/styles/qstylehelper.cpp
@@ -47,6 +47,7 @@
#include <qmath.h>
#include <qscrollbar.h>
#include <qabstractscrollarea.h>
+#include <qwindow.h>
#include "qstylehelper_p.h"
#include <qstringbuilder.h>
@@ -397,5 +398,14 @@ QColor backgroundColor(const QPalette &pal, const QWidget* widget)
return widget->parentWidget()->parentWidget()->palette().color(QPalette::Base);
return pal.color(QPalette::Base);
}
+
+QWindow *styleObjectWindow(QObject *so)
+{
+ if (so)
+ return so->property("_q_styleObjectWindow").value<QWindow *>();
+
+ return 0;
+}
+
}
QT_END_NAMESPACE
diff --git a/src/widgets/styles/qstylehelper_p.h b/src/widgets/styles/qstylehelper_p.h
index 73e5c94dcd..1229af7497 100644
--- a/src/widgets/styles/qstylehelper_p.h
+++ b/src/widgets/styles/qstylehelper_p.h
@@ -68,6 +68,7 @@ class QPainter;
class QPixmap;
class QStyleOptionSlider;
class QStyleOption;
+class QWindow;
namespace QStyleHelper
{
@@ -87,6 +88,7 @@ namespace QStyleHelper
bool hasAncestor(QObject *obj, QAccessible::Role role);
#endif
QColor backgroundColor(const QPalette &pal, const QWidget* widget = 0);
+ QWindow *styleObjectWindow(QObject *so);
}
diff --git a/src/widgets/styles/qwindowscestyle_p.h b/src/widgets/styles/qwindowscestyle_p.h
index 73fb2b7ab7..d5e2ee84ed 100644
--- a/src/widgets/styles/qwindowscestyle_p.h
+++ b/src/widgets/styles/qwindowscestyle_p.h
@@ -42,6 +42,17 @@
#ifndef QWINDOWSCESTYLE_P_H
#define QWINDOWSCESTYLE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <private/qwindowsstyle_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/styles/qwindowsmobilestyle_p.h b/src/widgets/styles/qwindowsmobilestyle_p.h
index 4262bf5c73..75a4e45ea9 100644
--- a/src/widgets/styles/qwindowsmobilestyle_p.h
+++ b/src/widgets/styles/qwindowsmobilestyle_p.h
@@ -42,6 +42,17 @@
#ifndef QWINDOWSMOBILESTYLE_P_H
#define QWINDOWSMOBILESTYLE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <private/qwindowsstyle_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/styles/qwindowsstyle_p.h b/src/widgets/styles/qwindowsstyle_p.h
index 1107e70061..39b85ec148 100644
--- a/src/widgets/styles/qwindowsstyle_p.h
+++ b/src/widgets/styles/qwindowsstyle_p.h
@@ -42,6 +42,17 @@
#ifndef QWINDOWSSTYLE_P_H
#define QWINDOWSSTYLE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtWidgets/qcommonstyle.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/styles/qwindowsvistastyle_p.h b/src/widgets/styles/qwindowsvistastyle_p.h
index f7914f1645..1b3201c026 100644
--- a/src/widgets/styles/qwindowsvistastyle_p.h
+++ b/src/widgets/styles/qwindowsvistastyle_p.h
@@ -42,6 +42,17 @@
#ifndef QWINDOWSVISTASTYLE_P_H
#define QWINDOWSVISTASTYLE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <private/qwindowsxpstyle_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/styles/qwindowsxpstyle_p.h b/src/widgets/styles/qwindowsxpstyle_p.h
index d61132295c..4bb7c73660 100644
--- a/src/widgets/styles/qwindowsxpstyle_p.h
+++ b/src/widgets/styles/qwindowsxpstyle_p.h
@@ -42,6 +42,17 @@
#ifndef QWINDOWSXPSTYLE_P_H
#define QWINDOWSXPSTYLE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <private/qwindowsstyle_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/widgets/qkeysequenceedit_p.h b/src/widgets/widgets/qkeysequenceedit_p.h
index f74433bb71..adb3dc7a55 100644
--- a/src/widgets/widgets/qkeysequenceedit_p.h
+++ b/src/widgets/widgets/qkeysequenceedit_p.h
@@ -43,6 +43,17 @@
#ifndef QKEYSEQUENCEEDIT_P_H
#define QKEYSEQUENCEEDIT_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qkeysequenceedit.h"
#include <private/qwidget_p.h>
diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp
index 58ec068bb2..76830c57a1 100644
--- a/src/widgets/widgets/qlineedit_p.cpp
+++ b/src/widgets/widgets/qlineedit_p.cpp
@@ -310,7 +310,6 @@ QLineEditIconButton::QLineEditIconButton(QWidget *parent)
: QToolButton(parent)
, m_opacity(0)
{
- updateCursor();
setFocusPolicy(Qt::NoFocus);
}
@@ -334,18 +333,20 @@ void QLineEditIconButton::setOpacity(qreal value)
{
if (!qFuzzyCompare(m_opacity, value)) {
m_opacity = value;
+ updateCursor();
update();
}
}
+#ifndef QT_NO_ANIMATION
void QLineEditIconButton::startOpacityAnimation(qreal endValue)
{
QPropertyAnimation *animation = new QPropertyAnimation(this, QByteArrayLiteral("opacity"));
- connect(animation, &QAbstractAnimation::finished, this, &QLineEditIconButton::updateCursor);
animation->setDuration(160);
animation->setEndValue(endValue);
animation->start(QAbstractAnimation::DeleteWhenStopped);
}
+#endif
void QLineEditIconButton::updateCursor()
{
@@ -360,6 +361,7 @@ void QLineEditPrivate::_q_textChanged(const QString &text)
const int newTextSize = text.size();
if (!newTextSize || !lastTextSize) {
lastTextSize = newTextSize;
+#ifndef QT_NO_ANIMATION
const bool fadeIn = newTextSize > 0;
foreach (const SideWidgetEntry &e, leadingSideWidgets) {
if (e.flags & SideWidgetFadeInWithText)
@@ -369,6 +371,7 @@ void QLineEditPrivate::_q_textChanged(const QString &text)
if (e.flags & SideWidgetFadeInWithText)
static_cast<QLineEditIconButton *>(e.widget)->animateShow(fadeIn);
}
+#endif
}
}
}
diff --git a/src/widgets/widgets/qlineedit_p.h b/src/widgets/widgets/qlineedit_p.h
index 08365521d5..b45fde8a1a 100644
--- a/src/widgets/widgets/qlineedit_p.h
+++ b/src/widgets/widgets/qlineedit_p.h
@@ -84,7 +84,9 @@ public:
qreal opacity() const { return m_opacity; }
void setOpacity(qreal value);
+#ifndef QT_NO_ANIMATION
void animateShow(bool visible) { startOpacityAnimation(visible ? 1.0 : 0.0); }
+#endif
protected:
void paintEvent(QPaintEvent *event);
@@ -93,7 +95,9 @@ private slots:
void updateCursor();
private:
+#ifndef QT_NO_ANIMATION
void startOpacityAnimation(qreal endValue);
+#endif
qreal m_opacity;
};
diff --git a/src/widgets/widgets/qplaintextedit.cpp b/src/widgets/widgets/qplaintextedit.cpp
index 3f34a08b5e..3ff8e8cbbf 100644
--- a/src/widgets/widgets/qplaintextedit.cpp
+++ b/src/widgets/widgets/qplaintextedit.cpp
@@ -997,7 +997,8 @@ void QPlainTextEditPrivate::_q_adjustScrollbars()
} else {
vmax = qMax(0, doc->lineCount() - 1);
- vSliderLength = viewport->height() / q->fontMetrics().lineSpacing();
+ int lineSpacing = q->fontMetrics().lineSpacing();
+ vSliderLength = lineSpacing != 0 ? viewport->height() / lineSpacing : 0;
}
diff --git a/src/widgets/widgets/qsizegrip.cpp b/src/widgets/widgets/qsizegrip.cpp
index e46de3958f..5994071bfc 100644
--- a/src/widgets/widgets/qsizegrip.cpp
+++ b/src/widgets/widgets/qsizegrip.cpp
@@ -83,7 +83,7 @@ public:
int dyMax;
Qt::Corner m_corner;
bool gotMousePress;
- QWidget *tlw;
+ QPointer<QWidget> tlw;
#ifdef Q_WS_MAC
void updateMacSizer(bool hide) const;
#endif
diff --git a/src/widgets/widgets/qtoolbutton.cpp b/src/widgets/widgets/qtoolbutton.cpp
index 1b5ba8cd58..a3845c96f2 100644
--- a/src/widgets/widgets/qtoolbutton.cpp
+++ b/src/widgets/widgets/qtoolbutton.cpp
@@ -653,6 +653,10 @@ void QToolButton::setMenu(QMenu* menu)
} else {
d->menuAction = 0;
}
+
+ // changing the menu set may change the size hint, so reset it
+ d->sizeHint = QSize();
+ updateGeometry();
update();
}
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index 9ce931d78a..ddfb68cabc 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -234,6 +234,8 @@ private slots:
void mapResource();
void mapOpenMode_data();
void mapOpenMode();
+ void mapWrittenFile_data();
+ void mapWrittenFile();
#ifndef Q_OS_WINCE
void openStandardStreamsFileDescriptors();
@@ -3087,6 +3089,44 @@ void tst_QFile::mapOpenMode()
file.close();
}
+void tst_QFile::mapWrittenFile_data()
+{
+ QTest::addColumn<int>("mode");
+ QTest::newRow("buffered") << 0;
+ QTest::newRow("unbuffered") << int(QIODevice::Unbuffered);
+}
+
+void tst_QFile::mapWrittenFile()
+{
+ static const char data[128] = "Some data padded with nulls\n";
+ QFETCH(int, mode);
+
+ QString fileName = QDir::currentPath() + '/' + "qfile_map_testfile";
+
+#ifdef Q_OS_WINCE
+ fileName = QFileInfo(fileName).absoluteFilePath();
+#endif
+
+ if (QFile::exists(fileName)) {
+ QVERIFY(QFile::setPermissions(fileName,
+ QFile::WriteOwner | QFile::ReadOwner | QFile::WriteUser | QFile::ReadUser));
+ QFile::remove(fileName);
+ }
+ QFile file(fileName);
+ QVERIFY(file.open(QIODevice::ReadWrite | QFile::OpenMode(mode)));
+ QCOMPARE(file.write(data, sizeof data), qint64(sizeof data));
+ if ((mode & QIODevice::Unbuffered) == 0)
+ file.flush();
+
+ // test that we can read the data we've just written, without closing the file
+ uchar *memory = file.map(0, sizeof data);
+ QVERIFY(memory);
+ QVERIFY(memcmp(memory, data, sizeof data) == 0);
+
+ file.close();
+ file.remove();
+}
+
void tst_QFile::openDirectory()
{
QFile f1(m_resourcesDir);
diff --git a/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp b/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp
index f6fd13007a..ed57b7cce0 100644
--- a/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp
+++ b/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp
@@ -100,6 +100,7 @@ void tst_QCollator::compare_data()
QTest::addColumn<QString>("s2");
QTest::addColumn<int>("result");
QTest::addColumn<int>("caseInsensitiveResult");
+ QTest::addColumn<bool>("numericMode");
/*
A few tests below are commented out on the mac. It's unclear why they fail,
@@ -114,49 +115,55 @@ void tst_QCollator::compare_data()
comparison of Latin-1 values, although I'm not sure. So I
just test digits to make sure that it's not totally broken.
*/
- QTest::newRow("english1") << QString("en_US") << QString("5") << QString("4") << 1 << 1;
- QTest::newRow("english2") << QString("en_US") << QString("4") << QString("6") << -1 << -1;
- QTest::newRow("english3") << QString("en_US") << QString("5") << QString("6") << -1 << -1;
- QTest::newRow("english4") << QString("en_US") << QString("a") << QString("b") << -1 << -1;
+ QTest::newRow("english1") << QString("en_US") << QString("5") << QString("4") << 1 << 1 << false;
+ QTest::newRow("english2") << QString("en_US") << QString("4") << QString("6") << -1 << -1 << false;
+ QTest::newRow("english3") << QString("en_US") << QString("5") << QString("6") << -1 << -1 << false;
+ QTest::newRow("english4") << QString("en_US") << QString("a") << QString("b") << -1 << -1 << false;
+ QTest::newRow("english5") << QString("en_US") << QString("test 9") << QString("test 19") << -1 << -1 << true;
+
/*
In Swedish, a with ring above (E5) comes before a with
diaresis (E4), which comes before o diaresis (F6), which
all come after z.
*/
- QTest::newRow("swedish1") << QString("sv_SE") << QString::fromLatin1("\xe5") << QString::fromLatin1("\xe4") << -1 << -1;
- QTest::newRow("swedish2") << QString("sv_SE") << QString::fromLatin1("\xe4") << QString::fromLatin1("\xf6") << -1 << -1;
- QTest::newRow("swedish3") << QString("sv_SE") << QString::fromLatin1("\xe5") << QString::fromLatin1("\xf6") << -1 << -1;
- QTest::newRow("swedish4") << QString("sv_SE") << QString::fromLatin1("z") << QString::fromLatin1("\xe5") << -1 << -1;
+ QTest::newRow("swedish1") << QString("sv_SE") << QString::fromLatin1("\xe5") << QString::fromLatin1("\xe4") << -1 << -1 << false;
+ QTest::newRow("swedish2") << QString("sv_SE") << QString::fromLatin1("\xe4") << QString::fromLatin1("\xf6") << -1 << -1 << false;
+ QTest::newRow("swedish3") << QString("sv_SE") << QString::fromLatin1("\xe5") << QString::fromLatin1("\xf6") << -1 << -1 << false;
+ QTest::newRow("swedish4") << QString("sv_SE") << QString::fromLatin1("z") << QString::fromLatin1("\xe5") << -1 << -1 << false;
+ QTest::newRow("swedish5") << QString("sv_SE") << QString("9") << QString("19") << -1 << -1 << true;
/*
In Norwegian, ae (E6) comes before o with stroke (D8), which
comes before a with ring above (E5).
*/
- QTest::newRow("norwegian1") << QString("no_NO") << QString::fromLatin1("\xe6") << QString::fromLatin1("\xd8") << -1 << -1;
- QTest::newRow("norwegian2") << QString("no_NO") << QString::fromLatin1("\xd8") << QString::fromLatin1("\xe5") << -1 << -1;
- QTest::newRow("norwegian3") << QString("no_NO") << QString::fromLatin1("\xe6") << QString::fromLatin1("\xe5") << -1 << -1;
+ QTest::newRow("norwegian1") << QString("no_NO") << QString::fromLatin1("\xe6") << QString::fromLatin1("\xd8") << -1 << -1 << false;
+ QTest::newRow("norwegian2") << QString("no_NO") << QString::fromLatin1("\xd8") << QString::fromLatin1("\xe5") << -1 << -1 << false;
+ QTest::newRow("norwegian3") << QString("no_NO") << QString::fromLatin1("\xe6") << QString::fromLatin1("\xe5") << -1 << -1 << false;
+ QTest::newRow("norwegian4") << QString("no_NO") << QString("9") << QString("19") << -1 << -1 << true;
+
/*
In German, z comes *after* a with diaresis (E4),
which comes before o diaresis (F6).
*/
- QTest::newRow("german1") << QString("de_DE") << QString::fromLatin1("a") << QString::fromLatin1("\xe4") << -1 << -1;
- QTest::newRow("german2") << QString("de_DE") << QString::fromLatin1("b") << QString::fromLatin1("\xe4") << 1 << 1;
- QTest::newRow("german3") << QString("de_DE") << QString::fromLatin1("z") << QString::fromLatin1("\xe4") << 1 << 1;
- QTest::newRow("german4") << QString("de_DE") << QString::fromLatin1("\xe4") << QString::fromLatin1("\xf6") << -1 << -1;
- QTest::newRow("german5") << QString("de_DE") << QString::fromLatin1("z") << QString::fromLatin1("\xf6") << 1 << 1;
- QTest::newRow("german6") << QString("de_DE") << QString::fromLatin1("\xc0") << QString::fromLatin1("\xe0") << 1 << 0;
- QTest::newRow("german7") << QString("de_DE") << QString::fromLatin1("\xd6") << QString::fromLatin1("\xf6") << 1 << 0;
- QTest::newRow("german8") << QString("de_DE") << QString::fromLatin1("oe") << QString::fromLatin1("\xf6") << 1 << 1;
- QTest::newRow("german9") << QString("de_DE") << QString("A") << QString("a") << 1 << 0;
+ QTest::newRow("german1") << QString("de_DE") << QString::fromLatin1("a") << QString::fromLatin1("\xe4") << -1 << -1 << false;
+ QTest::newRow("german2") << QString("de_DE") << QString::fromLatin1("b") << QString::fromLatin1("\xe4") << 1 << 1 << false;
+ QTest::newRow("german3") << QString("de_DE") << QString::fromLatin1("z") << QString::fromLatin1("\xe4") << 1 << 1 << false;
+ QTest::newRow("german4") << QString("de_DE") << QString::fromLatin1("\xe4") << QString::fromLatin1("\xf6") << -1 << -1 << false;
+ QTest::newRow("german5") << QString("de_DE") << QString::fromLatin1("z") << QString::fromLatin1("\xf6") << 1 << 1 << false;
+ QTest::newRow("german6") << QString("de_DE") << QString::fromLatin1("\xc0") << QString::fromLatin1("\xe0") << 1 << 0 << false;
+ QTest::newRow("german7") << QString("de_DE") << QString::fromLatin1("\xd6") << QString::fromLatin1("\xf6") << 1 << 0 << false;
+ QTest::newRow("german8") << QString("de_DE") << QString::fromLatin1("oe") << QString::fromLatin1("\xf6") << 1 << 1 << false;
+ QTest::newRow("german9") << QString("de_DE") << QString("A") << QString("a") << 1 << 0 << false;
+ QTest::newRow("german10") << QString("de_DE") << QString("9") << QString("19") << -1 << -1 << true;
/*
French sorting of e and e with accent
*/
- QTest::newRow("french1") << QString("fr_FR") << QString::fromLatin1("\xe9") << QString::fromLatin1("e") << 1 << 1;
- QTest::newRow("french2") << QString("fr_FR") << QString::fromLatin1("\xe9t") << QString::fromLatin1("et") << 1 << 1;
- QTest::newRow("french3") << QString("fr_FR") << QString::fromLatin1("\xe9") << QString::fromLatin1("d") << 1 << 1;
- QTest::newRow("french4") << QString("fr_FR") << QString::fromLatin1("\xe9") << QString::fromLatin1("f") << -1 << -1;
-
+ QTest::newRow("french1") << QString("fr_FR") << QString::fromLatin1("\xe9") << QString::fromLatin1("e") << 1 << 1 << false;
+ QTest::newRow("french2") << QString("fr_FR") << QString::fromLatin1("\xe9t") << QString::fromLatin1("et") << 1 << 1 << false;
+ QTest::newRow("french3") << QString("fr_FR") << QString::fromLatin1("\xe9") << QString::fromLatin1("d") << 1 << 1 << false;
+ QTest::newRow("french4") << QString("fr_FR") << QString::fromLatin1("\xe9") << QString::fromLatin1("f") << -1 << -1 << false;
+ QTest::newRow("french5") << QString("fr_FR") << QString("9") << QString("19") << -1 << -1 << true;
}
@@ -167,8 +174,13 @@ void tst_QCollator::compare()
QFETCH(QString, s2);
QFETCH(int, result);
QFETCH(int, caseInsensitiveResult);
+ QFETCH(bool, numericMode);
QCollator collator(locale);
+
+ if (numericMode)
+ collator.setNumericMode(true);
+
QCOMPARE(collator.compare(s1, s2), result);
collator.setCaseSensitivity(Qt::CaseInsensitive);
QCOMPARE(collator.compare(s1, s2), caseInsensitiveResult);
diff --git a/tests/auto/gui/text/qglyphrun/test.ttf b/tests/auto/gui/text/qglyphrun/test.ttf
index 9043a576ef..382b2547b0 100644
--- a/tests/auto/gui/text/qglyphrun/test.ttf
+++ b/tests/auto/gui/text/qglyphrun/test.ttf
Binary files differ
diff --git a/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp b/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp
index f576627745..8d1ec51c26 100644
--- a/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp
+++ b/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp
@@ -77,6 +77,7 @@ private slots:
void setRawData();
void setRawDataAndGetAsVector();
void boundingRect();
+ void mixedScripts();
private:
int m_testFontId;
@@ -399,7 +400,7 @@ void tst_QGlyphRun::setRawDataAndGetAsVector()
void tst_QGlyphRun::drawNonExistentGlyphs()
{
QVector<quint32> glyphIndexes;
- glyphIndexes.append(3);
+ glyphIndexes.append(4);
QVector<QPointF> glyphPositions;
glyphPositions.append(QPointF(0, 0));
@@ -725,6 +726,23 @@ void tst_QGlyphRun::boundingRect()
QCOMPARE(glyphs.boundingRect(), boundingRect);
}
+void tst_QGlyphRun::mixedScripts()
+{
+ QString s;
+ s += QChar(0x31); // The character '1'
+ s += QChar(0xbc14); // Hangul character
+
+ QTextLayout layout;
+ layout.setFont(m_testFont);
+ layout.setText(s);
+ layout.beginLayout();
+ layout.createLine();
+ layout.endLayout();
+
+ QList<QGlyphRun> glyphRuns = layout.glyphRuns();
+ QCOMPARE(glyphRuns.size(), 2);
+}
+
#endif // QT_NO_RAWFONT
QTEST_MAIN(tst_QGlyphRun)
diff --git a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
index ec698e5db4..e49d8c3b07 100644
--- a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
+++ b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
@@ -86,6 +86,7 @@ private slots:
void cursorToXForSetColumns();
void cursorToXForTrailingSpaces_data();
void cursorToXForTrailingSpaces();
+ void cursorToXInvalidInput();
void horizontalAlignment_data();
void horizontalAlignment();
void horizontalAlignmentMultiline_data();
@@ -674,6 +675,28 @@ void tst_QTextLayout::cursorToXForTrailingSpaces()
QCOMPARE(line.cursorToX(6), cursorAt6);
}
+void tst_QTextLayout::cursorToXInvalidInput()
+{
+ QTextLayout layout("aaa", testFont);
+
+ layout.beginLayout();
+ QTextLine line = layout.createLine();
+ line.setLineWidth(5);
+ layout.endLayout();
+
+ int cursorPos;
+
+ cursorPos = 0;
+ layout.lineAt(0).cursorToX(&cursorPos);
+ QCOMPARE(cursorPos, 0);
+ cursorPos = -300;
+ layout.lineAt(0).cursorToX(&cursorPos);
+ QCOMPARE(cursorPos, 0);
+ cursorPos = 300;
+ layout.lineAt(0).cursorToX(&cursorPos);
+ QCOMPARE(cursorPos, 3);
+}
+
void tst_QTextLayout::horizontalAlignment_data()
{
qreal width = TESTFONT_SIZE * 4;
diff --git a/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp b/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp
index 40c6087882..b4d826836c 100644
--- a/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp
+++ b/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp
@@ -1255,21 +1255,29 @@ void tst_QTextScriptEngine::thaiWithZWJ()
QTextLayout layout(s, font);
QTextEngine *e = layout.engine();
e->itemize();
- QCOMPARE(e->layoutData->items.size(), 3);
+ QCOMPARE(e->layoutData->items.size(), 11);
for (int item = 0; item < e->layoutData->items.size(); ++item)
e->shape(item);
- QCOMPARE(e->layoutData->items[0].num_glyphs, ushort(15)); // Thai: The ZWJ and ZWNJ characters are inherited, so should be part of the thai script
- QCOMPARE(e->layoutData->items[1].num_glyphs, ushort(1)); // Han: Kanji for tree
- QCOMPARE(e->layoutData->items[2].num_glyphs, ushort(2)); // Thai: Thai character followed by superscript "a" which is of inherited type
+ QCOMPARE(e->layoutData->items[0].num_glyphs, ushort(7)); // Thai: The ZWJ and ZWNJ characters are inherited, so should be part of the thai script
+ QCOMPARE(e->layoutData->items[1].num_glyphs, ushort(1)); // Common: The smart quotes cannot be handled by thai, so should be a separate item
+ QCOMPARE(e->layoutData->items[2].num_glyphs, ushort(1)); // Thai: Thai character
+ QCOMPARE(e->layoutData->items[3].num_glyphs, ushort(1)); // Common: Ellipsis
+ QCOMPARE(e->layoutData->items[4].num_glyphs, ushort(1)); // Thai: Thai character
+ QCOMPARE(e->layoutData->items[5].num_glyphs, ushort(1)); // Common: Smart quote
+ QCOMPARE(e->layoutData->items[6].num_glyphs, ushort(1)); // Thai: Thai character
+ QCOMPARE(e->layoutData->items[7].num_glyphs, ushort(1)); // Common: \xA0 = non-breaking space. Could be useful to have in thai, but not currently implemented
+ QCOMPARE(e->layoutData->items[8].num_glyphs, ushort(1)); // Thai: Thai character
+ QCOMPARE(e->layoutData->items[9].num_glyphs, ushort(1)); // Japanese: Kanji for tree
+ QCOMPARE(e->layoutData->items[10].num_glyphs, ushort(2)); // Thai: Thai character followed by superscript "a" which is of inherited type
//A quick sanity check - check all the characters are individual clusters
unsigned short *logClusters = e->layoutData->logClustersPtr;
- for (int i = 0; i <= 14; i++)
+ for (int i = 0; i < 7; i++)
QCOMPARE(logClusters[i], ushort(i));
- QCOMPARE(logClusters[15], ushort(0));
- QCOMPARE(logClusters[16], ushort(0));
+ for (int i = 0; i < 10; i++)
+ QCOMPARE(logClusters[i+7], ushort(0));
// A thai implementation could either remove the ZWJ and ZWNJ characters, or hide them.
// The current implementation hides them, so we test for that.
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
index 480eeecb63..70c118b681 100644
--- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -206,6 +206,7 @@ private Q_SLOTS:
void getFromFileSpecial();
void getFromFtp_data();
void getFromFtp();
+ void getFromFtpAfterError(); // QTBUG-40797
void getFromHttp_data();
void getFromHttp();
void getErrors_data();
@@ -218,6 +219,7 @@ private Q_SLOTS:
void putToFile();
void putToFtp_data();
void putToFtp();
+ void putToFtpWithInvalidCredentials(); // QTBUG-40622
void putToHttp_data();
void putToHttp();
void putToHttpSynchronous_data();
@@ -1753,6 +1755,26 @@ void tst_QNetworkReply::getFromFtp()
QCOMPARE(reply->readAll(), reference.readAll());
}
+void tst_QNetworkReply::getFromFtpAfterError()
+{
+ QNetworkRequest invalidRequest(QUrl("ftp://" + QtNetworkSettings::serverName() + "/qtest/invalid.txt"));
+ QNetworkReplyPtr invalidReply;
+ invalidReply.reset(manager.get(invalidRequest));
+ QSignalSpy spy(invalidReply.data(), SIGNAL(error(QNetworkReply::NetworkError)));
+ QVERIFY(spy.wait());
+ QCOMPARE(invalidReply->error(), QNetworkReply::ContentNotFoundError);
+
+ QFile reference(testDataDir + "/rfc3252.txt");
+ QVERIFY(reference.open(QIODevice::ReadOnly));
+ QNetworkRequest validRequest(QUrl("ftp://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"));
+ QNetworkReplyPtr validReply;
+ RUN_REQUEST(runSimpleRequest(QNetworkAccessManager::GetOperation, validRequest, validReply));
+ QCOMPARE(validReply->url(), validRequest.url());
+ QCOMPARE(validReply->error(), QNetworkReply::NoError);
+ QCOMPARE(validReply->header(QNetworkRequest::ContentLengthHeader).toLongLong(), reference.size());
+ QCOMPARE(validReply->readAll(), reference.readAll());
+}
+
void tst_QNetworkReply::getFromHttp_data()
{
QTest::addColumn<QString>("referenceName");
@@ -2054,6 +2076,28 @@ void tst_QNetworkReply::putToFtp()
QObject::disconnect(r, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
}
+void tst_QNetworkReply::putToFtpWithInvalidCredentials()
+{
+ QUrl url("ftp://" + QtNetworkSettings::serverName());
+ url.setPath(QString("/qtest/upload/qnetworkaccess-putToFtp-%1-%2")
+ .arg(QTest::currentDataTag())
+ .arg(uniqueExtension));
+ url.setUserName("invalidUser");
+ url.setPassword("InvalidPassword");
+ QNetworkRequest req(url);
+ QNetworkReplyPtr r;
+
+ for (int i = 0; i < 2; i++)
+ {
+ runSimpleRequest(QNetworkAccessManager::PutOperation, req, r, QByteArray());
+
+ QVERIFY(r->isFinished());
+ QCOMPARE(r->url(), url);
+ QCOMPARE(r->error(), QNetworkReply::AuthenticationRequiredError);
+ r->close();
+ }
+}
+
void tst_QNetworkReply::putToHttp_data()
{
putToFile_data();
diff --git a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
index 850bedd9cc..4167d633b0 100644
--- a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
+++ b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
@@ -79,6 +79,8 @@ private slots:
void taskQTBUG_7103_minMaxWidthNotRespected();
void taskQTBUG_27420_takeAtShouldUnparentLayout();
+ void taskQTBUG_40609_addingWidgetToItsOwnLayout();
+ void taskQTBUG_40609_addingLayoutToItself();
void replaceWidget();
};
@@ -329,6 +331,36 @@ void tst_QBoxLayout::taskQTBUG_27420_takeAtShouldUnparentLayout()
QVERIFY(!inner.isNull());
}
+void tst_QBoxLayout::taskQTBUG_40609_addingWidgetToItsOwnLayout(){
+ QWidget widget;
+ widget.setObjectName("347b469225a24a0ef05150a");
+ QVBoxLayout layout(&widget);
+ layout.setObjectName("ef9e2b42298e0e6420105bb");
+
+ QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add a null widget to QVBoxLayout/ef9e2b42298e0e6420105bb");
+ layout.addWidget(Q_NULLPTR);
+ QCOMPARE(layout.count(), 0);
+
+ QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add parent widget QWidget/347b469225a24a0ef05150a to its child layout QVBoxLayout/ef9e2b42298e0e6420105bb");
+ layout.addWidget(&widget);
+ QCOMPARE(layout.count(), 0);
+}
+
+void tst_QBoxLayout::taskQTBUG_40609_addingLayoutToItself(){
+ QWidget widget;
+ widget.setObjectName("fe44e5cb6c08006597126a");
+ QVBoxLayout layout(&widget);
+ layout.setObjectName("cc751dd0f50f62b05a62da");
+
+ QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add a null layout to QVBoxLayout/cc751dd0f50f62b05a62da");
+ layout.addLayout(Q_NULLPTR);
+ QCOMPARE(layout.count(), 0);
+
+ QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add layout QVBoxLayout/cc751dd0f50f62b05a62da to itself");
+ layout.addLayout(&layout);
+ QCOMPARE(layout.count(), 0);
+}
+
struct Descr
{
Descr(int min, int sh, int max = -1, bool exp= false, int _stretch = 0, bool _empty = false)
diff --git a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
index 9df7e1662d..962e472606 100644
--- a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
+++ b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
@@ -135,6 +135,8 @@ private slots:
*/
void taskQTBUG_27420_takeAtShouldUnparentLayout();
+ void taskQTBUG_40609_addingWidgetToItsOwnLayout();
+ void taskQTBUG_40609_addingLayoutToItself();
};
@@ -949,6 +951,28 @@ void tst_QFormLayout::taskQTBUG_27420_takeAtShouldUnparentLayout()
QVERIFY(!inner.isNull());
}
+void tst_QFormLayout::taskQTBUG_40609_addingWidgetToItsOwnLayout(){
+ QWidget widget;
+ widget.setObjectName("6435cbada60548b4522cbb6");
+ QFormLayout layout(&widget);
+ layout.setObjectName("c03c0e22c0b6d019a93a248");
+
+ QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add parent widget QWidget/6435cbada60548b4522cbb6 to its child layout QFormLayout/c03c0e22c0b6d019a93a248");
+ layout.addRow(QLatin1String("48c81f39b7320082f8"), &widget);
+ QCOMPARE(layout.count(), 0);
+}
+
+void tst_QFormLayout::taskQTBUG_40609_addingLayoutToItself(){
+ QWidget widget;
+ widget.setObjectName("2bc425637d084c07ce65956");
+ QFormLayout layout(&widget);
+ layout.setObjectName("60e31de0c8800eaba713a4f2");
+
+ QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add layout QFormLayout/60e31de0c8800eaba713a4f2 to itself");
+ layout.addRow(QLatin1String("9a2cd4f40c06b489f889"), &layout);
+ QCOMPARE(layout.count(), 0);
+}
+
void tst_QFormLayout::replaceWidget()
{
QWidget w;
diff --git a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
index 3b7c2ac14d..0dcae2fbcc 100644
--- a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
+++ b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
@@ -101,6 +101,8 @@ private slots:
void distributeMultiCell();
void taskQTBUG_27420_takeAtShouldUnparentLayout();
+ void taskQTBUG_40609_addingWidgetToItsOwnLayout();
+ void taskQTBUG_40609_addingLayoutToItself();
void replaceWidget();
private:
@@ -1660,6 +1662,36 @@ void tst_QGridLayout::taskQTBUG_27420_takeAtShouldUnparentLayout()
QVERIFY(!inner.isNull());
}
+void tst_QGridLayout::taskQTBUG_40609_addingWidgetToItsOwnLayout(){
+ QWidget widget;
+ widget.setObjectName("9bb37ca762aeb7269b8");
+ QGridLayout layout(&widget);
+ layout.setObjectName("d631e91a35f2b66a6dff35");
+
+ QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add a null widget to QGridLayout/d631e91a35f2b66a6dff35");
+ layout.addWidget(Q_NULLPTR, 0, 0);
+ QCOMPARE(layout.count(), 0);
+
+ QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add parent widget QWidget/9bb37ca762aeb7269b8 to its child layout QGridLayout/d631e91a35f2b66a6dff35");
+ layout.addWidget(&widget, 0, 0);
+ QCOMPARE(layout.count(), 0);
+}
+
+void tst_QGridLayout::taskQTBUG_40609_addingLayoutToItself(){
+ QWidget widget;
+ widget.setObjectName("0373d417fffe2c59c6fe543");
+ QGridLayout layout(&widget);
+ layout.setObjectName("5d79e1b0aed83f100e3c2");
+
+ QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add a null layout to QGridLayout/5d79e1b0aed83f100e3c2");
+ layout.addLayout(Q_NULLPTR, 0, 0);
+ QCOMPARE(layout.count(), 0);
+
+ QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add layout QGridLayout/5d79e1b0aed83f100e3c2 to itself");
+ layout.addLayout(&layout, 0, 0);
+ QCOMPARE(layout.count(), 0);
+}
+
void tst_QGridLayout::replaceWidget()
{
QWidget wdg;
diff --git a/tests/auto/widgets/kernel/qwidget_window/qwidget_window.pro b/tests/auto/widgets/kernel/qwidget_window/qwidget_window.pro
index d61681d5cb..d61681d5cb 100644..100755
--- a/tests/auto/widgets/kernel/qwidget_window/qwidget_window.pro
+++ b/tests/auto/widgets/kernel/qwidget_window/qwidget_window.pro
diff --git a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
index f9d705de26..0240bde3e9 100644..100755
--- a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
+++ b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
@@ -52,6 +52,7 @@
#include <qlistwidget.h>
#include <qpushbutton.h>
#include <qboxlayout.h>
+#include <qtabwidget.h>
#include <qlabel.h>
#include <private/qwindow_p.h>
@@ -100,6 +101,8 @@ private slots:
void tst_qtbug35600();
void tst_updateWinId_QTBUG40681();
+ void tst_recreateWindow_QTBUG40817();
+
};
void tst_QWidget_window::initTestCase()
@@ -634,5 +637,37 @@ void tst_QWidget_window::tst_updateWinId_QTBUG40681()
QCOMPARE(lbl->winId(), lbl->windowHandle()->winId());
}
+void tst_QWidget_window::tst_recreateWindow_QTBUG40817()
+{
+ QTabWidget tab;
+
+ QWidget *w = new QWidget;
+ tab.addTab(w, "Tab1");
+ QVBoxLayout *vl = new QVBoxLayout(w);
+ QLabel *lbl = new QLabel("HELLO1");
+ lbl->setObjectName("label1");
+ vl->addWidget(lbl);
+ w = new QWidget;
+ tab.addTab(w, "Tab2");
+ vl = new QVBoxLayout(w);
+ lbl = new QLabel("HELLO2");
+ lbl->setAttribute(Qt::WA_NativeWindow);
+ lbl->setObjectName("label2");
+ vl->addWidget(lbl);
+
+ tab.show();
+
+ QVERIFY(QTest::qWaitForWindowExposed(&tab));
+
+ QWindow *win = tab.windowHandle();
+ win->destroy();
+ QWindowPrivate *p = qt_window_private(win);
+ p->create(true);
+ win->show();
+
+ tab.setCurrentIndex(1);
+}
+
+
QTEST_MAIN(tst_QWidget_window)
#include "tst_qwidget_window.moc"
diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
index c7fba1c871..63928db80f 100644
--- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
+++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
@@ -4213,6 +4213,7 @@ void tst_QLineEdit::clearButton()
QVERIFY(clearButton);
QCOMPARE(filterModel->rowCount(), 3);
QTest::keyClick(filterLineEdit, 'a');
+ QTRY_COMPARE(clearButton->cursor().shape(), Qt::ArrowCursor);
QTRY_COMPARE(filterModel->rowCount(), 2); // matches 'aa', 'ab'
QTest::keyClick(filterLineEdit, 'b');
QTRY_COMPARE(filterModel->rowCount(), 1); // matches 'ab'
@@ -4220,7 +4221,7 @@ void tst_QLineEdit::clearButton()
const QPoint clearButtonCenterPos = QRect(QPoint(0, 0), clearButton->size()).center();
QTest::mouseClick(clearButton, Qt::LeftButton, 0, clearButtonCenterPos);
QCOMPARE(spyEdited.count(), 1);
- QTest::mouseClick(clearButton, Qt::LeftButton, 0, clearButtonCenterPos);
+ QTRY_COMPARE(clearButton->cursor().shape(), filterLineEdit->cursor().shape());
QTRY_COMPARE(filterModel->rowCount(), 3);
QCoreApplication::processEvents();
QCOMPARE(spyEdited.count(), 1);
@@ -4252,6 +4253,8 @@ void tst_QLineEdit::sideWidgets()
testWidget.move(300, 300);
testWidget.show();
QVERIFY(QTest::qWaitForWindowExposed(&testWidget));
+ foreach (QToolButton *button, lineEdit->findChildren<QToolButton *>())
+ QCOMPARE(button->cursor().shape(), Qt::ArrowCursor);
// Arbitrarily add/remove actions, trying to detect crashes. Add QTRY_VERIFY(false) to view the result.
delete label3Action;
lineEdit->removeAction(label2Action);
diff --git a/tests/auto/widgets/widgets/qsizegrip/tst_qsizegrip.cpp b/tests/auto/widgets/widgets/qsizegrip/tst_qsizegrip.cpp
index f88cd634de..2600348998 100644
--- a/tests/auto/widgets/widgets/qsizegrip/tst_qsizegrip.cpp
+++ b/tests/auto/widgets/widgets/qsizegrip/tst_qsizegrip.cpp
@@ -46,6 +46,10 @@
#include <QLineEdit>
#include <QVBoxLayout>
#include <QLabel>
+#include <QMainWindow>
+#include <QStatusBar>
+#include <QMdiArea>
+#include <QMdiSubWindow>
static inline Qt::Corner sizeGripCorner(QWidget *parent, QSizeGrip *sizeGrip)
{
@@ -75,6 +79,7 @@ private slots:
void hideAndShowOnWindowStateChange_data();
void hideAndShowOnWindowStateChange();
void orientation();
+ void dontCrashOnTLWChange();
private:
QLineEdit *dummyWidget;
@@ -191,6 +196,26 @@ void tst_QSizeGrip::orientation()
QCOMPARE(sizeGripCorner(&widget, sizeGrip), Qt::TopRightCorner);
}
+void tst_QSizeGrip::dontCrashOnTLWChange()
+{
+ // QTBUG-22867
+ QMdiArea mdiArea;
+ mdiArea.show();
+
+ QMainWindow *mw = new QMainWindow();
+ QMdiSubWindow *mdi = mdiArea.addSubWindow(mw);
+ mw->statusBar()->setSizeGripEnabled(true);
+ mdiArea.removeSubWindow(mw);
+ delete mdi;
+ mw->show();
+
+ // the above setup causes a change of TLW for the size grip,
+ // and it must not crash.
+
+ QVERIFY(QTest::qWaitForWindowExposed(&mdiArea));
+ QVERIFY(QTest::qWaitForWindowExposed(mw));
+}
+
QTEST_MAIN(tst_QSizeGrip)
#include "tst_qsizegrip.moc"
diff --git a/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp b/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp
index 168a17773e..650f189309 100644
--- a/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp
+++ b/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp
@@ -66,6 +66,7 @@ private slots:
void task230994_iconSize();
void task176137_autoRepeatOfAction();
void qtbug_26956_popupTimerDone();
+ void qtbug_34759_sizeHintResetWhenSettingMenu();
protected slots:
void sendMouseClick();
@@ -265,5 +266,32 @@ void tst_QToolButton::qtbug_26956_popupTimerDone()
tb->showMenu();
}
+void tst_QToolButton::qtbug_34759_sizeHintResetWhenSettingMenu()
+{
+ // There is no reliable way of checking what's ultimately a style-dependent
+ // sizing. So the idea is checking if the size is the "correct" size w.r.t.
+ // another toolbutton which has had a menu set before it was shown for the first time
+
+ QToolButton button1;
+ QToolButton button2;
+
+ button1.setToolButtonStyle(Qt::ToolButtonIconOnly);
+ button1.setPopupMode(QToolButton::MenuButtonPopup);
+
+ button2.setToolButtonStyle(Qt::ToolButtonIconOnly);
+ button2.setPopupMode(QToolButton::MenuButtonPopup);
+
+ button2.setMenu(new QMenu(&button2));
+
+ button1.show();
+ button2.show();
+
+ QVERIFY(QTest::qWaitForWindowExposed(&button1));
+ QVERIFY(QTest::qWaitForWindowExposed(&button2));
+
+ button1.setMenu(new QMenu(&button1));
+ QTRY_COMPARE(button1.sizeHint(), button2.sizeHint());
+}
+
QTEST_MAIN(tst_QToolButton)
#include "tst_qtoolbutton.moc"
diff --git a/tests/manual/qlayout/gridwidget.cpp b/tests/manual/qlayout/gridwidget.cpp
index 31f0094182..6d7de3c763 100644
--- a/tests/manual/qlayout/gridwidget.cpp
+++ b/tests/manual/qlayout/gridwidget.cpp
@@ -53,6 +53,7 @@ GridWidget::GridWidget(QWidget *parent) :
QWidget(parent)
{
QGridLayout *hb = new QGridLayout(this);
+ hb->setObjectName("GridWidget");
QComboBox *combo = new QComboBox();
combo->addItem("123");
QComboBox *combo2 = new QComboBox();
@@ -71,4 +72,11 @@ GridWidget::GridWidget(QWidget *parent) :
hb->addWidget(new QPushButton("123"), 1, 4);
hb->addWidget(new QSpinBox(), 0, 5);
hb->addWidget(new QSpinBox(), 1, 5);
+
+ qDebug("There should be four warnings, but no crash or freeze:");
+ hb->addWidget(this, 6, 6); ///< This command should print a warning, but should not add "this"
+ hb->addWidget(Q_NULLPTR, 6, 7); ///< This command should print a warning, but should not add "NULL"
+ hb->addLayout(hb, 7, 6); ///< This command should print a warning, but should not add "hb"
+ hb->addLayout(Q_NULLPTR, 7, 7); ///< This command should print a warning, but should not add "NULL"
+ qDebug("Neither crashed nor frozen");
}
diff --git a/tests/manual/qlayout/hbwidget.cpp b/tests/manual/qlayout/hbwidget.cpp
index e8bb07f4a4..743b420b0d 100644
--- a/tests/manual/qlayout/hbwidget.cpp
+++ b/tests/manual/qlayout/hbwidget.cpp
@@ -53,6 +53,7 @@ HbWidget::HbWidget(QWidget *parent) :
QWidget(parent)
{
QHBoxLayout *hb = new QHBoxLayout(this);
+ hb->setObjectName("HbWidget");
QComboBox *combo = new QComboBox(this);
combo->addItem("123");
QComboBox *combo2 = new QComboBox();
@@ -67,4 +68,11 @@ HbWidget::HbWidget(QWidget *parent) :
hb->addWidget(new QDateTimeEdit());
hb->addWidget(new QPushButton("123"));
hb->addWidget(new QSpinBox());
+
+ qDebug("There should be four warnings, but no crash or freeze:");
+ hb->addWidget(this); ///< This command should print a warning, but should not add "this"
+ hb->addWidget(Q_NULLPTR); ///< This command should print a warning, but should not add "NULL"
+ hb->addLayout(hb); ///< This command should print a warning, but should not add "hb"
+ hb->addLayout(Q_NULLPTR); ///< This command should print a warning, but should not add "NULL"
+ qDebug("Neither crashed nor frozen");
}
diff --git a/tests/manual/qlayout/vbwidget.cpp b/tests/manual/qlayout/vbwidget.cpp
index 063176625d..ffd918b955 100644
--- a/tests/manual/qlayout/vbwidget.cpp
+++ b/tests/manual/qlayout/vbwidget.cpp
@@ -53,6 +53,7 @@ VbWidget::VbWidget(QWidget *parent) :
QWidget(parent)
{
QVBoxLayout *hb = new QVBoxLayout(this);
+ hb->setObjectName("VbWidget");
QComboBox *combo = new QComboBox(this);
combo->addItem("123");
QComboBox *combo2 = new QComboBox();
@@ -67,4 +68,11 @@ VbWidget::VbWidget(QWidget *parent) :
hb->addWidget(new QDateTimeEdit());
hb->addWidget(new QPushButton("123"));
hb->addWidget(new QSpinBox());
+
+ qDebug("There should be four warnings, but no crash or freeze:");
+ hb->addWidget(this); ///< This command should print a warning, but should not add "this"
+ hb->addWidget(Q_NULLPTR); ///< This command should print a warning, but should not add "NULL"
+ hb->addLayout(hb); ///< This command should print a warning, but should not add "hb"
+ hb->addLayout(Q_NULLPTR); ///< This command should print a warning, but should not add "NULL"
+ qDebug("Neither crashed nor frozen");
}