summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--LICENSE.GPLv3686
-rw-r--r--LICENSE.LGPLv34
-rw-r--r--configure.bat7
-rw-r--r--doc/global/qt-cpp-defines.qdocconf3
-rw-r--r--mkspecs/common/msvc-desktop.conf2
-rw-r--r--mkspecs/macx-ios-clang/features/default_post.prf26
-rw-r--r--qmake/doc/src/qmake-manual.qdoc4
-rw-r--r--src/3rdparty/forkfd/forkfd.c10
-rw-r--r--src/3rdparty/md5/md5.cpp2
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java30
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtLayout.java8
-rw-r--r--src/corelib/arch/qatomic_cxx11.h6
-rw-r--r--src/corelib/codecs/qutfcodec.cpp12
-rw-r--r--src/corelib/global/qcompilerdetection.h5
-rw-r--r--src/corelib/global/qglobal.cpp6
-rw-r--r--src/corelib/io/qbuffer.cpp2
-rw-r--r--src/corelib/io/qdebug.cpp146
-rw-r--r--src/corelib/io/qdebug.h14
-rw-r--r--src/corelib/io/qfsfileengine.cpp4
-rw-r--r--src/corelib/io/qloggingregistry.cpp8
-rw-r--r--src/corelib/io/qprocess.cpp12
-rw-r--r--src/corelib/io/qresource.cpp6
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel.cpp8
-rw-r--r--src/corelib/itemmodels/qsortfilterproxymodel.cpp2
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp2
-rw-r--r--src/corelib/kernel/qmetaobject.cpp23
-rw-r--r--src/corelib/kernel/qmetatype.cpp13
-rw-r--r--src/corelib/kernel/qobject.cpp9
-rw-r--r--src/corelib/kernel/qtranslator.cpp2
-rw-r--r--src/corelib/plugin/qlibrary_p.h2
-rw-r--r--src/corelib/plugin/qplugin.h4
-rw-r--r--src/corelib/plugin/quuid.cpp2
-rw-r--r--src/corelib/thread/qreadwritelock.cpp57
-rw-r--r--src/corelib/thread/qreadwritelock_p.h1
-rw-r--r--src/corelib/tools/qbytearray.cpp8
-rw-r--r--src/corelib/tools/qcollator.cpp2
-rw-r--r--src/corelib/tools/qpair.qdoc5
-rw-r--r--src/corelib/tools/qsimd.cpp18
-rw-r--r--src/corelib/tools/qsimd_p.h3
-rw-r--r--src/corelib/tools/qstring.cpp30
-rw-r--r--src/corelib/tools/qtimezoneprivate_tz.cpp19
-rw-r--r--src/corelib/xml/qxmlstream.cpp6
-rw-r--r--src/dbus/qdbusunixfiledescriptor.cpp2
-rw-r--r--src/gui/accessible/qaccessible.cpp132
-rw-r--r--src/gui/image/qgifhandler.pri1
-rw-r--r--src/gui/image/qicon.cpp7
-rw-r--r--src/gui/image/qimage.cpp9
-rw-r--r--src/gui/image/qjpeghandler.pri1
-rw-r--r--src/gui/image/qpixmapcache.cpp14
-rw-r--r--src/gui/image/qpnghandler.pri1
-rw-r--r--src/gui/kernel/qevent.cpp56
-rw-r--r--src/gui/kernel/qguiapplication.cpp10
-rw-r--r--src/gui/kernel/qsessionmanager.cpp2
-rw-r--r--src/gui/kernel/qwindowsysteminterface.cpp16
-rw-r--r--src/gui/kernel/qwindowsysteminterface.h2
-rw-r--r--src/gui/math3d/qgenericmatrix.cpp6
-rw-r--r--src/gui/opengl/qopengldebug.cpp6
-rw-r--r--src/gui/opengl/qopengltexture.cpp5
-rw-r--r--src/gui/opengl/qopenglversionfunctions.cpp10
-rw-r--r--src/gui/painting/qbackingstore.cpp14
-rw-r--r--src/gui/painting/qbrush.cpp2
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp4
-rw-r--r--src/gui/painting/qpdf.cpp8
-rw-r--r--src/gui/text/qfontdatabase.cpp85
-rw-r--r--src/gui/text/qfontengine.cpp14
-rw-r--r--src/gui/text/qfontmetrics.cpp5
-rw-r--r--src/gui/text/qplatformfontdatabase.cpp14
-rw-r--r--src/gui/text/qtextdocument.cpp3
-rw-r--r--src/network/ssl/qasn1element_p.h2
-rw-r--r--src/network/ssl/qsslcertificate_qt.cpp4
-rw-r--r--src/network/ssl/qsslkey_qt.cpp67
-rw-r--r--src/network/ssl/qsslsocket.cpp1
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp9
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadermanager.cpp3
-rw-r--r--src/opengl/qgl.cpp7
-rw-r--r--src/platformheaders/xcbfunctions/qxcbwindowfunctions.qdoc1
-rw-r--r--src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp40
-rw-r--r--src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h3
-rw-r--r--src/plugins/imageformats/gif/gif.pro1
-rw-r--r--src/plugins/imageformats/jpeg/jpeg.pro1
-rw-r--r--src/plugins/platforms/android/androidjnimain.cpp5
-rw-r--r--src/plugins/platforms/android/qandroidplatformfontdatabase.cpp35
-rw-r--r--src/plugins/platforms/android/qandroidplatformfontdatabase.h3
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm8
-rw-r--r--src/plugins/platforms/ios/qioscontext.h12
-rw-r--r--src/plugins/platforms/ios/qiosfileengineassetslibrary.mm2
-rw-r--r--src/plugins/platforms/ios/qiosintegration.h26
-rw-r--r--src/plugins/platforms/ios/qiosintegration.mm2
-rw-r--r--src/plugins/platforms/ios/qiosmenu.h2
-rw-r--r--src/plugins/platforms/ios/qiosscreen.h20
-rw-r--r--src/plugins/platforms/ios/qiostextresponder.mm2
-rw-r--r--src/plugins/platforms/ios/qiostheme.h4
-rw-r--r--src/plugins/platforms/ios/qioswindow.h24
-rw-r--r--src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp12
-rw-r--r--src/plugins/platforms/windows/qwindowsclipboard.cpp37
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.cpp6
-rw-r--r--src/plugins/platforms/windows/qwindowsfontdatabase.cpp26
-rw-r--r--src/plugins/platforms/windows/qwindowsfontdatabase.h1
-rw-r--r--src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp6
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.cpp2
-rw-r--r--src/plugins/platforms/windows/qwindowsinternalmimedata.h2
-rw-r--r--src/plugins/platforms/windows/qwindowsmousehandler.cpp24
-rw-r--r--src/plugins/platforms/windows/qwindowsmousehandler.h3
-rw-r--r--src/plugins/platforms/windows/qwindowsnativeinterface.cpp4
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp1
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp64
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.h3
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection_xi2.cpp33
-rw-r--r--src/plugins/platforms/xcb/qxcbcursor.cpp2
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.cpp2
-rw-r--r--src/printsupport/kernel/qprinter.cpp10
-rw-r--r--src/testlib/testlib.pro11
-rw-r--r--src/tools/qdoc/generator.cpp4
-rw-r--r--src/tools/qdoc/helpprojectwriter.cpp8
-rw-r--r--src/tools/qdoc/htmlgenerator.cpp2
-rw-r--r--src/tools/qlalr/lalr.cpp8
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp15
-rw-r--r--src/widgets/kernel/qaction.cpp11
-rw-r--r--src/widgets/kernel/qwidget.cpp49
-rw-r--r--src/widgets/kernel/qwidgetbackingstore.cpp4
-rw-r--r--src/widgets/kernel/qwidgetwindow.cpp2
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp2
-rw-r--r--src/widgets/widgets/qcombobox.cpp1
-rw-r--r--src/widgets/widgets/qmacnativewidget_mac.mm5
-rw-r--r--src/widgets/widgets/qtoolbutton.cpp7
-rwxr-xr-xtests/auto/android/runtests_androiddeployqt.pl2
-rw-r--r--tests/auto/corelib/io/qdebug/tst_qdebug.cpp49
-rw-r--r--tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp8
-rw-r--r--tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp11
-rw-r--r--tests/auto/corelib/io/qprocess/tst_qprocess.cpp38
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp53
-rw-r--r--tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp18
-rw-r--r--tests/auto/dbus/qdbusabstractadaptor/qdbusabstractadaptor.pro2
-rw-r--r--tests/auto/dbus/qdbusabstractadaptor/qdbusabstractadaptor/qdbusabstractadaptor.pro (renamed from tests/auto/dbus/qdbusabstractadaptor/test/test.pro)0
-rw-r--r--tests/auto/dbus/qdbusabstractinterface/qdbusabstractinterface.pro2
-rw-r--r--tests/auto/dbus/qdbusabstractinterface/qdbusabstractinterface/qdbusabstractinterface.pro (renamed from tests/auto/dbus/qdbusabstractinterface/test/test.pro)0
-rw-r--r--tests/auto/dbus/qdbusinterface/qdbusinterface.pro2
-rw-r--r--tests/auto/dbus/qdbusinterface/qdbusinterface/qdbusinterface.pro (renamed from tests/auto/dbus/qdbusinterface/test/test.pro)0
-rw-r--r--tests/auto/dbus/qdbusmarshall/qdbusmarshall.pro2
-rw-r--r--tests/auto/dbus/qdbusmarshall/qdbusmarshall/qdbusmarshall.pro (renamed from tests/auto/dbus/qdbusmarshall/test/test.pro)0
-rw-r--r--tests/auto/gui/image/qimage/images/jpeg_exif_invalid_data_QTBUG-46870.jpgbin0 -> 14122 bytes
-rw-r--r--tests/auto/gui/image/qimage/tst_qimage.cpp8
-rw-r--r--tests/auto/gui/text/qfontcache/tst_qfontcache.cpp14
-rw-r--r--tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp76
-rw-r--r--tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp12
-rw-r--r--tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp8
-rw-r--r--tests/auto/network/ssl/qsslcertificate/certificates/dsa-cert-ss.der.pubkeybin0 -> 442 bytes
-rw-r--r--tests/auto/network/ssl/qsslcertificate/certificates/dsa-cert-ss.pem16
-rw-r--r--tests/auto/network/ssl/qsslcertificate/certificates/dsa-cert-ss.pem.digest-md51
-rw-r--r--tests/auto/network/ssl/qsslcertificate/certificates/dsa-cert-ss.pem.digest-sha11
-rw-r--r--tests/auto/network/ssl/qsslcertificate/certificates/dsa-cert-ss.pem.pubkey12
-rw-r--r--tests/auto/network/ssl/qsslcertificate/certificates/ec-cert-ss.der.pubkeybin0 -> 120 bytes
-rw-r--r--tests/auto/network/ssl/qsslcertificate/certificates/ec-cert-ss.pem11
-rw-r--r--tests/auto/network/ssl/qsslcertificate/certificates/ec-cert-ss.pem.digest-md51
-rw-r--r--tests/auto/network/ssl/qsslcertificate/certificates/ec-cert-ss.pem.digest-sha11
-rw-r--r--tests/auto/network/ssl/qsslcertificate/certificates/ec-cert-ss.pem.pubkey5
-rwxr-xr-xtests/auto/network/ssl/qsslcertificate/certificates/gencertificates.sh46
-rw-r--r--tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp14
-rw-r--r--tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp2
-rw-r--r--tests/auto/testlib/selftests/expected_badxml.lightxml2
-rw-r--r--tests/auto/testlib/selftests/expected_badxml.xml2
-rw-r--r--tests/auto/testlib/selftests/expected_badxml.xunitxml4
-rw-r--r--tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp9
-rw-r--r--tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp5
164 files changed, 2242 insertions, 494 deletions
diff --git a/LICENSE.GPLv3 b/LICENSE.GPLv3
new file mode 100644
index 0000000000..afa69d94b9
--- /dev/null
+++ b/LICENSE.GPLv3
@@ -0,0 +1,686 @@
+ GNU GENERAL PUBLIC LICENSE
+
+ The Qt Toolkit is Copyright (C) 2015 The Qt Company Ltd.
+ Contact: http://www.qt.io/licensing/
+
+ You may use, distribute and copy the Qt GUI Toolkit under the terms of
+ GNU Lesser General Public License version 3. That license references
+ the General Public License version 3, that is displayed below. Other
+ portions of the Qt Toolkit may be licensed directly other this license.
+
+-------------------------------------------------------------------------
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/LICENSE.LGPLv3 b/LICENSE.LGPLv3
index 8fbb74390c..2a0988d97b 100644
--- a/LICENSE.LGPLv3
+++ b/LICENSE.LGPLv3
@@ -4,7 +4,9 @@
Contact: http://www.qt.io/licensing/
You may use, distribute and copy the Qt GUI Toolkit under the terms of
- GNU Lesser General Public License version 3, which is displayed below.
+ GNU Lesser General Public License version 3, which is displayed
+ below. This license makes reference to the version 3 of the GNU General
+ Public License, which you can find in the LICENSE.GPLv3 file.
-------------------------------------------------------------------------
diff --git a/configure.bat b/configure.bat
index 8c0819aeb5..1220bfedc2 100644
--- a/configure.bat
+++ b/configure.bat
@@ -37,7 +37,7 @@ set QTDIR=%CD%
if not exist %QTSRC%.gitignore goto sconf
echo Please wait while bootstrapping configure ...
-for %%C in (cl.exe icl.exe g++.exe perl.exe) do set %%C=%%~$PATH:C
+for %%C in (cl.exe icl.exe g++.exe perl.exe jom.exe) do set %%C=%%~$PATH:C
if "%perl.exe%" == "" (
echo Perl not found in PATH. Aborting. >&2
@@ -57,6 +57,9 @@ if not exist tools\configure (
cd tools\configure
if errorlevel 1 goto exit
+set make=nmake
+if not "%jom.exe%" == "" set make=jom
+
echo #### Generated by configure.bat - DO NOT EDIT! ####> Makefile
echo/>> Makefile
for /f "tokens=3 usebackq" %%V in (`findstr QT_VERSION_STR %QTSRC%src\corelib\global\qglobal.h`) do @echo QTVERSION = %%~V>> Makefile
@@ -66,14 +69,12 @@ if not "%icl.exe%" == "" (
rem This must have a trailing space.
echo QTSRC = %QTSRC% >> Makefile
set tmpl=win32
- set make=nmake
) else if not "%cl.exe%" == "" (
echo CXX = cl>>Makefile
echo EXTRA_CXXFLAGS =>>Makefile
rem This must have a trailing space.
echo QTSRC = %QTSRC% >> Makefile
set tmpl=win32
- set make=nmake
) else if not "%g++.exe%" == "" (
echo CXX = g++>>Makefile
echo EXTRA_CXXFLAGS =>>Makefile
diff --git a/doc/global/qt-cpp-defines.qdocconf b/doc/global/qt-cpp-defines.qdocconf
index 2d2fb9c357..8649a14582 100644
--- a/doc/global/qt-cpp-defines.qdocconf
+++ b/doc/global/qt-cpp-defines.qdocconf
@@ -157,4 +157,5 @@ Cpp.ignoredirectives += \
QT_WARNING_DISABLE_GCC \
QT_WARNING_DISABLE_INTEL \
QT_WARNING_DISABLE_MSVC \
- Q_ATTRIBUTE_FORMAT_PRINTF
+ Q_ATTRIBUTE_FORMAT_PRINTF \
+ Q_MV_IOS
diff --git a/mkspecs/common/msvc-desktop.conf b/mkspecs/common/msvc-desktop.conf
index e1abca46e4..72e0b98c9c 100644
--- a/mkspecs/common/msvc-desktop.conf
+++ b/mkspecs/common/msvc-desktop.conf
@@ -141,7 +141,7 @@ greaterThan(MSC_VER, 1899) {
QMAKE_CFLAGS_WARN_ON += -w44456 -w44457 -w44458
QMAKE_CFLAGS_AVX2 = -arch:AVX2
QMAKE_CXXFLAGS += -Zc:strictStrings
- QMAKE_CXXFLAGS_WARN_ON += -w44456 -w44457 -w44458
+ QMAKE_CXXFLAGS_WARN_ON += -w44456 -w44457 -w44458 -wd4577
}
unset(MSC_VER)
diff --git a/mkspecs/macx-ios-clang/features/default_post.prf b/mkspecs/macx-ios-clang/features/default_post.prf
index 3acd35a038..5266c88f16 100644
--- a/mkspecs/macx-ios-clang/features/default_post.prf
+++ b/mkspecs/macx-ios-clang/features/default_post.prf
@@ -41,24 +41,24 @@ macx-xcode {
# Set up default 4-inch iPhone/iPod launch image so that our apps
# support the full screen resolution of those devices.
- launch_image = Default-568h@2x.png
- copy_image.input = $$QMAKESPEC/$$launch_image
- copy_image.output = $$OUT_PWD/$${TARGET}.xcodeproj/$$launch_image
- copy_image.CONFIG = verbatim
- QMAKE_SUBSTITUTES += copy_image
- launch_images.files = $$copy_image.output
- QMAKE_BUNDLE_DATA += launch_images
+ qmake_launch_image = Default-568h@2x.png
+ qmake_copy_image.input = $$QMAKESPEC/$$qmake_launch_image
+ qmake_copy_image.output = $$OUT_PWD/$${TARGET}.xcodeproj/$$qmake_launch_image
+ qmake_copy_image.CONFIG = verbatim
+ QMAKE_SUBSTITUTES += qmake_copy_image
+ qmake_launch_images.files = $$qmake_copy_image.output
+ QMAKE_BUNDLE_DATA += qmake_launch_images
lessThan(QMAKE_XCODE_VERSION, "6.0") {
warning("You need to update Xcode to version 6 or newer to fully support iPhone6/6+")
} else {
# Set up default LaunchScreen to support iPhone6/6+
- launch_screen = LaunchScreen.xib
- copy_launch_screen.input = $$QMAKESPEC/$$launch_screen
- copy_launch_screen.output = $$OUT_PWD/$${TARGET}.xcodeproj/$$launch_screen
- QMAKE_SUBSTITUTES += copy_launch_screen
- launch_screens.files = $$copy_launch_screen.output
- QMAKE_BUNDLE_DATA += launch_screens
+ qmake_launch_screen = LaunchScreen.xib
+ qmake_copy_launch_screen.input = $$QMAKESPEC/$$qmake_launch_screen
+ qmake_copy_launch_screen.output = $$OUT_PWD/$${TARGET}.xcodeproj/$$qmake_launch_screen
+ QMAKE_SUBSTITUTES += qmake_copy_launch_screen
+ qmake_launch_screens.files = $$qmake_copy_launch_screen.output
+ QMAKE_BUNDLE_DATA += qmake_launch_screens
}
}
diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc
index eb484e9501..14697425c0 100644
--- a/qmake/doc/src/qmake-manual.qdoc
+++ b/qmake/doc/src/qmake-manual.qdoc
@@ -2197,6 +2197,10 @@
\snippet code/doc_src_qmake-manual.pro 47
+ If your project is a \QD plugin, use the value \c uiplugin to specify that
+ the project is to be built as a library, but with specific plugin support
+ for \QD. For more information, see \l {Building and Installing the Plugin}.
+
\section1 QTPLUGIN
Specifies a list of names of static Qt plugins that are to be
diff --git a/src/3rdparty/forkfd/forkfd.c b/src/3rdparty/forkfd/forkfd.c
index 39eeb6a202..e942db2717 100644
--- a/src/3rdparty/forkfd/forkfd.c
+++ b/src/3rdparty/forkfd/forkfd.c
@@ -44,11 +44,13 @@
#ifdef __linux__
# define HAVE_WAIT4 1
-# if (defined(__GLIBC__) && (__GLIBC__ << 16) + __GLIBC_MINOR__ >= 0x207) || defined(__BIONIC__)
+# if defined(__BIONIC__) || (defined(__GLIBC__) && (__GLIBC__ << 8) + __GLIBC_MINOR__ >= 0x207 && \
+ (!defined(__UCLIBC__) || ((__UCLIBC_MAJOR__ << 16) + (__UCLIBC_MINOR__ << 8) + __UCLIBC_SUBLEVEL__ > 0x921)))
# include <sys/eventfd.h>
# define HAVE_EVENTFD 1
# endif
-# if (defined(__GLIBC__) && (__GLIBC__ << 16) + __GLIBC_MINOR__ >= 0x209) || defined(__BIONIC__)
+# if defined(__BIONIC__) || (defined(__GLIBC__) && (__GLIBC__ << 8) + __GLIBC_MINOR__ >= 0x209 && \
+ (!defined(__UCLIBC__) || ((__UCLIBC_MAJOR__ << 16) + (__UCLIBC_MINOR__ << 8) + __UCLIBC_SUBLEVEL__ > 0x921)))
# define HAVE_PIPE2 1
# endif
#endif
@@ -56,6 +58,10 @@
#if _POSIX_VERSION-0 >= 200809L || _XOPEN_VERSION-0 >= 500
# define HAVE_WAITID 1
#endif
+
+#if defined(__FreeBSD__)
+# define HAVE_PIPE2 1
+#endif
#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) || \
defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__)
# define HAVE_WAIT4 1
diff --git a/src/3rdparty/md5/md5.cpp b/src/3rdparty/md5/md5.cpp
index cc69b56213..f9e04a93e3 100644
--- a/src/3rdparty/md5/md5.cpp
+++ b/src/3rdparty/md5/md5.cpp
@@ -36,7 +36,7 @@ static void
byteSwap(UWORD32 *buf, unsigned words)
{
const quint32 byteOrderTest = 0x1;
- if (((char *)&byteOrderTest)[0] == 0) {
+ if (((const char *)&byteOrderTest)[0] == 0) {
md5byte *p = (md5byte *)buf;
do {
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 f4d2645e9a..ba3ecfecd6 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
@@ -760,12 +760,6 @@ public class QtActivityDelegate
if (null == m_surfaces)
onCreate(null);
- String nativeLibraryDir = QtNativeLibrariesDir.nativeLibrariesDir(m_activity);
- QtNative.startApplication(m_applicationParameters,
- m_environmentVariables,
- m_mainLib,
- nativeLibraryDir);
- m_started = true;
return true;
} catch (Exception e) {
e.printStackTrace();
@@ -781,14 +775,26 @@ public class QtActivityDelegate
public void onCreate(Bundle savedInstanceState)
{
m_quitApp = true;
+ Runnable startApplication = null;
if (null == savedInstanceState) {
- DisplayMetrics metrics = new DisplayMetrics();
- m_activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
- QtNative.setApplicationDisplayMetrics(metrics.widthPixels, metrics.heightPixels,
- 0, 0,
- metrics.xdpi, metrics.ydpi, metrics.scaledDensity);
+ startApplication = new Runnable() {
+ @Override
+ public void run() {
+ try {
+ String nativeLibraryDir = QtNativeLibrariesDir.nativeLibrariesDir(m_activity);
+ QtNative.startApplication(m_applicationParameters,
+ m_environmentVariables,
+ m_mainLib,
+ nativeLibraryDir);
+ m_started = true;
+ } catch (Exception e) {
+ e.printStackTrace();
+ m_activity.finish();
+ }
+ }
+ };
}
- m_layout = new QtLayout(m_activity);
+ m_layout = new QtLayout(m_activity, startApplication);
m_editText = new QtEditText(m_activity, this);
m_imm = (InputMethodManager)m_activity.getSystemService(Context.INPUT_METHOD_SERVICE);
m_surfaces = new HashMap<Integer, QtSurface>();
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtLayout.java b/src/android/jar/src/org/qtproject/qt5/android/QtLayout.java
index 09fef4a705..4d7ca47dde 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtLayout.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtLayout.java
@@ -43,9 +43,11 @@ import android.view.ViewGroup;
public class QtLayout extends ViewGroup
{
- public QtLayout(Context context)
+ private Runnable m_startApplicationRunnable;
+ public QtLayout(Context context, Runnable startRunnable)
{
super(context);
+ m_startApplicationRunnable = startRunnable;
}
public QtLayout(Context context, AttributeSet attrs)
@@ -65,6 +67,10 @@ public class QtLayout extends ViewGroup
((Activity) getContext()).getWindowManager().getDefaultDisplay().getMetrics(metrics);
QtNative.setApplicationDisplayMetrics(metrics.widthPixels,
metrics.heightPixels, w, h, metrics.xdpi, metrics.ydpi, metrics.scaledDensity);
+ if (m_startApplicationRunnable != null) {
+ m_startApplicationRunnable.run();
+ m_startApplicationRunnable = null;
+ }
}
@Override
diff --git a/src/corelib/arch/qatomic_cxx11.h b/src/corelib/arch/qatomic_cxx11.h
index 09e900f4ea..0e06ca951a 100644
--- a/src/corelib/arch/qatomic_cxx11.h
+++ b/src/corelib/arch/qatomic_cxx11.h
@@ -328,10 +328,10 @@ template <typename X> struct QAtomicOps
}
};
-#ifdef ATOMIC_VAR_INIT
-# define Q_BASIC_ATOMIC_INITIALIZER(a) { ATOMIC_VAR_INIT(a) }
+#if defined(Q_COMPILER_CONSTEXPR) && defined(Q_COMPILER_DEFAULT_MEMBERS) && defined(Q_COMPILER_DELETE_MEMBERS)
+# define Q_BASIC_ATOMIC_INITIALIZER(a) { a }
#else
-# define Q_BASIC_ATOMIC_INITIALIZER(a) { {a} }
+# define Q_BASIC_ATOMIC_INITIALIZER(a) { ATOMIC_VAR_INIT(a) }
#endif
QT_END_NAMESPACE
diff --git a/src/corelib/codecs/qutfcodec.cpp b/src/corelib/codecs/qutfcodec.cpp
index 64863cdb05..98d4b2e4e3 100644
--- a/src/corelib/codecs/qutfcodec.cpp
+++ b/src/corelib/codecs/qutfcodec.cpp
@@ -51,8 +51,8 @@ static inline bool simdEncodeAscii(uchar *&dst, const ushort *&nextAscii, const
{
// do sixteen characters at a time
for ( ; end - src >= 16; src += 16, dst += 16) {
- __m128i data1 = _mm_loadu_si128((__m128i*)src);
- __m128i data2 = _mm_loadu_si128(1+(__m128i*)src);
+ __m128i data1 = _mm_loadu_si128((const __m128i*)src);
+ __m128i data2 = _mm_loadu_si128(1+(const __m128i*)src);
// check if everything is ASCII
@@ -90,7 +90,7 @@ static inline bool simdDecodeAscii(ushort *&dst, const uchar *&nextAscii, const
{
// do sixteen characters at a time
for ( ; end - src >= 16; src += 16, dst += 16) {
- __m128i data = _mm_loadu_si128((__m128i*)src);
+ __m128i data = _mm_loadu_si128((const __m128i*)src);
#ifdef __AVX2__
const int BitSpacing = 2;
@@ -390,7 +390,7 @@ QString QUtf8::convertToUnicode(const char *chars, int len, QTextCodec::Converte
*dst++ = QChar::ReplacementCharacter;
}
- result.truncate(dst - (ushort *)result.unicode());
+ result.truncate(dst - (const ushort *)result.unicode());
if (state) {
state->invalidChars += invalid;
if (headerdone)
@@ -469,7 +469,7 @@ QString QUtf16::convertToUnicode(const char *chars, int len, QTextCodec::Convert
endian = (QSysInfo::ByteOrder == QSysInfo::BigEndian) ? BigEndianness : LittleEndianness;
QString result(len, Qt::Uninitialized); // worst case
- QChar *qch = (QChar *)result.unicode();
+ QChar *qch = (QChar *)result.data();
while (len--) {
if (half) {
QChar ch;
@@ -600,7 +600,7 @@ QString QUtf32::convertToUnicode(const char *chars, int len, QTextCodec::Convert
QString result;
result.resize((num + len) >> 2 << 1); // worst case
- QChar *qch = (QChar *)result.unicode();
+ QChar *qch = (QChar *)result.data();
const char *end = chars + len;
while (chars < end) {
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index c582b1f238..4828d8596a 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -572,6 +572,9 @@
# if _MSC_VER < 1900
// ICC disables unicode string support when compatibility mode with MSVC 2013 or lower is active
# undef Q_COMPILER_UNICODE_STRINGS
+// Disable constexpr unless the MS headers have constexpr in all the right places too
+// (like std::numeric_limits<T>::max())
+# undef Q_COMPILER_CONSTEXPR
# endif
# endif
# endif
@@ -1140,7 +1143,7 @@
# define QT_WARNING_DISABLE_GCC(text) QT_DO_PRAGMA(GCC diagnostic ignored text) // GCC directives work in Clang too
# define QT_WARNING_DISABLE_INTEL(number)
# define QT_WARNING_DISABLE_MSVC(number)
-#elif defined(Q_CC_GNU) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 405)
+#elif defined(Q_CC_GNU) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
# define QT_WARNING_PUSH QT_DO_PRAGMA(GCC diagnostic push)
# define QT_WARNING_POP QT_DO_PRAGMA(GCC diagnostic pop)
# define QT_WARNING_DISABLE_GCC(text) QT_DO_PRAGMA(GCC diagnostic ignored text)
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index f335794fed..37a765b40a 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -1178,7 +1178,7 @@ bool qSharedBuild() Q_DECL_NOTHROW
\relates <QtGlobal>
Defined on Darwin-based operating systems distributed by Apple, which
- currently includes OS X and iOS, but not the open source version.
+ currently includes OS X and iOS, but not the open source versions of Darwin.
*/
/*!
@@ -1200,7 +1200,7 @@ bool qSharedBuild() Q_DECL_NOTHROW
\relates <QtGlobal>
Defined on all supported versions of Windows. That is, if
- \l Q_OS_WIN32, \l Q_OS_WIN64 or \l Q_OS_WINCE is defined.
+ \l Q_OS_WIN32, \l Q_OS_WIN64, \l Q_OS_WINCE or \l Q_OS_WINRT is defined.
*/
/*!
@@ -2046,8 +2046,6 @@ QSysInfo::WinVersion QSysInfo::windowsVersion()
} else if (osver.dwMajorVersion == 10 && osver.dwMinorVersion == 0) {
winver = QSysInfo::WV_WINDOWS10;
} else {
- qWarning("Qt: Untested Windows version %d.%d detected!",
- int(osver.dwMajorVersion), int(osver.dwMinorVersion));
winver = QSysInfo::WV_NT_based;
}
}
diff --git a/src/corelib/io/qbuffer.cpp b/src/corelib/io/qbuffer.cpp
index 680f832909..fd74681663 100644
--- a/src/corelib/io/qbuffer.cpp
+++ b/src/corelib/io/qbuffer.cpp
@@ -425,7 +425,7 @@ qint64 QBuffer::writeData(const char *data, qint64 len)
}
}
- memcpy(d->buf->data() + pos(), (uchar *)data, int(len));
+ memcpy(d->buf->data() + pos(), data, int(len));
#ifndef QT_NO_QOBJECT
d->writtenSinceLastEmit += len;
diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp
index 8676fe0259..54a705b72b 100644
--- a/src/corelib/io/qdebug.cpp
+++ b/src/corelib/io/qdebug.cpp
@@ -174,6 +174,16 @@ void QDebug::putUcs4(uint ucs4)
maybeQuote('\'');
}
+// These two functions return true if the character should be printed by QDebug.
+// For QByteArray, this is technically identical to US-ASCII isprint();
+// for QString, we use QChar::isPrint, which requires a full UCS-4 decode.
+static inline bool isPrintable(uint ucs4)
+{ return QChar::isPrint(ucs4); }
+static inline bool isPrintable(ushort uc)
+{ return QChar::isPrint(uc); }
+static inline bool isPrintable(uchar c)
+{ return c >= ' ' && c < 0x7f; }
+
template <typename Char>
static inline void putEscapedString(QTextStreamPrivate *d, const Char *begin, int length, bool isUnicode = true)
{
@@ -194,22 +204,23 @@ static inline void putEscapedString(QTextStreamPrivate *d, const Char *begin, in
}
if (sizeof(Char) == sizeof(QChar)) {
+ // Surrogate characters are category Cs (Other_Surrogate), so isPrintable = false for them
int runLength = 0;
while (p + runLength != end &&
- p[runLength] < 0x7f && p[runLength] >= 0x20 && p[runLength] != '\\' && p[runLength] != '"')
+ isPrintable(p[runLength]) && p[runLength] != '\\' && p[runLength] != '"')
++runLength;
if (runLength) {
d->write(reinterpret_cast<const QChar *>(p), runLength);
p += runLength - 1;
continue;
}
- } else if (*p < 0x7f && *p >= 0x20 && *p != '\\' && *p != '"') {
+ } else if (isPrintable(*p) && *p != '\\' && *p != '"') {
QChar c = QLatin1Char(*p);
d->write(&c, 1);
continue;
}
- // print as an escape sequence
+ // print as an escape sequence (maybe, see below for surrogate pairs)
int buflen = 2;
ushort buf[sizeof "\\U12345678" - 1];
buf[0] = '\\';
@@ -248,17 +259,23 @@ static inline void putEscapedString(QTextStreamPrivate *d, const Char *begin, in
if ((p + 1) != end && QChar::isLowSurrogate(p[1])) {
// properly-paired surrogates
uint ucs4 = QChar::surrogateToUcs4(*p, p[1]);
+ if (isPrintable(ucs4)) {
+ buf[0] = *p;
+ buf[1] = p[1];
+ buflen = 2;
+ } else {
+ buf[1] = 'U';
+ buf[2] = '0'; // toHexUpper(ucs4 >> 32);
+ buf[3] = '0'; // toHexUpper(ucs4 >> 28);
+ buf[4] = toHexUpper(ucs4 >> 20);
+ buf[5] = toHexUpper(ucs4 >> 16);
+ buf[6] = toHexUpper(ucs4 >> 12);
+ buf[7] = toHexUpper(ucs4 >> 8);
+ buf[8] = toHexUpper(ucs4 >> 4);
+ buf[9] = toHexUpper(ucs4);
+ buflen = 10;
+ }
++p;
- buf[1] = 'U';
- buf[2] = '0'; // toHexUpper(ucs4 >> 32);
- buf[3] = '0'; // toHexUpper(ucs4 >> 28);
- buf[4] = toHexUpper(ucs4 >> 20);
- buf[5] = toHexUpper(ucs4 >> 16);
- buf[6] = toHexUpper(ucs4 >> 12);
- buf[7] = toHexUpper(ucs4 >> 8);
- buf[8] = toHexUpper(ucs4 >> 4);
- buf[9] = toHexUpper(ucs4);
- buflen = 10;
break;
}
// improperly-paired surrogates, fall through
@@ -409,6 +426,9 @@ QDebug &QDebug::resetFormat()
Disables automatic insertion of quotation characters around QChar, QString and QByteArray
contents and returns a reference to the stream.
+ When quoting is disabled, these types are printed without quotation
+ characters and without escaping of non-printable characters.
+
\sa quote(), maybeQuote()
*/
@@ -454,7 +474,11 @@ QDebug &QDebug::resetFormat()
\fn QDebug &QDebug::operator<<(QChar t)
Writes the character, \a t, to the stream and returns a reference to the
- stream.
+ stream. Normally, QDebug prints control characters and non-US-ASCII
+ characters as their C escape sequences or their Unicode value (\\u1234). To
+ print non-printable characters without transformation, enable the noquote()
+ functionality, but note that some QDebug backends may not be 8-bit clean
+ and may not be able to represent \c t.
*/
/*!
@@ -545,34 +569,114 @@ QDebug &QDebug::resetFormat()
\fn QDebug &QDebug::operator<<(const char *s)
Writes the '\\0'-terminated string, \a s, to the stream and returns a
- reference to the stream.
+ reference to the stream. The string is never quoted nor transformed to the
+ output, but note that some QDebug backends might not be 8-bit clean.
*/
/*!
\fn QDebug &QDebug::operator<<(const QString &s)
- Writes the string, \a s, to the stream and returns a reference to the stream.
+ Writes the string, \a s, to the stream and returns a reference to the
+ stream. Normally, QDebug prints the string inside quotes and transforms
+ non-printable characters to their Unicode values (\\u1234).
+
+ To print non-printable characters without transformation, enable the
+ noquote() functionality. Note that some QDebug backends might not be 8-bit
+ clean.
+
+ Output examples:
+ \code
+ QString s;
+
+ s = "a";
+ qDebug().noquote() << s; // prints: a
+ qDebug() << s; // prints: "a"
+
+ s = "\"a\r\n\"";
+ qDebug() << s; // prints: "\"a\r\n\""
+
+ s = "\033"; // escape character
+ qDebug() << s; // prints: "\u001B"
+
+ s = "\u00AD"; // SOFT HYPHEN
+ qDebug() << s; // prints: "\u00AD"
+
+ s = "\u00E1"; // LATIN SMALL LETTER A WITH ACUTE
+ qDebug() << s; // prints: "á"
+
+ s = "a\u0301"; // "a" followed by COMBINING ACUTE ACCENT
+ qDebug() << s; // prints: "á";
+
+ s = "\u0430\u0301"; // CYRILLIC SMALL LETTER A followed by COMBINING ACUTE ACCENT
+ qDebug() << s; // prints: "а́"
+ \endcode
*/
/*!
\fn QDebug &QDebug::operator<<(const QStringRef &s)
- Writes the string reference, \a s, to the stream and returns a reference to
- the stream.
+ Writes the string, \a s, to the stream and returns a reference to the
+ stream. Normally, QDebug prints the string inside quotes and transforms
+ non-printable characters to their Unicode values (\\u1234).
+
+ To print non-printable characters without transformation, enable the
+ noquote() functionality. Note that some QDebug backends might not be 8-bit
+ clean.
+
+ See the QString overload for examples.
*/
/*!
\fn QDebug &QDebug::operator<<(QLatin1String s)
- Writes the Latin1-encoded string, \a s, to the stream and returns a reference
- to the stream.
+ Writes the string, \a s, to the stream and returns a reference to the
+ stream. Normally, QDebug prints the string inside quotes and transforms
+ non-printable characters to their Unicode values (\\u1234).
+
+ To print non-printable characters without transformation, enable the
+ noquote() functionality. Note that some QDebug backends might not be 8-bit
+ clean.
+
+ See the QString overload for examples.
*/
/*!
\fn QDebug &QDebug::operator<<(const QByteArray &b)
Writes the byte array, \a b, to the stream and returns a reference to the
- stream.
+ stream. Normally, QDebug prints the array inside quotes and transforms
+ control or non-US-ASCII characters to their C escape sequences (\\xAB). This
+ way, the output is always 7-bit clean and the string can be copied from the
+ output and pasted back into C++ sources, if necessary.
+
+ To print non-printable characters without transformation, enable the
+ noquote() functionality. Note that some QDebug backends might not be 8-bit
+ clean.
+
+ Output examples:
+ \code
+ QByteArray ba;
+
+ ba = "a";
+ qDebug().noquote() << ba; // prints: a
+ qDebug() << ba; // prints: "a"
+
+ ba = "\"a\r\n\"";
+ qDebug() << ba; // prints: "\"a\r\n\""
+
+ ba = "\033"; // escape character
+ qDebug() << ba; // prints: "\x1B"
+
+ ba = "\xC3\xA1";
+ qDebug() << ba; // prints: "\xC3\xA1"
+
+ ba = QByteArray("a\0b", 3);
+ qDebug() << ba // prints: "\a\x00""b"
+ \endcode
+
+ Note how QDebug needed to close and reopen the string in the way C and C++
+ languages concatenate string literals so that the letter 'b' is not
+ interpreted as part of the previous hexadecimal escape sequence.
*/
/*!
diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h
index 9391799624..2f626dfc1f 100644
--- a/src/corelib/io/qdebug.h
+++ b/src/corelib/io/qdebug.h
@@ -293,7 +293,7 @@ template <class T>
inline typename QtPrivate::QEnableIf<
QtPrivate::IsQEnumHelper<T>::Value || QtPrivate::IsQEnumHelper<QFlags<T> >::Value,
QDebug>::Type
-operator<<(QDebug debug, const QFlags<T> &flags)
+qt_QMetaEnum_flagDebugOperator_helper(QDebug debug, const QFlags<T> &flags)
{
const QMetaObject *obj = qt_getEnumMetaObject(T());
const char *name = qt_getEnumName(T());
@@ -304,10 +304,10 @@ template <class T>
inline typename QtPrivate::QEnableIf<
!QtPrivate::IsQEnumHelper<T>::Value && !QtPrivate::IsQEnumHelper<QFlags<T> >::Value,
QDebug>::Type
-operator<<(QDebug debug, const QFlags<T> &flags)
+qt_QMetaEnum_flagDebugOperator_helper(QDebug debug, const QFlags<T> &flags)
#else // !QT_NO_QOBJECT
template <class T>
-inline QDebug operator<<(QDebug debug, const QFlags<T> &flags)
+inline QDebug qt_QMetaEnum_flagDebugOperator_helper(QDebug debug, const QFlags<T> &flags)
#endif
{
QDebugStateSaver saver(debug);
@@ -327,6 +327,14 @@ inline QDebug operator<<(QDebug debug, const QFlags<T> &flags)
return debug;
}
+template<typename T>
+inline QDebug operator<<(QDebug debug, const QFlags<T> &flags)
+{
+ // We have to use an indirection otherwise specialisation of some other overload of the
+ // operator<< the compiler would try to instantiate QFlags<T> for the QEnableIf
+ return qt_QMetaEnum_flagDebugOperator_helper(debug, flags);
+}
+
#ifdef Q_OS_MAC
// We provide QDebug stream operators for commonly used Core Foundation
diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp
index ddbd24338b..429c40da1a 100644
--- a/src/corelib/io/qfsfileengine.cpp
+++ b/src/corelib/io/qfsfileengine.cpp
@@ -819,13 +819,13 @@ bool QFSFileEngine::extension(Extension extension, const ExtensionOption *option
return feof(d->fh);
if (extension == MapExtension) {
- const MapExtensionOption *options = (MapExtensionOption*)(option);
+ const MapExtensionOption *options = (const MapExtensionOption*)(option);
MapExtensionReturn *returnValue = static_cast<MapExtensionReturn*>(output);
returnValue->address = d->map(options->offset, options->size, options->flags);
return (returnValue->address != 0);
}
if (extension == UnMapExtension) {
- UnMapExtensionOption *options = (UnMapExtensionOption*)option;
+ const UnMapExtensionOption *options = (const UnMapExtensionOption*)option;
return d->unmap(options->address);
}
diff --git a/src/corelib/io/qloggingregistry.cpp b/src/corelib/io/qloggingregistry.cpp
index 05c41910c5..f0b72cd9be 100644
--- a/src/corelib/io/qloggingregistry.cpp
+++ b/src/corelib/io/qloggingregistry.cpp
@@ -398,10 +398,12 @@ void QLoggingRegistry::defaultCategoryFilter(QLoggingCategory *cat)
Q_ASSERT(reg->categories.contains(cat));
QtMsgType enableForLevel = reg->categories.value(cat);
+ // NB: note that the numeric values of the Qt*Msg constants are
+ // not in severity order.
bool debug = (enableForLevel == QtDebugMsg);
- bool info = (enableForLevel <= QtInfoMsg);
- bool warning = (enableForLevel <= QtWarningMsg);
- bool critical = (enableForLevel <= QtCriticalMsg);
+ bool info = debug || (enableForLevel == QtInfoMsg);
+ bool warning = info || (enableForLevel == QtWarningMsg);
+ bool critical = warning || (enableForLevel == QtCriticalMsg);
// hard-wired implementation of
// qt.*.debug=false
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index f979f8e0ec..dfde5f236d 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -2122,6 +2122,13 @@ void QProcess::start(const QString &program, const QStringList &arguments, OpenM
qWarning("QProcess::start: Process is already running");
return;
}
+ if (program.isEmpty()) {
+ Q_D(QProcess);
+ d->processError = QProcess::FailedToStart;
+ setErrorString(tr("No program defined"));
+ emit error(d->processError);
+ return;
+ }
d->program = program;
d->arguments = arguments;
@@ -2146,7 +2153,10 @@ void QProcess::start(OpenMode mode)
return;
}
if (d->program.isEmpty()) {
- qWarning("QProcess::start: program not set");
+ Q_D(QProcess);
+ d->processError = QProcess::FailedToStart;
+ setErrorString(tr("No program defined"));
+ emit error(d->processError);
return;
}
diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp
index 345f0bd65d..4e6079306b 100644
--- a/src/corelib/io/qresource.cpp
+++ b/src/corelib/io/qresource.cpp
@@ -956,7 +956,7 @@ public:
} else
#endif
{
- delete [] (uchar *)mappingBuffer();
+ delete [] mappingBuffer();
}
}
QString mappingFile() const { return fileName; }
@@ -1450,13 +1450,13 @@ bool QResourceFileEngine::extension(Extension extension, const ExtensionOption *
{
Q_D(QResourceFileEngine);
if (extension == MapExtension) {
- const MapExtensionOption *options = (MapExtensionOption*)(option);
+ const MapExtensionOption *options = (const MapExtensionOption*)(option);
MapExtensionReturn *returnValue = static_cast<MapExtensionReturn*>(output);
returnValue->address = d->map(options->offset, options->size, options->flags);
return (returnValue->address != 0);
}
if (extension == UnMapExtension) {
- UnMapExtensionOption *options = (UnMapExtensionOption*)option;
+ const UnMapExtensionOption *options = (const UnMapExtensionOption*)option;
return d->unmap(options->address);
}
return false;
diff --git a/src/corelib/itemmodels/qitemselectionmodel.cpp b/src/corelib/itemmodels/qitemselectionmodel.cpp
index fa7d4647a4..ba97543c44 100644
--- a/src/corelib/itemmodels/qitemselectionmodel.cpp
+++ b/src/corelib/itemmodels/qitemselectionmodel.cpp
@@ -1744,13 +1744,19 @@ const QItemSelection QItemSelectionModel::selection() const
\property QItemSelectionModel::selectedIndexes
*/
+
/*!
\since 5.5
- \property QItemSelectionModel::model
+ \property QItemSelectionModel::selection
\internal
*/
+/*!
+ \since 5.5
+ \property QItemSelectionModel::model
+ \internal
+*/
/*!
\since 5.5
diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
index 4ee37defae..0771fd0e30 100644
--- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp
+++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
@@ -2725,7 +2725,7 @@ bool QSortFilterProxyModel::filterAcceptsRow(int source_row, const QModelIndex &
The default implementation returns \c true if the value held by the relevant item
matches the filter string, wildcard string or regular expression.
- \note By default, the Qt::DisplayRole is used to determine if the row
+ \note By default, the Qt::DisplayRole is used to determine if the column
should be accepted or not. This can be changed by setting the \l
filterRole property.
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 5e15f2d773..e08f709cd2 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -441,7 +441,7 @@ QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv, uint
static const char *const empty = "";
if (argc == 0 || argv == 0) {
argc = 0;
- argv = (char **)&empty;
+ argv = const_cast<char **>(&empty);
}
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
if (!isArgvModified(argc, argv)) {
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index 90ee7d8f95..7ae9fef622 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -1533,6 +1533,29 @@ bool QMetaObject::invokeMethod(QObject *obj,
*/
/*!
+ \fn QMetaObject::Connection::Connection(const Connection &other)
+
+ Constructs a copy of \a other.
+*/
+
+/*!
+ \fn QMetaObject::Connection::Connection &operator=(const Connection &other)
+
+ Assigns \a other to this connection and returns a reference to this connection.
+*/
+
+/*!
+ \fn QMetaObject::Connection &QMetaObject::Connection::operator=(Connection &&other)
+
+ Move-assigns \a other to this object.
+*/
+/*!
+ \fn QMetaObject::Connection::Connection(Connection &&o)
+
+ Move-constructs a Connection instance, making it point to the same object that \a o was pointing to.
+*/
+
+/*!
\class QMetaMethod
\inmodule QtCore
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index 641053371d..3906cdc036 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -421,6 +421,16 @@ struct DefinedTypesFilter {
*/
/*!
+ \fn void *QMetaType::construct(int type, const void *copy)
+ \deprecated
+
+ Constructs a value of the given type which is a copy of \a copy.
+ The default value for \a copy is 0.
+
+ Deprecated, use the static function QMetaType::create(int type,
+ const void *copy) instead.
+*/
+/*!
\fn void *QMetaType::construct(void *where, const void *copy = 0) const
\since 5.0
@@ -1834,7 +1844,8 @@ public:
void delegate(const T *where) { DestructorImpl<T>::Destruct(m_type, const_cast<T*>(where)); }
void delegate(const void *) {}
void delegate(const QMetaTypeSwitcher::UnknownType*) {}
- void delegate(const QMetaTypeSwitcher::NotBuiltinType *where) { customTypeDestructor(m_type, (void*)where); }
+ void delegate(const QMetaTypeSwitcher::NotBuiltinType *where)
+ { customTypeDestructor(m_type, const_cast<void *>(static_cast<const void *>(where))); }
private:
static void customTypeDestructor(const int type, void *where)
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index e6ea27ef58..4d4cccd7b1 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -4103,7 +4103,7 @@ QDebug operator<<(QDebug dbg, const QObject *o)
QDebugStateSaver saver(dbg);
if (!o)
return dbg << "QObject(0x0)";
- dbg.nospace() << o->metaObject()->className() << '(' << (void *)o;
+ dbg.nospace() << o->metaObject()->className() << '(' << (const void *)o;
if (!o->objectName().isEmpty())
dbg << ", name = " << o->objectName();
dbg << ')';
@@ -4908,8 +4908,15 @@ QMetaObject::Connection& QMetaObject::Connection::operator=(const QMetaObject::C
return *this;
}
+/*!
+ Creates a Connection instance.
+*/
+
QMetaObject::Connection::Connection() : d_ptr(0) {}
+/*!
+ Destructor for QMetaObject::Connection.
+*/
QMetaObject::Connection::~Connection()
{
if (d_ptr)
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp
index ef74b4bdd1..794a4aaa0c 100644
--- a/src/corelib/kernel/qtranslator.cpp
+++ b/src/corelib/kernel/qtranslator.cpp
@@ -722,7 +722,7 @@ static QString find_translation(const QLocale & locale,
For example, an application running in the \a locale with the following
\l{QLocale::uiLanguages()}{ui languages} - "es", "fr-CA", "de" might call
- load(QLocale::system(), "foo", ".", "/opt/foolib", ".qm"). load() would
+ load(QLocale(), "foo", ".", "/opt/foolib", ".qm"). load() would
replace '-' (dash) with '_' (underscore) in the ui language and then try to
open the first existing readable file from this list:
diff --git a/src/corelib/plugin/qlibrary_p.h b/src/corelib/plugin/qlibrary_p.h
index 3965176ef7..ada90d7bfd 100644
--- a/src/corelib/plugin/qlibrary_p.h
+++ b/src/corelib/plugin/qlibrary_p.h
@@ -108,7 +108,7 @@ public:
raw += strlen("QTMETADATA ");
// the size of the embedded JSON object can be found 8 bytes into the data (see qjson_p.h),
// but doesn't include the size of the header (8 bytes)
- QByteArray json(raw, qFromLittleEndian<uint>(*(uint *)(raw + 8)) + 8);
+ QByteArray json(raw, qFromLittleEndian<uint>(*(const uint *)(raw + 8)) + 8);
return QJsonDocument::fromBinaryData(json);
}
diff --git a/src/corelib/plugin/qplugin.h b/src/corelib/plugin/qplugin.h
index 4b5cafaa06..efab6523ac 100644
--- a/src/corelib/plugin/qplugin.h
+++ b/src/corelib/plugin/qplugin.h
@@ -112,7 +112,7 @@ void Q_CORE_EXPORT qRegisterStaticPluginFunction(QStaticPlugin staticPlugin);
# define QT_MOC_EXPORT_PLUGIN(PLUGINCLASS, PLUGINCLASSNAME) \
static QT_PREPEND_NAMESPACE(QObject) *qt_plugin_instance_##PLUGINCLASSNAME() \
Q_PLUGIN_INSTANCE(PLUGINCLASS) \
- static const char *qt_plugin_query_metadata_##PLUGINCLASSNAME() { return (const char *)qt_pluginMetaData; } \
+ static const char *qt_plugin_query_metadata_##PLUGINCLASSNAME() { return reinterpret_cast<const char *>(qt_pluginMetaData); } \
const QT_PREPEND_NAMESPACE(QStaticPlugin) qt_static_plugin_##PLUGINCLASSNAME() { \
QT_PREPEND_NAMESPACE(QStaticPlugin) plugin = { qt_plugin_instance_##PLUGINCLASSNAME, qt_plugin_query_metadata_##PLUGINCLASSNAME}; \
return plugin; \
@@ -123,7 +123,7 @@ void Q_CORE_EXPORT qRegisterStaticPluginFunction(QStaticPlugin staticPlugin);
# define QT_MOC_EXPORT_PLUGIN(PLUGINCLASS, PLUGINCLASSNAME) \
Q_EXTERN_C Q_DECL_EXPORT \
const char *qt_plugin_query_metadata() \
- { return (const char *)qt_pluginMetaData; } \
+ { return reinterpret_cast<const char *>(qt_pluginMetaData); } \
Q_EXTERN_C Q_DECL_EXPORT QT_PREPEND_NAMESPACE(QObject) *qt_plugin_instance() \
Q_PLUGIN_INSTANCE(PLUGINCLASS)
diff --git a/src/corelib/plugin/quuid.cpp b/src/corelib/plugin/quuid.cpp
index 72f662dc1e..812e2c9fb6 100644
--- a/src/corelib/plugin/quuid.cpp
+++ b/src/corelib/plugin/quuid.cpp
@@ -543,7 +543,7 @@ QUuid QUuid::fromRfc4122(const QByteArray &bytes)
QString QUuid::toString() const
{
QString result(38, Qt::Uninitialized);
- ushort *data = (ushort *)result.unicode();
+ ushort *data = (ushort *)result.data();
_q_uuidToHex(data, data1, data2, data3, data4);
diff --git a/src/corelib/thread/qreadwritelock.cpp b/src/corelib/thread/qreadwritelock.cpp
index e6477bf5e0..0ea8c4c00f 100644
--- a/src/corelib/thread/qreadwritelock.cpp
+++ b/src/corelib/thread/qreadwritelock.cpp
@@ -136,11 +136,27 @@ void QReadWriteLock::lockForRead()
{
QMutexLocker lock(&d->mutex);
+ Qt::HANDLE self = 0;
+ if (d->recursive) {
+ self = QThread::currentThreadId();
+
+ QHash<Qt::HANDLE, int>::iterator it = d->currentReaders.find(self);
+ if (it != d->currentReaders.end()) {
+ ++it.value();
+ ++d->accessCount;
+ Q_ASSERT_X(d->accessCount > 0, "QReadWriteLock::lockForRead()",
+ "Overflow in lock counter");
+ return;
+ }
+ }
+
while (d->accessCount < 0 || d->waitingWriters) {
++d->waitingReaders;
d->readerWait.wait(&d->mutex);
--d->waitingReaders;
}
+ if (d->recursive)
+ d->currentReaders.insert(self, 1);
++d->accessCount;
Q_ASSERT_X(d->accessCount > 0, "QReadWriteLock::lockForRead()", "Overflow in lock counter");
@@ -166,8 +182,24 @@ bool QReadWriteLock::tryLockForRead()
{
QMutexLocker lock(&d->mutex);
+ Qt::HANDLE self = 0;
+ if (d->recursive) {
+ self = QThread::currentThreadId();
+
+ QHash<Qt::HANDLE, int>::iterator it = d->currentReaders.find(self);
+ if (it != d->currentReaders.end()) {
+ ++it.value();
+ ++d->accessCount;
+ Q_ASSERT_X(d->accessCount > 0, "QReadWriteLock::tryLockForRead()",
+ "Overflow in lock counter");
+ return true;
+ }
+ }
+
if (d->accessCount < 0)
return false;
+ if (d->recursive)
+ d->currentReaders.insert(self, 1);
++d->accessCount;
Q_ASSERT_X(d->accessCount > 0, "QReadWriteLock::tryLockForRead()", "Overflow in lock counter");
@@ -198,6 +230,20 @@ bool QReadWriteLock::tryLockForRead(int timeout)
{
QMutexLocker lock(&d->mutex);
+ Qt::HANDLE self = 0;
+ if (d->recursive) {
+ self = QThread::currentThreadId();
+
+ QHash<Qt::HANDLE, int>::iterator it = d->currentReaders.find(self);
+ if (it != d->currentReaders.end()) {
+ ++it.value();
+ ++d->accessCount;
+ Q_ASSERT_X(d->accessCount > 0, "QReadWriteLock::tryLockForRead()",
+ "Overflow in lock counter");
+ return true;
+ }
+ }
+
while (d->accessCount < 0 || d->waitingWriters) {
++d->waitingReaders;
bool success = d->readerWait.wait(&d->mutex, timeout < 0 ? ULONG_MAX : ulong(timeout));
@@ -205,6 +251,8 @@ bool QReadWriteLock::tryLockForRead(int timeout)
if (!success)
return false;
}
+ if (d->recursive)
+ d->currentReaders.insert(self, 1);
++d->accessCount;
Q_ASSERT_X(d->accessCount > 0, "QReadWriteLock::tryLockForRead()", "Overflow in lock counter");
@@ -364,6 +412,15 @@ void QReadWriteLock::unlock()
bool unlocked = false;
if (d->accessCount > 0) {
// releasing a read lock
+ if (d->recursive) {
+ Qt::HANDLE self = QThread::currentThreadId();
+ QHash<Qt::HANDLE, int>::iterator it = d->currentReaders.find(self);
+ if (it != d->currentReaders.end()) {
+ if (--it.value() <= 0)
+ d->currentReaders.erase(it);
+ }
+ }
+
unlocked = --d->accessCount == 0;
} else if (d->accessCount < 0 && ++d->accessCount == 0) {
// released a write lock
diff --git a/src/corelib/thread/qreadwritelock_p.h b/src/corelib/thread/qreadwritelock_p.h
index 15a6d1f57e..e57c0e403f 100644
--- a/src/corelib/thread/qreadwritelock_p.h
+++ b/src/corelib/thread/qreadwritelock_p.h
@@ -69,6 +69,7 @@ struct QReadWriteLockPrivate
bool recursive;
Qt::HANDLE currentWriter;
+ QHash<Qt::HANDLE, int> currentReaders;
};
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index 0434cebc15..447e84b3d4 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -511,7 +511,7 @@ QByteArray qCompress(const uchar* data, int nbytes, int compressionLevel)
int res;
do {
bazip.resize(len + 4);
- res = ::compress2((uchar*)bazip.data()+4, &len, (uchar*)data, nbytes, compressionLevel);
+ res = ::compress2((uchar*)bazip.data()+4, &len, data, nbytes, compressionLevel);
switch (res) {
case Z_OK:
@@ -602,7 +602,7 @@ QByteArray qUncompress(const uchar* data, int nbytes)
d->size = 0; // Shut up valgrind "uninitialized variable" warning
int res = ::uncompress((uchar*)d->data(), &len,
- (uchar*)data+4, nbytes-4);
+ data+4, nbytes-4);
switch (res) {
case Z_OK:
@@ -2186,9 +2186,9 @@ QByteArray &QByteArray::replace(const char *before, int bsize, const char *after
}
if (a != after)
- ::free((char *)a);
+ ::free(const_cast<char *>(a));
if (b != before)
- ::free((char *)b);
+ ::free(const_cast<char *>(b));
return *this;
diff --git a/src/corelib/tools/qcollator.cpp b/src/corelib/tools/qcollator.cpp
index 615b7a4e3e..59f8f66869 100644
--- a/src/corelib/tools/qcollator.cpp
+++ b/src/corelib/tools/qcollator.cpp
@@ -87,7 +87,7 @@ QCollator::QCollator(const QCollator &other)
}
/*!
- Destructor for QCollator.
+ Destroys the collator.
*/
QCollator::~QCollator()
{
diff --git a/src/corelib/tools/qpair.qdoc b/src/corelib/tools/qpair.qdoc
index 2a421a1bbf..7cba7480f0 100644
--- a/src/corelib/tools/qpair.qdoc
+++ b/src/corelib/tools/qpair.qdoc
@@ -109,7 +109,7 @@
\endcode
Swap overloads are found in namespace \c std as well as via
- argument-dependent lookup (ADL) in \c{T}'s namespace.
+ argument-dependent lookup (ADL) in the namespace of \c{T} .
*/
/*!
@@ -136,8 +136,7 @@
\fn QPair::QPair(QPair<TT1, TT2> &&p)
\since 5.2
- Move-constructs a QPair instance, making it point to the same object that
- \a p was pointing to.
+ Move-constructs a QPair instance, making it point to the same object that \a p was pointing to.
*/
/*!
diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp
index d572dd209c..e7917ffdac 100644
--- a/src/corelib/tools/qsimd.cpp
+++ b/src/corelib/tools/qsimd.cpp
@@ -36,6 +36,10 @@
#include <QByteArray>
#include <stdio.h>
+#ifdef Q_OS_LINUX
+# include "../testlib/3rdparty/valgrind_p.h"
+#endif
+
#if defined(Q_OS_WIN)
# if defined(Q_OS_WINCE)
# include <qt_windows.h>
@@ -256,8 +260,12 @@ static inline uint detectProcessorFeatures()
uint features = 0;
int cpuidLevel = maxBasicCpuidSupported();
+#if Q_PROCESSOR_X86 < 5
if (cpuidLevel < 1)
return 0;
+#else
+ Q_ASSERT(cpuidLevel >= 1);
+#endif
uint cpuid01ECX = 0, cpuid01EDX = 0;
cpuidFeatures01(cpuid01ECX, cpuid01EDX);
@@ -497,8 +505,7 @@ static const int features_indices[] = {
static const int features_count = (sizeof features_indices - 1) / (sizeof features_indices[0]);
// record what CPU features were enabled by default in this Qt build
-// don't define for HLE, since the HLE prefix can be run on older CPUs
-static const uint minFeature = qCompilerCpuFeatures & ~HLE;
+static const uint minFeature = qCompilerCpuFeatures;
#ifdef Q_OS_WIN
#if defined(Q_CC_GNU)
@@ -554,7 +561,12 @@ void qDetectCpuFeatures()
}
}
- if (minFeature != 0 && (f & minFeature) != minFeature) {
+#ifdef RUNNING_ON_VALGRIND
+ bool runningOnValgrind = RUNNING_ON_VALGRIND;
+#else
+ bool runningOnValgrind = false;
+#endif
+ if (!runningOnValgrind && (minFeature != 0 && (f & minFeature) != minFeature)) {
uint missing = minFeature & ~f;
fprintf(stderr, "Incompatible processor. This Qt build requires the following features:\n ");
for (int i = 0; i < features_count; ++i) {
diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
index 1f5e743b7f..dd93b4fd26 100644
--- a/src/corelib/tools/qsimd_p.h
+++ b/src/corelib/tools/qsimd_p.h
@@ -265,9 +265,6 @@ static const uint qCompilerCpuFeatures = 0
#if defined __RTM__
| RTM
#endif
-#if defined __HLE__
- | HLE
-#endif
#if defined __AVX2__
| AVX2
#endif
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 345114d907..8bb8953dde 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -215,7 +215,7 @@ void qt_from_latin1(ushort *dst, const char *str, size_t size)
// we're going to read str[offset..offset+15] (16 bytes)
for ( ; str + offset + 15 < e; offset += 16) {
- const __m128i chunk = _mm_loadu_si128((__m128i*)(str + offset)); // load
+ const __m128i chunk = _mm_loadu_si128((const __m128i*)(str + offset)); // load
#ifdef __AVX2__
// zero extend to an YMM register
const __m256i extended = _mm256_cvtepu8_epi16(chunk);
@@ -316,10 +316,10 @@ static void qt_to_latin1(uchar *dst, const ushort *src, int length)
// we're going to write to dst[offset..offset+15] (16 bytes)
for ( ; dst + offset + 15 < e; offset += 16) {
- __m128i chunk1 = _mm_loadu_si128((__m128i*)(src + offset)); // load
+ __m128i chunk1 = _mm_loadu_si128((const __m128i*)(src + offset)); // load
chunk1 = mergeQuestionMarks(chunk1);
- __m128i chunk2 = _mm_loadu_si128((__m128i*)(src + offset + 8)); // load
+ __m128i chunk2 = _mm_loadu_si128((const __m128i*)(src + offset + 8)); // load
chunk2 = mergeQuestionMarks(chunk2);
// pack the two vector to 16 x 8bits elements
@@ -458,8 +458,8 @@ static int ucstrncmp(const QChar *a, const QChar *b, int l)
// we're going to read ptr[0..15] (16 bytes)
for ( ; ptr + 15 < reinterpret_cast<const char *>(a); ptr += 16) {
- __m128i a_data = _mm_loadu_si128((__m128i*)ptr);
- __m128i b_data = _mm_loadu_si128((__m128i*)(ptr + distance));
+ __m128i a_data = _mm_loadu_si128((const __m128i*)ptr);
+ __m128i b_data = _mm_loadu_si128((const __m128i*)(ptr + distance));
__m128i result = _mm_cmpeq_epi16(a_data, b_data);
uint mask = ~_mm_movemask_epi8(result);
if (ushort(mask)) {
@@ -541,14 +541,14 @@ static int ucstrncmp(const QChar *a, const uchar *c, int l)
for ( ; uc + offset + 15 < e; offset += 16) {
// similar to fromLatin1_helper:
// load 16 bytes of Latin 1 data
- __m128i chunk = _mm_loadu_si128((__m128i*)(c + offset));
+ __m128i chunk = _mm_loadu_si128((const __m128i*)(c + offset));
# ifdef __AVX2__
// expand Latin 1 data via zero extension
__m256i ldata = _mm256_cvtepu8_epi16(chunk);
// load UTF-16 data and compare
- __m256i ucdata = _mm256_loadu_si256((__m256i*)(uc + offset));
+ __m256i ucdata = _mm256_loadu_si256((const __m256i*)(uc + offset));
__m256i result = _mm256_cmpeq_epi16(ldata, ucdata);
uint mask = ~_mm256_movemask_epi8(result);
@@ -558,8 +558,8 @@ static int ucstrncmp(const QChar *a, const uchar *c, int l)
__m128i secondHalf = _mm_unpackhi_epi8(chunk, nullmask);
// load UTF-16 data and compare
- __m128i ucdata1 = _mm_loadu_si128((__m128i*)(uc + offset));
- __m128i ucdata2 = _mm_loadu_si128((__m128i*)(uc + offset + 8));
+ __m128i ucdata1 = _mm_loadu_si128((const __m128i*)(uc + offset));
+ __m128i ucdata2 = _mm_loadu_si128((const __m128i*)(uc + offset + 8));
__m128i result1 = _mm_cmpeq_epi16(firstHalf, ucdata1);
__m128i result2 = _mm_cmpeq_epi16(secondHalf, ucdata2);
@@ -577,10 +577,10 @@ static int ucstrncmp(const QChar *a, const uchar *c, int l)
// we'll read uc[offset..offset+7] (16 bytes) and c[offset..offset+7] (8 bytes)
if (uc + offset + 7 < e) {
// same, but we're using an 8-byte load
- __m128i chunk = _mm_cvtsi64_si128(*(long long *)(c + offset));
+ __m128i chunk = _mm_cvtsi64_si128(*(const long long *)(c + offset));
__m128i secondHalf = _mm_unpacklo_epi8(chunk, nullmask);
- __m128i ucdata = _mm_loadu_si128((__m128i*)(uc + offset));
+ __m128i ucdata = _mm_loadu_si128((const __m128i*)(uc + offset));
__m128i result = _mm_cmpeq_epi16(secondHalf, ucdata);
uint mask = ~_mm_movemask_epi8(result);
if (ushort(mask)) {
@@ -672,7 +672,7 @@ static int findChar(const QChar *str, int len, QChar ch, int from,
// we're going to read n[0..7] (16 bytes)
for (const ushort *next = n + 8; next <= e; n = next, next += 8) {
- __m128i data = _mm_loadu_si128((__m128i*)n);
+ __m128i data = _mm_loadu_si128((const __m128i*)n);
__m128i result = _mm_cmpeq_epi16(data, mch);
uint mask = _mm_movemask_epi8(result);
if (ushort(mask)) {
@@ -2744,7 +2744,7 @@ bool operator<(const QString &s1, const QString &s2)
*/
bool QString::operator<(QLatin1String other) const
{
- const uchar *c = (uchar *) other.latin1();
+ const uchar *c = (const uchar *) other.latin1();
if (!c || *c == 0)
return false;
@@ -2849,7 +2849,7 @@ bool QString::operator<(QLatin1String other) const
*/
bool QString::operator>(QLatin1String other) const
{
- const uchar *c = (uchar *) other.latin1();
+ const uchar *c = (const uchar *) other.latin1();
if (!c || *c == '\0')
return !isEmpty();
@@ -5392,7 +5392,7 @@ int QString::compare_helper(const QChar *data1, int length1, QLatin1String s2,
{
const ushort *uc = reinterpret_cast<const ushort *>(data1);
const ushort *uce = uc + length1;
- const uchar *c = (uchar *)s2.latin1();
+ const uchar *c = (const uchar *)s2.latin1();
if (!c)
return length1;
diff --git a/src/corelib/tools/qtimezoneprivate_tz.cpp b/src/corelib/tools/qtimezoneprivate_tz.cpp
index 7c5e5bd2cf..90ce8e3b68 100644
--- a/src/corelib/tools/qtimezoneprivate_tz.cpp
+++ b/src/corelib/tools/qtimezoneprivate_tz.cpp
@@ -389,12 +389,19 @@ static int parsePosixOffset(const QByteArray &timeRule)
// Format "[+|-]hh[:mm[:ss]]"
QList<QByteArray> parts = timeRule.split(':');
int count = parts.count();
- if (count == 3)
- return (parts.at(0).toInt() * -60 * 60) + (parts.at(1).toInt() * 60) + parts.at(2).toInt();
- else if (count == 2)
- return (parts.at(0).toInt() * -60 * 60) + (parts.at(1).toInt() * 60);
- else if (count == 1)
- return (parts.at(0).toInt() * -60 * 60);
+ if (count == 3) {
+ int hour = parts.at(0).toInt();
+ int sign = hour >= 0 ? -1 : 1;
+ return sign * ((qAbs(hour) * 60 * 60) + (parts.at(1).toInt() * 60) + parts.at(2).toInt());
+ } else if (count == 2) {
+ int hour = parts.at(0).toInt();
+ int sign = hour >= 0 ? -1 : 1;
+ return sign * ((qAbs(hour) * 60 * 60) + (parts.at(1).toInt() * 60));
+ } else if (count == 1) {
+ int hour = parts.at(0).toInt();
+ int sign = hour >= 0 ? -1 : 1;
+ return sign * (qAbs(hour) * 60 * 60);
+ }
return 0;
}
diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp
index bbd751efd0..13c84db9ae 100644
--- a/src/corelib/xml/qxmlstream.cpp
+++ b/src/corelib/xml/qxmlstream.cpp
@@ -2396,6 +2396,12 @@ QXmlStreamAttribute& QXmlStreamAttribute::operator=(const QXmlStreamAttribute &o
*/
/*!
+ \fn QXmlStreamAttributes::QXmlStreamAttributes()
+
+ A constructor for QXmlStreamAttributes.
+*/
+
+/*!
\typedef QXmlStreamNotationDeclarations
\relates QXmlStreamNotationDeclaration
diff --git a/src/dbus/qdbusunixfiledescriptor.cpp b/src/dbus/qdbusunixfiledescriptor.cpp
index 77f48c03a4..6b167458b9 100644
--- a/src/dbus/qdbusunixfiledescriptor.cpp
+++ b/src/dbus/qdbusunixfiledescriptor.cpp
@@ -174,7 +174,7 @@ QDBusUnixFileDescriptor &QDBusUnixFileDescriptor::operator=(const QDBusUnixFileD
}
/*!
- \fn QDBusUnixFileDescriptor &operator=(QDBusUnixFileDescriptor &&other)
+ \fn QDBusUnixFileDescriptor &QDBusUnixFileDescriptor::operator=(QDBusUnixFileDescriptor &&other)
Move-assigns \a other to this QDBusUnixFileDescriptor.
*/
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp
index dc6933f9ff..50a4a09102 100644
--- a/src/gui/accessible/qaccessible.cpp
+++ b/src/gui/accessible/qaccessible.cpp
@@ -1387,10 +1387,18 @@ QAccessible::Id QAccessibleEvent::uniqueId() const
*/
/*! \fn QAccessibleValueChangeEvent::QAccessibleValueChangeEvent(QObject *object, const QVariant &value)
+
Constructs a new QAccessibleValueChangeEvent for \a object.
The event contains the new \a value.
*/
+/*! \fn QAccessibleValueChangeEvent::QAccessibleValueChangeEvent(QAccessibleInterface *iface, const QVariant &val)
+
+ Constructs a new QAccessibleValueChangeEvent for \a iface.
+ The event contains the new value \a val.
+*/
+
/*! \fn void QAccessibleValueChangeEvent::setValue(const QVariant & value)
+
Sets the new \a value for this event.
*/
/*!
@@ -1419,11 +1427,13 @@ QAccessibleValueChangeEvent::~QAccessibleValueChangeEvent()
\sa QAccessibleInterface::state()
*/
/*! \fn QAccessibleStateChangeEvent::QAccessibleStateChangeEvent(QObject *object, QAccessible::State state)
+
Constructs a new QAccessibleStateChangeEvent for \a object.
The difference to the object's previous state is in \a state.
*/
/*!
\fn QAccessibleStateChangeEvent::QAccessibleStateChangeEvent(QAccessibleInterface *iface, QAccessible::State state)
+
Constructs a new QAccessibleStateChangeEvent.
\a iface is the interface associated with the event
\a state is the state of the accessible object.
@@ -1432,8 +1442,8 @@ QAccessibleValueChangeEvent::~QAccessibleValueChangeEvent()
\fn QAccessible::State QAccessibleStateChangeEvent::changedStates() const
\brief Returns the states that have been changed.
- Be aware that the returned states are the ones that have changed,
- to find out about the state of an object, use QAccessibleInterface::state().
+ Keep in mind that the returned states are the ones that have changed.
+ To find out about the state of an object, use QAccessibleInterface::state().
For example, if an object used to have the focus but loses it,
the object's state will have focused set to \c false. This event on the
@@ -1462,7 +1472,7 @@ QAccessibleStateChangeEvent::~QAccessibleStateChangeEvent()
*/
/*! \enum QAccessibleTableModelChangeEvent::ModelChangeType
- This enum describes different types of changes in the table model.
+ This enum describes the different types of changes in the table model.
\value ModelReset The model has been reset, all previous knowledge about the model is now invalid.
\value DataChanged No cells have been added or removed, but the data of the specified cell range is invalid.
\value RowsInserted New rows have been inserted.
@@ -1471,47 +1481,62 @@ QAccessibleStateChangeEvent::~QAccessibleStateChangeEvent()
\value ColumnsRemoved Columns have been removed.
*/
/*! \fn QAccessibleTableModelChangeEvent::QAccessibleTableModelChangeEvent(QObject *object, ModelChangeType changeType)
+
Constructs a new QAccessibleTableModelChangeEvent for \a object of with \a changeType.
*/
/*! \fn int QAccessibleTableModelChangeEvent::firstColumn() const
+
Returns the first changed column.
*/
/*! \fn int QAccessibleTableModelChangeEvent::firstRow() const
+
Returns the first changed row.
*/
/*! \fn int QAccessibleTableModelChangeEvent::lastColumn() const
+
Returns the last changed column.
*/
/*! \fn int QAccessibleTableModelChangeEvent::lastRow() const
+
Returns the last changed row.
*/
/*! \fn QAccessibleTableModelChangeEvent::ModelChangeType QAccessibleTableModelChangeEvent::modelChangeType() const
+
Returns the type of change.
*/
/*! \fn void QAccessibleTableModelChangeEvent::setFirstColumn(int column)
+
Sets the first changed \a column.
*/
/*! \fn void QAccessibleTableModelChangeEvent::setFirstRow(int row)
+
Sets the first changed \a row.
*/
/*! \fn void QAccessibleTableModelChangeEvent::setLastColumn(int column)
+
Sets the last changed \a column.
*/
/*! \fn void QAccessibleTableModelChangeEvent::setLastRow(int row)
+
Sets the last changed \a row.
*/
/*! \fn void QAccessibleTableModelChangeEvent::setModelChangeType(ModelChangeType changeType)
+
Sets the type of change to \a changeType.
*/
/*!
+ \fn QAccessibleTableModelChangeEvent::QAccessibleTableModelChangeEvent(QAccessibleInterface *iface, ModelChangeType changeType)
+
+ Constructs a new QAccessibleTableModelChangeEvent for interface \a iface with a model
+ change type \a changeType.
+*/
+/*!
\internal
*/
QAccessibleTableModelChangeEvent::~QAccessibleTableModelChangeEvent()
{
// must be empty until ### Qt 6
}
-
-
/*!
\class QAccessibleTextCursorEvent
\ingroup accessibility
@@ -1521,14 +1546,17 @@ QAccessibleTableModelChangeEvent::~QAccessibleTableModelChangeEvent()
This class is used with \l QAccessible::updateAccessibility().
*/
-/*! \fn QAccessibleTextCursorEvent::QAccessibleTextCursorEvent(QObject *object, int cursorPosition)
+/*! \fn QAccessibleTextCursorEvent::QAccessibleTextCursorEvent(QObject *object, int cursorPos)
+
Create a new QAccessibleTextCursorEvent for \a object.
- The \a cursorPosition is the new cursor position.
+ The \a cursorPos is the new cursor position.
*/
/*! \fn int QAccessibleTextCursorEvent::cursorPosition() const
+
Returns the cursor position.
*/
/*! \fn void QAccessibleTextCursorEvent::setCursorPosition(int position)
+
Sets the cursor \a position for this event.
*/
/*!
@@ -1541,6 +1569,13 @@ QAccessibleTextCursorEvent::~QAccessibleTextCursorEvent()
/*!
+ \fn QAccessibleTextCursorEvent(QAccessibleInterface *iface, int cursorPos)
+
+ Create a new QAccessibleTextCursorEvent for \a iface,
+ The \a cursorPos is the new cursor position.
+*/
+
+/*!
\class QAccessibleTextInsertEvent
\ingroup accessibility
\inmodule QtGui
@@ -1550,6 +1585,7 @@ QAccessibleTextCursorEvent::~QAccessibleTextCursorEvent()
This class is used with \l QAccessible::updateAccessibility().
*/
/*! \fn QAccessibleTextInsertEvent::QAccessibleTextInsertEvent(QObject *object, int position, const QString &text)
+
Constructs a new QAccessibleTextInsertEvent event for \a object.
The \a text has been inserted at \a position.
By default, it is assumed that the cursor has moved to the end
@@ -1557,9 +1593,11 @@ QAccessibleTextCursorEvent::~QAccessibleTextCursorEvent()
set it with \l QAccessibleTextCursorEvent::setCursorPosition() for this event.
*/
/*! \fn int QAccessibleTextInsertEvent::changePosition() const
+
Returns the position where the text was inserted.
*/
/*! \fn QString QAccessibleTextInsertEvent::textInserted() const
+
Returns the text that has been inserted.
*/
/*!
@@ -1581,17 +1619,28 @@ QAccessibleTextInsertEvent::~QAccessibleTextInsertEvent()
This class is used with \l QAccessible::updateAccessibility().
*/
/*! \fn QAccessibleTextRemoveEvent::QAccessibleTextRemoveEvent(QObject *object, int position, const QString &text)
+
Constructs a new QAccessibleTextRemoveEvent event for \a object.
The \a text has been removed at \a position.
By default it is assumed that the cursor has moved to \a position.
If that is not the case, one needs to manually
set it with \l QAccessibleTextCursorEvent::setCursorPosition() for this event.
*/
+/*! \fn QAccessibleTextRemoveEvent::QAccessibleTextRemoveEvent(QAccessibleInterface *iface, int position, const QString &text)
+
+ Constructs a new QAccessibleTextRemoveEvent event for \a iface.
+ The \a text has been removed at \a position.
+ By default it is assumed that the cursor has moved to \a position.
+ If that is not the case, one needs to manually
+ set it with \l QAccessibleTextCursorEvent::setCursorPosition() for this event.
+*/
/*! \fn int QAccessibleTextRemoveEvent::changePosition() const
+
Returns the position where the text was removed.
*/
/*! \fn QString QAccessibleTextRemoveEvent::textRemoved() const
+
Returns the text that has been removed.
*/
/*!
@@ -1603,6 +1652,31 @@ QAccessibleTextRemoveEvent::~QAccessibleTextRemoveEvent()
}
/*!
+ \fn QAccessibleTextSelectionEvent::QAccessibleTextSelectionEvent(QAccessibleInterface *iface, int start, int end)
+
+ Constructs a new QAccessibleTextSelectionEvent for \a iface. The new selection this
+ event notifies about is from position \a start to \a end.
+*/
+
+/*!
+ \fn QAccessibleTextInsertEvent::QAccessibleTextInsertEvent(QAccessibleInterface *iface, int position, const QString &text)
+
+ Constructs a new QAccessibleTextInsertEvent event for \a iface. The text has been inserted at
+ \a position.
+*/
+
+/*!
+ \fn inline QAccessibleTextUpdateEvent::QAccessibleTextUpdateEvent(QAccessibleInterface *iface, int position, const QString &oldText,
+ const QString &text)
+
+ Constructs a new QAccessibleTextUpdateEvent for \a iface. The text change takes place at
+ \a position where the \a oldText was removed and \a text inserted instead.
+
+*/
+
+
+
+/*!
\class QAccessibleTextUpdateEvent
\ingroup accessibility
\inmodule QtGui
@@ -1615,16 +1689,20 @@ QAccessibleTextRemoveEvent::~QAccessibleTextRemoveEvent()
This class is used with \l QAccessible::updateAccessibility().
*/
/*! \fn QAccessibleTextUpdateEvent::QAccessibleTextUpdateEvent(QObject *object, int position, const QString &oldText, const QString &text)
+
Constructs a new QAccessibleTextUpdateEvent for \a object.
The text change takes place at \a position where the \a oldText was removed and \a text inserted instead.
*/
/*! \fn int QAccessibleTextUpdateEvent::changePosition() const
+
Returns where the change took place.
*/
/*! \fn QString QAccessibleTextUpdateEvent::textInserted() const
+
Returns the inserted text.
*/
/*! \fn QString QAccessibleTextUpdateEvent::textRemoved() const
+
Returns the removed text.
*/
/*!
@@ -1646,16 +1724,20 @@ QAccessibleTextUpdateEvent::~QAccessibleTextUpdateEvent()
This class is used with \l QAccessible::updateAccessibility().
*/
/*! \fn QAccessibleTextSelectionEvent::QAccessibleTextSelectionEvent(QObject *object, int start, int end)
+
Constructs a new QAccessibleTextSelectionEvent for \a object.
The new selection this event notifies about is from position \a start to \a end.
*/
/*! \fn int QAccessibleTextSelectionEvent::selectionEnd() const
+
Returns the position of the last selected character.
*/
/*! \fn int QAccessibleTextSelectionEvent::selectionStart() const
+
Returns the position of the first selected character.
*/
/*! \fn void QAccessibleTextSelectionEvent::setSelection(int start, int end)
+
Sets the selection for this event from position \a start to \a end.
*/
/*!
@@ -1903,6 +1985,7 @@ QDebug operator<<(QDebug d, const QAccessibleEvent &ev)
*/
/*!
+
Destroys the QAccessibleTextInterface.
*/
QAccessibleTextInterface::~QAccessibleTextInterface()
@@ -1912,6 +1995,7 @@ QAccessibleTextInterface::~QAccessibleTextInterface()
/*!
\fn void QAccessibleTextInterface::addSelection(int startOffset, int endOffset)
+
Select the text from \a startOffset to \a endOffset.
The \a startOffset is the first character that will be selected.
The \a endOffset is the first character that will not be selected.
@@ -1924,6 +2008,7 @@ QAccessibleTextInterface::~QAccessibleTextInterface()
/*!
\fn QString QAccessibleTextInterface::attributes(int offset, int *startOffset, int *endOffset) const
+
Returns the text attributes at the position \a offset.
In addition the range of the attributes is returned in \a startOffset and \a endOffset.
*/
@@ -1936,6 +2021,7 @@ QAccessibleTextInterface::~QAccessibleTextInterface()
/*!
\fn QRect QAccessibleTextInterface::characterRect(int offset) const
+
Returns the position and size of the character at position \a offset in screen coordinates.
*/
@@ -2288,6 +2374,7 @@ QString QAccessibleTextInterface::textAtOffset(int offset, QAccessible::TextBoun
*/
/*!
+
Destroys the QAccessibleEditableTextInterface.
*/
QAccessibleEditableTextInterface::~QAccessibleEditableTextInterface()
@@ -2333,6 +2420,7 @@ QAccessibleEditableTextInterface::~QAccessibleEditableTextInterface()
/*!
Destroys the QAccessibleValueInterface.
+
*/
QAccessibleValueInterface::~QAccessibleValueInterface()
{
@@ -2415,6 +2503,7 @@ QAccessibleImageInterface::~QAccessibleImageInterface()
*/
/*!
+
Destroys the QAccessibleTableCellInterface.
*/
QAccessibleTableCellInterface::~QAccessibleTableCellInterface()
@@ -2424,41 +2513,49 @@ QAccessibleTableCellInterface::~QAccessibleTableCellInterface()
/*!
\fn virtual int QAccessibleTableCellInterface::columnExtent() const
+
Returns the number of columns occupied by this cell accessible.
*/
/*!
\fn virtual QList<QAccessibleInterface*> QAccessibleTableCellInterface::columnHeaderCells() const
+
Returns the column headers as an array of cell accessibles.
*/
/*!
\fn virtual int QAccessibleTableCellInterface::columnIndex() const
+
Translates this cell accessible into the corresponding column index.
*/
/*!
\fn virtual int QAccessibleTableCellInterface::rowExtent() const
+
Returns the number of rows occupied by this cell accessible.
*/
/*!
\fn virtual QList<QAccessibleInterface*> QAccessibleTableCellInterface::rowHeaderCells() const
+
Returns the row headers as an array of cell accessibles.
*/
/*!
\fn virtual int QAccessibleTableCellInterface::rowIndex() const
+
Translates this cell accessible into the corresponding row index.
*/
/*!
\fn virtual bool QAccessibleTableCellInterface::isSelected() const
+
Returns a boolean value indicating whether this cell is selected.
*/
/*!
\fn virtual QAccessibleInterface *QAccessibleTableCellInterface::table() const
+
Returns the QAccessibleInterface of the table containing this cell.
*/
@@ -2474,6 +2571,7 @@ QAccessibleTableCellInterface::~QAccessibleTableCellInterface()
*/
/*!
+
Destroys the QAccessibleTableInterface.
*/
QAccessibleTableInterface::~QAccessibleTableInterface()
@@ -2483,100 +2581,119 @@ QAccessibleTableInterface::~QAccessibleTableInterface()
/*!
\fn virtual QAccessibleInterface *QAccessibleTableInterface::cellAt(int row, int column) const
+
Returns the cell at the specified \a row and \a column in the table.
*/
/*!
\fn virtual QAccessibleInterface *QAccessibleTableInterface::caption() const
+
Returns the caption for the table.
*/
/*!
\fn virtual QString QAccessibleTableInterface::columnDescription(int column) const
+
Returns the description text of the specified \a column in the table.
*/
/*!
\fn virtual int QAccessibleTableInterface::columnCount() const
+
Returns the total number of columns in table.
*/
/*!
\fn virtual int QAccessibleTableInterface::rowCount() const
+
Returns the total number of rows in table.
*/
/*!
\fn virtual int QAccessibleTableInterface::selectedCellCount() const
+
Returns the total number of selected cells.
*/
/*!
\fn virtual int QAccessibleTableInterface::selectedColumnCount() const
+
Returns the total number of selected columns.
*/
/*!
\fn virtual int QAccessibleTableInterface::selectedRowCount() const
+
Returns the total number of selected rows.
*/
/*!
\fn virtual QString QAccessibleTableInterface::rowDescription(int row) const
+
Returns the description text of the specified \a row in the table.
*/
/*!
\fn virtual QList<int> QAccessibleTableInterface::selectedCells() const
+
Returns the list of selected cell (by their index as \l QAccessibleInterface::child() accepts).
*/
/*!
\fn virtual QList<int> QAccessibleTableInterface::selectedColumns() const
+
Returns the list of currently selected columns.
*/
/*!
\fn virtual QList<int> QAccessibleTableInterface::selectedRows() const
+
Returns the list of currently selected columns.
*/
/*!
\fn virtual QAccessibleInterface *QAccessibleTableInterface::summary() const
+
Returns a QAccessibleInterface that represents a summary of the table.
This function may return 0 if no such interface exists.
*/
/*!
\fn virtual bool QAccessibleTableInterface::isColumnSelected(int column) const
+
Returns a boolean value indicating whether the specified \a column is completely selected.
*/
/*!
\fn virtual bool QAccessibleTableInterface::isRowSelected(int row) const
+
Returns a boolean value indicating whether the specified \a row is completely selected.
*/
/*!
\fn virtual bool QAccessibleTableInterface::selectRow(int row)
+
Selects \a row. This function might unselect all previously selected rows.
Returns \c true if the selection was successful.
*/
/*!
\fn virtual bool QAccessibleTableInterface::selectColumn(int column)
+
Selects \a column. This function might unselect all previously selected columns.
Returns \c true if the selection was successful.
*/
/*!
\fn virtual bool QAccessibleTableInterface::unselectRow(int row)
+
Unselects \a row, leaving other selected rows selected (if any).
Returns \c true if the selection was successful.
*/
/*!
\fn virtual bool QAccessibleTableInterface::unselectColumn(int column)
+
Unselects \a column, leaving other selected columns selected (if any).
Returns \c true if the selection was successful.
*/
@@ -2630,6 +2747,7 @@ QAccessibleTableInterface::~QAccessibleTableInterface()
*/
/*!
+
Destroys the QAccessibleActionInterface.
*/
QAccessibleActionInterface::~QAccessibleActionInterface()
diff --git a/src/gui/image/qgifhandler.pri b/src/gui/image/qgifhandler.pri
index 6eb0751372..ec33101451 100644
--- a/src/gui/image/qgifhandler.pri
+++ b/src/gui/image/qgifhandler.pri
@@ -1,4 +1,3 @@
# common to plugin and built-in forms
-INCLUDEPATH *= $$PWD
HEADERS += $$PWD/qgifhandler_p.h
SOURCES += $$PWD/qgifhandler.cpp
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp
index 6b506580ea..7a59adffb8 100644
--- a/src/gui/image/qicon.cpp
+++ b/src/gui/image/qicon.cpp
@@ -629,6 +629,13 @@ QIcon::QIcon(const QIcon &other)
}
/*!
+ \fn QIcon::QIcon(QIcon &&other)
+
+ Move-constructs a QIcon instance, making it point to the same object
+ that \a other was pointing to.
+*/
+
+/*!
Constructs an icon from the file with the given \a fileName. The
file will be loaded on demand.
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index b8606a92b4..aea6fc133f 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -572,12 +572,13 @@ bool QImageData::checkForAlphaPixels() const
\endtable
+ \target qimage-legalese
\section1 Legal Information
For smooth scaling, the transformed() functions use code based on
smooth scaling algorithm by Daniel M. Duley.
- \legalese
+ \badcode
Copyright (C) 2004, 2005 Daniel M. Duley
Redistribution and use in source and binary forms, with or without
@@ -600,7 +601,7 @@ bool QImageData::checkForAlphaPixels() const
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- \endlegalese
+ \endcode
\sa QImageReader, QImageWriter, QPixmap, QSvgRenderer, {Image Composition Example},
{Image Viewer Example}, {Scribble Example}, {Pixelator Example}
@@ -4359,6 +4360,10 @@ int QImage::bitPlaneCount() const
return bpc;
}
+/*!
+ Returns a smoothly scaled copy of the image. The returned image has a size
+ of width \a w by height \a h pixels.
+*/
QImage QImage::smoothScaled(int w, int h) const {
QImage src = *this;
switch (src.format()) {
diff --git a/src/gui/image/qjpeghandler.pri b/src/gui/image/qjpeghandler.pri
index c8de33d8b4..de40c6742e 100644
--- a/src/gui/image/qjpeghandler.pri
+++ b/src/gui/image/qjpeghandler.pri
@@ -1,5 +1,4 @@
# common to plugin and built-in forms
-INCLUDEPATH *= $$PWD
HEADERS += $$PWD/qjpeghandler_p.h
SOURCES += $$PWD/qjpeghandler.cpp
contains(QT_CONFIG, system-jpeg) {
diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp
index 0fefa1f7ea..71a79745e8 100644
--- a/src/gui/image/qpixmapcache.cpp
+++ b/src/gui/image/qpixmapcache.cpp
@@ -659,4 +659,18 @@ int QPixmapCache::totalUsed()
return (pm_cache()->totalCost()+1023) / 1024;
}
+/*!
+ \fn QPixmapCache::KeyData::KeyData()
+
+ \internal
+*/
+/*!
+ \fn QPixmapCache::KeyData::KeyData(const KeyData &other)
+ \internal
+*/
+/*!
+ \fn QPixmapCache::KeyData::~KeyData()
+
+ \internal
+*/
QT_END_NAMESPACE
diff --git a/src/gui/image/qpnghandler.pri b/src/gui/image/qpnghandler.pri
index aca7e2c568..9ab175d628 100644
--- a/src/gui/image/qpnghandler.pri
+++ b/src/gui/image/qpnghandler.pri
@@ -1,4 +1,3 @@
-INCLUDEPATH *= $$PWD
HEADERS += $$PWD/qpnghandler_p.h
SOURCES += $$PWD/qpnghandler.cpp
contains(QT_CONFIG, system-png) {
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index adbaa5ff86..3873976144 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -83,6 +83,52 @@ QEnterEvent::~QEnterEvent()
}
/*!
+ \fn QPoint QEnterEvent::globalPos() const
+
+ Returns the global position of the widget \e{at the time of the event}.
+*/
+/*!
+ \fn int QEnterEvent::globalX() const
+
+ Returns the global position on the X-axis of the mouse cursor relative to the the widget.
+*/
+/*!
+ \fn int QEnterEvent::globalY() const
+
+ Returns the global position on the Y-axis of the mouse cursor relative to the the widget.
+*/
+/*!
+ \fn QPoint QEnterEvent::localPos() const
+
+ Returns the mouse cursor's position relative to the receiving widget.
+*/
+/*!
+ \fn QPoint QEnterEvent::pos() const
+
+ Returns the position of the mouse cursor in global screen coordinates.
+*/
+/*!
+ \fn QPoint QEnterEvent::screenPos() const
+
+ Returns the position of the mouse cursor relative to the receiving screen.
+*/
+/*!
+ \fn QPoint QEnterEvent::windowPos() const
+
+ Returns the position of the mouse cursor relative to the receiving window.
+*/
+/*!
+ \fn int QEnterEvent::x() const
+
+ Returns the x position of the mouse cursor relative to the receiving widget.
+*/
+/*!
+ \fn int QEnterEvent::y() const
+
+ Returns the y position of the mouse cursor relative to the receiving widget.
+*/
+
+/*!
\class QInputEvent
\ingroup events
\inmodule QtGui
@@ -4196,6 +4242,12 @@ QTouchEvent::~QTouchEvent()
\sa QTouchDevice::type(), QTouchEvent::device()
*/
+/*! \fn QTouchEvent::TouchPoint::TouchPoint(TouchPoint &&other)
+
+ Move-constructs a TouchPoint instance, making it point to the same
+ object that \a other was pointing to.
+*/
+
/*! \fn Qt::TouchPointStates QTouchEvent::touchPointStates() const
Returns a bitwise OR of all the touch point states for this event.
@@ -4723,6 +4775,10 @@ void QTouchEvent::TouchPoint::setFlags(InfoFlags flags)
*/
/*!
+ \fn TouchPoint &TouchPoint::operator=(TouchPoint &&other)
+ \internal
+ */
+/*!
\fn void QTouchEvent::TouchPoint::swap(TouchPoint &other);
\internal
*/
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 54bd654ce5..f240153f9f 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1898,8 +1898,14 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE
#if !defined(Q_OS_OSX)
// On OS X the shortcut override is checked earlier, see: QWindowSystemInterface::handleKeyEvent()
const bool checkShortcut = e->keyType == QEvent::KeyPress && window != 0;
- if (checkShortcut && QWindowSystemInterface::tryHandleShortcutEvent(window, e->timestamp, e->key, e->modifiers, e->unicode, e->repeat, e->repeatCount))
- return;
+ if (checkShortcut) {
+ QKeyEvent override(QEvent::ShortcutOverride, e->key, e->modifiers,
+ e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers,
+ e->unicode, e->repeat, e->repeatCount);
+ override.setTimestamp(e->timestamp);
+ if (QWindowSystemInterface::tryHandleShortcutOverrideEvent(window, &override))
+ return;
+ }
#endif // Q_OS_OSX
QKeyEvent ev(e->keyType, e->key, e->modifiers,
diff --git a/src/gui/kernel/qsessionmanager.cpp b/src/gui/kernel/qsessionmanager.cpp
index b54b7b468c..f4b56fd01b 100644
--- a/src/gui/kernel/qsessionmanager.cpp
+++ b/src/gui/kernel/qsessionmanager.cpp
@@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
\class QSessionManager
\brief The QSessionManager class provides access to the session manager.
- \inmodule QtWidgets
+ \inmodule QtGui
A session manager in a desktop environment (in which Qt GUI applications
live) keeps track of a session, which is a group of running applications,
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp
index 5877467830..3ab2f59661 100644
--- a/src/gui/kernel/qwindowsysteminterface.cpp
+++ b/src/gui/kernel/qwindowsysteminterface.cpp
@@ -227,6 +227,22 @@ bool QWindowSystemInterface::tryHandleShortcutEvent(QWindow *w, ulong timestamp,
#endif
}
+bool QWindowSystemInterface::tryHandleShortcutOverrideEvent(QWindow *w, QKeyEvent *ev)
+{
+#ifndef QT_NO_SHORTCUT
+ Q_ASSERT(ev->type() == QKeyEvent::ShortcutOverride);
+
+ QObject *focus = w->focusObject();
+ if (!focus)
+ focus = w;
+ return QGuiApplicationPrivate::instance()->shortcutMap.tryShortcutEvent(focus, ev);
+#else
+ Q_UNUSED(w)
+ Q_UNUSED(ev)
+ return false;
+#endif
+}
+
// used by QTestLib to directly send shortcuts to objects
bool QWindowSystemInterface::tryHandleShortcutEventToObject(QObject *o, ulong timestamp, int k, Qt::KeyboardModifiers mods,
const QString &text, bool autorep, ushort count)
diff --git a/src/gui/kernel/qwindowsysteminterface.h b/src/gui/kernel/qwindowsysteminterface.h
index 7ad491cdac..453dbe81cf 100644
--- a/src/gui/kernel/qwindowsysteminterface.h
+++ b/src/gui/kernel/qwindowsysteminterface.h
@@ -78,6 +78,8 @@ public:
Qt::KeyboardModifiers mods = Qt::NoModifier,
Qt::MouseEventSource source = Qt::MouseEventNotSynthesized);
+ static bool tryHandleShortcutOverrideEvent(QWindow *w, QKeyEvent *ev);
+
static bool tryHandleShortcutEvent(QWindow *w, int k, Qt::KeyboardModifiers mods,
const QString & text = QString(), bool autorep = false, ushort count = 1);
static bool tryHandleShortcutEvent(QWindow *w, ulong timestamp, int k, Qt::KeyboardModifiers mods,
diff --git a/src/gui/math3d/qgenericmatrix.cpp b/src/gui/math3d/qgenericmatrix.cpp
index 7b46bb452c..2c9dfd8bb5 100644
--- a/src/gui/math3d/qgenericmatrix.cpp
+++ b/src/gui/math3d/qgenericmatrix.cpp
@@ -69,12 +69,6 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn QGenericMatrix::QGenericMatrix(const QGenericMatrix<N, M, T>& other)
-
- Constructs a copy of \a other.
-*/
-
-/*!
\fn QGenericMatrix::QGenericMatrix(const T *values)
Constructs a matrix from the given N * M floating-point \a values.
diff --git a/src/gui/opengl/qopengldebug.cpp b/src/gui/opengl/qopengldebug.cpp
index e747372df9..8b2ffb1a20 100644
--- a/src/gui/opengl/qopengldebug.cpp
+++ b/src/gui/opengl/qopengldebug.cpp
@@ -916,6 +916,12 @@ QOpenGLDebugMessage &QOpenGLDebugMessage::operator=(const QOpenGLDebugMessage &d
}
/*!
+ \fn QOpenGLDebugMessage &QOpenGLDebugMessage::operator=(QOpenGLDebugMessage &&debugMessage)
+
+ Move-assigns \a debugMessage to this object.
+*/
+
+/*!
\fn void QOpenGLDebugMessage::swap(QOpenGLDebugMessage &debugMessage)
Swaps the message \a debugMessage with this message. This operation is very
diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp
index 9b82233b9a..301b2ad13d 100644
--- a/src/gui/opengl/qopengltexture.cpp
+++ b/src/gui/opengl/qopengltexture.cpp
@@ -179,8 +179,9 @@ void QOpenGLTexturePrivate::destroy()
// not created or already destroyed
return;
}
- if (QOpenGLContext::currentContext() != context) {
- qWarning("Requires a valid current OpenGL context.\n"
+ QOpenGLContext *currentContext = QOpenGLContext::currentContext();
+ if (!currentContext || !QOpenGLContext::areSharing(currentContext, context)) {
+ qWarning("Texture is not valid in the current context.\n"
"Texture has not been destroyed");
return;
}
diff --git a/src/gui/opengl/qopenglversionfunctions.cpp b/src/gui/opengl/qopenglversionfunctions.cpp
index 346a526054..17cd55720a 100644
--- a/src/gui/opengl/qopenglversionfunctions.cpp
+++ b/src/gui/opengl/qopenglversionfunctions.cpp
@@ -186,11 +186,17 @@ void QAbstractOpenGLFunctionsPrivate::removeExternalFunctions(QOpenGLContext *co
\sa QOpenGLContext::versionFunctions()
*/
+/*!
+ Constructs a QAbstractOpenGLFunctions object.
+*/
QAbstractOpenGLFunctions::QAbstractOpenGLFunctions()
: d_ptr(new QAbstractOpenGLFunctionsPrivate)
{
}
+/*!
+ Destroys a QAbstractOpenGLFunctions object.
+*/
QAbstractOpenGLFunctions::~QAbstractOpenGLFunctions()
{
Q_D(QAbstractOpenGLFunctions);
@@ -228,12 +234,16 @@ bool QAbstractOpenGLFunctions::isInitialized() const
return d->initialized;
}
+/*! \internal
+ */
void QAbstractOpenGLFunctions::setOwningContext(const QOpenGLContext *context)
{
Q_D(QAbstractOpenGLFunctions);
d->owningContext = const_cast<QOpenGLContext*>(context);
}
+/*! \internal
+ */
QOpenGLContext *QAbstractOpenGLFunctions::owningContext() const
{
Q_D(const QAbstractOpenGLFunctions);
diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp
index 4136c29d4e..68ed3eae6e 100644
--- a/src/gui/painting/qbackingstore.cpp
+++ b/src/gui/painting/qbackingstore.cpp
@@ -235,16 +235,27 @@ bool QBackingStore::scroll(const QRegion &area, int dx, int dy)
return d_ptr->platformBackingStore->scroll(QHighDpi::toNativeLocalRegion(area, d_ptr->window), QHighDpi::toNativePixels(dx, d_ptr->window), QHighDpi::toNativePixels(dy, d_ptr->window));
}
+/*!
+ Set \a region as the static contents of this window.
+*/
void QBackingStore::setStaticContents(const QRegion &region)
{
d_ptr->staticContents = region;
}
+/*!
+ Returns a pointer to the QRegion that has the static contents
+ of this window.
+*/
QRegion QBackingStore::staticContents() const
{
return d_ptr->staticContents;
}
+/*!
+ Returns a boolean indicating if this window
+ has static contents or not.
+*/
bool QBackingStore::hasStaticContents() const
{
return !d_ptr->staticContents.isEmpty();
@@ -297,6 +308,9 @@ void Q_GUI_EXPORT qt_scrollRectInImage(QImage &img, const QRect &rect, const QPo
}
}
+/*!
+ Returns a pointer to the QPlatformBackingStore implementation
+*/
QPlatformBackingStore *QBackingStore::handle() const
{
return d_ptr->platformBackingStore;
diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp
index d6eb8d8a48..9e039b7ae4 100644
--- a/src/gui/painting/qbrush.cpp
+++ b/src/gui/painting/qbrush.cpp
@@ -35,7 +35,7 @@
#include "qpixmap.h"
#include "qbitmap.h"
#include "qpixmapcache.h"
-#include "qplatformpixmap.h"
+#include <qpa/qplatformpixmap.h>
#include "qdatastream.h"
#include "qvariant.h"
#include "qline.h"
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 28a6276746..6b8136c52d 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -3277,6 +3277,10 @@ bool QRasterPaintEngine::requiresPretransformedGlyphPositions(QFontEngine *fontE
return QPaintEngineEx::requiresPretransformedGlyphPositions(fontEngine, m);
}
+/*!
+ Indicates whether glyph caching is supported by the font engine
+ \a fontEngine with the given transform \a m applied.
+*/
bool QRasterPaintEngine::shouldDrawCachedGlyphs(QFontEngine *fontEngine, const QTransform &m) const
{
// The raster engine does not support projected cached glyph drawing
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index eb9cfcac2a..0814e0494d 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -2012,8 +2012,8 @@ int QPdfEnginePrivate::createShadingFunction(const QGradient *gradient, int from
if (reflect && step % 2) {
for (int i = stops.size() - 1; i > 0; --i) {
QGradientBound b;
- b.start = step + 1 - qBound(0., stops.at(i).first, 1.);
- b.stop = step + 1 - qBound(0., stops.at(i - 1).first, 1.);
+ b.start = step + 1 - qBound(qreal(0.), stops.at(i).first, qreal(1.));
+ b.stop = step + 1 - qBound(qreal(0.), stops.at(i - 1).first, qreal(1.));
b.function = functions.at(i - 1);
b.reverse = true;
gradientBounds << b;
@@ -2021,8 +2021,8 @@ int QPdfEnginePrivate::createShadingFunction(const QGradient *gradient, int from
} else {
for (int i = 0; i < stops.size() - 1; ++i) {
QGradientBound b;
- b.start = step + qBound(0., stops.at(i).first, 1.);
- b.stop = step + qBound(0., stops.at(i + 1).first, 1.);
+ b.start = step + qBound(qreal(0.), stops.at(i).first, qreal(1.));
+ b.stop = step + qBound(qreal(0.), stops.at(i + 1).first, qreal(1.));
b.function = functions.at(i);
b.reverse = false;
gradientBounds << b;
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index 0b0940855d..80908122a8 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -72,12 +72,14 @@ QT_BEGIN_NAMESPACE
#define SMOOTH_SCALABLE 0xffff
+#if defined(QT_BUILD_INTERNAL)
bool qt_enable_test_font = false;
Q_AUTOTEST_EXPORT void qt_setQtEnableTestFont(bool value)
{
qt_enable_test_font = value;
}
+#endif
static int getFontWeight(const QString &weightString)
{
@@ -756,7 +758,47 @@ QString qt_resolveFontFamilyAlias(const QString &alias)
return alias;
}
-static QStringList fallbackFamilies(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script)
+QStringList QPlatformFontDatabase::fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const
+{
+ Q_UNUSED(family);
+ Q_UNUSED(styleHint);
+
+ QStringList retList;
+
+ size_t writingSystem = std::find(scriptForWritingSystem,
+ scriptForWritingSystem + QFontDatabase::WritingSystemsCount,
+ script) - scriptForWritingSystem;
+ if (writingSystem >= QFontDatabase::WritingSystemsCount)
+ writingSystem = QFontDatabase::Any;
+
+ QFontDatabasePrivate *db = privateDb();
+ for (int i = 0; i < db->count; ++i) {
+ QtFontFamily *f = db->families[i];
+
+ f->ensurePopulated();
+
+ if (writingSystem > QFontDatabase::Any && f->writingSystems[writingSystem] != QtFontFamily::Supported)
+ continue;
+
+ for (int j = 0; j < f->count; ++j) {
+ QtFontFoundry *foundry = f->foundries[j];
+
+ for (int k = 0; k < foundry->count; ++k) {
+ if (style == foundry->styles[k]->key.style) {
+ if (foundry->name.isEmpty())
+ retList.append(f->name);
+ else
+ retList.append(f->name + QLatin1String(" [") + foundry->name + QLatin1Char(']'));
+ break;
+ }
+ }
+ }
+ }
+
+ return retList;
+}
+
+QStringList qt_fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script)
{
// make sure that the db has all fallback families
QStringList retList = QGuiApplicationPrivate::platformIntegration()->fontDatabase()->fallbacksForFamily(family,style,styleHint,script);
@@ -884,17 +926,19 @@ QFontEngine *loadEngine(int script, const QFontDef &request,
QFontEngine *engine = loadSingleEngine(script, request, family, foundry, style, size);
Q_ASSERT(!engine || engine->type() != QFontEngine::Multi);
if (engine && !(request.styleStrategy & QFont::NoFontMerging) && !engine->symbol) {
- QStringList fallbacks = request.fallBackFamilies;
+ QPlatformFontDatabase *pfdb = QGuiApplicationPrivate::platformIntegration()->fontDatabase();
+ QFontEngineMulti *pfMultiEngine = pfdb->fontEngineMulti(engine, QChar::Script(script));
+ if (!request.fallBackFamilies.isEmpty()) {
+ QStringList fallbacks = request.fallBackFamilies;
- QFont::StyleHint styleHint = QFont::StyleHint(request.styleHint);
- if (styleHint == QFont::AnyStyle && request.fixedPitch)
- styleHint = QFont::TypeWriter;
+ QFont::StyleHint styleHint = QFont::StyleHint(request.styleHint);
+ if (styleHint == QFont::AnyStyle && request.fixedPitch)
+ styleHint = QFont::TypeWriter;
- fallbacks += fallbackFamilies(family->name, QFont::Style(style->key.style), styleHint, QChar::Script(script));
+ fallbacks += qt_fallbacksForFamily(family->name, QFont::Style(style->key.style), styleHint, QChar::Script(script));
- QPlatformFontDatabase *pfdb = QGuiApplicationPrivate::platformIntegration()->fontDatabase();
- QFontEngineMulti *pfMultiEngine = pfdb->fontEngineMulti(engine, QChar::Script(script));
- pfMultiEngine->setFallbackFamiliesList(fallbacks);
+ pfMultiEngine->setFallbackFamiliesList(fallbacks);
+ }
engine = pfMultiEngine;
// Cache Multi font engine as well in case we got the single
@@ -2527,6 +2571,15 @@ QFontEngine *QFontDatabase::findFont(const QFontDef &request, int script)
QFontEngine *engine;
+#if defined(QT_BUILD_INTERNAL)
+ // For testing purpose only, emulates an exact-matching monospace font
+ if (qt_enable_test_font && request.family == QLatin1String("__Qt__Box__Engine__")) {
+ engine = new QTestFontEngine(request.pixelSize);
+ engine->fontDef = request;
+ return engine;
+ }
+#endif
+
// Until we specifically asked not to, try looking for Multi font engine
// first, the last '1' indicates that we want Multi font engine instead
// of single ones
@@ -2542,12 +2595,6 @@ QFontEngine *QFontDatabase::findFont(const QFontDef &request, int script)
parseFontName(request.family, foundry_name, family_name);
- if (qt_enable_test_font && request.family == QLatin1String("__Qt__Box__Engine__")) {
- engine =new QTestFontEngine(request.pixelSize);
- engine->fontDef = request;
- return engine;
- }
-
QtFontDesc desc;
QList<int> blackListed;
int index = match(script, request, family_name, foundry_name, &desc, blackListed);
@@ -2568,10 +2615,10 @@ QFontEngine *QFontDatabase::findFont(const QFontDef &request, int script)
styleHint = QFont::TypeWriter;
QStringList fallbacks = request.fallBackFamilies
- + fallbackFamilies(request.family,
- QFont::Style(request.style),
- styleHint,
- QChar::Script(script));
+ + qt_fallbacksForFamily(request.family,
+ QFont::Style(request.style),
+ styleHint,
+ QChar::Script(script));
if (script > QChar::Script_Common)
fallbacks += QString(); // Find the first font matching the specified script.
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp
index 6f5d178655..f9d924d10a 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -1590,15 +1590,15 @@ QFontEngineMulti::~QFontEngineMulti()
}
}
+QStringList qt_fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script);
+
void QFontEngineMulti::ensureFallbackFamiliesQueried()
{
- if (QPlatformIntegration *integration = QGuiApplicationPrivate::platformIntegration()) {
- const QStringList fallbackFamilies = integration->fontDatabase()->fallbacksForFamily(fontDef.family,
- QFont::Style(fontDef.style),
- QFont::AnyStyle,
- QChar::Script(m_script));
- setFallbackFamiliesList(fallbackFamilies);
- }
+ QFont::StyleHint styleHint = QFont::StyleHint(fontDef.styleHint);
+ if (styleHint == QFont::AnyStyle && fontDef.fixedPitch)
+ styleHint = QFont::TypeWriter;
+
+ setFallbackFamiliesList(qt_fallbacksForFamily(fontDef.family, QFont::Style(fontDef.style), styleHint, QChar::Script(m_script)));
}
void QFontEngineMulti::setFallbackFamiliesList(const QStringList &fallbackFamilies)
diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp
index e351d4d2c5..5bc9fe3c7f 100644
--- a/src/gui/text/qfontmetrics.cpp
+++ b/src/gui/text/qfontmetrics.cpp
@@ -208,6 +208,11 @@ QFontMetrics &QFontMetrics::operator=(const QFontMetrics &fm)
\since 5.2
*/
+/*!
+ \fn QFontMetricsF &QFontMetricsF::operator=(QFontMetricsF &&other)
+
+ Move-assigns \a other to this QFontMetricsF instance.
+*/
/*!
\fn void QFontMetrics::swap(QFontMetrics &other)
diff --git a/src/gui/text/qplatformfontdatabase.cpp b/src/gui/text/qplatformfontdatabase.cpp
index 482495302b..0695c2eff4 100644
--- a/src/gui/text/qplatformfontdatabase.cpp
+++ b/src/gui/text/qplatformfontdatabase.cpp
@@ -346,17 +346,15 @@ QFontEngine *QPlatformFontDatabase::fontEngine(const QByteArray &fontData, qreal
}
/*!
+ \fn QStringList QPlatformFontDatabase::fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const
+
Returns a list of alternative fonts for the specified \a family and
\a style and \a script using the \a styleHint given.
+
+ Default implementation returns a list of fonts for which \a style and \a script support
+ has been reported during the font database population.
*/
-QStringList QPlatformFontDatabase::fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const
-{
- Q_UNUSED(family);
- Q_UNUSED(style);
- Q_UNUSED(styleHint);
- Q_UNUSED(script);
- return QStringList();
-}
+// implemented in qfontdatabase.cpp
/*!
Adds an application font described by the font contained supplied \a fontData
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index 40cca77c26..0affd3239d 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -135,9 +135,8 @@ bool Qt::mightBeRichText(const QString& text)
return false;
}
-/*!
- \fn QString Qt::convertFromPlainText(const QString &plain, WhiteSpaceMode mode)
+/*!
Converts the plain text string \a plain to an HTML-formatted
paragraph while preserving most of its look.
diff --git a/src/network/ssl/qasn1element_p.h b/src/network/ssl/qasn1element_p.h
index 68acbe33ee..e58b974661 100644
--- a/src/network/ssl/qasn1element_p.h
+++ b/src/network/ssl/qasn1element_p.h
@@ -53,6 +53,7 @@ QT_BEGIN_NAMESPACE
#define RSA_ENCRYPTION_OID QByteArrayLiteral("1.2.840.113549.1.1.1")
#define DSA_ENCRYPTION_OID QByteArrayLiteral("1.2.840.10040.4.1")
+#define EC_ENCRYPTION_OID QByteArrayLiteral("1.2.840.10045.2.1")
class Q_AUTOTEST_EXPORT QAsn1Element
{
@@ -80,6 +81,7 @@ public:
// context specific
Context0Type = 0xA0,
+ Context1Type = 0xA1,
Context3Type = 0xA3
};
diff --git a/src/network/ssl/qsslcertificate_qt.cpp b/src/network/ssl/qsslcertificate_qt.cpp
index 2d1dd68198..a283078998 100644
--- a/src/network/ssl/qsslcertificate_qt.cpp
+++ b/src/network/ssl/qsslcertificate_qt.cpp
@@ -366,8 +366,10 @@ bool QSslCertificatePrivate::parse(const QByteArray &data)
const QByteArray oid = elem.toObjectId();
if (oid == RSA_ENCRYPTION_OID)
publicKeyAlgorithm = QSsl::Rsa;
- else if (oid == RSA_ENCRYPTION_OID)
+ else if (oid == DSA_ENCRYPTION_OID)
publicKeyAlgorithm = QSsl::Dsa;
+ else if (oid == EC_ENCRYPTION_OID)
+ publicKeyAlgorithm = QSsl::Ec;
else
publicKeyAlgorithm = QSsl::Opaque;
diff --git a/src/network/ssl/qsslkey_qt.cpp b/src/network/ssl/qsslkey_qt.cpp
index 4f68912527..c4f8df86e2 100644
--- a/src/network/ssl/qsslkey_qt.cpp
+++ b/src/network/ssl/qsslkey_qt.cpp
@@ -59,6 +59,47 @@ static const quint8 bits_table[256] = {
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
};
+// OIDs of named curves allowed in TLS as per RFCs 4492 and 7027,
+// see also https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-8
+
+typedef QMap<QByteArray, int> OidLengthMap;
+static OidLengthMap createOidMap()
+{
+ OidLengthMap oids;
+ oids.insert(oids.cend(), QByteArrayLiteral("1.2.840.10045.3.1.1"), 192); // secp192r1 a.k.a prime192v1
+ oids.insert(oids.cend(), QByteArrayLiteral("1.2.840.10045.3.1.7"), 256); // secp256r1 a.k.a prime256v1
+ oids.insert(oids.cend(), QByteArrayLiteral("1.3.132.0.1"), 193); // sect193r2
+ oids.insert(oids.cend(), QByteArrayLiteral("1.3.132.0.10"), 256); // secp256k1
+ oids.insert(oids.cend(), QByteArrayLiteral("1.3.132.0.16"), 283); // sect283k1
+ oids.insert(oids.cend(), QByteArrayLiteral("1.3.132.0.17"), 283); // sect283r1
+ oids.insert(oids.cend(), QByteArrayLiteral("1.3.132.0.26"), 233); // sect233k1
+ oids.insert(oids.cend(), QByteArrayLiteral("1.3.132.0.27"), 233); // sect233r1
+ oids.insert(oids.cend(), QByteArrayLiteral("1.3.132.0.3"), 239); // sect239k1
+ oids.insert(oids.cend(), QByteArrayLiteral("1.3.132.0.30"), 160); // secp160r2
+ oids.insert(oids.cend(), QByteArrayLiteral("1.3.132.0.31"), 192); // secp192k1
+ oids.insert(oids.cend(), QByteArrayLiteral("1.3.132.0.32"), 224); // secp224k1
+ oids.insert(oids.cend(), QByteArrayLiteral("1.3.132.0.33"), 224); // secp224r1
+ oids.insert(oids.cend(), QByteArrayLiteral("1.3.132.0.34"), 384); // secp384r1
+ oids.insert(oids.cend(), QByteArrayLiteral("1.3.132.0.35"), 521); // secp521r1
+ oids.insert(oids.cend(), QByteArrayLiteral("1.3.132.0.36"), 409); // sect409k1
+ oids.insert(oids.cend(), QByteArrayLiteral("1.3.132.0.37"), 409); // sect409r1
+ oids.insert(oids.cend(), QByteArrayLiteral("1.3.132.0.38"), 571); // sect571k1
+ oids.insert(oids.cend(), QByteArrayLiteral("1.3.132.0.39"), 571); // sect571r1
+ oids.insert(oids.cend(), QByteArrayLiteral("1.3.132.0.8"), 160); // secp160r1
+ oids.insert(oids.cend(), QByteArrayLiteral("1.3.132.0.9"), 160); // secp160k1
+ oids.insert(oids.cend(), QByteArrayLiteral("1.3.36.3.3.2.8.1.1.11"), 384); // brainpoolP384r1
+ oids.insert(oids.cend(), QByteArrayLiteral("1.3.36.3.3.2.8.1.1.13"), 521); // brainpoolP512r1
+ oids.insert(oids.cend(), QByteArrayLiteral("1.3.36.3.3.2.8.1.1.7"), 256); // brainpoolP256r1
+ return oids;
+}
+Q_GLOBAL_STATIC_WITH_ARGS(OidLengthMap, oidLengthMap, (createOidMap()))
+
+static int curveBits(const QByteArray &oid)
+{
+ const int length = oidLengthMap->value(oid);
+ return length ? length : -1;
+}
+
static int numberOfBits(const QByteArray &modulus)
{
int bits = modulus.size() * 8;
@@ -146,6 +187,12 @@ void QSslKeyPrivate::decodeDer(const QByteArray &der, bool deepClear)
if (params.isEmpty() || params[0].type() != QAsn1Element::IntegerType)
return;
keyLength = numberOfBits(params[0].value());
+ } else if (algorithm == QSsl::Ec) {
+ if (infoItems[0].toObjectId() != EC_ENCRYPTION_OID)
+ return;
+ if (infoItems[1].type() != QAsn1Element::ObjectIdentifierType)
+ return;
+ keyLength = curveBits(infoItems[1].toObjectId());
}
} else {
@@ -154,17 +201,35 @@ void QSslKeyPrivate::decodeDer(const QByteArray &der, bool deepClear)
return;
// version
- if (items[0].type() != QAsn1Element::IntegerType || items[0].value().toHex() != "00")
+ if (items[0].type() != QAsn1Element::IntegerType)
return;
+ const QByteArray versionHex = items[0].value().toHex();
if (algorithm == QSsl::Rsa) {
+ if (versionHex != "00")
+ return;
if (items.size() != 9 || items[1].type() != QAsn1Element::IntegerType)
return;
keyLength = numberOfBits(items[1].value());
} else if (algorithm == QSsl::Dsa) {
+ if (versionHex != "00")
+ return;
if (items.size() != 6 || items[1].type() != QAsn1Element::IntegerType)
return;
keyLength = numberOfBits(items[1].value());
+ } else if (algorithm == QSsl::Ec) {
+ if (versionHex != "01")
+ return;
+ if (items.size() != 4
+ || items[1].type() != QAsn1Element::OctetStringType
+ || items[2].type() != QAsn1Element::Context0Type
+ || items[3].type() != QAsn1Element::Context1Type)
+ return;
+ QAsn1Element oidElem;
+ if (!oidElem.read(items[2].value())
+ || oidElem.type() != QAsn1Element::ObjectIdentifierType)
+ return;
+ keyLength = curveBits(oidElem.toObjectId());
}
}
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index b9b49ac26e..c15045b180 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -500,6 +500,7 @@ bool QSslSocket::setSocketDescriptor(qintptr socketDescriptor, SocketState state
bool retVal = d->plainSocket->setSocketDescriptor(socketDescriptor, state, openMode);
d->cachedSocketDescriptor = d->plainSocket->socketDescriptor();
setSocketError(d->plainSocket->error());
+ setErrorString(d->plainSocket->errorString());
setSocketState(state);
setOpenMode(openMode);
setLocalPort(d->plainSocket->localPort());
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index 3bcb8925c1..1634d65eb6 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -380,12 +380,9 @@ bool QSslSocketBackendPrivate::initSslContext()
return false;
}
- if ((configuration.protocol == QSsl::TlsV1SslV3 ||
- configuration.protocol == QSsl::TlsV1_0 ||
- configuration.protocol == QSsl::TlsV1_1 ||
- configuration.protocol == QSsl::TlsV1_2 ||
- configuration.protocol == QSsl::SecureProtocols ||
- configuration.protocol == QSsl::AnyProtocol) &&
+ if (configuration.protocol != QSsl::SslV2 &&
+ configuration.protocol != QSsl::SslV3 &&
+ configuration.protocol != QSsl::UnknownProtocol &&
mode == QSslSocket::SslClientMode && q_SSLeay() >= 0x00090806fL) {
// Set server hostname on TLS extension. RFC4366 section 3.1 requires it in ACE format.
QString tlsHostName = verificationPeerName.isEmpty() ? q->peerName() : verificationPeerName;
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
index 8e5d93dce2..903f34f939 100644
--- a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
+++ b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
@@ -424,11 +424,10 @@ QGLEngineShaderProg *QGLEngineSharedShaders::findProgramInCache(const QGLEngineS
if (!inCache)
shaderCache.store(newProg->program, QGLContext::currentContext());
} else {
- QLatin1String none("none");
- QLatin1String br("\n");
QString error;
error = QLatin1String("Shader program failed to link,");
#if defined(QT_DEBUG)
+ QLatin1String br("\n");
error += QLatin1String("\n Shaders Used:\n");
for (int i = 0; i < newProg->program->shaders().count(); ++i) {
QGLShader *shader = newProg->program->shaders().at(i);
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 63ebf14bd5..d84b59efff 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -2168,6 +2168,9 @@ QGLContext::QGLContext(QOpenGLContext *context)
d->setupSharing();
}
+/*!
+ Returns the OpenGL context handle.
+*/
QOpenGLContext *QGLContext::contextHandle() const
{
Q_D(const QGLContext);
@@ -2175,7 +2178,7 @@ QOpenGLContext *QGLContext::contextHandle() const
}
/*!
- Returns a OpenGL context for the window context specified by the \a context
+ Returns an OpenGL context for the window context specified by the \a context
parameter.
*/
QGLContext *QGLContext::fromOpenGLContext(QOpenGLContext *context)
@@ -4355,7 +4358,7 @@ void QGLWidget::resizeOverlayGL(int, int)
}
/*!\reimp
- */
+*/
bool QGLWidget::event(QEvent *e)
{
Q_D(QGLWidget);
diff --git a/src/platformheaders/xcbfunctions/qxcbwindowfunctions.qdoc b/src/platformheaders/xcbfunctions/qxcbwindowfunctions.qdoc
index a02f93968d..b26255553f 100644
--- a/src/platformheaders/xcbfunctions/qxcbwindowfunctions.qdoc
+++ b/src/platformheaders/xcbfunctions/qxcbwindowfunctions.qdoc
@@ -208,3 +208,4 @@
Returns the unsigned integer result of calling the function or
UINT_MAX if the function was not found.
*/
+
diff --git a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp
index 65cdabdf5b..c41061a9fd 100644
--- a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp
+++ b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp
@@ -55,23 +55,24 @@ QT_BEGIN_NAMESPACE
void QBasicFontDatabase::populateFontDatabase()
{
QString fontpath = fontDir();
+ QDir dir(fontpath);
- if(!QFile::exists(fontpath)) {
+ if (!dir.exists()) {
qWarning("QFontDatabase: Cannot find font directory %s - is Qt installed correctly?",
qPrintable(fontpath));
return;
}
- QDir dir(fontpath);
- dir.setNameFilters(QStringList() << QLatin1String("*.ttf")
- << QLatin1String("*.ttc") << QLatin1String("*.pfa")
- << QLatin1String("*.pfb")
- << QLatin1String("*.otf"));
- dir.refresh();
- for (int i = 0; i < int(dir.count()); ++i) {
- const QByteArray file = QFile::encodeName(dir.absoluteFilePath(dir[i]));
-// qDebug() << "looking at" << file;
- addTTFile(QByteArray(), file);
+ QStringList nameFilters;
+ nameFilters << QLatin1String("*.ttf")
+ << QLatin1String("*.ttc")
+ << QLatin1String("*.pfa")
+ << QLatin1String("*.pfb")
+ << QLatin1String("*.otf");
+
+ foreach (const QFileInfo &fi, dir.entryInfoList(nameFilters, QDir::Files)) {
+ const QByteArray file = QFile::encodeName(fi.absoluteFilePath());
+ QBasicFontDatabase::addTTFile(QByteArray(), file);
}
}
@@ -176,18 +177,9 @@ QFontEngine *QBasicFontDatabase::fontEngine(const QByteArray &fontData, qreal pi
return fe;
}
-QStringList QBasicFontDatabase::fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const
-{
- Q_UNUSED(family);
- Q_UNUSED(style);
- Q_UNUSED(script);
- Q_UNUSED(styleHint);
- return QStringList();
-}
-
QStringList QBasicFontDatabase::addApplicationFont(const QByteArray &fontData, const QString &fileName)
{
- return addTTFile(fontData,fileName.toLocal8Bit());
+ return QBasicFontDatabase::addTTFile(fontData, fileName.toLocal8Bit());
}
void QBasicFontDatabase::releaseHandle(void *handle)
@@ -198,7 +190,7 @@ void QBasicFontDatabase::releaseHandle(void *handle)
extern FT_Library qt_getFreetype();
-QStringList QBasicFontDatabase::addTTFile(const QByteArray &fontData, const QByteArray &file, QSupportedWritingSystems *supportedWritingSystems)
+QStringList QBasicFontDatabase::addTTFile(const QByteArray &fontData, const QByteArray &file)
{
FT_Library library = qt_getFreetype();
@@ -237,8 +229,6 @@ QStringList QBasicFontDatabase::addTTFile(const QByteArray &fontData, const QByt
if (cm->encoding == FT_ENCODING_ADOBE_CUSTOM
|| cm->encoding == FT_ENCODING_MS_SYMBOL) {
writingSystems.setSupported(QFontDatabase::Symbol);
- if (supportedWritingSystems)
- supportedWritingSystems->setSupported(QFontDatabase::Symbol);
break;
}
}
@@ -257,8 +247,6 @@ QStringList QBasicFontDatabase::addTTFile(const QByteArray &fontData, const QByt
};
writingSystems = QPlatformFontDatabase::writingSystemsFromTrueTypeBits(unicodeRange, codePageRange);
- if (supportedWritingSystems)
- *supportedWritingSystems = writingSystems;
if (os2->usWeightClass) {
weight = QPlatformFontDatabase::weightFromInteger(os2->usWeightClass);
diff --git a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h
index 3fe1a04b0f..f78587e296 100644
--- a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h
+++ b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h
@@ -63,11 +63,10 @@ public:
void populateFontDatabase() Q_DECL_OVERRIDE;
QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) Q_DECL_OVERRIDE;
QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) Q_DECL_OVERRIDE;
- QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const Q_DECL_OVERRIDE;
QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName) Q_DECL_OVERRIDE;
void releaseHandle(void *handle) Q_DECL_OVERRIDE;
- static QStringList addTTFile(const QByteArray &fontData, const QByteArray &file, QSupportedWritingSystems *supportedWritingSystems = 0);
+ static QStringList addTTFile(const QByteArray &fontData, const QByteArray &file);
};
QT_END_NAMESPACE
diff --git a/src/plugins/imageformats/gif/gif.pro b/src/plugins/imageformats/gif/gif.pro
index 898f06e7c7..2a5048bb1c 100644
--- a/src/plugins/imageformats/gif/gif.pro
+++ b/src/plugins/imageformats/gif/gif.pro
@@ -5,6 +5,7 @@ PLUGIN_CLASS_NAME = QGifPlugin
load(qt_plugin)
include(../../../gui/image/qgifhandler.pri)
+INCLUDEPATH += ../../../gui/image
SOURCES += $$PWD/main.cpp
HEADERS += $$PWD/main.h
OTHER_FILES += gif.json
diff --git a/src/plugins/imageformats/jpeg/jpeg.pro b/src/plugins/imageformats/jpeg/jpeg.pro
index 45bf7bbd43..e33fde1cdb 100644
--- a/src/plugins/imageformats/jpeg/jpeg.pro
+++ b/src/plugins/imageformats/jpeg/jpeg.pro
@@ -9,6 +9,7 @@ QT += core-private
QTDIR_build:REQUIRES = "!contains(QT_CONFIG, no-jpeg)"
include(../../../gui/image/qjpeghandler.pri)
+INCLUDEPATH += ../../../gui/image
SOURCES += main.cpp
HEADERS += main.h
OTHER_FILES += jpeg.json
diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp
index 19ab051162..cd40b7eec2 100644
--- a/src/plugins/platforms/android/androidjnimain.cpp
+++ b/src/plugins/platforms/android/androidjnimain.cpp
@@ -443,6 +443,11 @@ static void *startMainMethod(void */*data*/)
if (m_applicationClass)
QJNIObjectPrivate::callStaticMethod<void>(m_applicationClass, "quitApp", "()V");
+ // All attached threads should be detached before returning from this function.
+ JavaVM *vm = QtAndroidPrivate::javaVM();
+ if (vm != 0)
+ vm->DetachCurrentThread();
+
return 0;
}
diff --git a/src/plugins/platforms/android/qandroidplatformfontdatabase.cpp b/src/plugins/platforms/android/qandroidplatformfontdatabase.cpp
index 9b60ab291c..be1a3d7bdf 100644
--- a/src/plugins/platforms/android/qandroidplatformfontdatabase.cpp
+++ b/src/plugins/platforms/android/qandroidplatformfontdatabase.cpp
@@ -45,26 +45,20 @@ QString QAndroidPlatformFontDatabase::fontDir() const
void QAndroidPlatformFontDatabase::populateFontDatabase()
{
QString fontpath = fontDir();
+ QDir dir(fontpath);
- if (!QFile::exists(fontpath)) {
+ if (!dir.exists()) {
qFatal("QFontDatabase: Cannot find font directory %s - is Qt installed correctly?",
qPrintable(fontpath));
}
- QDir dir(fontpath);
- QList<QFileInfo> entries = dir.entryInfoList(QStringList() << QStringLiteral("*.ttf") << QStringLiteral("*.otf"), QDir::Files);
- for (int i = 0; i < int(entries.count()); ++i) {
- const QByteArray file = QFile::encodeName(entries.at(i).absoluteFilePath());
- QSupportedWritingSystems supportedWritingSystems;
- QStringList families = addTTFile(QByteArray(), file, &supportedWritingSystems);
+ QStringList nameFilters;
+ nameFilters << QLatin1String("*.ttf")
+ << QLatin1String("*.otf");
- extern int qt_script_for_writing_system(QFontDatabase::WritingSystem writingSystem);
- for (int i = 0; i < QFontDatabase::WritingSystemsCount; ++i) {
- if (i == QFontDatabase::Any || supportedWritingSystems.supported(QFontDatabase::WritingSystem(i))) {
- QChar::Script script = QChar::Script(qt_script_for_writing_system(QFontDatabase::WritingSystem(i)));
- m_fallbacks[script] += families;
- }
- }
+ foreach (const QFileInfo &fi, dir.entryInfoList(nameFilters, QDir::Files)) {
+ const QByteArray file = QFile::encodeName(fi.absoluteFilePath());
+ QBasicFontDatabase::addTTFile(QByteArray(), file);
}
}
@@ -73,15 +67,16 @@ QStringList QAndroidPlatformFontDatabase::fallbacksForFamily(const QString &fami
QFont::StyleHint styleHint,
QChar::Script script) const
{
- Q_UNUSED(family);
- Q_UNUSED(style);
-
+ QStringList result;
if (styleHint == QFont::Monospace || styleHint == QFont::Courier)
- return QString(qgetenv("QT_ANDROID_FONTS_MONOSPACE")).split(";") + m_fallbacks[script];
+ result.append(QString(qgetenv("QT_ANDROID_FONTS_MONOSPACE")).split(";"));
else if (styleHint == QFont::Serif)
- return QString(qgetenv("QT_ANDROID_FONTS_SERIF")).split(";") + m_fallbacks[script];
+ result.append(QString(qgetenv("QT_ANDROID_FONTS_SERIF")).split(";"));
+ else
+ result.append(QString(qgetenv("QT_ANDROID_FONTS")).split(";"));
+ result.append(QPlatformFontDatabase::fallbacksForFamily(family, style, styleHint, script));
- return QString(qgetenv("QT_ANDROID_FONTS")).split(";") + m_fallbacks[script];
+ return result;
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/android/qandroidplatformfontdatabase.h b/src/plugins/platforms/android/qandroidplatformfontdatabase.h
index 45de47a58c..89a9ed8bc0 100644
--- a/src/plugins/platforms/android/qandroidplatformfontdatabase.h
+++ b/src/plugins/platforms/android/qandroidplatformfontdatabase.h
@@ -47,9 +47,6 @@ public:
QFont::Style style,
QFont::StyleHint styleHint,
QChar::Script script) const;
-
-private:
- QHash<QChar::Script, QStringList> m_fallbacks;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 4309702fd5..edcbd16dca 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -1435,8 +1435,12 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
if (eventType == QEvent::KeyPress) {
- if (m_composingText.isEmpty())
- m_sendKeyEvent = !QWindowSystemInterface::tryHandleShortcutEvent(focusWindow, timestamp, keyCode, modifiers, text, [nsevent isARepeat], 1);
+ if (m_composingText.isEmpty()) {
+ QKeyEvent override(QEvent::ShortcutOverride, keyCode, modifiers,
+ nativeScanCode, nativeVirtualKey, nativeModifiers, text, [nsevent isARepeat], 1);
+ override.setTimestamp(timestamp);
+ m_sendKeyEvent = !QWindowSystemInterface::tryHandleShortcutOverrideEvent(focusWindow, &override);
+ }
QObject *fo = QGuiApplication::focusObject();
if (m_sendKeyEvent && fo) {
diff --git a/src/plugins/platforms/ios/qioscontext.h b/src/plugins/platforms/ios/qioscontext.h
index e550efe7c3..ec678fee44 100644
--- a/src/plugins/platforms/ios/qioscontext.h
+++ b/src/plugins/platforms/ios/qioscontext.h
@@ -50,15 +50,15 @@ public:
QIOSContext(QOpenGLContext *context);
~QIOSContext();
- QSurfaceFormat format() const;
+ QSurfaceFormat format() const Q_DECL_OVERRIDE;
- void swapBuffers(QPlatformSurface *surface);
+ void swapBuffers(QPlatformSurface *surface) Q_DECL_OVERRIDE;
- bool makeCurrent(QPlatformSurface *surface);
- void doneCurrent();
+ bool makeCurrent(QPlatformSurface *surface) Q_DECL_OVERRIDE;
+ void doneCurrent() Q_DECL_OVERRIDE;
- GLuint defaultFramebufferObject(QPlatformSurface *) const;
- QFunctionPointer getProcAddress(const QByteArray &procName);
+ GLuint defaultFramebufferObject(QPlatformSurface *) const Q_DECL_OVERRIDE;
+ QFunctionPointer getProcAddress(const QByteArray &procName) Q_DECL_OVERRIDE;
bool isSharing() const Q_DECL_OVERRIDE;
bool isValid() const Q_DECL_OVERRIDE;
diff --git a/src/plugins/platforms/ios/qiosfileengineassetslibrary.mm b/src/plugins/platforms/ios/qiosfileengineassetslibrary.mm
index f0b6afce2d..761a89c989 100644
--- a/src/plugins/platforms/ios/qiosfileengineassetslibrary.mm
+++ b/src/plugins/platforms/ios/qiosfileengineassetslibrary.mm
@@ -304,7 +304,7 @@ public:
return g_iteratorCurrentUrl.localData();
}
- QFileInfo currentFileInfo() const
+ QFileInfo currentFileInfo() const Q_DECL_OVERRIDE
{
return QFileInfo(currentFileName());
}
diff --git a/src/plugins/platforms/ios/qiosintegration.h b/src/plugins/platforms/ios/qiosintegration.h
index 0fe318dce7..7d23fe1d62 100644
--- a/src/plugins/platforms/ios/qiosintegration.h
+++ b/src/plugins/platforms/ios/qiosintegration.h
@@ -54,26 +54,26 @@ public:
QIOSIntegration();
~QIOSIntegration();
- bool hasCapability(Capability cap) const;
+ bool hasCapability(Capability cap) const Q_DECL_OVERRIDE;
- QPlatformWindow *createPlatformWindow(QWindow *window) const;
- QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const;
+ QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE;
+ QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE;
- QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const;
+ QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE;
QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const Q_DECL_OVERRIDE;
- QPlatformFontDatabase *fontDatabase() const;
- QPlatformClipboard *clipboard() const;
- QPlatformInputContext *inputContext() const;
+ QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE;
+ QPlatformClipboard *clipboard() const Q_DECL_OVERRIDE;
+ QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE;
QPlatformServices *services() const Q_DECL_OVERRIDE;
- QVariant styleHint(StyleHint hint) const;
+ QVariant styleHint(StyleHint hint) const Q_DECL_OVERRIDE;
- QStringList themeNames() const;
- QPlatformTheme *createPlatformTheme(const QString &name) const;
+ QStringList themeNames() const Q_DECL_OVERRIDE;
+ QPlatformTheme *createPlatformTheme(const QString &name) const Q_DECL_OVERRIDE;
- QAbstractEventDispatcher *createEventDispatcher() const;
- QPlatformNativeInterface *nativeInterface() const;
+ QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE;
+ QPlatformNativeInterface *nativeInterface() const Q_DECL_OVERRIDE;
QTouchDevice *touchDevice();
QPlatformAccessibility *accessibility() const Q_DECL_OVERRIDE;
@@ -86,7 +86,7 @@ public:
// -- QPlatformNativeInterface --
- void *nativeResourceForWindow(const QByteArray &resource, QWindow *window);
+ void *nativeResourceForWindow(const QByteArray &resource, QWindow *window) Q_DECL_OVERRIDE;
void setDebugWindowManagement(bool);
bool debugWindowManagement() const;
diff --git a/src/plugins/platforms/ios/qiosintegration.mm b/src/plugins/platforms/ios/qiosintegration.mm
index b4050b8f62..eaff0daf19 100644
--- a/src/plugins/platforms/ios/qiosintegration.mm
+++ b/src/plugins/platforms/ios/qiosintegration.mm
@@ -81,7 +81,7 @@ QIOSIntegration::QIOSIntegration()
// QPlatformBackingStore.
qApp->setAttribute(Qt::AA_ShareOpenGLContexts, true);
// And that context must match the format used for the backingstore's context.
- QSurfaceFormat fmt;
+ QSurfaceFormat fmt = QSurfaceFormat::defaultFormat();
fmt.setDepthBufferSize(16);
fmt.setStencilBufferSize(8);
QSurfaceFormat::setDefaultFormat(fmt);
diff --git a/src/plugins/platforms/ios/qiosmenu.h b/src/plugins/platforms/ios/qiosmenu.h
index 15f200bb27..4fa0416df7 100644
--- a/src/plugins/platforms/ios/qiosmenu.h
+++ b/src/plugins/platforms/ios/qiosmenu.h
@@ -112,7 +112,7 @@ public:
static id menuActionTarget() { return m_currentMenu ? m_currentMenu->m_menuController : 0; }
protected:
- bool eventFilter(QObject *obj, QEvent *event);
+ bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE;
private:
quintptr m_tag;
diff --git a/src/plugins/platforms/ios/qiosscreen.h b/src/plugins/platforms/ios/qiosscreen.h
index a638210c00..a0aa922a31 100644
--- a/src/plugins/platforms/ios/qiosscreen.h
+++ b/src/plugins/platforms/ios/qiosscreen.h
@@ -50,17 +50,17 @@ public:
QIOSScreen(UIScreen *screen);
~QIOSScreen();
- QRect geometry() const;
- QRect availableGeometry() const;
- int depth() const;
- QImage::Format format() const;
- QSizeF physicalSize() const;
- QDpi logicalDpi() const;
- qreal devicePixelRatio() const;
+ QRect geometry() const Q_DECL_OVERRIDE;
+ QRect availableGeometry() const Q_DECL_OVERRIDE;
+ int depth() const Q_DECL_OVERRIDE;
+ QImage::Format format() const Q_DECL_OVERRIDE;
+ QSizeF physicalSize() const Q_DECL_OVERRIDE;
+ QDpi logicalDpi() const Q_DECL_OVERRIDE;
+ qreal devicePixelRatio() const Q_DECL_OVERRIDE;
- Qt::ScreenOrientation nativeOrientation() const;
- Qt::ScreenOrientation orientation() const;
- void setOrientationUpdateMask(Qt::ScreenOrientations mask);
+ Qt::ScreenOrientation nativeOrientation() const Q_DECL_OVERRIDE;
+ Qt::ScreenOrientation orientation() const Q_DECL_OVERRIDE;
+ void setOrientationUpdateMask(Qt::ScreenOrientations mask) Q_DECL_OVERRIDE;
UIScreen *uiScreen() const;
UIWindow *uiWindow() const;
diff --git a/src/plugins/platforms/ios/qiostextresponder.mm b/src/plugins/platforms/ios/qiostextresponder.mm
index d86f545154..e2c61e1161 100644
--- a/src/plugins/platforms/ios/qiostextresponder.mm
+++ b/src/plugins/platforms/ios/qiostextresponder.mm
@@ -221,6 +221,8 @@
self.keyboardType = UIKeyboardTypePhonePad;
else if (hints & Qt::ImhLatinOnly)
self.keyboardType = UIKeyboardTypeASCIICapable;
+ else if (hints & Qt::ImhPreferNumbers)
+ self.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
else
self.keyboardType = UIKeyboardTypeDefault;
diff --git a/src/plugins/platforms/ios/qiostheme.h b/src/plugins/platforms/ios/qiostheme.h
index 9ef179b4dc..58144cb239 100644
--- a/src/plugins/platforms/ios/qiostheme.h
+++ b/src/plugins/platforms/ios/qiostheme.h
@@ -47,7 +47,7 @@ public:
~QIOSTheme();
const QPalette *palette(Palette type = SystemPalette) const Q_DECL_OVERRIDE;
- QVariant themeHint(ThemeHint hint) const;
+ QVariant themeHint(ThemeHint hint) const Q_DECL_OVERRIDE;
QPlatformMenuItem* createPlatformMenuItem() const Q_DECL_OVERRIDE;
QPlatformMenu* createPlatformMenu() const Q_DECL_OVERRIDE;
@@ -55,7 +55,7 @@ public:
bool usePlatformNativeDialog(DialogType type) const Q_DECL_OVERRIDE;
QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const Q_DECL_OVERRIDE;
- const QFont *font(Font type = SystemFont) const;
+ const QFont *font(Font type = SystemFont) const Q_DECL_OVERRIDE;
static const char *name;
diff --git a/src/plugins/platforms/ios/qioswindow.h b/src/plugins/platforms/ios/qioswindow.h
index c53eee1afd..0c65cf8aa5 100644
--- a/src/plugins/platforms/ios/qioswindow.h
+++ b/src/plugins/platforms/ios/qioswindow.h
@@ -54,29 +54,29 @@ public:
explicit QIOSWindow(QWindow *window);
~QIOSWindow();
- void setGeometry(const QRect &rect);
+ void setGeometry(const QRect &rect) Q_DECL_OVERRIDE;
- void setWindowState(Qt::WindowState state);
- void setParent(const QPlatformWindow *window);
- void handleContentOrientationChange(Qt::ScreenOrientation orientation);
- void setVisible(bool visible);
+ void setWindowState(Qt::WindowState state) Q_DECL_OVERRIDE;
+ void setParent(const QPlatformWindow *window) Q_DECL_OVERRIDE;
+ void handleContentOrientationChange(Qt::ScreenOrientation orientation) Q_DECL_OVERRIDE;
+ void setVisible(bool visible) Q_DECL_OVERRIDE;
void setOpacity(qreal level) Q_DECL_OVERRIDE;
bool isExposed() const Q_DECL_OVERRIDE;
void propagateSizeHints() Q_DECL_OVERRIDE {}
- void raise() { raiseOrLower(true); }
- void lower() { raiseOrLower(false); }
+ void raise() Q_DECL_OVERRIDE{ raiseOrLower(true); }
+ void lower() Q_DECL_OVERRIDE { raiseOrLower(false); }
bool shouldAutoActivateWindow() const;
- void requestActivateWindow();
+ void requestActivateWindow() Q_DECL_OVERRIDE;
- qreal devicePixelRatio() const;
+ qreal devicePixelRatio() const Q_DECL_OVERRIDE;
- bool setMouseGrabEnabled(bool grab) { return grab; }
- bool setKeyboardGrabEnabled(bool grab) { return grab; }
+ bool setMouseGrabEnabled(bool grab) Q_DECL_OVERRIDE { return grab; }
+ bool setKeyboardGrabEnabled(bool grab) Q_DECL_OVERRIDE { return grab; }
- WId winId() const { return WId(m_view); };
+ WId winId() const Q_DECL_OVERRIDE { return WId(m_view); }
void clearAccessibleCache();
diff --git a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp
index 8b67f235bb..2189938248 100644
--- a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp
+++ b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp
@@ -689,7 +689,7 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accChild(VARIANT varChildI
return E_INVALIDARG;
QAccessibleInterface *acc = childPointer(accessible, varChildID);
- if (acc) {
+ if (acc && acc->isValid()) {
*ppdispChild = QWindowsAccessibility::wrap(acc);
return S_OK;
}
@@ -778,7 +778,7 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accDescription(VARIANT var
QString descr;
if (varID.lVal) {
QAccessibleInterface *child = childPointer(accessible, varID);
- if (!child)
+ if (!child || !child->isValid())
return E_FAIL;
descr = child->text(QAccessible::Description);
} else {
@@ -803,7 +803,7 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accHelp(VARIANT varID, BST
QString help;
if (varID.lVal) {
QAccessibleInterface *child = childPointer(accessible, varID);
- if (!child)
+ if (!child || !child->isValid())
return E_FAIL;
help = child->text(QAccessible::Help);
} else {
@@ -862,7 +862,7 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accName(VARIANT varID, BST
QString name;
if (varID.lVal) {
QAccessibleInterface *child = childPointer(accessible, varID);
- if (!child)
+ if (!child || !child->isValid())
return E_FAIL;
name = child->text(QAccessible::Name);
if (name.isEmpty()) {
@@ -910,7 +910,7 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accRole(VARIANT varID, VAR
QAccessible::Role role;
if (varID.lVal) {
QAccessibleInterface *child = childPointer(accessible, varID);
- if (!child)
+ if (!child || !child->isValid())
return E_FAIL;
role = child->role();
} else {
@@ -947,7 +947,7 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accState(VARIANT varID, VA
QAccessible::State state;
if (varID.lVal) {
QAccessibleInterface *child = childPointer(accessible, varID);
- if (!child)
+ if (!child || !child->isValid())
return E_FAIL;
state = child->state();
} else {
diff --git a/src/plugins/platforms/windows/qwindowsclipboard.cpp b/src/plugins/platforms/windows/qwindowsclipboard.cpp
index 4cea845c36..925427ac30 100644
--- a/src/plugins/platforms/windows/qwindowsclipboard.cpp
+++ b/src/plugins/platforms/windows/qwindowsclipboard.cpp
@@ -69,25 +69,28 @@ static const char formatTextHtmlC[] = "text/html";
\ingroup qt-lighthouse-win
*/
-QDebug operator<<(QDebug d, const QMimeData &m)
+static QDebug operator<<(QDebug d, const QMimeData *mimeData)
{
QDebugStateSaver saver(d);
d.nospace();
- const QStringList formats = m.formats();
- d << "QMimeData: " << formats.join(QStringLiteral(", ")) << '\n'
- << " Text=" << m.hasText() << " HTML=" << m.hasHtml()
- << " Color=" << m.hasColor() << " Image=" << m.hasImage()
- << " URLs=" << m.hasUrls() << '\n';
- if (m.hasText())
- d << " Text: '" << m.text() << "'\n";
- if (m.hasHtml())
- d << " HTML: '" << m.html() << "'\n";
- if (m.hasColor())
- d << " Color: " << qvariant_cast<QColor>(m.colorData()) << '\n';
- if (m.hasImage())
- d << " Image: " << qvariant_cast<QImage>(m.imageData()).size() << '\n';
- if (m.hasUrls())
- d << " URLs: " << m.urls() << '\n';
+ d << "QMimeData(";
+ if (mimeData) {
+ const QStringList formats = mimeData->formats();
+ d << "formats=" << formats.join(QStringLiteral(", "));
+ if (mimeData->hasText())
+ d << ", text=" << mimeData->text();
+ if (mimeData->hasHtml())
+ d << ", html=" << mimeData->html();
+ if (mimeData->hasColor())
+ d << ", colorData=" << qvariant_cast<QColor>(mimeData->colorData());
+ if (mimeData->hasImage())
+ d << ", imageData=" << qvariant_cast<QImage>(mimeData->imageData());
+ if (mimeData->hasUrls())
+ d << ", urls=" << mimeData->urls();
+ } else {
+ d << '0';
+ }
+ d << ')';
return d;
}
@@ -297,7 +300,7 @@ QMimeData *QWindowsClipboard::mimeData(QClipboard::Mode mode)
void QWindowsClipboard::setMimeData(QMimeData *mimeData, QClipboard::Mode mode)
{
- qCDebug(lcQpaMime) << __FUNCTION__ << mode << *mimeData;
+ qCDebug(lcQpaMime) << __FUNCTION__ << mode << mimeData;
if (mode != QClipboard::Clipboard)
return;
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index 27323a2fd6..717adcc47f 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -918,7 +918,11 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
case QtWindows::InputMethodRequest:
return QWindowsInputContext::instance()->handleIME_Request(wParam, lParam, result);
case QtWindows::GestureEvent:
- return d->m_mouseHandler.translateTouchEvent(platformWindow->window(), hwnd, et, msg, result);
+#if !defined(Q_OS_WINCE) && !defined(QT_NO_SESSIONMANAGER)
+ return platformSessionManager()->isInteractionBlocked() ? true : d->m_mouseHandler.translateGestureEvent(platformWindow->window(), hwnd, et, msg, result);
+#else
+ return d->m_mouseHandler.translateGestureEvent(platformWindow->window(), hwnd, et, msg, result);
+#endif
case QtWindows::InputMethodOpenCandidateWindowEvent:
case QtWindows::InputMethodCloseCandidateWindowEvent:
// TODO: Release/regrab mouse if a popup has mouse grab.
diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
index 1c5b114efd..3b27964b0e 100644
--- a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
@@ -933,7 +933,7 @@ static bool addFontToDatabase(const QString &familyName, uchar charSet,
}
static int QT_WIN_CALLBACK storeFont(ENUMLOGFONTEX* f, NEWTEXTMETRICEX *textmetric,
- int type, LPARAM)
+ int type, LPARAM registerAlias)
{
const QString familyName = QString::fromWCharArray(f->elfLogFont.lfFaceName);
const uchar charSet = f->elfLogFont.lfCharSet;
@@ -943,13 +943,13 @@ static int QT_WIN_CALLBACK storeFont(ENUMLOGFONTEX* f, NEWTEXTMETRICEX *textmetr
// NEWTEXTMETRICEX is a NEWTEXTMETRIC, which according to the documentation is
// identical to a TEXTMETRIC except for the last four members, which we don't use
// anyway
- addFontToDatabase(familyName, charSet, (TEXTMETRIC *)textmetric, &signature, type, false);
+ addFontToDatabase(familyName, charSet, (TEXTMETRIC *)textmetric, &signature, type, registerAlias);
// keep on enumerating
return 1;
}
-void QWindowsFontDatabase::populateFamily(const QString &familyName)
+void QWindowsFontDatabase::populateFamily(const QString &familyName, bool registerAlias)
{
qCDebug(lcQpaFonts) << familyName;
if (familyName.size() >= LF_FACESIZE) {
@@ -962,10 +962,15 @@ void QWindowsFontDatabase::populateFamily(const QString &familyName)
familyName.toWCharArray(lf.lfFaceName);
lf.lfFaceName[familyName.size()] = 0;
lf.lfPitchAndFamily = 0;
- EnumFontFamiliesEx(dummy, &lf, (FONTENUMPROC)storeFont, 0, 0);
+ EnumFontFamiliesEx(dummy, &lf, (FONTENUMPROC)storeFont, (LPARAM)registerAlias, 0);
ReleaseDC(0, dummy);
}
+void QWindowsFontDatabase::populateFamily(const QString &familyName)
+{
+ populateFamily(familyName, false);
+}
+
namespace {
// Context for enumerating system fonts, records whether the default font has been encountered,
// which is normally not enumerated by EnumFontFamiliesEx().
@@ -1075,11 +1080,7 @@ QWindowsFontDatabase::~QWindowsFontDatabase()
QFontEngineMulti *QWindowsFontDatabase::fontEngineMulti(QFontEngine *fontEngine, QChar::Script script)
{
- if (script == QChar::Script_Common)
- return new QWindowsMultiFontEngine(fontEngine, script);
- // ### as long as fallbacksForFamily() does not take script parameter into account,
- // prefer QFontEngineMulti's loadEngine() implementation for complex scripts
- return QPlatformFontDatabase::fontEngineMulti(fontEngine, script);
+ return new QWindowsMultiFontEngine(fontEngine, script);
}
QFontEngine * QWindowsFontDatabase::fontEngine(const QFontDef &fontDef, void *handle)
@@ -1382,7 +1383,7 @@ QStringList QWindowsFontDatabase::addApplicationFont(const QByteArray &fontData,
// Fonts based on files are added via populate, as they will show up in font enumeration.
for (int j = 0; j < families.count(); ++j)
- populateFamily(families.at(j));
+ populateFamily(families.at(j), true);
}
m_applicationFonts << font;
@@ -1661,11 +1662,10 @@ QString QWindowsFontDatabase::familyForStyleHint(QFont::StyleHint styleHint)
QStringList QWindowsFontDatabase::fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const
{
- QStringList result = QPlatformFontDatabase::fallbacksForFamily(family, style, styleHint, script);
- if (!result.isEmpty())
- return result;
+ QStringList result;
result.append(QWindowsFontDatabase::familyForStyleHint(styleHint));
result.append(QWindowsFontDatabase::extraTryFontsForFamily(family));
+ result.append(QPlatformFontDatabase::fallbacksForFamily(family, style, styleHint, script));
qCDebug(lcQpaFonts) << __FUNCTION__ << family << style << styleHint
<< script << result;
diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.h b/src/plugins/platforms/windows/qwindowsfontdatabase.h
index 3615612c78..efb5421996 100644
--- a/src/plugins/platforms/windows/qwindowsfontdatabase.h
+++ b/src/plugins/platforms/windows/qwindowsfontdatabase.h
@@ -100,6 +100,7 @@ public:
static QString familyForStyleHint(QFont::StyleHint styleHint);
private:
+ void populateFamily(const QString &familyName, bool registerAlias);
void removeApplicationFonts();
struct WinApplicationFont {
diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp
index ad75a0bd54..795554698c 100644
--- a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp
@@ -661,9 +661,7 @@ QFontEngine *QWindowsFontDatabaseFT::fontEngine(const QByteArray &fontData, qrea
QStringList QWindowsFontDatabaseFT::fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const
{
- QStringList result = QPlatformFontDatabase::fallbacksForFamily(family, style, styleHint, script);
- if (!result.isEmpty())
- return result;
+ QStringList result;
result.append(QWindowsFontDatabase::familyForStyleHint(styleHint));
@@ -679,6 +677,8 @@ QStringList QWindowsFontDatabaseFT::fallbacksForFamily(const QString &family, QF
result.append(QWindowsFontDatabase::extraTryFontsForFamily(family));
+ result.append(QPlatformFontDatabase::fallbacksForFamily(family, style, styleHint, script));
+
qCDebug(lcQpaFonts) << __FUNCTION__ << family << style << styleHint
<< script << result;
diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp
index 05c7e6b240..f97c23c207 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.cpp
+++ b/src/plugins/platforms/windows/qwindowsintegration.cpp
@@ -487,7 +487,7 @@ QVariant QWindowsIntegration::styleHint(QPlatformIntegration::StyleHint hint) co
switch (hint) {
case QPlatformIntegration::CursorFlashTime:
if (const unsigned timeMS = GetCaretBlinkTime())
- return QVariant(int(timeMS) * 2);
+ return QVariant(timeMS != INFINITE ? int(timeMS) * 2 : 0);
break;
#ifdef SPI_GETKEYBOARDSPEED
case KeyboardAutoRepeatRate:
diff --git a/src/plugins/platforms/windows/qwindowsinternalmimedata.h b/src/plugins/platforms/windows/qwindowsinternalmimedata.h
index 09ab417268..6a60a9676a 100644
--- a/src/plugins/platforms/windows/qwindowsinternalmimedata.h
+++ b/src/plugins/platforms/windows/qwindowsinternalmimedata.h
@@ -55,8 +55,6 @@ protected:
virtual void releaseDataObject(IDataObject *) const {}
};
-QDebug operator<<(QDebug d, const QMimeData &m);
-
QT_END_NAMESPACE
#endif // QWINDOWSINTERNALMIME_H
diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.cpp b/src/plugins/platforms/windows/qwindowsmousehandler.cpp
index a8aea05fd8..200eb11855 100644
--- a/src/plugins/platforms/windows/qwindowsmousehandler.cpp
+++ b/src/plugins/platforms/windows/qwindowsmousehandler.cpp
@@ -465,12 +465,11 @@ bool QWindowsMouseHandler::translateScrollEvent(QWindow *window, HWND,
}
// from bool QApplicationPrivate::translateTouchEvent()
-bool QWindowsMouseHandler::translateTouchEvent(QWindow *window, HWND hwnd,
+bool QWindowsMouseHandler::translateTouchEvent(QWindow *window, HWND,
QtWindows::WindowsEventType,
MSG msg, LRESULT *)
{
#ifndef Q_OS_WINCE
- Q_UNUSED(hwnd);
typedef QWindowSystemInterface::TouchPoint QTouchPoint;
typedef QList<QWindowSystemInterface::TouchPoint> QTouchPointList;
@@ -537,8 +536,24 @@ bool QWindowsMouseHandler::translateTouchEvent(QWindow *window, HWND hwnd,
QWindowSystemInterface::handleTouchEvent(window,
m_touchDevice,
touchPoints);
+#else // !Q_OS_WINCE
+ Q_UNUSED(window)
+ Q_UNUSED(msg)
+#endif
return true;
-#else //Q_OS_WINCE
+
+}
+
+bool QWindowsMouseHandler::translateGestureEvent(QWindow *window, HWND hwnd,
+ QtWindows::WindowsEventType,
+ MSG msg, LRESULT *)
+{
+#ifndef Q_OS_WINCE
+ Q_UNUSED(window)
+ Q_UNUSED(hwnd)
+ Q_UNUSED(msg)
+ return false;
+#else // !Q_OS_WINCE
GESTUREINFO gi;
memset(&gi, 0, sizeof(GESTUREINFO));
gi.cbSize = sizeof(GESTUREINFO);
@@ -617,9 +632,8 @@ bool QWindowsMouseHandler::translateTouchEvent(QWindow *window, HWND hwnd,
QWindowSystemInterface::handleEnterEvent(window);
m_windowUnderMouse = window;
}
-
return true;
-#endif
+#endif // Q_OS_WINCE
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.h b/src/plugins/platforms/windows/qwindowsmousehandler.h
index ce3e6b6fc4..61aa8d6084 100644
--- a/src/plugins/platforms/windows/qwindowsmousehandler.h
+++ b/src/plugins/platforms/windows/qwindowsmousehandler.h
@@ -59,6 +59,9 @@ public:
bool translateTouchEvent(QWindow *widget, HWND hwnd,
QtWindows::WindowsEventType t, MSG msg,
LRESULT *result);
+ bool translateGestureEvent(QWindow *window, HWND hwnd,
+ QtWindows::WindowsEventType,
+ MSG msg, LRESULT *);
bool translateScrollEvent(QWindow *window, HWND hwnd,
MSG msg, LRESULT *result);
diff --git a/src/plugins/platforms/windows/qwindowsnativeinterface.cpp b/src/plugins/platforms/windows/qwindowsnativeinterface.cpp
index 6e58c55bbe..db8b2ec094 100644
--- a/src/plugins/platforms/windows/qwindowsnativeinterface.cpp
+++ b/src/plugins/platforms/windows/qwindowsnativeinterface.cpp
@@ -135,7 +135,9 @@ QVariantMap QWindowsNativeInterface::windowProperties(QPlatformWindow *window) c
void *QWindowsNativeInterface::nativeResourceForIntegration(const QByteArray &resource)
{
-#ifndef QT_NO_OPENGL
+#ifdef QT_NO_OPENGL
+ Q_UNUSED(resource)
+#else
if (resourceType(resource) == GlHandleType)
return QWindowsIntegration::staticOpenGLContext()->moduleHandle();
#endif
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 87747a74fd..1b5d7b87bc 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -2270,6 +2270,7 @@ void QWindowsWindow::setCustomMargins(const QMargins &newCustomMargins)
void *QWindowsWindow::surface(void *nativeConfig, int *err)
{
#ifdef QT_NO_OPENGL
+ Q_UNUSED(err)
Q_UNUSED(nativeConfig)
return 0;
#else
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index 1fe46ff290..15d3575e60 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -55,7 +55,6 @@
#include <algorithm>
-#include <dlfcn.h>
#include <stdio.h>
#include <errno.h>
#include <xcb/shm.h>
@@ -77,6 +76,25 @@
#include <xcb/render.h>
#endif
+#if defined(Q_CC_GNU) && defined(Q_OF_ELF)
+static xcb_generic_event_t *local_xcb_poll_for_queued_event(xcb_connection_t *c)
+ __attribute__((weakref("xcb_poll_for_queued_event")));
+
+static inline void checkXcbPollForQueuedEvent()
+{ }
+#else
+#include <dlfcn.h>
+typedef xcb_generic_event_t * (*XcbPollForQueuedEventFunctionPointer)(xcb_connection_t *c);
+static XcbPollForQueuedEventFunctionPointer local_xcb_poll_for_queued_event;
+
+static inline void checkXcbPollForQueuedEvent()
+{
+#ifdef RTLD_DEFAULT
+ local_xcb_poll_for_queued_event = (XcbPollForQueuedEventFunctionPointer)dlsym(RTLD_DEFAULT, "xcb_poll_for_queued_event");
+#endif
+}
+#endif
+
QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(lcQpaXInput, "qt.qpa.input")
@@ -252,16 +270,32 @@ void QXcbConnection::updateScreens(const xcb_randr_notify_event_t *event)
otherScreen->addVirtualSibling(screen);
m_screens << screen;
QXcbIntegration::instance()->screenAdded(screen, screen->isPrimary());
+
+ // Windows which had null screens have already had expose events by now.
+ // They need to be told the screen is back, it's OK to render.
+ foreach (QWindow *window, QGuiApplication::topLevelWindows()) {
+ QXcbWindow *xcbWin = static_cast<QXcbWindow*>(window->handle());
+ if (xcbWin)
+ xcbWin->maybeSetScreen(screen);
+ }
}
// else ignore disabled screens
} else if (screen) {
// Screen has been disabled -> remove
if (output.crtc == XCB_NONE && output.mode == XCB_NONE) {
- qCDebug(lcQpaScreen) << "output" << screen->name() << "has been disabled";
- m_screens.removeOne(screen);
- foreach (QXcbScreen *otherScreen, m_screens)
- otherScreen->removeVirtualSibling((QPlatformScreen *) screen);
- QXcbIntegration::instance()->destroyScreen(screen);
+ xcb_randr_get_output_info_cookie_t outputInfoCookie =
+ xcb_randr_get_output_info(xcb_connection(), output.output, output.config_timestamp);
+ QScopedPointer<xcb_randr_get_output_info_reply_t, QScopedPointerPodDeleter> outputInfo(
+ xcb_randr_get_output_info_reply(xcb_connection(), outputInfoCookie, NULL));
+ if (outputInfo->crtc == XCB_NONE) {
+ qCDebug(lcQpaScreen) << "output" << screen->name() << "has been disabled";
+ m_screens.removeOne(screen);
+ foreach (QXcbScreen *otherScreen, m_screens)
+ otherScreen->removeVirtualSibling((QPlatformScreen *) screen);
+ QXcbIntegration::instance()->destroyScreen(screen);
+ } else {
+ qCDebug(lcQpaScreen) << "output" << screen->name() << "has been temporarily disabled for the mode switch";
+ }
} else {
// Just update existing screen
screen->updateGeometry(output.config_timestamp);
@@ -1153,21 +1187,13 @@ void QXcbConnection::addPeekFunc(PeekFunc f)
QXcbEventReader::QXcbEventReader(QXcbConnection *connection)
: m_connection(connection)
- , m_xcb_poll_for_queued_event(0)
{
-#ifdef RTLD_DEFAULT
- m_xcb_poll_for_queued_event = (XcbPollForQueuedEventFunctionPointer)dlsym(RTLD_DEFAULT, "xcb_poll_for_queued_event");
-#endif
-
-#ifdef Q_XCB_DEBUG
- if (m_xcb_poll_for_queued_event)
- qDebug("Using threaded event reader with xcb_poll_for_queued_event");
-#endif
+ checkXcbPollForQueuedEvent();
}
void QXcbEventReader::start()
{
- if (m_xcb_poll_for_queued_event) {
+ if (local_xcb_poll_for_queued_event) {
connect(this, SIGNAL(eventPending()), m_connection, SLOT(processXcbEvents()), Qt::QueuedConnection);
connect(this, SIGNAL(finished()), m_connection, SLOT(processXcbEvents()));
QThread::start();
@@ -1193,7 +1219,7 @@ void QXcbEventReader::registerEventDispatcher(QAbstractEventDispatcher *dispatch
// flush the xcb connection before the EventDispatcher is going to block
// In the non-threaded case processXcbEvents is called before going to block,
// which flushes the connection.
- if (m_xcb_poll_for_queued_event)
+ if (local_xcb_poll_for_queued_event)
connect(dispatcher, SIGNAL(aboutToBlock()), m_connection, SLOT(flush()));
}
@@ -1203,7 +1229,7 @@ void QXcbEventReader::run()
while (m_connection && (event = xcb_wait_for_event(m_connection->xcb_connection()))) {
m_mutex.lock();
addEvent(event);
- while (m_connection && (event = m_xcb_poll_for_queued_event(m_connection->xcb_connection())))
+ while (m_connection && (event = local_xcb_poll_for_queued_event(m_connection->xcb_connection())))
addEvent(event);
m_mutex.unlock();
emit eventPending();
@@ -1227,7 +1253,7 @@ void QXcbEventReader::addEvent(xcb_generic_event_t *event)
QXcbEventArray *QXcbEventReader::lock()
{
m_mutex.lock();
- if (!m_xcb_poll_for_queued_event) {
+ if (!local_xcb_poll_for_queued_event) {
while (xcb_generic_event_t *event = xcb_poll_for_event(m_connection->xcb_connection()))
m_events << event;
}
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h
index 7016b99425..4a0348aa0c 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.h
+++ b/src/plugins/platforms/xcb/qxcbconnection.h
@@ -324,9 +324,6 @@ private:
QMutex m_mutex;
QXcbEventArray m_events;
QXcbConnection *m_connection;
-
- typedef xcb_generic_event_t * (*XcbPollForQueuedEventFunctionPointer)(xcb_connection_t *c);
- XcbPollForQueuedEventFunctionPointer m_xcb_poll_for_queued_event;
};
class QXcbWindowEventListener
diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
index 4a347a3706..5a2ea74258 100644
--- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
@@ -306,14 +306,13 @@ void QXcbConnection::xi2Select(xcb_window_t window)
const bool pointerSelected = isAtLeastXI22() && xi2MouseEvents();
QSet<int> tabletDevices;
#ifndef QT_NO_TABLETEVENT
- if (!m_tabletData.isEmpty() && !pointerSelected) {
+ if (!m_tabletData.isEmpty()) {
unsigned int tabletBitMask;
unsigned char *xiTabletBitMask = reinterpret_cast<unsigned char *>(&tabletBitMask);
QVector<XIEventMask> xiEventMask(m_tabletData.count());
- tabletBitMask = XI_ButtonPressMask;
- tabletBitMask |= XI_ButtonReleaseMask;
- tabletBitMask |= XI_MotionMask;
- tabletBitMask |= XI_PropertyEventMask;
+ tabletBitMask = XI_PropertyEventMask;
+ if (!pointerSelected)
+ tabletBitMask |= XI_ButtonPressMask | XI_ButtonReleaseMask | XI_MotionMask;
for (int i = 0; i < m_tabletData.count(); ++i) {
int deviceId = m_tabletData.at(i).deviceId;
tabletDevices.insert(deviceId);
@@ -458,17 +457,6 @@ static inline qreal fixed1616ToReal(FP1616 val)
}
#endif // defined(XCB_USE_XINPUT21) || !defined(QT_NO_TABLETEVENT)
-#if defined(XCB_USE_XINPUT21)
-static qreal valuatorNormalized(double value, XIValuatorClassInfo *vci)
-{
- if (value > vci->max)
- value = vci->max;
- if (value < vci->min)
- value = vci->min;
- return (value - vci->min) / (vci->max - vci->min);
-}
-#endif // XCB_USE_XINPUT21
-
void QXcbConnection::xi2HandleEvent(xcb_ge_event_t *event)
{
if (xi2PrepareXIGenericDeviceEvent(event, m_xiOpCode)) {
@@ -481,9 +469,11 @@ void QXcbConnection::xi2HandleEvent(xcb_ge_event_t *event)
case XI_ButtonPress:
case XI_ButtonRelease:
case XI_Motion:
+#ifdef XCB_USE_XINPUT22
case XI_TouchBegin:
case XI_TouchUpdate:
case XI_TouchEnd:
+#endif
{
xiDeviceEvent = reinterpret_cast<xXIDeviceEvent *>(event);
eventListener = windowEventListenerFromId(xiDeviceEvent->event);
@@ -548,6 +538,15 @@ void QXcbConnection::xi2HandleEvent(xcb_ge_event_t *event)
}
#ifdef XCB_USE_XINPUT22
+static qreal valuatorNormalized(double value, XIValuatorClassInfo *vci)
+{
+ if (value > vci->max)
+ value = vci->max;
+ if (value < vci->min)
+ value = vci->min;
+ return (value - vci->min) / (vci->max - vci->min);
+}
+
void QXcbConnection::xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow)
{
xXIDeviceEvent *xiDeviceEvent = static_cast<xXIDeviceEvent *>(xiDevEvent);
@@ -973,6 +972,8 @@ bool QXcbConnection::xi2HandleTabletEvent(void *event, TabletData *tabletData, Q
// the pen on the XI 2.2+ path.
if (xi2MouseEvents() && eventListener)
eventListener->handleXIMouseEvent(reinterpret_cast<xcb_ge_event_t *>(event));
+#else
+ Q_UNUSED(eventListener);
#endif
switch (xiEvent->evtype) {
diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp
index 6c95de6806..0cd9159052 100644
--- a/src/plugins/platforms/xcb/qxcbcursor.cpp
+++ b/src/plugins/platforms/xcb/qxcbcursor.cpp
@@ -336,8 +336,10 @@ QXcbCursor::~QXcbCursor()
if (!--cursorCount)
xcb_close_font(conn, cursorFont);
+#ifndef QT_NO_CURSOR
foreach (xcb_cursor_t cursor, m_cursorHash)
xcb_free_cursor(conn, cursor);
+#endif
}
#ifndef QT_NO_CURSOR
diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp
index 29262b5847..c6e48dc8c4 100644
--- a/src/plugins/platforms/xcb/qxcbscreen.cpp
+++ b/src/plugins/platforms/xcb/qxcbscreen.cpp
@@ -708,7 +708,7 @@ static inline void formatSizeF(QDebug &debug, const QSizeF s)
debug << s.width() << 'x' << s.height() << "mm";
}
-Q_XCB_EXPORT QDebug operator<<(QDebug debug, const QXcbScreen *screen)
+QDebug operator<<(QDebug debug, const QXcbScreen *screen)
{
const QDebugStateSaver saver(debug);
debug.nospace();
diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp
index 4f8eaba85a..2cecf61573 100644
--- a/src/printsupport/kernel/qprinter.cpp
+++ b/src/printsupport/kernel/qprinter.cpp
@@ -1092,12 +1092,20 @@ void QPrinter::setCreator(const QString &creator)
To obtain the current page margins use pageLayout().pageMargins().
- Returns true if the page margins was successfully set to \a margins.
+ Returns \c true if the page margins was successfully set to \a margins.
\sa pageLayout(), setPageLayout()
*/
/*!
+ \fn bool QPrinter::setPageMargins(const QMarginsF &margins)
+
+ Set the page margins to \a margins using the current units.
+ Returns \c true if the page margins were set successfully.
+
+ \sa pageLayout(), setPageLayout()
+*/
+/*!
\fn QPageLayout QPrinter::pageLayout() const
\since 5.3
diff --git a/src/testlib/testlib.pro b/src/testlib/testlib.pro
index 2d9bae5f31..0070cdb271 100644
--- a/src/testlib/testlib.pro
+++ b/src/testlib/testlib.pro
@@ -99,7 +99,14 @@ mac {
# Exclude these headers from the clean check if their dependencies aren't
# being built
-contains(QT_CONFIG, no-widgets): HEADERSCLEAN_EXCLUDE += qtest_widgets.h
-contains(QT_CONFIG, no-gui): HEADERSCLEAN_EXCLUDE += qtest_gui.h
+!qtHaveModule(gui) {
+ HEADERSCLEAN_EXCLUDE += qtest_gui.h \
+ qtestaccessible.h \
+ qtestkeyboard.h \
+ qtestmouse.h \
+ qtesttouch.h
+}
+
+!qtHaveModule(widgets): HEADERSCLEAN_EXCLUDE += qtest_widgets.h
load(qt_module)
diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp
index 9f722abe9b..5153b0de5c 100644
--- a/src/tools/qdoc/generator.cpp
+++ b/src/tools/qdoc/generator.cpp
@@ -932,14 +932,16 @@ void Generator::generateFileList(const DocumentNode* dn,
if (!file.isEmpty()) {
QDir dirInfo;
QString userFriendlyFilePath;
+ const QString prefix("/images/used-in-examples/");
QString srcPath = Config::findFile(dn->location(),
QStringList(),
exampleDirs,
file,
exampleImgExts,
userFriendlyFilePath);
+ outFileNames_ << prefix.mid(1) + userFriendlyFilePath;
userFriendlyFilePath.truncate(userFriendlyFilePath.lastIndexOf('/'));
- QString imgOutDir = outDir_ + "/images/used-in-examples/" + userFriendlyFilePath;
+ QString imgOutDir = outDir_ + prefix + userFriendlyFilePath;
if (!dirInfo.mkpath(imgOutDir))
dn->location().fatal(tr("Cannot create output directory '%1'").arg(imgOutDir));
Config::copyFile(dn->location(), srcPath, file, imgOutDir);
diff --git a/src/tools/qdoc/helpprojectwriter.cpp b/src/tools/qdoc/helpprojectwriter.cpp
index 996cf03f32..8161913f1f 100644
--- a/src/tools/qdoc/helpprojectwriter.cpp
+++ b/src/tools/qdoc/helpprojectwriter.cpp
@@ -202,13 +202,7 @@ QStringList HelpProjectWriter::keywordDetails(const Node *node) const
{
QStringList details;
- if (node->isQmlProperty() || node->isJsProperty()) {
- // "name"
- details << node->name();
- // "id"
- details << node->parent()->parent()->name()+"::"+node->name();
- }
- else if (node->parent() && !node->parent()->name().isEmpty()) {
+ if (node->parent() && !node->parent()->name().isEmpty()) {
// "name"
if (node->type() == Node::Enum || node->type() == Node::Typedef)
details << node->parent()->name()+"::"+node->name();
diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp
index 911b91991f..18d2af5810 100644
--- a/src/tools/qdoc/htmlgenerator.cpp
+++ b/src/tools/qdoc/htmlgenerator.cpp
@@ -2663,7 +2663,7 @@ QString HtmlGenerator::generateLowStatusMemberFile(Aggregate *inner,
out() << "<p><b>The following members of class "
<< "<a href=\"" << linkForNode(inner, 0) << "\">"
<< protectEnc(inner->name()) << "</a>"
- << "are part of the "
+ << " are part of the "
"Qt compatibility layer.</b> We advise against "
"using them in new code.</p>\n";
}
diff --git a/src/tools/qlalr/lalr.cpp b/src/tools/qlalr/lalr.cpp
index 4470c8f07f..537051956e 100644
--- a/src/tools/qlalr/lalr.cpp
+++ b/src/tools/qlalr/lalr.cpp
@@ -238,11 +238,11 @@ void Grammar::buildExtendedGrammar ()
non_terminals.insert (accept_symbol);
}
-struct _Nullable: public std::unary_function<Name, bool>
+struct Nullable: public std::unary_function<Name, bool>
{
Automaton *_M_automaton;
- _Nullable (Automaton *aut):
+ Nullable (Automaton *aut):
_M_automaton (aut) {}
bool operator () (Name name) const
@@ -300,7 +300,7 @@ void Automaton::buildNullables ()
for (RulePointer rule = _M_grammar->rules.begin (); rule != _M_grammar->rules.end (); ++rule)
{
- NameList::iterator nn = std::find_if (rule->rhs.begin (), rule->rhs.end (), std::not1 (_Nullable (this)));
+ NameList::iterator nn = std::find_if (rule->rhs.begin (), rule->rhs.end (), std::not1 (Nullable (this)));
if (nn == rule->rhs.end ())
changed |= nullables.insert (rule->lhs).second;
@@ -635,7 +635,7 @@ void Automaton::buildIncludesDigraph ()
if (! _M_grammar->isNonTerminal (*A))
continue;
- NameList::iterator first_not_nullable = std::find_if (dot, rule->rhs.end (), std::not1 (_Nullable (this)));
+ NameList::iterator first_not_nullable = std::find_if (dot, rule->rhs.end (), std::not1 (Nullable (this)));
if (first_not_nullable != rule->rhs.end ())
continue;
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index 335c70eeb6..81beccd5c8 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -189,7 +189,9 @@ Q_GLOBAL_STATIC(QUrl, lastVisitedDir)
\value AnyFile The name of a file, whether it exists or not.
\value ExistingFile The name of a single existing file.
\value Directory The name of a directory. Both files and
- directories are displayed.
+ directories are displayed. However, the native Windows
+ file dialog does not support displaying files in the
+ directory chooser.
\value ExistingFiles The names of zero or more existing files.
This value is obsolete since Qt 4.5:
@@ -2414,9 +2416,12 @@ QUrl QFileDialog::getSaveFileUrl(QWidget *parent,
pass. To ensure a native file dialog, \l{QFileDialog::}{ShowDirsOnly} must
be set.
- On Windows, and OS X, this static function will use the
- native file dialog and not a QFileDialog. On Windows CE, if the device has
- no native file dialog, a QFileDialog will be used.
+ On Windows and OS X, this static function will use the
+ native file dialog and not a QFileDialog. However, the native Windows file
+ dialog does not support displaying files in the directory chooser. You need
+ to pass \l{QFileDialog::}{DontUseNativeDialog} to display files using a
+ QFileDialog. On Windows CE, if the device has no native file dialog, a
+ QFileDialog will be used.
On Unix/X11, the normal behavior of the file dialog is to resolve and
follow symlinks. For example, if \c{/usr/tmp} is a symlink to \c{/var/tmp},
@@ -2424,7 +2429,7 @@ QUrl QFileDialog::getSaveFileUrl(QWidget *parent,
\a options includes DontResolveSymlinks, the file dialog will treat
symlinks as regular directories.
- On Windows the dialog will spin a blocking modal event loop that will not
+ On Windows, the dialog will spin a blocking modal event loop that will not
dispatch any QTimers, and if \a parent is not 0 then it will position the
dialog just below the parent's title bar.
diff --git a/src/widgets/kernel/qaction.cpp b/src/widgets/kernel/qaction.cpp
index 255ffbd258..95c4877eb9 100644
--- a/src/widgets/kernel/qaction.cpp
+++ b/src/widgets/kernel/qaction.cpp
@@ -58,14 +58,9 @@ QT_BEGIN_NAMESPACE
static QString qt_strippedText(QString s)
{
s.remove( QString::fromLatin1("...") );
- int i = 0;
- while (i < s.size()) {
- ++i;
- if (s.at(i-1) != QLatin1Char('&'))
- continue;
- if (i < s.size() && s.at(i) == QLatin1Char('&'))
- ++i;
- s.remove(i-1,1);
+ for (int i = 0; i < s.size(); ++i) {
+ if (s.at(i) == QLatin1Char('&'))
+ s.remove(i, 1);
}
return s.trimmed();
}
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 9195c1e5fa..1ebf782edf 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -12681,11 +12681,21 @@ void QWidget::initPainter(QPainter *painter) const
painter->d_func()->state->font = f;
}
+/*!
+ \internal
+
+ Do PaintDevice rendering with the specified \a offset.
+*/
QPaintDevice *QWidget::redirected(QPoint *offset) const
{
return d_func()->redirected(offset);
}
+/*!
+ \internal
+
+ A painter that is shared among other instances of QPainter.
+*/
QPainter *QWidget::sharedPainter() const
{
// Someone sent a paint event directly to the widget
@@ -12887,6 +12897,45 @@ QDebug operator<<(QDebug debug, const QWidget *widget)
}
#endif // !QT_NO_DEBUG_STREAM
+/*! \fn Qt::HANDLE QWidget::macCGHandle() const
+ \internal
+
+ Returns the CoreGraphics handle of the widget. Use of this function is not portable.
+ This function will return 0 if no painter context can be established, or if the handle
+ could not be created.
+
+ \warning This function is only available on OS X.
+*/
+/*! \fn Qt::HANDLE QWidget::macQDHandle() const
+ \internal
+
+ Returns the QuickDraw handle of the widget. Use of this function is not portable.
+ This function will return 0 if QuickDraw is not supported, or if the handle could
+ not be created.
+
+ \warning This function is only available on OS X.
+*/
+/*! \fn const QX11Info &QWidget::x11Info() const
+ \internal
+
+ Returns information about the configuration of the X display used to display
+ the widget.
+
+ \warning This function is only available on X11.
+*/
+
+/*! \fn Qt::HANDLE QWidget::x11PictureHandle() const
+ \internal
+
+ Returns the X11 picture handle of the widget for XRender
+ support. Use of this function is not portable. This function will
+ return 0 if XRender support is not compiled into Qt, if the
+ XRender extension is not supported on the X11 display, or if the
+ handle could not be created.
+
+ \warning This function is only available on X11.
+
+*/
QT_END_NAMESPACE
#include "moc_qwidget.cpp"
diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp
index fff75d829f..69958636fd 100644
--- a/src/widgets/kernel/qwidgetbackingstore.cpp
+++ b/src/widgets/kernel/qwidgetbackingstore.cpp
@@ -74,7 +74,7 @@ void QWidgetBackingStore::qt_flush(QWidget *widget, const QRegion &region, QBack
Q_UNUSED(widgetTextures);
Q_ASSERT(!region.isEmpty());
#else
- Q_ASSERT(!region.isEmpty() || (widgetTextures && widgetTextures->count()));
+ Q_ASSERT(!region.isEmpty() || widgetTextures);
#endif
Q_ASSERT(widget);
Q_ASSERT(backingStore);
@@ -1123,7 +1123,7 @@ void QWidgetBackingStore::doSync()
widgetTextures = new QPlatformTextureList;
findTextureWidgetsRecursively(tlw, tlw, widgetTextures);
}
- qt_window_private(tlw->windowHandle())->compositing = widgetTextures && !widgetTextures->isEmpty();
+ qt_window_private(tlw->windowHandle())->compositing = widgetTextures;
fullUpdatePending = false;
#endif
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index 633e710853..58436a7d92 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -892,7 +892,7 @@ void QWidgetWindow::handleTabletEvent(QTabletEvent *event)
QGuiApplication::sendSpontaneousEvent(qt_tablet_target, &ev);
}
- if (event->type() == QEvent::TabletRelease)
+ if (event->type() == QEvent::TabletRelease && event->buttons() == Qt::NoButton)
qt_tablet_target = 0;
}
#endif // QT_NO_TABLETEVENT
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 662e1f9b96..380b2b3939 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -4156,7 +4156,7 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op
switch (pe) {
case PE_FrameStatusBar: {
- QRenderRule subRule = renderRule(w->parentWidget(), opt, PseudoElement_Item);
+ QRenderRule subRule = renderRule(w ? w->parentWidget() : Q_NULLPTR, opt, PseudoElement_Item);
if (subRule.hasDrawable()) {
subRule.drawRule(p, opt->rect);
return;
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index 2958d662c7..af085747ec 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -1765,6 +1765,7 @@ void QComboBox::setLineEdit(QLineEdit *edit)
delete d->lineEdit;
d->lineEdit = edit;
+ qt_widget_private(d->lineEdit)->inheritsInputMethodHints = 1;
if (d->lineEdit->parent() != this)
d->lineEdit->setParent(this);
connect(d->lineEdit, SIGNAL(returnPressed()), this, SLOT(_q_returnPressed()));
diff --git a/src/widgets/widgets/qmacnativewidget_mac.mm b/src/widgets/widgets/qmacnativewidget_mac.mm
index 7a7492e717..46a43c4110 100644
--- a/src/widgets/widgets/qmacnativewidget_mac.mm
+++ b/src/widgets/widgets/qmacnativewidget_mac.mm
@@ -142,6 +142,11 @@ QSize QMacNativeWidget::sizeHint() const
return QWidget::sizeHint();
}
+/*! \fn NSView *QMacNativeWidget::nativeView() const
+
+ Returns the native view backing the QMacNativeWidget.
+
+*/
NSView *QMacNativeWidget::nativeView() const
{
winId();
diff --git a/src/widgets/widgets/qtoolbutton.cpp b/src/widgets/widgets/qtoolbutton.cpp
index 93f0b60058..69432761e6 100644
--- a/src/widgets/widgets/qtoolbutton.cpp
+++ b/src/widgets/widgets/qtoolbutton.cpp
@@ -897,7 +897,12 @@ void QToolButton::setDefaultAction(QAction *action)
return;
if (!actions().contains(action))
addAction(action);
- setText(action->text());
+ QString buttonText = action->iconText();
+ // If iconText() is generated from text(), we need to escape any '&'s so they
+ // don't turn into shortcuts
+ if (QActionPrivate::get(action)->iconText.isEmpty())
+ buttonText.replace(QLatin1String("&"), QLatin1String("&&"));
+ setText(buttonText);
setIcon(action->icon());
#ifndef QT_NO_TOOLTIP
setToolTip(action->toolTip());
diff --git a/tests/auto/android/runtests_androiddeployqt.pl b/tests/auto/android/runtests_androiddeployqt.pl
index 3e62e8614a..a73ea054b3 100755
--- a/tests/auto/android/runtests_androiddeployqt.pl
+++ b/tests/auto/android/runtests_androiddeployqt.pl
@@ -390,7 +390,7 @@ sub startTest
system("$adb_tool $device_serial pull /data/data/$packageName/output.txt $output_dir/$output_file.txt") if ($get_txt);
if ($get_txt){
- print "Tesresults for $packageName:\n";
+ print "Test results for $packageName:\n";
my $insig =
print_output("$output_dir/$output_file.txt", $packageName, $insignificance);
}
diff --git a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
index 1b7d410beb..db2805ebf0 100644
--- a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
+++ b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
@@ -411,18 +411,48 @@ void tst_QDebug::qDebugQString() const
qDebug().noquote().nospace() << qSetFieldWidth(8) << string;
QCOMPARE(s_msg, " " + string);
- string = QLatin1String("\nSm\xF8rg\xE5sbord\\");
+ string = "Sm\xc3\xb8rg\xc3\xa5sbord " // Latin script
+ "\xce\x91\xce\xb8\xce\xae\xce\xbd\xce\xb1 " // Greek script
+ "\xd0\x9c\xd0\xbe\xd1\x81\xd0\xba\xd0\xb2\xd0\xb0"; // Cyrillic script
qDebug().noquote().nospace() << string;
QCOMPARE(s_msg, string);
+ // This string only contains printable characters
qDebug() << string;
- QCOMPARE(s_msg, QString("\"\\nSm\\u00F8rg\\u00E5sbord\\\\\""));
+ QCOMPARE(s_msg, '"' + string + '"');
+
+ string = "\n\t\\\"";
+ qDebug().noquote().nospace() << string;
+ QCOMPARE(s_msg, string);
+
+ // This string only contains characters that must be escaped
+ qDebug() << string;
+ QCOMPARE(s_msg, QString("\"\\n\\t\\\\\\\"\""));
- // surrogate pairs (including broken pairings)
- ushort utf16[] = { 0xDC00, 0xD800, 0xDC00, 'x', 0xD800, 0xDC00, 0xD800, 0 };
+ // Unicode escapes, BMP
+ string = "\1" // U+0001: START OF HEADING (category Cc)
+ "\x7f" // U+007F: DELETE (category Cc)
+ "\xc2\xad" // U+00AD: SOFT HYPHEN (category Cf)
+ "\xef\xbb\xbf"; // U+FEFF: ZERO WIDTH NO-BREAK SPACE / BOM (category Cf)
+ qDebug() << string;
+ QCOMPARE(s_msg, QString("\"\\u0001\\u007F\\u00AD\\uFEFF\""));
+
+ // Unicode printable non-BMP
+ string = "\xf0\x90\x80\x80"; // U+10000: LINEAR B SYLLABLE B008 A (category Lo)
+ qDebug() << string;
+ QCOMPARE(s_msg, '"' + string + '"');
+
+ // non-BMP and non-printable
+ string = "\xf3\xa0\x80\x81 " // U+E0001: LANGUAGE TAG (category Cf)
+ "\xf4\x80\x80\x80"; // U+100000: Plane 16 Private Use (category Co)
+ qDebug() << string;
+ QCOMPARE(s_msg, QString("\"\\U000E0001 \\U00100000\""));
+
+ // broken surrogate pairs
+ ushort utf16[] = { 0xDC00, 0xD800, 'x', 0xD800, 0 };
string = QString::fromUtf16(utf16);
qDebug() << string;
- QCOMPARE(s_msg, QString("\"\\uDC00\\U00010000x\\U00010000\\uD800\""));
+ QCOMPARE(s_msg, QString("\"\\uDC00\\uD800x\\uD800\""));
}
void tst_QDebug::qDebugQStringRef() const
@@ -657,5 +687,14 @@ void tst_QDebug::threadSafety() const
}
}
+// Should compile: instentiation of unrelated operator<< should not cause cause compilation
+// error in QDebug operators (QTBUG-47375)
+class TestClassA {};
+class TestClassB {};
+
+template <typename T>
+TestClassA& operator<< (TestClassA& s, T&) { return s; };
+template<> TestClassA& operator<< <TestClassB>(TestClassA& s, TestClassB& l);
+
QTEST_MAIN(tst_QDebug);
#include "tst_qdebug.moc"
diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
index bbee33ac78..8d276b3616 100644
--- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
+++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
@@ -144,12 +144,18 @@ inline bool qIsLikelyToBeNfs(int /* handle */)
#endif
#endif
+static QString seedAndTemplate()
+{
+ qsrand(QDateTime::currentDateTimeUtc().toTime_t());
+ return QDir::tempPath() + "/tst_qfileinfo-XXXXXX";
+}
class tst_QFileInfo : public QObject
{
Q_OBJECT
public:
- tst_QFileInfo() : m_currentDir(QDir::currentPath()) {}
+ tst_QFileInfo() : m_currentDir(QDir::currentPath()), m_dir(seedAndTemplate())
+ {}
private slots:
void initTestCase();
diff --git a/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp b/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp
index deef9eecbf..0f2cfd406d 100644
--- a/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp
+++ b/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp
@@ -376,6 +376,7 @@ private slots:
#ifdef Q_COMPILER_VARIADIC_MACROS
Q_LOGGING_CATEGORY(TST_MACRO_2, "tst.macro.2", QtDebugMsg)
Q_LOGGING_CATEGORY(TST_MACRO_3, "tst.macro.3", QtFatalMsg)
+ Q_LOGGING_CATEGORY(TST_MACRO_4, "tst.macro.4", QtInfoMsg)
#endif
void QLoggingCategoryMacro()
@@ -383,6 +384,7 @@ private slots:
const QLoggingCategory &cat1 = TST_MACRO_1();
QCOMPARE(cat1.categoryName(), "tst.macro.1");
QCOMPARE(cat1.isDebugEnabled(), true);
+ QCOMPARE(cat1.isInfoEnabled(), true);
QCOMPARE(cat1.isWarningEnabled(), true);
QCOMPARE(cat1.isCriticalEnabled(), true);
@@ -390,14 +392,23 @@ private slots:
const QLoggingCategory &cat2 = TST_MACRO_2();
QCOMPARE(cat2.categoryName(), "tst.macro.2");
QCOMPARE(cat2.isDebugEnabled(), true);
+ QCOMPARE(cat2.isInfoEnabled(), true);
QCOMPARE(cat2.isWarningEnabled(), true);
QCOMPARE(cat2.isCriticalEnabled(), true);
const QLoggingCategory &cat3 = TST_MACRO_3();
QCOMPARE(cat3.categoryName(), "tst.macro.3");
QCOMPARE(cat3.isDebugEnabled(), false);
+ QCOMPARE(cat3.isInfoEnabled(), false);
QCOMPARE(cat3.isWarningEnabled(), false);
QCOMPARE(cat3.isCriticalEnabled(), false);
+
+ const QLoggingCategory &cat4 = TST_MACRO_4();
+ QCOMPARE(cat4.categoryName(), "tst.macro.4");
+ QCOMPARE(cat4.isDebugEnabled(), false);
+ QCOMPARE(cat4.isInfoEnabled(), true);
+ QCOMPARE(cat4.isWarningEnabled(), true);
+ QCOMPARE(cat4.isCriticalEnabled(), true);
#endif
}
diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
index 02501ca9d9..0ffac21186 100644
--- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
+++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
@@ -155,6 +155,8 @@ private slots:
void failToStart();
void failToStartWithWait();
void failToStartWithEventLoop();
+ void failToStartEmptyArgs_data();
+ void failToStartEmptyArgs();
protected slots:
void readFromProcess();
@@ -1690,6 +1692,42 @@ void tst_QProcess::failToStartWithEventLoop()
}
}
+void tst_QProcess::failToStartEmptyArgs_data()
+{
+ QTest::addColumn<int>("startOverload");
+ QTest::newRow("start(QString, QStringList, OpenMode)") << 0;
+ QTest::newRow("start(QString, OpenMode)") << 1;
+ QTest::newRow("start(OpenMode)") << 2;
+}
+
+void tst_QProcess::failToStartEmptyArgs()
+{
+ QFETCH(int, startOverload);
+ qRegisterMetaType<QProcess::ProcessError>("QProcess::ProcessError");
+
+ QProcess process;
+ QSignalSpy errorSpy(&process, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error));
+ QVERIFY(errorSpy.isValid());
+
+ switch (startOverload) {
+ case 0:
+ process.start(QString(), QStringList(), QIODevice::ReadWrite);
+ break;
+ case 1:
+ process.start(QString(), QIODevice::ReadWrite);
+ break;
+ case 2:
+ process.start(QIODevice::ReadWrite);
+ break;
+ default:
+ QFAIL("Unhandled QProcess::start overload.");
+ };
+
+ QVERIFY(!process.waitForStarted());
+ QCOMPARE(errorSpy.count(), 1);
+ QCOMPARE(process.error(), QProcess::FailedToStart);
+}
+
//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
index 7c32f2cc12..12abaf47c5 100644
--- a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
@@ -73,10 +73,45 @@ static inline QString testSuiteWarning()
return result;
}
+static bool copyResourceFile(const QString &sourceFileName, const QString &targetFileName,
+ QString *errorMessage)
+{
+
+ QFile sourceFile(sourceFileName);
+ if (!sourceFile.exists()) {
+ *errorMessage = QDir::toNativeSeparators(sourceFileName) + QLatin1String(" does not exist.");
+ return false;
+ }
+ if (!sourceFile.copy(targetFileName)) {
+ *errorMessage = QLatin1String("Cannot copy ")
+ + QDir::toNativeSeparators(sourceFileName) + QLatin1String(" to ")
+ + QDir::toNativeSeparators(targetFileName) + QLatin1String(": ")
+ + sourceFile.errorString();
+ return false;
+ }
+ // QFile::copy() sets the permissions of the source file which are read-only for
+ // resource files. Set write permission to enable deletion of the temporary directory.
+ QFile targetFile(targetFileName);
+ if (!targetFile.setPermissions(targetFile.permissions() | QFileDevice::WriteUser)) {
+ *errorMessage = QLatin1String("Cannot set write permission on ")
+ + QDir::toNativeSeparators(targetFileName) + QLatin1String(": ")
+ + targetFile.errorString();
+ return false;
+ }
+ return true;
+}
+
// Set LANG before QCoreApplication is created
Q_CONSTRUCTOR_FUNCTION(initializeLang)
+static QString seedAndTemplate()
+{
+ qsrand(QDateTime::currentDateTimeUtc().toTime_t());
+ return QDir::tempPath() + "/tst_qmimedatabase-XXXXXX";
+}
+
tst_QMimeDatabase::tst_QMimeDatabase()
+ : m_temporaryDir(seedAndTemplate())
{
}
@@ -103,15 +138,15 @@ void tst_QMimeDatabase::initTestCase()
const QString freeDesktopXml = QStringLiteral("freedesktop.org.xml");
const QString xmlFileName = QLatin1String(RESOURCE_PREFIX) + freeDesktopXml;
- QVERIFY2(QFileInfo(xmlFileName).exists(), qPrintable(xmlFileName + QStringLiteral(" does not exist")));
- QFile xml(xmlFileName);
- QVERIFY(xml.copy(globalPackageDir + '/' + freeDesktopXml));
+ const QString xmlTargetFileName = globalPackageDir + QLatin1Char('/') + freeDesktopXml;
+ QString errorMessage;
+ QVERIFY2(copyResourceFile(xmlFileName, xmlTargetFileName, &errorMessage), qPrintable(errorMessage));
m_testSuite = QFINDTESTDATA("testfiles");
if (m_testSuite.isEmpty())
qWarning("%s", qPrintable(testSuiteWarning()));
- const QString errorMessage = QString::fromLatin1("Cannot find '%1'");
+ errorMessage = QString::fromLatin1("Cannot find '%1'");
m_yastMimeTypes = QLatin1String(RESOURCE_PREFIX) + yastFileName;
QVERIFY2(QFile::exists(m_yastMimeTypes), qPrintable(errorMessage.arg(yastFileName)));
m_qmlAgainFileName = QLatin1String(RESOURCE_PREFIX) + qmlAgainFileName;
@@ -836,8 +871,9 @@ void tst_QMimeDatabase::installNewGlobalMimeType()
if (!QFileInfo(destDir).isDir())
QVERIFY(QDir(m_globalXdgDir).mkpath(destDir));
- QVERIFY(QFile::copy(m_yastMimeTypes, destFile));
- QVERIFY(QFile::copy(m_qmlAgainFileName, destQmlFile));
+ QString errorMessage;
+ QVERIFY2(copyResourceFile(m_yastMimeTypes, destFile, &errorMessage), qPrintable(errorMessage));
+ QVERIFY2(copyResourceFile(m_qmlAgainFileName, destQmlFile, &errorMessage), qPrintable(errorMessage));
if (!waitAndRunUpdateMimeDatabase(mimeDir))
QSKIP("shared-mime-info not found, skipping mime.cache test");
@@ -882,8 +918,9 @@ void tst_QMimeDatabase::installNewLocalMimeType()
QFile::remove(destFile);
const QString destQmlFile = destDir + QLatin1String(qmlAgainFileName);
QFile::remove(destQmlFile);
- QVERIFY(QFile::copy(m_yastMimeTypes, destFile));
- QVERIFY(QFile::copy(m_qmlAgainFileName, destQmlFile));
+ QString errorMessage;
+ QVERIFY2(copyResourceFile(m_yastMimeTypes, destFile, &errorMessage), qPrintable(errorMessage));
+ QVERIFY2(copyResourceFile(m_qmlAgainFileName, destQmlFile, &errorMessage), qPrintable(errorMessage));
if (!runUpdateMimeDatabase(mimeDir)) {
const QString skipWarning = QStringLiteral("shared-mime-info not found, skipping mime.cache test (")
+ QDir::toNativeSeparators(mimeDir) + QLatin1Char(')');
diff --git a/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp b/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp
index 2af37eb86e..b511abf670 100644
--- a/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp
+++ b/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp
@@ -823,6 +823,24 @@ void tst_QTimeZone::tzTest()
QCOMPARE(dat.offsetFromUtc, 3600);
QCOMPARE(dat.standardTimeOffset, 3600);
QCOMPARE(dat.daylightTimeOffset, 0);
+
+ // Test TZ timezone vs UTC timezone for fractionary negative offset
+ QTzTimeZonePrivate tztz1("America/Caracas");
+ QUtcTimeZonePrivate tzutc1("UTC-04:30");
+ QVERIFY(tztz1.isValid());
+ QVERIFY(tzutc1.isValid());
+ QTzTimeZonePrivate::Data datatz1 = tztz1.data(std);
+ QTzTimeZonePrivate::Data datautc1 = tzutc1.data(std);
+ QCOMPARE(datatz1.offsetFromUtc, datautc1.offsetFromUtc);
+
+ // Test TZ timezone vs UTC timezone for fractionary positive offset
+ QTzTimeZonePrivate tztz2("Asia/Calcutta");
+ QUtcTimeZonePrivate tzutc2("UTC+05:30");
+ QVERIFY(tztz2.isValid());
+ QVERIFY(tzutc2.isValid());
+ QTzTimeZonePrivate::Data datatz2 = tztz2.data(std);
+ QTzTimeZonePrivate::Data datautc2 = tzutc2.data(std);
+ QCOMPARE(datatz2.offsetFromUtc, datautc2.offsetFromUtc);
#endif // Q_OS_UNIX
}
diff --git a/tests/auto/dbus/qdbusabstractadaptor/qdbusabstractadaptor.pro b/tests/auto/dbus/qdbusabstractadaptor/qdbusabstractadaptor.pro
index d67d81e4bf..1b35019f94 100644
--- a/tests/auto/dbus/qdbusabstractadaptor/qdbusabstractadaptor.pro
+++ b/tests/auto/dbus/qdbusabstractadaptor/qdbusabstractadaptor.pro
@@ -3,4 +3,4 @@ TARGET = tst_qdbusabstractadaptor
QT = core core-private testlib
TEMPLATE = subdirs
CONFIG += ordered
-SUBDIRS = qmyserver test
+SUBDIRS = qmyserver qdbusabstractadaptor
diff --git a/tests/auto/dbus/qdbusabstractadaptor/test/test.pro b/tests/auto/dbus/qdbusabstractadaptor/qdbusabstractadaptor/qdbusabstractadaptor.pro
index d95fa941f0..d95fa941f0 100644
--- a/tests/auto/dbus/qdbusabstractadaptor/test/test.pro
+++ b/tests/auto/dbus/qdbusabstractadaptor/qdbusabstractadaptor/qdbusabstractadaptor.pro
diff --git a/tests/auto/dbus/qdbusabstractinterface/qdbusabstractinterface.pro b/tests/auto/dbus/qdbusabstractinterface/qdbusabstractinterface.pro
index 623b07fcbd..99462b1b36 100644
--- a/tests/auto/dbus/qdbusabstractinterface/qdbusabstractinterface.pro
+++ b/tests/auto/dbus/qdbusabstractinterface/qdbusabstractinterface.pro
@@ -2,5 +2,5 @@ CONFIG += testcase
TARGET = tst_qdbusabstractinterface
TEMPLATE = subdirs
CONFIG += ordered
-SUBDIRS = qpinger test
+SUBDIRS = qpinger qdbusabstractinterface
OTHER_FILES += org.qtproject.QtDBus.Pinger.xml
diff --git a/tests/auto/dbus/qdbusabstractinterface/test/test.pro b/tests/auto/dbus/qdbusabstractinterface/qdbusabstractinterface/qdbusabstractinterface.pro
index a8cc4c2b38..a8cc4c2b38 100644
--- a/tests/auto/dbus/qdbusabstractinterface/test/test.pro
+++ b/tests/auto/dbus/qdbusabstractinterface/qdbusabstractinterface/qdbusabstractinterface.pro
diff --git a/tests/auto/dbus/qdbusinterface/qdbusinterface.pro b/tests/auto/dbus/qdbusinterface/qdbusinterface.pro
index 093a888765..c8861cb2a4 100644
--- a/tests/auto/dbus/qdbusinterface/qdbusinterface.pro
+++ b/tests/auto/dbus/qdbusinterface/qdbusinterface.pro
@@ -3,4 +3,4 @@ TARGET = tst_qdbusinterface
QT = core testlib
TEMPLATE = subdirs
CONFIG += ordered
-SUBDIRS = qmyserver test
+SUBDIRS = qmyserver qdbusinterface
diff --git a/tests/auto/dbus/qdbusinterface/test/test.pro b/tests/auto/dbus/qdbusinterface/qdbusinterface/qdbusinterface.pro
index 170b555ee7..170b555ee7 100644
--- a/tests/auto/dbus/qdbusinterface/test/test.pro
+++ b/tests/auto/dbus/qdbusinterface/qdbusinterface/qdbusinterface.pro
diff --git a/tests/auto/dbus/qdbusmarshall/qdbusmarshall.pro b/tests/auto/dbus/qdbusmarshall/qdbusmarshall.pro
index dfbb206324..e9a41c0fb4 100644
--- a/tests/auto/dbus/qdbusmarshall/qdbusmarshall.pro
+++ b/tests/auto/dbus/qdbusmarshall/qdbusmarshall.pro
@@ -2,7 +2,7 @@ CONFIG += testcase
TARGET = tst_qdbusmarshall
TEMPLATE = subdirs
CONFIG += ordered
-SUBDIRS = qpong test
+SUBDIRS = qpong qdbusmarshall
QT = core-private testlib
diff --git a/tests/auto/dbus/qdbusmarshall/test/test.pro b/tests/auto/dbus/qdbusmarshall/qdbusmarshall/qdbusmarshall.pro
index b0656231d2..b0656231d2 100644
--- a/tests/auto/dbus/qdbusmarshall/test/test.pro
+++ b/tests/auto/dbus/qdbusmarshall/qdbusmarshall/qdbusmarshall.pro
diff --git a/tests/auto/gui/image/qimage/images/jpeg_exif_invalid_data_QTBUG-46870.jpg b/tests/auto/gui/image/qimage/images/jpeg_exif_invalid_data_QTBUG-46870.jpg
new file mode 100644
index 0000000000..a51a1e3162
--- /dev/null
+++ b/tests/auto/gui/image/qimage/images/jpeg_exif_invalid_data_QTBUG-46870.jpg
Binary files differ
diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp
index c1b32a273c..08f48abd20 100644
--- a/tests/auto/gui/image/qimage/tst_qimage.cpp
+++ b/tests/auto/gui/image/qimage/tst_qimage.cpp
@@ -185,6 +185,7 @@ private slots:
void exifOrientation();
void exif_QTBUG45865();
+ void exif_invalid_data_QTBUG46870();
void cleanupFunctions();
@@ -2872,6 +2873,13 @@ void tst_QImage::exif_QTBUG45865()
QCOMPARE(image.size(), QSize(5, 8));
}
+void tst_QImage::exif_invalid_data_QTBUG46870()
+{
+ QImage image;
+ QVERIFY(image.load(m_prefix + "jpeg_exif_invalid_data_QTBUG-46870.jpg"));
+ QVERIFY(!image.isNull());
+}
+
static void cleanupFunction(void* info)
{
bool *called = static_cast<bool*>(info);
diff --git a/tests/auto/gui/text/qfontcache/tst_qfontcache.cpp b/tests/auto/gui/text/qfontcache/tst_qfontcache.cpp
index 0658d99fb2..272827e57b 100644
--- a/tests/auto/gui/text/qfontcache/tst_qfontcache.cpp
+++ b/tests/auto/gui/text/qfontcache/tst_qfontcache.cpp
@@ -51,15 +51,15 @@ private slots:
void clear();
};
-QT_BEGIN_NAMESPACE
-extern void qt_setQtEnableTestFont(bool value); // qfontdatabase.cpp
-
#ifdef QT_BUILD_INTERNAL
+QT_BEGIN_NAMESPACE
+// qfontdatabase.cpp
+Q_AUTOTEST_EXPORT void qt_setQtEnableTestFont(bool value);
// qfontengine.cpp
-extern void QFontEngine_startCollectingEngines();
-extern QList<QFontEngine *> QFontEngine_stopCollectingEngines();
-#endif
+Q_AUTOTEST_EXPORT void QFontEngine_startCollectingEngines();
+Q_AUTOTEST_EXPORT QList<QFontEngine *> QFontEngine_stopCollectingEngines();
QT_END_NAMESPACE
+#endif
tst_QFontCache::tst_QFontCache()
{
@@ -79,6 +79,7 @@ void tst_QFontCache::clear()
QFontEngine *fontEngine = 0;
+#ifdef QT_BUILD_INTERNAL
{
// we're never caching the box (and the "test") font engines
// let's ensure we're not leaking them as well as the cached ones
@@ -88,6 +89,7 @@ void tst_QFontCache::clear()
f.setFamily("__Qt__Box__Engine__");
f.exactMatch(); // loads engine
}
+#endif
{
QFontDatabase db;
diff --git a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
index b19f90935b..18da61925d 100644
--- a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
+++ b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
@@ -68,6 +68,7 @@ public slots:
private slots:
void getSetCheck();
void lineBreaking();
+#ifdef QT_BUILD_INTERNAL
void simpleBoundingRect();
void threeLineBoundingRect();
void boundingRectWithLongLineAndNoWrap();
@@ -83,16 +84,20 @@ private slots:
void horizontalAlignment();
void horizontalAlignmentMultiline_data();
void horizontalAlignmentMultiline();
+#endif
void defaultWordSeparators_data();
void defaultWordSeparators();
void cursorMovementFromInvalidPositions();
void cursorMovementInsideSpaces();
void charWordStopOnLineSeparator();
+#ifdef QT_BUILD_INTERNAL
void xToCursorAtEndOfLine();
+#endif
void boundingRectTopLeft();
void graphemeBoundaryForSurrogatePairs();
void tabStops();
void integerOverflow();
+#ifdef QT_BUILD_INTERNAL
void testDefaultTabs();
void testTabs();
void testMultilineTab();
@@ -103,6 +108,7 @@ private slots:
void testMultiTab();
void testTabDPIScale();
void tabsForRtl();
+#endif
void tabHeight();
void capitalization_allUpperCase();
void capitalization_allUpperCase_newline();
@@ -119,12 +125,14 @@ private slots:
void layoutWithCustomTabStops();
// QTextLine stuff
+#ifdef QT_BUILD_INTERNAL
void setNumColumnsWrapAtWordBoundaryOrAnywhere();
void setNumColumnsWordWrap();
void smallTextLengthNoWrap();
void smallTextLengthWordWrap();
void smallTextLengthWrapAtWordBoundaryOrAnywhere();
void testLineBreakingAllSpaces();
+#endif
void lineWidthFromBOM();
void textWidthVsWIdth();
void textWithSurrogates_qtbug15679();
@@ -143,7 +151,7 @@ private:
void tst_QTextLayout::getSetCheck()
{
QString str("Bogus text");
- QTextLayout layout(str, testFont);
+ QTextLayout layout(str);
layout.beginLayout();
QTextEngine *engine = layout.engine();
QTextInlineObject obj1(0, engine);
@@ -177,13 +185,18 @@ void tst_QTextLayout::getSetCheck()
QCOMPARE(true, obj2.cacheEnabled());
}
+#ifdef QT_BUILD_INTERNAL
QT_BEGIN_NAMESPACE
-extern void qt_setQtEnableTestFont(bool value);
+// qfontdatabase.cpp
+Q_AUTOTEST_EXPORT void qt_setQtEnableTestFont(bool value);
QT_END_NAMESPACE
+#endif
tst_QTextLayout::tst_QTextLayout()
{
+#ifdef QT_BUILD_INTERNAL
qt_setQtEnableTestFont(true);
+#endif
}
tst_QTextLayout::~tst_QTextLayout()
@@ -193,10 +206,14 @@ tst_QTextLayout::~tst_QTextLayout()
void tst_QTextLayout::init()
{
testFont = QFont();
+#ifdef QT_BUILD_INTERNAL
testFont.setFamily("__Qt__Box__Engine__");
+#endif
testFont.setPixelSize(TESTFONT_SIZE);
testFont.setWeight(QFont::Normal);
+#ifdef QT_BUILD_INTERNAL
QCOMPARE(QFontMetrics(testFont).width('a'), testFont.pixelSize());
+#endif
}
void tst_QTextLayout::cleanup()
@@ -286,6 +303,7 @@ void tst_QTextLayout::lineBreaking()
#endif
}
+#ifdef QT_BUILD_INTERNAL
void tst_QTextLayout::simpleBoundingRect()
{
/* just check if boundingRect() gives sane values. The text is not broken. */
@@ -972,6 +990,7 @@ void tst_QTextLayout::horizontalAlignmentMultiline()
QCOMPARE(rect.left(), lastLeft);
QCOMPARE(rect.right(), lastRight);
}
+#endif
void tst_QTextLayout::defaultWordSeparators_data()
{
@@ -1009,7 +1028,7 @@ void tst_QTextLayout::defaultWordSeparators()
QFETCH(QString, text);
QFETCH(int, startPos);
QFETCH(int, endPos);
- QTextLayout layout(text, testFont);
+ QTextLayout layout(text);
QCOMPARE(layout.nextCursorPosition(startPos, QTextLayout::SkipWords), endPos);
QCOMPARE(layout.previousCursorPosition(endPos, QTextLayout::SkipWords), startPos);
@@ -1019,7 +1038,7 @@ void tst_QTextLayout::cursorMovementFromInvalidPositions()
{
int badpos = 10000;
- QTextLayout layout("ABC", testFont);
+ QTextLayout layout("ABC");
QCOMPARE(layout.previousCursorPosition(-badpos, QTextLayout::SkipCharacters), -badpos);
QCOMPARE(layout.nextCursorPosition(-badpos, QTextLayout::SkipCharacters), -badpos);
@@ -1030,13 +1049,13 @@ void tst_QTextLayout::cursorMovementFromInvalidPositions()
void tst_QTextLayout::cursorMovementInsideSpaces()
{
- QTextLayout layout("ABC DEF", testFont);
+ QTextLayout layout("ABC DEF");
QCOMPARE(layout.previousCursorPosition(6, QTextLayout::SkipWords), 0);
QCOMPARE(layout.nextCursorPosition(6, QTextLayout::SkipWords), 15);
- QTextLayout layout2("ABC\t\t\t\t\t\t\t\t\t\t\t\tDEF", testFont);
+ QTextLayout layout2("ABC\t\t\t\t\t\t\t\t\t\t\t\tDEF");
QCOMPARE(layout2.previousCursorPosition(6, QTextLayout::SkipWords), 0);
QCOMPARE(layout2.nextCursorPosition(6, QTextLayout::SkipWords), 15);
@@ -1048,13 +1067,14 @@ void tst_QTextLayout::charWordStopOnLineSeparator()
QString txt;
txt.append(lineSeparator);
txt.append(lineSeparator);
- QTextLayout layout(txt, testFont);
+ QTextLayout layout(txt);
QTextEngine *engine = layout.engine();
const QCharAttributes *attrs = engine->attributes();
QVERIFY(attrs);
QVERIFY(attrs[1].graphemeBoundary);
}
+#ifdef QT_BUILD_INTERNAL
void tst_QTextLayout::xToCursorAtEndOfLine()
{
QString text = "FirstLine SecondLine";
@@ -1078,13 +1098,14 @@ void tst_QTextLayout::xToCursorAtEndOfLine()
line = layout.lineAt(1);
QCOMPARE(line.xToCursor(100000), 20);
}
+#endif
void tst_QTextLayout::boundingRectTopLeft()
{
QString text = "FirstLine\nSecondLine";
text.replace('\n', QChar::LineSeparator);
- QTextLayout layout(text, testFont);
+ QTextLayout layout(text);
layout.setCacheEnabled(true);
layout.beginLayout();
@@ -1106,7 +1127,7 @@ void tst_QTextLayout::graphemeBoundaryForSurrogatePairs()
txt.append(0xd87e);
txt.append(0xdc25);
txt.append("b");
- QTextLayout layout(txt, testFont);
+ QTextLayout layout(txt);
QTextEngine *engine = layout.engine();
const QCharAttributes *attrs = engine->attributes();
QVERIFY(attrs);
@@ -1119,13 +1140,13 @@ void tst_QTextLayout::graphemeBoundaryForSurrogatePairs()
void tst_QTextLayout::tabStops()
{
QString txt("Hello there\tworld");
- QTextLayout layout(txt, testFont);
+ QTextLayout layout(txt);
layout.beginLayout();
QTextLine line = layout.createLine();
QVERIFY(line.isValid());
line.setNumColumns(11);
- QCOMPARE(line.textLength(), TESTFONT_SIZE);
+ QCOMPARE(line.textLength(), 12);
line = layout.createLine();
QVERIFY(line.isValid());
@@ -1142,7 +1163,7 @@ void tst_QTextLayout::integerOverflow()
for (int i = 0; i < 8; ++i)
txt += txt;
- QTextLayout layout(txt, testFont);
+ QTextLayout layout(txt);
layout.beginLayout();
QTextLine line = layout.createLine();
@@ -1155,6 +1176,7 @@ void tst_QTextLayout::integerOverflow()
layout.endLayout();
}
+#ifdef QT_BUILD_INTERNAL
void tst_QTextLayout::setNumColumnsWrapAtWordBoundaryOrAnywhere()
{
QString txt("This is a small test text");
@@ -1696,22 +1718,23 @@ void tst_QTextLayout::testTabDPIScale()
QCOMPARE(line.cursorToX(12), tabs.at(1).position * scale - TESTFONT_SIZE * 5);
QCOMPARE(line.cursorToX(18), tabs.at(2).position * scale - TESTFONT_SIZE * 3 / 2.0);
}
+#endif
void tst_QTextLayout::tabHeight()
{
- QTextLayout layout("\t", testFont);
+ QTextLayout layout("\t");
layout.setCacheEnabled(true);
layout.beginLayout();
QTextLine line = layout.createLine();
layout.endLayout();
- QCOMPARE(qRound(line.ascent()), QFontMetrics(testFont).ascent());
- QCOMPARE(qRound(line.descent()), QFontMetrics(testFont).descent());
+ QCOMPARE(qRound(line.ascent()), QFontMetrics(layout.font()).ascent());
+ QCOMPARE(qRound(line.descent()), QFontMetrics(layout.font()).descent());
}
void tst_QTextLayout::capitalization_allUpperCase()
{
- QFont font(testFont);
+ QFont font;
font.setCapitalization(QFont::AllUppercase);
QTextLayout layout("Test", font);
layout.setCacheEnabled(true);
@@ -1727,7 +1750,7 @@ void tst_QTextLayout::capitalization_allUpperCase()
void tst_QTextLayout::capitalization_allUpperCase_newline()
{
- QFont font(testFont);
+ QFont font;
font.setCapitalization(QFont::AllUppercase);
QString tmp = "hello\nworld!";
@@ -1749,7 +1772,7 @@ void tst_QTextLayout::capitalization_allUpperCase_newline()
void tst_QTextLayout::capitalization_allLowerCase()
{
- QFont font(testFont);
+ QFont font;
font.setCapitalization(QFont::AllLowercase);
QTextLayout layout("Test", font);
layout.setCacheEnabled(true);
@@ -1765,7 +1788,7 @@ void tst_QTextLayout::capitalization_allLowerCase()
void tst_QTextLayout::capitalization_smallCaps()
{
- QFont font(testFont);
+ QFont font;
font.setCapitalization(QFont::SmallCaps);
QTextLayout layout("Test", font);
layout.setCacheEnabled(true);
@@ -1782,7 +1805,7 @@ void tst_QTextLayout::capitalization_smallCaps()
void tst_QTextLayout::capitalization_capitalize()
{
- QFont font(testFont);
+ QFont font;
font.setCapitalization(QFont::Capitalize);
QTextLayout layout("hello\tworld", font);
layout.setCacheEnabled(true);
@@ -1805,7 +1828,7 @@ void tst_QTextLayout::longText()
QString longText(128000, 'a');
{
- QTextLayout layout(longText, testFont);
+ QTextLayout layout(longText);
layout.setCacheEnabled(true);
layout.beginLayout();
QTextLine line = layout.createLine();
@@ -1815,7 +1838,7 @@ void tst_QTextLayout::longText()
}
for (int cap = QFont::MixedCase; cap < QFont::Capitalize + 1; ++cap) {
- QFont f(testFont);
+ QFont f;
f.setCapitalization(QFont::Capitalization(cap));
QTextLayout layout(longText, f);
layout.setCacheEnabled(true);
@@ -1827,7 +1850,7 @@ void tst_QTextLayout::longText()
}
{
- QTextLayout layout(longText, testFont);
+ QTextLayout layout(longText);
layout.setCacheEnabled(true);
layout.setFlags(Qt::TextForceLeftToRight);
layout.beginLayout();
@@ -1838,7 +1861,7 @@ void tst_QTextLayout::longText()
}
{
- QTextLayout layout(longText, testFont);
+ QTextLayout layout(longText);
layout.setCacheEnabled(true);
layout.setFlags(Qt::TextForceRightToLeft);
layout.beginLayout();
@@ -1851,7 +1874,8 @@ void tst_QTextLayout::longText()
void tst_QTextLayout::widthOfTabs()
{
- QTextEngine engine("ddd\t\t", testFont);
+ QTextEngine engine;
+ engine.text = "ddd\t\t";
engine.ignoreBidi = true;
engine.itemize();
QCOMPARE(qRound(engine.width(0, 5)), qRound(engine.boundingBox(0, 5).width));
@@ -2079,7 +2103,7 @@ void tst_QTextLayout::cursorInNonStopChars()
void tst_QTextLayout::justifyTrailingSpaces()
{
- QTextLayout layout(QStringLiteral(" t"), testFont);
+ QTextLayout layout(QStringLiteral(" t"));
layout.setTextOption(QTextOption(Qt::AlignJustify));
layout.beginLayout();
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
index 5a685037a1..4d41d4beb1 100644
--- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -88,6 +88,14 @@ Q_DECLARE_METATYPE(QSharedPointer<char>)
#include "../../../network-settings.h"
+// Non-OpenSSL backends are not able to report a specific error code
+// for self-signed certificates.
+#ifndef QT_NO_OPENSSL
+#define FLUKE_CERTIFICATE_ERROR QSslError::SelfSignedCertificate
+#else
+#define FLUKE_CERTIFICATE_ERROR QSslError::CertificateUntrusted
+#endif
+
Q_DECLARE_METATYPE(QAuthenticator*)
#ifndef QT_NO_NETWORKPROXY
Q_DECLARE_METATYPE(QNetworkProxyQuery)
@@ -6047,8 +6055,8 @@ void tst_QNetworkReply::ignoreSslErrorsList_data()
QList<QSslError> expectedSslErrors;
QList<QSslCertificate> certs = QSslCertificate::fromPath(testDataDir + "/certs/qt-test-server-cacert.pem");
- QSslError rightError(QSslError::SelfSignedCertificate, certs.at(0));
- QSslError wrongError(QSslError::SelfSignedCertificate);
+ QSslError rightError(FLUKE_CERTIFICATE_ERROR, certs.at(0));
+ QSslError wrongError(FLUKE_CERTIFICATE_ERROR);
QTest::newRow("SSL-failure-empty-list") << "https://" + QtNetworkSettings::serverName() + "/index.html" << expectedSslErrors << QNetworkReply::SslHandshakeFailedError;
expectedSslErrors.append(wrongError);
diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
index 5b27b7d2b4..dc41a93906 100644
--- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
+++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
@@ -1574,7 +1574,7 @@ void tst_QUdpSocket::readyRead()
QSignalSpy spy(&receiver, SIGNAL(readyRead()));
// send a datagram to that port
- sender.writeDatagram("a", makeNonAny(receiver.localAddress()), port);
+ sender.writeDatagram("aa", makeNonAny(receiver.localAddress()), port);
// wait a little
// if QTBUG-43857 is still going, we'll live-lock on socket notifications from receiver's socket
@@ -1583,8 +1583,8 @@ void tst_QUdpSocket::readyRead()
// make sure only one signal was emitted
QCOMPARE(spy.count(), 1);
QVERIFY(receiver.hasPendingDatagrams());
- QCOMPARE(receiver.bytesAvailable(), qint64(1));
- QCOMPARE(receiver.pendingDatagramSize(), qint64(1));
+ QCOMPARE(receiver.bytesAvailable(), qint64(2));
+ QCOMPARE(receiver.pendingDatagramSize(), qint64(2));
// write another datagram
sender.writeDatagram("ab", makeNonAny(receiver.localAddress()), port);
@@ -1594,7 +1594,7 @@ void tst_QUdpSocket::readyRead()
QCOMPARE(spy.count(), 1);
QVERIFY(receiver.hasPendingDatagrams());
QVERIFY(receiver.bytesAvailable() >= 1); // most likely is 1, but it could be 1 + 2 in the future
- QCOMPARE(receiver.pendingDatagramSize(), qint64(1));
+ QCOMPARE(receiver.pendingDatagramSize(), qint64(2));
// read all the datagrams (we could read one only, but we can't be sure the OS is queueing)
while (receiver.hasPendingDatagrams())
diff --git a/tests/auto/network/ssl/qsslcertificate/certificates/dsa-cert-ss.der.pubkey b/tests/auto/network/ssl/qsslcertificate/certificates/dsa-cert-ss.der.pubkey
new file mode 100644
index 0000000000..4e46848106
--- /dev/null
+++ b/tests/auto/network/ssl/qsslcertificate/certificates/dsa-cert-ss.der.pubkey
Binary files differ
diff --git a/tests/auto/network/ssl/qsslcertificate/certificates/dsa-cert-ss.pem b/tests/auto/network/ssl/qsslcertificate/certificates/dsa-cert-ss.pem
new file mode 100644
index 0000000000..d81f8f1def
--- /dev/null
+++ b/tests/auto/network/ssl/qsslcertificate/certificates/dsa-cert-ss.pem
@@ -0,0 +1,16 @@
+-----BEGIN CERTIFICATE-----
+MIICijCCAkgCCQC7PDslmXiXHzALBglghkgBZQMEAwIwKTEaMBgGA1UEAwwRbmFt
+ZS93aXRoL3NsYXNoZXMxCzAJBgNVBAYTAk5PMB4XDTE1MDcyOTEyMTAyNloXDTE1
+MDgyODEyMTAyNlowKTEaMBgGA1UEAwwRbmFtZS93aXRoL3NsYXNoZXMxCzAJBgNV
+BAYTAk5PMIIBtjCCASsGByqGSM44BAEwggEeAoGBAMJjrSlWu595Nf9UAAeggH6k
+US30P+pigB5WEgeToqTkpIwHO24GdEL+dGtFVWwT+r+rSuI+SZPMMSQWpVcgjeCq
+oaPpn+9P5gCof1jmn4oegis4K8hJANnsDDdE1HRkeVDSzFlkmvk+FnVfB0wI0T8F
+k7BV4wZDyvgTKko6t7YZAhUAoXZvBxhaUam1WnS18Yrk+1IT3u8CgYAx22xg8DQG
+4HE2vGH0p3Ug2FziCtjpDaN1ryomPbroQSK7/x9dhuy/4b1H2KdJufawWTVPdBI5
+TfXXvCcJEmQKKegarq3DFPGkpH+rp72GejEgmBMUU22+1NHga3VzSspLjAK2e/+r
++foHHzJnGQs6JrvMNaXK+UVJxXRp878CGgOBhAACgYAKoweyuHdke1ngEmgXMPrC
+NBJiPPHPcEX9CSZasSka7gI6OWZDk6H80W1KRPxHMeKb4V06wa02IbZvWA5zeStC
+OtmMCylk5Tzav8/UqYeDAqjddbSm7i423/pjmUh+eD/wLHvJxYanRm8nqBQLe1jL
+2NmVkb1OpCyMK+sRF+K+sjALBglghkgBZQMEAwIDLwAwLAIUHVt2TWRAe/JSEHY1
+x6+igQb3AFQCFHYwbrScyMUwuVkNft2ttDN1I7ak
+-----END CERTIFICATE-----
diff --git a/tests/auto/network/ssl/qsslcertificate/certificates/dsa-cert-ss.pem.digest-md5 b/tests/auto/network/ssl/qsslcertificate/certificates/dsa-cert-ss.pem.digest-md5
new file mode 100644
index 0000000000..dba3fdff03
--- /dev/null
+++ b/tests/auto/network/ssl/qsslcertificate/certificates/dsa-cert-ss.pem.digest-md5
@@ -0,0 +1 @@
+MD5 Fingerprint=35:B0:60:B2:37:14:43:31:01:71:C0:D9:CE:AF:20:CB
diff --git a/tests/auto/network/ssl/qsslcertificate/certificates/dsa-cert-ss.pem.digest-sha1 b/tests/auto/network/ssl/qsslcertificate/certificates/dsa-cert-ss.pem.digest-sha1
new file mode 100644
index 0000000000..3879ef954f
--- /dev/null
+++ b/tests/auto/network/ssl/qsslcertificate/certificates/dsa-cert-ss.pem.digest-sha1
@@ -0,0 +1 @@
+SHA1 Fingerprint=BD:46:36:00:D7:31:3F:95:46:55:62:1A:FB:CA:36:A3:3D:27:15:92
diff --git a/tests/auto/network/ssl/qsslcertificate/certificates/dsa-cert-ss.pem.pubkey b/tests/auto/network/ssl/qsslcertificate/certificates/dsa-cert-ss.pem.pubkey
new file mode 100644
index 0000000000..c44fd6f4a9
--- /dev/null
+++ b/tests/auto/network/ssl/qsslcertificate/certificates/dsa-cert-ss.pem.pubkey
@@ -0,0 +1,12 @@
+-----BEGIN PUBLIC KEY-----
+MIIBtjCCASsGByqGSM44BAEwggEeAoGBAMJjrSlWu595Nf9UAAeggH6kUS30P+pi
+gB5WEgeToqTkpIwHO24GdEL+dGtFVWwT+r+rSuI+SZPMMSQWpVcgjeCqoaPpn+9P
+5gCof1jmn4oegis4K8hJANnsDDdE1HRkeVDSzFlkmvk+FnVfB0wI0T8Fk7BV4wZD
+yvgTKko6t7YZAhUAoXZvBxhaUam1WnS18Yrk+1IT3u8CgYAx22xg8DQG4HE2vGH0
+p3Ug2FziCtjpDaN1ryomPbroQSK7/x9dhuy/4b1H2KdJufawWTVPdBI5TfXXvCcJ
+EmQKKegarq3DFPGkpH+rp72GejEgmBMUU22+1NHga3VzSspLjAK2e/+r+foHHzJn
+GQs6JrvMNaXK+UVJxXRp878CGgOBhAACgYAKoweyuHdke1ngEmgXMPrCNBJiPPHP
+cEX9CSZasSka7gI6OWZDk6H80W1KRPxHMeKb4V06wa02IbZvWA5zeStCOtmMCylk
+5Tzav8/UqYeDAqjddbSm7i423/pjmUh+eD/wLHvJxYanRm8nqBQLe1jL2NmVkb1O
+pCyMK+sRF+K+sg==
+-----END PUBLIC KEY-----
diff --git a/tests/auto/network/ssl/qsslcertificate/certificates/ec-cert-ss.der.pubkey b/tests/auto/network/ssl/qsslcertificate/certificates/ec-cert-ss.der.pubkey
new file mode 100644
index 0000000000..05e3f82ebd
--- /dev/null
+++ b/tests/auto/network/ssl/qsslcertificate/certificates/ec-cert-ss.der.pubkey
Binary files differ
diff --git a/tests/auto/network/ssl/qsslcertificate/certificates/ec-cert-ss.pem b/tests/auto/network/ssl/qsslcertificate/certificates/ec-cert-ss.pem
new file mode 100644
index 0000000000..c4843c4420
--- /dev/null
+++ b/tests/auto/network/ssl/qsslcertificate/certificates/ec-cert-ss.pem
@@ -0,0 +1,11 @@
+-----BEGIN CERTIFICATE-----
+MIIBfjCCAQUCCQC0FR+dPQNT7TAKBggqhkjOPQQDAjApMRowGAYDVQQDDBFuYW1l
+L3dpdGgvc2xhc2hlczELMAkGA1UEBhMCTk8wHhcNMTUwNzI5MTIyNDA2WhcNMTUw
+ODI4MTIyNDA2WjApMRowGAYDVQQDDBFuYW1lL3dpdGgvc2xhc2hlczELMAkGA1UE
+BhMCTk8wdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQk+TMJ/Zu30xojWhWSFnllEgEF
++jBRIxSoJ8T7vaPy3dV0Dxomv5NxOi0kn1kzYUzMoMReK/IAJ3bfRGyFbV4i/KDJ
+VAvyEevvMnp2ewKxmwlg9E9n+d4Tm7tf5+3Tz+EwCgYIKoZIzj0EAwIDZwAwZAIw
+cM1DRkrcg4IPUZZaP96rI70H7OT3VDg5zSNMkEE/QBPGtE7T1Lzkxk96e/BkiQoV
+AjB/t955UraOxLtnqjSHvVmiczWK+2b4QV+wiQBV6XTLI6FUeKLa70I0ruLdIgJ4
+zKU=
+-----END CERTIFICATE-----
diff --git a/tests/auto/network/ssl/qsslcertificate/certificates/ec-cert-ss.pem.digest-md5 b/tests/auto/network/ssl/qsslcertificate/certificates/ec-cert-ss.pem.digest-md5
new file mode 100644
index 0000000000..69ad0aa247
--- /dev/null
+++ b/tests/auto/network/ssl/qsslcertificate/certificates/ec-cert-ss.pem.digest-md5
@@ -0,0 +1 @@
+MD5 Fingerprint=83:EF:5F:FF:C1:DB:E0:AC:4A:FA:E1:1C:9F:07:9B:1E
diff --git a/tests/auto/network/ssl/qsslcertificate/certificates/ec-cert-ss.pem.digest-sha1 b/tests/auto/network/ssl/qsslcertificate/certificates/ec-cert-ss.pem.digest-sha1
new file mode 100644
index 0000000000..7547b5ce3f
--- /dev/null
+++ b/tests/auto/network/ssl/qsslcertificate/certificates/ec-cert-ss.pem.digest-sha1
@@ -0,0 +1 @@
+SHA1 Fingerprint=06:07:56:98:99:A1:45:D7:94:14:5A:B9:92:97:35:35:C8:EA:7C:3E
diff --git a/tests/auto/network/ssl/qsslcertificate/certificates/ec-cert-ss.pem.pubkey b/tests/auto/network/ssl/qsslcertificate/certificates/ec-cert-ss.pem.pubkey
new file mode 100644
index 0000000000..1ced61d62c
--- /dev/null
+++ b/tests/auto/network/ssl/qsslcertificate/certificates/ec-cert-ss.pem.pubkey
@@ -0,0 +1,5 @@
+-----BEGIN PUBLIC KEY-----
+MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEJPkzCf2bt9MaI1oVkhZ5ZRIBBfowUSMU
+qCfE+72j8t3VdA8aJr+TcTotJJ9ZM2FMzKDEXivyACd230RshW1eIvygyVQL8hHr
+7zJ6dnsCsZsJYPRPZ/neE5u7X+ft08/h
+-----END PUBLIC KEY-----
diff --git a/tests/auto/network/ssl/qsslcertificate/certificates/gencertificates.sh b/tests/auto/network/ssl/qsslcertificate/certificates/gencertificates.sh
index b21776536b..50d17b9453 100755
--- a/tests/auto/network/ssl/qsslcertificate/certificates/gencertificates.sh
+++ b/tests/auto/network/ssl/qsslcertificate/certificates/gencertificates.sh
@@ -34,7 +34,8 @@
# This script generates digital certificates of different types.
-#--- Certificates ---------------------------------------------------------------------------
+#--- RSA Certificates -----------------------------------------------------------------------
+
echo -e "\ngenerating 1024-bit RSA private key to PEM file ..."
openssl genrsa -out rsa-pri-1024.pem 1024
@@ -57,6 +58,38 @@ openssl x509 -req -in req.pem -out cert.pem -CA ca-cert.pem -set_serial 17
echo -e "\n generating a certifificate signed by a dummy CA to DER file ..."
openssl x509 -req -in req.pem -out cert.der -CA ca-cert.pem -set_serial 17 -outform der
+#--- DSA Certificates -----------------------------------------------------------------------
+echo -e "\ngenerating DSA parameters to PEM file ..."
+openssl dsaparam -out dsapar-1024.pem 1024
+
+echo -e "\ngenerating DSA private key to PEM file ..."
+openssl gendsa dsapar-1024.pem -out dsa-pri-1024.pem
+/bin/rm dsapar-1024.pem
+
+echo -e "\ngenerating DSA public key to PEM and DER file ..."
+openssl dsa -in dsa-pri-1024.pem -pubout -out dsa-pub-1024.pem
+openssl dsa -in dsa-pri-1024.pem -pubout -out dsa-pub-1024.der -outform der
+
+echo -e "\ngenerating certificate signing request (CSR) ..."
+openssl req -out req.pem -new -key dsa-pri-1024.pem -subj "/CN=name\/with\/slashes/C=NO"
+
+echo -e "\n generating a self-signed certifificate to PEM file ..."
+openssl x509 -req -in req.pem -out dsa-cert-ss.pem -signkey dsa-pri-1024.pem
+
+#--- EC Certificates ------------------------------------------------------------------------
+echo -e "\ngenerating EC private key to PEM file ..."
+openssl ecparam -name secp384r1 -genkey -noout -out ec-pri-384.pem
+
+echo -e "\ngenerating EC public key to PEM and DER file ..."
+openssl ec -in ec-pri-384.pem -pubout -out ec-pub-384.pem
+openssl ec -in ec-pri-384.pem -pubout -out ec-pub-384.der -outform DER
+
+echo -e "\ngenerating certificate signing request (CSR) ..."
+openssl req -out req.pem -new -key ec-pri-384.pem -subj "/CN=name\/with\/slashes/C=NO"
+
+echo -e "\n generating a self-signed certifificate to PEM file ..."
+openssl x509 -req -in req.pem -out ec-cert-ss.pem -signkey ec-pri-384.pem
+
#--- Public keys --------------------------------------------------------------------------------
echo -e "\n associate public keys with all certificates ..."
# Note: For now, there is only one public key (encoded in both PEM and DER), but that could change.
@@ -64,6 +97,10 @@ echo -e "\n associate public keys with all certificates ..."
/bin/cp rsa-pub-1024.der cert-ss.der.pubkey
/bin/cp rsa-pub-1024.pem cert.pem.pubkey
/bin/cp rsa-pub-1024.der cert.der.pubkey
+/bin/cp dsa-pub-1024.pem dsa-cert-ss.pem.pubkey
+/bin/cp dsa-pub-1024.der dsa-cert-ss.der.pubkey
+/bin/cp ec-pub-384.pem ec-cert-ss.pem.pubkey
+/bin/cp ec-pub-384.der ec-cert-ss.der.pubkey
#--- Digests --------------------------------------------------------------------------------
echo -e "\n generating md5 and sha1 digests of all certificates ..."
@@ -72,6 +109,8 @@ do
openssl x509 -in ca-cert.pem -noout -fingerprint -$digest > ca-cert.pem.digest-$digest
openssl x509 -in cert-ss.pem -noout -fingerprint -$digest > cert-ss.pem.digest-$digest
openssl x509 -in cert.pem -noout -fingerprint -$digest > cert.pem.digest-$digest
+ openssl x509 -in dsa-cert-ss.pem -noout -fingerprint -$digest > dsa-cert-ss.pem.digest-$digest
+ openssl x509 -in ec-cert-ss.pem -noout -fingerprint -$digest > ec-cert-ss.pem.digest-$digest
done
#--- Subjet Alternative Name extension ----------------------------------------------------
@@ -93,4 +132,7 @@ openssl req -x509 -in req-san.pem -out $outname -key rsa-pri-1024.pem \
/bin/cp san.cnf $outname.san
echo -e "\n cleaning up ..."
-/bin/rm rsa-pri-1024.pem rsa-pub-1024.* req*.pem
+/bin/rm rsa-pri-1024.pem rsa-pub-1024.*
+/bin/rm dsa-pri-1024.pem dsa-pub-1024.*
+/bin/rm ec-pri-384.pem ec-pub-384.*
+/bin/rm req*.pem
diff --git a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp
index 5e7e250bfd..4c288fffaf 100644
--- a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp
+++ b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp
@@ -494,12 +494,20 @@ void tst_QSslCertificate::publicKey()
QFETCH(QSsl::EncodingFormat, format);
QFETCH(QString, pubkeyFilePath);
+ QSsl::KeyAlgorithm algorithm;
+ if (QFileInfo(pubkeyFilePath).fileName().startsWith("dsa-"))
+ algorithm = QSsl::Dsa;
+ else if (QFileInfo(pubkeyFilePath).fileName().startsWith("ec-"))
+ algorithm = QSsl::Ec;
+ else
+ algorithm = QSsl::Rsa;
+
QByteArray encodedCert = readFile(certFilePath);
QSslCertificate certificate(encodedCert, format);
QVERIFY(!certificate.isNull());
QByteArray encodedPubkey = readFile(pubkeyFilePath);
- QSslKey pubkey(encodedPubkey, QSsl::Rsa, format, QSsl::PublicKey); // ### support DSA as well!
+ QSslKey pubkey(encodedPubkey, algorithm, format, QSsl::PublicKey);
QVERIFY(!pubkey.isNull());
QCOMPARE(certificate.publicKey(), pubkey);
@@ -581,7 +589,7 @@ void tst_QSslCertificate::fromPath_data()
QTest::newRow("\"certificates/*\" fixed der") << QString("certificates/*") << int(QRegExp::FixedString) << false << 0;
QTest::newRow("\"certificates/*\" regexp pem") << QString("certificates/*") << int(QRegExp::RegExp) << true << 0;
QTest::newRow("\"certificates/*\" regexp der") << QString("certificates/*") << int(QRegExp::RegExp) << false << 0;
- QTest::newRow("\"certificates/*\" wildcard pem") << QString("certificates/*") << int(QRegExp::Wildcard) << true << 5;
+ QTest::newRow("\"certificates/*\" wildcard pem") << QString("certificates/*") << int(QRegExp::Wildcard) << true << 7;
QTest::newRow("\"certificates/ca*\" wildcard pem") << QString("certificates/ca*") << int(QRegExp::Wildcard) << true << 1;
QTest::newRow("\"certificates/cert*\" wildcard pem") << QString("certificates/cert*") << int(QRegExp::Wildcard) << true << 4;
QTest::newRow("\"certificates/cert-[sure]*\" wildcard pem") << QString("certificates/cert-[sure]*") << int(QRegExp::Wildcard) << true << 3;
@@ -612,7 +620,7 @@ void tst_QSslCertificate::fromPath_data()
QTest::newRow("\"d.*/c.*.pem\" wildcard pem") << QString("d.*/c.*.pem") << int(QRegExp::Wildcard) << true << 0;
QTest::newRow("\"d.*/c.*.pem\" wildcard der") << QString("d.*/c.*.pem") << int(QRegExp::Wildcard) << false << 0;
#ifdef Q_OS_LINUX
- QTest::newRow("absolute path wildcard pem") << (testDataDir + "/certificates/*.pem") << int(QRegExp::Wildcard) << true << 5;
+ QTest::newRow("absolute path wildcard pem") << (testDataDir + "/certificates/*.pem") << int(QRegExp::Wildcard) << true << 7;
#endif
QTest::newRow("trailing-whitespace") << QString("more-certificates/trailing-whitespace.pem") << int(QRegExp::FixedString) << true << 1;
diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
index 64288f50e1..c7d655af3d 100644
--- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
@@ -71,7 +71,7 @@ Q_DECLARE_METATYPE(QSslSocket::PeerVerifyMode);
typedef QSharedPointer<QSslSocket> QSslSocketPtr;
// Non-OpenSSL backends are not able to report a specific error code
-// for self-signed certificate for certificates.
+// for self-signed certificates.
#ifndef QT_NO_OPENSSL
#define FLUKE_CERTIFICATE_ERROR QSslError::SelfSignedCertificate
#else
diff --git a/tests/auto/testlib/selftests/expected_badxml.lightxml b/tests/auto/testlib/selftests/expected_badxml.lightxml
index e0de44f0be..94f479a79a 100644
--- a/tests/auto/testlib/selftests/expected_badxml.lightxml
+++ b/tests/auto/testlib/selftests/expected_badxml.lightxml
@@ -113,7 +113,7 @@
</TestFunction>
<TestFunction name="encoding">
<Message type="qdebug" file="" line="0">
- <Description><![CDATA["\u00DClrich \u00DCml\u00E4ut"]]></Description>
+ <Description><![CDATA["Ülrich Ümläut"]]></Description>
</Message>
<Incident type="pass" file="" line="0" />
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_badxml.xml b/tests/auto/testlib/selftests/expected_badxml.xml
index 8667c2d9cd..c1266bfeed 100644
--- a/tests/auto/testlib/selftests/expected_badxml.xml
+++ b/tests/auto/testlib/selftests/expected_badxml.xml
@@ -115,7 +115,7 @@
</TestFunction>
<TestFunction name="encoding">
<Message type="qdebug" file="" line="0">
- <Description><![CDATA["\u00DClrich \u00DCml\u00E4ut"]]></Description>
+ <Description><![CDATA["Ülrich Ümläut"]]></Description>
</Message>
<Incident type="pass" file="" line="0" />
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_badxml.xunitxml b/tests/auto/testlib/selftests/expected_badxml.xunitxml
index 46f4be4391..49048fdad6 100644
--- a/tests/auto/testlib/selftests/expected_badxml.xunitxml
+++ b/tests/auto/testlib/selftests/expected_badxml.xunitxml
@@ -30,7 +30,7 @@
<failure message="failure message" result="fail"/>
</testcase>
<testcase result="pass" name="encoding">
- <!-- message="&quot;\u00DClrich \u00DCml\u00E4ut&quot;" type="qdebug" -->
+ <!-- message="&quot;Ülrich Ümläut&quot;" type="qdebug" -->
</testcase>
<testcase result="pass" name="cleanupTestCase"/>
<system-err>
@@ -46,6 +46,6 @@
<![CDATA[quotes " text" more text]]>
<![CDATA[xml close > open < tags < text]]>
<![CDATA[all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]>
-<![CDATA["\u00DClrich \u00DCml\u00E4ut"]]>
+<![CDATA["Ülrich Ümläut"]]>
</system-err>
</testsuite>
diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
index fdc5bdd915..09129f0676 100644
--- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
@@ -165,6 +165,7 @@ private slots:
void setCustomModelAndView();
void updateDelegateOnEditableChange();
void respectChangedOwnershipOfItemView();
+ void task_QTBUG_39088_inputMethodHints();
};
class MyAbstractItemDelegate : public QAbstractItemDelegate
@@ -3170,6 +3171,14 @@ void tst_QComboBox::updateDelegateOnEditableChange()
}
}
+void tst_QComboBox::task_QTBUG_39088_inputMethodHints()
+{
+ QComboBox box;
+ box.setEditable(true);
+ box.setInputMethodHints(Qt::ImhNoPredictiveText);
+ QCOMPARE(box.lineEdit()->inputMethodHints(), Qt::ImhNoPredictiveText);
+}
+
void tst_QComboBox::respectChangedOwnershipOfItemView()
{
QComboBox box1;
diff --git a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
index fb7c3e8a68..0cc812cbca 100644
--- a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
+++ b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
@@ -1909,9 +1909,12 @@ void tst_QTextEdit::setText()
QCOMPARE(browser.toPlainText(), QLatin1String("with space"));
}
+#ifdef QT_BUILD_INTERNAL
QT_BEGIN_NAMESPACE
-extern void qt_setQtEnableTestFont(bool value);
+// qfontdatabase.cpp
+Q_AUTOTEST_EXPORT void qt_setQtEnableTestFont(bool value);
QT_END_NAMESPACE
+#endif
#ifdef QT_BUILD_INTERNAL
void tst_QTextEdit::fullWidthSelection_data()