summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-01-03 14:20:01 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-01-04 11:12:05 +0100
commitca2f44680cb97e7a7c46ee0ab26654822fe65e2d (patch)
treeb9d85ad8ec1b18a6aa56b7657812cf3791bdf72e /src/corelib
parent28a21d98ef8d880a6dd86ee19dd803424bb5eae1 (diff)
parent83188c6499ccdc87c0a2c468bb497e287f5db369 (diff)
Merge branch 'stable' into dev
Conflicts: examples/widgets/painting/shared/shared.pri src/corelib/tools/qharfbuzz_p.h src/corelib/tools/qunicodetools.cpp src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp src/plugins/platforms/windows/qwindowsfontdatabase.cpp Change-Id: Ibc9860abf570e5ce8b052fb88feb73ec35e64bd3
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/Qt5CTestMacros.cmake5
-rw-r--r--src/corelib/Qt5CoreConfigExtras.cmake.in6
-rw-r--r--src/corelib/corelib.pro28
-rw-r--r--src/corelib/doc/qtcore.qdocconf16
-rw-r--r--src/corelib/doc/snippets/code/doc_src_plugins-howto.cpp17
-rw-r--r--src/corelib/doc/snippets/code/doc_src_plugins-howto.pro11
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_io_qsettings.cpp2
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp2
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp2
-rw-r--r--src/corelib/doc/snippets/hellotrmain.cpp57
-rw-r--r--src/corelib/doc/src/custom-types.qdoc165
-rw-r--r--src/corelib/doc/src/implicit-sharing.qdoc2
-rw-r--r--src/corelib/doc/src/json.qdoc2
-rw-r--r--src/corelib/doc/src/objectmodel/object.qdoc3
-rw-r--r--src/corelib/doc/src/objectmodel/properties.qdoc4
-rw-r--r--src/corelib/doc/src/plugins-howto.qdoc25
-rw-r--r--src/corelib/doc/src/statemachine.qdoc2
-rw-r--r--src/corelib/doc/src/threads-basics.qdoc18
-rw-r--r--src/corelib/doc/src/threads.qdoc8
-rw-r--r--src/corelib/doc/src/timers.qdoc123
-rw-r--r--src/corelib/global/qconfig-minimal.h3
-rw-r--r--src/corelib/global/qconfig-nacl.h3
-rw-r--r--src/corelib/global/qconfig-small.h5
-rw-r--r--src/corelib/global/qfeatures.h6
-rw-r--r--src/corelib/global/qfeatures.txt9
-rw-r--r--src/corelib/global/qflags.h3
-rw-r--r--src/corelib/global/qglobal.cpp20
-rw-r--r--src/corelib/global/qglobal.h15
-rw-r--r--src/corelib/global/qlogging.cpp2
-rw-r--r--src/corelib/global/qnamespace.qdoc6
-rw-r--r--src/corelib/global/qsysinfo.h4
-rw-r--r--src/corelib/global/qtypeinfo.h4
-rw-r--r--src/corelib/global/qtypetraits.h3
-rw-r--r--src/corelib/io/qabstractfileengine.cpp2
-rw-r--r--src/corelib/io/qprocess_win.cpp3
-rw-r--r--src/corelib/io/qstandardpaths.h2
-rw-r--r--src/corelib/io/qstandardpaths_unix.cpp1
-rw-r--r--src/corelib/io/qurl.cpp251
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.cpp2
-rw-r--r--src/corelib/itemmodels/qabstractproxymodel.cpp4
-rw-r--r--src/corelib/itemmodels/qsortfilterproxymodel.cpp4
-rw-r--r--src/corelib/json/qjsonarray.cpp8
-rw-r--r--src/corelib/json/qjsonobject.cpp13
-rw-r--r--src/corelib/kernel/qeventdispatcher_blackberry.cpp2
-rw-r--r--src/corelib/kernel/qmetatype.h17
-rw-r--r--src/corelib/kernel/qobject.cpp16
-rw-r--r--src/corelib/kernel/qtimer.cpp6
-rw-r--r--src/corelib/kernel/qtranslator.cpp6
-rw-r--r--src/corelib/kernel/qvariant.cpp4
-rw-r--r--src/corelib/kernel/qwineventnotifier.h9
-rw-r--r--src/corelib/mimetypes/qmimedatabase.cpp14
-rw-r--r--src/corelib/plugin/qfactoryloader.cpp21
-rw-r--r--src/corelib/plugin/qlibrary.cpp2
-rw-r--r--src/corelib/plugin/qlibrary_p.h2
-rw-r--r--src/corelib/plugin/qlibrary_unix.cpp100
-rw-r--r--src/corelib/plugin/qlibrary_win.cpp11
-rw-r--r--src/corelib/plugin/qpluginloader.cpp54
-rw-r--r--src/corelib/plugin/quuid.cpp13
-rw-r--r--src/corelib/plugin/quuid.h4
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp8
-rw-r--r--src/corelib/thread/qatomic.cpp88
-rw-r--r--src/corelib/thread/qatomic.h10
-rw-r--r--src/corelib/thread/qbasicatomic.h4
-rw-r--r--src/corelib/thread/qfuture.qdoc8
-rw-r--r--src/corelib/thread/qmutex.cpp4
-rw-r--r--src/corelib/thread/qmutex_linux.cpp5
-rw-r--r--src/corelib/thread/qthread_unix.cpp7
-rw-r--r--src/corelib/thread/qwaitcondition.qdoc2
-rw-r--r--src/corelib/tools/qbytearray.cpp46
-rw-r--r--src/corelib/tools/qbytearray.h4
-rw-r--r--src/corelib/tools/qelapsedtimer_unix.cpp2
-rw-r--r--src/corelib/tools/qharfbuzz_p.h3
-rw-r--r--src/corelib/tools/qhash.cpp12
-rw-r--r--src/corelib/tools/qlinkedlist.cpp12
-rw-r--r--src/corelib/tools/qlist.cpp12
-rw-r--r--src/corelib/tools/qlist.h2
-rw-r--r--src/corelib/tools/qlocale.cpp25
-rw-r--r--src/corelib/tools/qlocale.h1
-rw-r--r--src/corelib/tools/qlocale.qdoc7
-rw-r--r--src/corelib/tools/qmap.cpp12
-rw-r--r--src/corelib/tools/qregexp.cpp4
-rw-r--r--src/corelib/tools/qset.qdoc16
-rw-r--r--src/corelib/tools/qstring.cpp12
-rw-r--r--src/corelib/tools/qunicodetools.cpp3
-rw-r--r--src/corelib/tools/qvarlengtharray.qdoc12
-rw-r--r--src/corelib/tools/qvector.cpp12
-rw-r--r--src/corelib/tools/tools.pri3
87 files changed, 1003 insertions, 485 deletions
diff --git a/src/corelib/Qt5CTestMacros.cmake b/src/corelib/Qt5CTestMacros.cmake
index fc39c708f3..c5d10c9b5b 100644
--- a/src/corelib/Qt5CTestMacros.cmake
+++ b/src/corelib/Qt5CTestMacros.cmake
@@ -1,4 +1,7 @@
-
+#
+# W A R N I N G
+# -------------
+#
# This file is not part of the Qt API. It exists purely as an
# implementation detail. This file, and its contents may change from version to
# version without notice, or even be removed.
diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in
index 0df27039d0..06ff6dc831 100644
--- a/src/corelib/Qt5CoreConfigExtras.cmake.in
+++ b/src/corelib/Qt5CoreConfigExtras.cmake.in
@@ -43,10 +43,10 @@ set(Qt5Core_QMAKE_EXECUTABLE Qt5::qmake)
set(Qt5Core_MOC_EXECUTABLE Qt5::moc)
set(Qt5Core_RCC_EXECUTABLE Qt5::rcc)
-!!IF isEmpty(CMAKE_DATA_DIR_IS_ABSOLUTE)
-list(APPEND Qt5Core_INCLUDE_DIRS \"${_qt5_corelib_install_prefix}/mkspecs/$${CMAKE_MKSPEC}\")
+!!IF isEmpty(CMAKE_ARCHDATA_DIR_IS_ABSOLUTE)
+list(APPEND Qt5Core_INCLUDE_DIRS \"${_qt5_corelib_install_prefix}/$${CMAKE_ARCHDATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
!!ELSE
-list(APPEND Qt5Core_INCLUDE_DIRS \"$${CMAKE_DATA_DIR}mkspecs/$${CMAKE_MKSPEC}\")
+list(APPEND Qt5Core_INCLUDE_DIRS \"$${CMAKE_ARCHDATA_DIR}mkspecs/$${CMAKE_MKSPEC}\")
!!ENDIF
!!IF !isEmpty(CMAKE_ADD_FPIE_FLAGS)
diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro
index 46c771e6a5..f95ee545c0 100644
--- a/src/corelib/corelib.pro
+++ b/src/corelib/corelib.pro
@@ -6,6 +6,7 @@ MODULE = core # not corelib, as per project file
MODULE_CONFIG = moc resources
!isEmpty(QT_NAMESPACE): MODULE_DEFINES = QT_NAMESPACE=$$QT_NAMESPACE
+CONFIG += $$MODULE_CONFIG
DEFINES += QT_NO_USING_NAMESPACE
win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x67000000
irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused
@@ -40,7 +41,6 @@ mac|darwin {
}
LIBS_PRIVATE += -framework CoreFoundation
}
-mac:lib_bundle:DEFINES += QT_NO_DEBUG_PLUGIN_CHECK
win32:DEFINES-=QT_NO_CAST_TO_ASCII
DEFINES += $$MODULE_DEFINES
@@ -50,29 +50,11 @@ QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtCore.dynlist
contains(DEFINES,QT_EVAL):include(eval.pri)
-load(moc)
-load(resources)
+HOST_BINS = $$[QT_HOST_BINS]
+host_bins.name = host_bins
+host_bins.variable = HOST_BINS
-moc_dir.name = moc_location
-moc_dir.variable = QMAKE_MOC
-
-rcc_dir.name = rcc_location
-rcc_dir.variable = QMAKE_RCC
-
-QMAKE_PKGCONFIG_VARIABLES += moc_dir rcc_dir
-
-# These are aliens, but Linguist installs no own module, and it fits here best.
-
-qtPrepareTool(QMAKE_LUPDATE, lupdate)
-qtPrepareTool(QMAKE_LRELEASE, lrelease)
-
-lupdate_dir.name = lupdate_location
-lupdate_dir.variable = QMAKE_LUPDATE
-
-lrelease_dir.name = lrelease_location
-lrelease_dir.variable = QMAKE_LRELEASE
-
-QMAKE_PKGCONFIG_VARIABLES += lupdate_dir lrelease_dir
+QMAKE_PKGCONFIG_VARIABLES += host_bins
ctest_macros_file.input = $$PWD/Qt5CTestMacros.cmake
ctest_macros_file.output = $$DESTDIR/cmake/Qt5Core/Qt5CTestMacros.cmake
diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf
index 2151d95f65..61c9d2bc00 100644
--- a/src/corelib/doc/qtcore.qdocconf
+++ b/src/corelib/doc/qtcore.qdocconf
@@ -3,21 +3,21 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtCore
description = Qt Core Reference Documentation
url = http://qt-project.org/doc/qtcore
-version = 5.0.0
+version = 5.0.1
examplesinstallpath = core
qhp.projects = QtCore
qhp.QtCore.file = qtcore.qhp
-qhp.QtCore.namespace = org.qt-project.qtcore.500
+qhp.QtCore.namespace = org.qt-project.qtcore.501
qhp.QtCore.virtualFolder = qtcore
qhp.QtCore.indexTitle = Qt Core
qhp.QtCore.indexRoot =
-qhp.QtCore.filterAttributes = qtcore 5.0.0 qtrefdoc
-qhp.QtCore.customFilters.Qt.name = QtCore 5.0.0
-qhp.QtCore.customFilters.Qt.filterAttributes = qtcore 5.0.0
+qhp.QtCore.filterAttributes = qtcore 5.0.1 qtrefdoc
+qhp.QtCore.customFilters.Qt.name = QtCore 5.0.1
+qhp.QtCore.customFilters.Qt.filterAttributes = qtcore 5.0.1
qhp.QtCore.subprojects = classes
qhp.QtCore.subprojects.classes.title = C++ Classes
qhp.QtCore.subprojects.classes.indexTitle = Qt Core C++ Classes
@@ -26,7 +26,7 @@ qhp.QtCore.subprojects.classes.sortPages = true
tagfile = ../../../doc/qtcore/qtcore.tags
-depends += qtgui qtwidgets qtnetwork qtdoc qtquick
+depends += qtgui qtwidgets qtnetwork qtdoc qtquick qtlinguist qtdesigner
headerdirs += ..
@@ -35,6 +35,8 @@ sourcedirs += ..
exampledirs += \
../ \
snippets \
- ../../../examples/threads
+ ../../../examples/threads/ \
+ ../../../examples/tools/ \
+ ../../../examples/widgets/widgets/analogclock
imagedirs += images
diff --git a/src/corelib/doc/snippets/code/doc_src_plugins-howto.cpp b/src/corelib/doc/snippets/code/doc_src_plugins-howto.cpp
index ca6e64a90e..a86441c822 100644
--- a/src/corelib/doc/snippets/code/doc_src_plugins-howto.cpp
+++ b/src/corelib/doc/snippets/code/doc_src_plugins-howto.cpp
@@ -65,20 +65,3 @@ QStyle *MyStylePlugin::create(const QString &key)
//! [2]
QApplication::setStyle(QStyleFactory::create("MyStyle"));
//! [2]
-
-
-//! [4]
-#include <QApplication>
-#include <QtPlugin>
-
-Q_IMPORT_PLUGIN(qjpeg)
-Q_IMPORT_PLUGIN(qgif)
-Q_IMPORT_PLUGIN(qkrcodecs)
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- ...
- return app.exec();
-}
-//! [4]
diff --git a/src/corelib/doc/snippets/code/doc_src_plugins-howto.pro b/src/corelib/doc/snippets/code/doc_src_plugins-howto.pro
index 20d5f7e41b..b33db7942f 100644
--- a/src/corelib/doc/snippets/code/doc_src_plugins-howto.pro
+++ b/src/corelib/doc/snippets/code/doc_src_plugins-howto.pro
@@ -42,9 +42,20 @@
CONFIG += release
#! [3]
+#! [4]
+CONFIG += qpa_minimal_plugin
+#! [4]
#! [5]
QTPLUGIN += qjpeg \
qgif \
qkrcodecs
#! [5]
+
+#! [6]
+CONFIG -= import_qpa_plugin
+#! [6]
+
+#! [7]
+CONFIG -= import_plugins
+#! [7]
diff --git a/src/corelib/doc/snippets/code/src_corelib_io_qsettings.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qsettings.cpp
index ab54033ef3..d3dde5be66 100644
--- a/src/corelib/doc/snippets/code/src_corelib_io_qsettings.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_io_qsettings.cpp
@@ -82,7 +82,7 @@ settings.value("HKEY_CURRENT_USER\\MySoft\\Star Runner\\Galaxy\\Default"); // re
//! [7]
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
QSettings settings("grenoullelogique.fr", "Squash");
#else
QSettings settings("Grenoulle Logique", "Squash");
diff --git a/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp b/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp
index c462083328..1735efbfde 100644
--- a/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp
@@ -377,7 +377,7 @@ Q_PROPERTY(type name
[DESIGNABLE bool]
[SCRIPTABLE bool]
[STORED bool]
- [USER bool]
+ [USER bool]
[CONSTANT]
[FINAL])
//! [36]
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp
index 71c6fbd80f..eef026af75 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp
@@ -251,7 +251,7 @@ ba.lastIndexOf("X"); // returns -1
//! [25]
-QByteArray url("ftp://ftp.qt.nokia.com/");
+QByteArray url("ftp://ftp.qt-project.org/");
if (url.startsWith("ftp:"))
...
//! [25]
diff --git a/src/corelib/doc/snippets/hellotrmain.cpp b/src/corelib/doc/snippets/hellotrmain.cpp
new file mode 100644
index 0000000000..fdb034c241
--- /dev/null
+++ b/src/corelib/doc/snippets/hellotrmain.cpp
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** 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."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [0]
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QTranslator translator;
+ translator.load("hellotr_la");
+ app.installTranslator(&translator);
+
+ QPushButton hello(QPushButton::tr("Hello world!"));
+ hello.resize(100, 30);
+
+ hello.show();
+ return app.exec();
+}
+//! [0]
+
diff --git a/src/corelib/doc/src/custom-types.qdoc b/src/corelib/doc/src/custom-types.qdoc
new file mode 100644
index 0000000000..95987ec014
--- /dev/null
+++ b/src/corelib/doc/src/custom-types.qdoc
@@ -0,0 +1,165 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page custom-types.html
+ \title Creating Custom Qt Types
+ \brief How to create and register new types with Qt.
+
+ \ingroup best-practices
+
+ \tableofcontents
+
+ \section1 Overview
+
+ When creating user interfaces with Qt, particularly those with specialized controls and
+ features, developers sometimes need to create new data types that can be used alongside
+ or in place of Qt's existing set of value types.
+
+ Standard types such as QSize, QColor and QString can all be stored in QVariant objects,
+ used as the types of properties in QObject-based classes, and emitted in signal-slot
+ communication.
+
+ In this document, we take a custom type and describe how to integrate it into Qt's object
+ model so that it can be stored in the same way as standard Qt types. We then show how to
+ register the custom type to allow it to be used in signals and slots connections.
+
+ \section1 Creating a Custom Type
+
+ Before we begin, we need to ensure that the custom type we are creating meets all the
+ requirements imposed by QMetaType. In other words, it must provide:
+
+ \list
+ \li a public default constructor,
+ \li a public copy constructor, and
+ \li a public destructor.
+ \endlist
+
+ The following \c Message class definition includes these members:
+
+ \snippet customtype/message.h custom type definition
+
+ The class also provides a constructor for normal use and two public member functions
+ that are used to obtain the private data.
+
+ \section1 Declaring the Type with QMetaType
+
+ The \c Message class only needs a suitable implementation in order to be usable.
+ However, Qt's type system will not be able to understand how to store, retrieve
+ and serialize instances of this class without some assistance. For example, we
+ will be unable to store \c Message values in QVariant.
+
+ The class in Qt responsible for custom types is QMetaType. To make the type known
+ to this class, we invoke the Q_DECLARE_METATYPE() macro on the class in the header
+ file where it is defined:
+
+ \snippet customtype/message.h custom type meta-type declaration
+
+ This now makes it possible for \c Message values to be stored in QVariant objects
+ and retrieved later. See the \l{Custom Type Example} for code that demonstrates
+ this.
+
+ The Q_DECLARE_METATYPE() macro also makes it possible for these values to be used as
+ arguments to signals, but \e{only in direct signal-slot connections}.
+ To make the custom type generally usable with the signals and slots mechanism, we
+ need to perform some extra work.
+
+ \section1 Creating and Destroying Custom Objects
+
+ Although the declaration in the previous section makes the type available for use
+ in direct signal-slot connections, it cannot be used for queued signal-slot
+ connections, such as those that are made between objects in different threads.
+ This is because the meta-object system does not know how to handle creation and
+ destruction of objects of the custom type at run-time.
+
+ To enable creation of objects at run-time, call the qRegisterMetaType() template
+ function to register it with the meta-object system. This also makes the type
+ available for queued signal-slot communication as long as you call it before you
+ make the first connection that uses the type.
+
+ The \l{Queued Custom Type Example} declares a \c Block class which is registered
+ in the \c{main.cpp} file:
+
+ \snippet queuedcustomtype/main.cpp main start
+ \dots
+ \snippet queuedcustomtype/main.cpp register meta-type for queued communications
+ \dots
+ \snippet queuedcustomtype/main.cpp main finish
+
+ This type is later used in a signal-slot connection in the \c{window.cpp} file:
+
+ \snippet queuedcustomtype/window.cpp Window constructor start
+ \dots
+ \snippet queuedcustomtype/window.cpp connecting signal with custom type
+ \dots
+ \snippet queuedcustomtype/window.cpp Window constructor finish
+
+ If a type is used in a queued connection without being registered, a warning will be
+ printed at the console; for example:
+
+ \code
+ QObject::connect: Cannot queue arguments of type 'Block'
+ (Make sure 'Block' is registered using qRegisterMetaType().)
+ \endcode
+
+ \section1 Making the Type Printable
+
+ It is often quite useful to make a custom type printable for debugging purposes,
+ as in the following code:
+
+ \snippet customtype/main.cpp printing a custom type
+
+ This is achieved by creating a streaming operator for the type, which is often
+ defined in the header file for that type:
+
+ \snippet customtype/message.h custom type streaming operator
+
+ The implementation for the \c Message type in the \l{Custom Type Example}
+ goes to some effort to make the printable representation as readable as
+ possible:
+
+ \snippet customtype/message.cpp custom type streaming operator
+
+ The output sent to the debug stream can, of course, be made as simple or as
+ complicated as you like. Note that the value returned by this function is
+ the QDebug object itself, though this is often obtained by calling the
+ maybeSpace() member function of QDebug that pads out the stream with space
+ characters to make it more readable.
+
+ \section1 Further Reading
+
+ The Q_DECLARE_METATYPE() macro and qRegisterMetaType() function documentation
+ contain more detailed information about their uses and limitations.
+
+ The \l{Custom Type Example}{Custom Type},
+ \l{Custom Type Sending Example}{Custom Type Sending}
+ and \l{Queued Custom Type Example}{Queued Custom Type} examples show how to
+ implement a custom type with the features outlined in this document.
+
+ The \l{Debugging Techniques} document provides an overview of the debugging
+ mechanisms discussed above.
+*/
diff --git a/src/corelib/doc/src/implicit-sharing.qdoc b/src/corelib/doc/src/implicit-sharing.qdoc
index 39ba702d55..baed85fb18 100644
--- a/src/corelib/doc/src/implicit-sharing.qdoc
+++ b/src/corelib/doc/src/implicit-sharing.qdoc
@@ -135,7 +135,7 @@
\warning Do not copy an implicitly shared container (QMap,
QVector, etc.) while you are iterating over it using an non-const
- \l{STL-style iterator}.
+ \l{STL-style iterators}{STL-style iterator}.
\keyword implicitly shared classes
\annotatedlist shared
diff --git a/src/corelib/doc/src/json.qdoc b/src/corelib/doc/src/json.qdoc
index ff06b48008..109102f190 100644
--- a/src/corelib/doc/src/json.qdoc
+++ b/src/corelib/doc/src/json.qdoc
@@ -99,8 +99,6 @@
A valid JSON document is either an array or an object, so a document always starts
with a square or curly bracket.
- JSON support in Qt consists of a set of 4 classes.
-
\section1 The JSON Classes
diff --git a/src/corelib/doc/src/objectmodel/object.qdoc b/src/corelib/doc/src/objectmodel/object.qdoc
index 47f56372de..edf5673da0 100644
--- a/src/corelib/doc/src/objectmodel/object.qdoc
+++ b/src/corelib/doc/src/objectmodel/object.qdoc
@@ -47,7 +47,7 @@
properties}
\li powerful \l{The Event System}{events and event filters}
\li contextual \l{i18n}{string translation for internationalization}
- \li sophisticated interval driven \l timers that make it possible
+ \li sophisticated interval driven \l {Timers}{timers} that make it possible
to elegantly integrate many tasks in an event-driven GUI
\li hierarchical and queryable \l{Object Trees & Ownership}{object
trees} that organize object ownership in a natural way
@@ -56,6 +56,7 @@
pointers which become dangling pointers when their objects are destroyed
\li a \l{metaobjects.html#qobjectcast}{dynamic cast} that works across
library boundaries.
+ \li support for \l{Creating Custom Qt Types}{custom type} creation.
\endlist
Many of these Qt features are implemented with standard C++
diff --git a/src/corelib/doc/src/objectmodel/properties.qdoc b/src/corelib/doc/src/objectmodel/properties.qdoc
index 4ea52050b8..d818d1154c 100644
--- a/src/corelib/doc/src/objectmodel/properties.qdoc
+++ b/src/corelib/doc/src/objectmodel/properties.qdoc
@@ -89,8 +89,8 @@
\li The \c DESIGNABLE attribute indicates whether the property
should be visible in the property editor of GUI design tool (e.g.,
- \l {Qt Designer}). Most properties are \c DESIGNABLE (default
- true). Instead of true or false, you can specify a boolean
+ \l {Qt Designer Manual}{Qt Designer}). Most properties are \c DESIGNABLE
+ (default true). Instead of true or false, you can specify a boolean
member function.
\li The \c SCRIPTABLE attribute indicates whether this property
diff --git a/src/corelib/doc/src/plugins-howto.qdoc b/src/corelib/doc/src/plugins-howto.qdoc
index 332b92596b..d94bf2eadc 100644
--- a/src/corelib/doc/src/plugins-howto.qdoc
+++ b/src/corelib/doc/src/plugins-howto.qdoc
@@ -266,18 +266,22 @@
\row \li \c qsqltds \li SQL driver \li Sybase Adaptive Server (TDS)
\endtable
- To link statically against those plugins, you need to use the
- Q_IMPORT_PLUGIN() macro in your application and you need to add
+ To link statically against those plugins, you need to add
the required plugins to your build using \c QTPLUGIN.
- For example, in your \c main.cpp:
-
- \snippet code/doc_src_plugins-howto.cpp 4
+ Q_IMPORT_PLUGIN() macros are also needed in application code,
+ but those are automatically generated by qmake and added to
+ your application project.
In the \c .pro file for your application, you need the following
entry:
\snippet code/doc_src_plugins-howto.pro 5
+ If you do not want all plugins added to QTPLUGIN to be automatically
+ linked, remove \c import_plugins from the \c CONFIG variable:
+
+ \snippet code/doc_src_plugins-howto.pro 7
+
It is also possible to create your own static plugins, by
following these steps:
@@ -296,6 +300,17 @@
to make sure that the \c{QT_STATICPLUGIN} preprocessor macro is
defined.
+ The default Qt platform adaptation plugin is automatically added to QTPLUGIN
+ in static builds. If you want to add the minimal plugin instead, add \c qpa_minimal_plugin
+ to \c CONFIG:
+
+ \snippet code/doc_src_plugins-howto.pro 4
+
+ If you want neither the default nor the minimal QPA plugin to be linked automatically,
+ remove \c import_qpa_plugin from \c CONFIG:
+
+ \snippet code/doc_src_plugins-howto.pro 6
+
\section1 Deploying and Debugging Plugins
The \l{Deploying Plugins} document covers the process of deploying
diff --git a/src/corelib/doc/src/statemachine.qdoc b/src/corelib/doc/src/statemachine.qdoc
index b241b4aff4..e23b911f85 100644
--- a/src/corelib/doc/src/statemachine.qdoc
+++ b/src/corelib/doc/src/statemachine.qdoc
@@ -45,7 +45,7 @@
The State Machine framework provides classes for creating and executing
state graphs. The concepts and notation are based on those from Harel's
- \l{Statecharts: A visual formalism for complex systems}{Statecharts}, which
+ \l{http://www.wisdom.weizmann.ac.il/~dharel/SCANNED.PAPERS/Statecharts.pdf}{Statecharts: A visual formalism for complex systems}, which
is also the basis of UML state diagrams. The semantics of state machine
execution are based on \l{State Chart XML: State Machine Notation for
Control Abstraction}{State Chart XML (SCXML)}.
diff --git a/src/corelib/doc/src/threads-basics.qdoc b/src/corelib/doc/src/threads-basics.qdoc
index 501edb6ecf..ea804f2d6d 100644
--- a/src/corelib/doc/src/threads-basics.qdoc
+++ b/src/corelib/doc/src/threads-basics.qdoc
@@ -244,18 +244,18 @@
code that generates another thread which says hello in that thread and then
exits.
- \snippet tutorials/threads/hellothread/hellothread.h 1
+ \snippet ../widgets/tutorials/threads/hellothread/hellothread.h 1
We derive a class from QThread and reimplement the \l{QThread::}{run()}
method.
- \snippet tutorials/threads/hellothread/hellothread.cpp 1
+ \snippet ../widgets/tutorials/threads/hellothread/hellothread.cpp 1
The run method contains the code that will be run in a separate thread. In
this example, a message containing the thread ID will be printed.
QThread::start() will call the method in another thread.
- \snippet tutorials/threads/hellothread/main.cpp 1
+ \snippet ../widgets/tutorials/threads/hellothread/main.cpp 1
To start the thread, our thread object needs to be instantiated. The
\l{QThread::}{start()} method creates a new thread and calls the
@@ -453,7 +453,7 @@
another thread needs to be placed in the reimplemented QRunnable::run()
method.
- \snippet tutorials/threads/hellothreadpool/hellothreadpool.cpp 1
+ \snippet ../widgets/tutorials/threads/hellothreadpool/hellothreadpool.cpp 1
We instantiate Work in main(), locate the global thread pool and use the
QThreadPool::start() method. Now the thread pool runs our worker in another
@@ -463,7 +463,7 @@
\section2 Example 2: Using QtConcurrent
- \snippet tutorials/threads/helloconcurrent/helloconcurrent.cpp 1
+ \snippet ../widgets/tutorials/threads/helloconcurrent/helloconcurrent.cpp 1
We write a global function hello() to implement the work. QtConcurrent::run()
is used to run the function in another thread. The result is a QFuture.
@@ -499,17 +499,17 @@
Communication from the GUI to the worker thread is shown in the next
example.
- \snippet tutorials/threads/clock/main.cpp 1
+ \snippet ../widgets/tutorials/threads/clock/main.cpp 1
We've connected the \c clockThread with the label. The connection must be a
queued signal-slot connection because we want to put the call in the event
loop.
- \snippet tutorials/threads/clock/clockthread.h 1
+ \snippet ../widgets/tutorials/threads/clock/clockthread.h 1
We have derived a class from QThread and declared the \c sendTime() signal.
- \snippet tutorials/threads/clock/clockthread.cpp 1
+ \snippet ../widgets/tutorials/threads/clock/clockthread.cpp 1
The trickiest part of this example is that the timer is connected to its
slot via a direct connection. A default connection would produce a queued
@@ -541,7 +541,7 @@
The \c Thread class's code is short but somewhat involved, so we only show
how to use the class.
- \snippet tutorials/threads/movedobject/main.cpp 1
+ \snippet ../widgets/tutorials/threads/movedobject/main.cpp 1
QMetaObject::invokeMethod() calls a slot via the event loop. The worker
object's methods should not be called directly after the object has been
diff --git a/src/corelib/doc/src/threads.qdoc b/src/corelib/doc/src/threads.qdoc
index 9b8fe527d2..bcabfc3c8c 100644
--- a/src/corelib/doc/src/threads.qdoc
+++ b/src/corelib/doc/src/threads.qdoc
@@ -74,10 +74,10 @@
to threading see our Recommended Reading list:
\list
- \li \l{Threads Primer: A Guide to Multithreaded Programming}
- \li \l{Thread Time: The Multithreaded Programming Guide}
- \li \l{Pthreads Programming: A POSIX Standard for Better Multiprocessing}
- \li \l{Win32 Multithreaded Programming}
+ \li \l {http://www.amazon.com/Threads-Primer-Guide-Multithreaded-Programming/dp/0134436989}{Threads Primer: A Guide to Multithreaded Programming}
+ \li \l {http://www.amazon.com/Thread-Time-MultiThreaded-Programming-Guide/dp/0131900676}{Thread Time: The Multithreaded Programming Guide}
+ \li \l {http://www.amazon.com/Pthreads-Programming-Standard-Multiprocessing-Nutshell/dp/1565921151a}{Pthreads Programming: A POSIX Standard for Better Multiprocessing}
+ \li \l {http://www.amazon.com/WIN32-Multithreaded-Programming-Aaron-Cohen/dp/1565922964}{Win32 Multithreaded Programming}
\endlist
\section1 The Threading Classes
diff --git a/src/corelib/doc/src/timers.qdoc b/src/corelib/doc/src/timers.qdoc
new file mode 100644
index 0000000000..eddb600559
--- /dev/null
+++ b/src/corelib/doc/src/timers.qdoc
@@ -0,0 +1,123 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page timers.html
+ \title Timers
+ \brief How to use Qt timers in your application.
+
+ \ingroup best-practices
+
+ QObject, the base class of all Qt objects, provides the basic
+ timer support in Qt. With QObject::startTimer(), you start a
+ timer with an interval in milliseconds as argument. The function
+ returns a unique integer timer ID. The timer will now fire at
+ regular intervals until you explicitly call QObject::killTimer()
+ with the timer ID.
+
+ For this mechanism to work, the application must run in an event
+ loop. You start an event loop with QApplication::exec(). When a
+ timer fires, the application sends a QTimerEvent, and the flow of
+ control leaves the event loop until the timer event is processed.
+ This implies that a timer cannot fire while your application is
+ busy doing something else. In other words: the accuracy of timers
+ depends on the granularity of your application.
+
+ In multithreaded applications, you can use the timer mechanism in
+ any thread that has an event loop. To start an event loop from a
+ non-GUI thread, use QThread::exec(). Qt uses the object's
+ \l{QObject::thread()}{thread affinity} to determine which thread
+ will deliver the QTimerEvent. Because of this, you must start and
+ stop all timers in the object's thread; it is not possible to
+ start timers for objects in another thread.
+
+ The upper limit for the interval value is determined by the number
+ of milliseconds that can be specified in a signed integer
+ (in practice, this is a period of just over 24 days). The accuracy
+ depends on the underlying operating system. Windows 2000 has 15
+ millisecond accuracy; other systems that we have tested can handle
+ 1 millisecond intervals.
+
+ The main API for the timer functionality is QTimer. That class
+ provides regular timers that emit a signal when the timer fires, and
+ inherits QObject so that it fits well into the ownership structure
+ of most GUI programs. The normal way of using it is like this:
+
+ \snippet timers/timers.cpp 0
+ \snippet timers/timers.cpp 1
+ \snippet timers/timers.cpp 2
+
+ The QTimer object is made into a child of this widget so that,
+ when this widget is deleted, the timer is deleted too.
+ Next, its \l{QTimer::}{timeout()} signal is connected to the slot
+ that will do the work, it is started with a value of 1000
+ milliseconds, indicating that it will time out every second.
+
+ QTimer also provides a static function for single-shot timers.
+ For example:
+
+ \snippet timers/timers.cpp 3
+
+ 200 milliseconds (0.2 seconds) after this line of code is
+ executed, the \c updateCaption() slot will be called.
+
+ For QTimer to work, you must have an event loop in your
+ application; that is, you must call QCoreApplication::exec()
+ somewhere. Timer events will be delivered only while the event
+ loop is running.
+
+ In multithreaded applications, you can use QTimer in any thread
+ that has an event loop. To start an event loop from a non-GUI
+ thread, use QThread::exec(). Qt uses the timer's
+ \l{QObject::thread()}{thread affinity} to determine which thread
+ will emit the \l{QTimer::}{timeout()} signal. Because of this, you
+ must start and stop the timer in its thread; it is not possible to
+ start a timer from another thread.
+
+ The \l{widgets/analogclock}{Analog Clock} example shows how to use
+ QTimer to redraw a widget at regular intervals. From \c{AnalogClock}'s
+ implementation:
+
+ \snippet analogclock.cpp 0
+ \snippet analogclock.cpp 2
+ \snippet analogclock.cpp 3
+ \snippet analogclock.cpp 4
+ \snippet analogclock.cpp 5
+ \snippet analogclock.cpp 6
+ \dots
+ \snippet analogclock.cpp 7
+
+ Every second, QTimer will call the QWidget::update() slot to
+ refresh the clock's display.
+
+ If you already have a QObject subclass and want an easy
+ optimization, you can use QBasicTimer instead of QTimer. With
+ QBasicTimer, you must reimplement
+ \l{QObject::timerEvent()}{timerEvent()} in your QObject subclass
+ and handle the timeout there. The \l{widgets/wiggly}{Wiggly}
+ example shows how to use QBasicTimer.
+*/
diff --git a/src/corelib/global/qconfig-minimal.h b/src/corelib/global/qconfig-minimal.h
index 28cb8fbede..6a21492827 100644
--- a/src/corelib/global/qconfig-minimal.h
+++ b/src/corelib/global/qconfig-minimal.h
@@ -40,9 +40,6 @@
****************************************************************************/
/* Data structures */
-#ifndef QT_NO_QUUID_STRING
-# define QT_NO_QUUID_STRING
-#endif
#ifndef QT_NO_TEXTDATE
# define QT_NO_TEXTDATE
#endif
diff --git a/src/corelib/global/qconfig-nacl.h b/src/corelib/global/qconfig-nacl.h
index d5172aac29..9dac73ea93 100644
--- a/src/corelib/global/qconfig-nacl.h
+++ b/src/corelib/global/qconfig-nacl.h
@@ -46,9 +46,6 @@
#define QT_FONTS_ARE_RESOURCES
/* Data structures */
-#ifndef QT_NO_QUUID_STRING
-# define QT_NO_QUUID_STRING
-#endif
#ifndef QT_NO_TEXTDATE
# define QT_NO_TEXTDATE
#endif
diff --git a/src/corelib/global/qconfig-small.h b/src/corelib/global/qconfig-small.h
index 9d72cd5d4c..405521c338 100644
--- a/src/corelib/global/qconfig-small.h
+++ b/src/corelib/global/qconfig-small.h
@@ -39,11 +39,6 @@
**
****************************************************************************/
-/* Data structures */
-#ifndef QT_NO_QUUID_STRING
-# define QT_NO_QUUID_STRING
-#endif
-
/* Dialogs */
#ifndef QT_NO_COLORDIALOG
# define QT_NO_COLORDIALOG
diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h
index 26d92592cb..a63d3a3b3d 100644
--- a/src/corelib/global/qfeatures.h
+++ b/src/corelib/global/qfeatures.h
@@ -91,9 +91,6 @@
// QHostInfo
//#define QT_NO_HOSTINFO
-// QImageIOPlugin
-//#define QT_NO_IMAGEFORMATPLUGIN
-
// BMP Image Format
//#define QT_NO_IMAGEFORMAT_BMP
@@ -157,9 +154,6 @@
// Properties
//#define QT_NO_PROPERTIES
-// Universally Unique Identifier Convertion
-//#define QT_NO_QUUID_STRING
-
// Resize Handler
//#define QT_NO_RESIZEHANDLER
diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt
index 941150351a..ad1ca5a6d5 100644
--- a/src/corelib/global/qfeatures.txt
+++ b/src/corelib/global/qfeatures.txt
@@ -141,13 +141,6 @@ Name: QInputContext
SeeAlso: ???
# Data structures
-Feature: QUUID_STRING
-Description: Supports convertion between UUID and strings.
-Section: Data structures
-Requires:
-Name: Universally Unique Identifier Convertion
-SeeAlso: ???
-
Feature: TEXTDATE
Description: Supports month and day names in dates.
Section: Data structures
@@ -767,7 +760,7 @@ SeeAlso: ???
Feature: IMAGEFORMATPLUGIN
Description: Supports writing an image format plugin.
Section: Images
-Requires:
+Requires: LIBRARY
Name: QImageIOPlugin
SeeAlso: ???
diff --git a/src/corelib/global/qflags.h b/src/corelib/global/qflags.h
index 3edbef3bd6..cbd7185a92 100644
--- a/src/corelib/global/qflags.h
+++ b/src/corelib/global/qflags.h
@@ -39,10 +39,11 @@
**
****************************************************************************/
+#include <QtCore/qglobal.h>
+
#ifndef QFLAGS_H
#define QFLAGS_H
-#include <QtCore/qglobal.h>
#include <QtCore/qtypeinfo.h>
#include <QtCore/qtypetraits.h>
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index c1501db33d..3881b166b1 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -2513,26 +2513,6 @@ int qrand()
*/
/*!
- \macro TRUE
- \relates <QtGlobal>
- \obsolete
-
- Synonym for \c true.
-
- \sa FALSE
-*/
-
-/*!
- \macro FALSE
- \relates <QtGlobal>
- \obsolete
-
- Synonym for \c false.
-
- \sa TRUE
-*/
-
-/*!
\macro QABS(n)
\relates <QtGlobal>
\obsolete
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 60b90dc70f..48cc477d51 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -45,11 +45,11 @@
#include <stddef.h>
-#define QT_VERSION_STR "5.0.0"
+#define QT_VERSION_STR "5.0.1"
/*
QT_VERSION is (major << 16) + (minor << 8) + patch.
*/
-#define QT_VERSION 0x050000
+#define QT_VERSION 0x050001
/*
can be used like #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0))
*/
@@ -436,17 +436,6 @@ typedef QIntegerForSizeof<void*>::Unsigned quintptr;
typedef QIntegerForSizeof<void*>::Signed qptrdiff;
typedef qptrdiff qintptr;
-/*
- Constant bool values
-*/
-
-#ifndef QT_LINUXBASE /* the LSB defines TRUE and FALSE for us */
-# ifndef TRUE
-# define TRUE true
-# define FALSE false
-# endif
-#endif
-
/* moc compats (signals/slots) */
#ifndef QT_MOC_COMPAT
# define QT_MOC_COMPAT
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index e4ff7eece4..339cedb57e 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -83,7 +83,6 @@ static bool isFatal(QtMsgType msgType)
/*!
\class QMessageLogContext
\inmodule QtCore
- \relates <QtGlobal>
\brief The QMessageLogContext class provides additional information about a log message.
\since 5.0
@@ -96,7 +95,6 @@ static bool isFatal(QtMsgType msgType)
/*!
\class QMessageLogger
\inmodule QtCore
- \relates <QtGlobal>
\brief The QMessageLogger class generates log messages.
\since 5.0
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 363c5206b0..0b0d089ba5 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -406,7 +406,7 @@
\value BevelJoin The triangular notch between the two lines is filled.
\value RoundJoin A circular arc between the two lines is filled.
\value SvgMiterJoin A miter join corresponding to the definition of
- a miter join in the \l{SVG 1.2 Tiny} specification.
+ a miter join in the \l{http://www.w3.org/TR/SVGMobile12/}{SVG 1.2 Tiny} specification.
\omitvalue MPenJoinStyle
\sa QPen
@@ -1721,7 +1721,9 @@
\value ScrollBarAlwaysOff QAbstractScrollArea never shows a scroll bar.
- \value ScrollBarAlwaysOn QAbstractScrollArea always shows a scroll bar.
+ \value ScrollBarAlwaysOn QAbstractScrollArea always shows a scroll bar. This
+ property is ignored on systems with transient scroll bars (e.g., on Mac from
+ version 10.7).
(The modes for the horizontal and vertical scroll bars are
independent.)
diff --git a/src/corelib/global/qsysinfo.h b/src/corelib/global/qsysinfo.h
index 275b899662..867acd4d60 100644
--- a/src/corelib/global/qsysinfo.h
+++ b/src/corelib/global/qsysinfo.h
@@ -39,11 +39,11 @@
**
****************************************************************************/
+#include <QtCore/qglobal.h>
+
#ifndef QSYSINFO_H
#define QSYSINFO_H
-#include <QtCore/qglobal.h>
-
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h
index a4b12feae3..68df50a2af 100644
--- a/src/corelib/global/qtypeinfo.h
+++ b/src/corelib/global/qtypeinfo.h
@@ -39,11 +39,11 @@
**
****************************************************************************/
+#include <QtCore/qglobal.h>
+
#ifndef QTYPEINFO_H
#define QTYPEINFO_H
-#include <QtCore/qglobal.h>
-
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/global/qtypetraits.h b/src/corelib/global/qtypetraits.h
index 0183f33738..54b48667b4 100644
--- a/src/corelib/global/qtypetraits.h
+++ b/src/corelib/global/qtypetraits.h
@@ -102,11 +102,12 @@
// - Use Qt macros for long long type differences on Windows.
// - Enclose in QtPrivate namespace.
+#include "QtCore/qglobal.h"
+
#ifndef QTYPETRAITS_H
#define QTYPETRAITS_H
#include <utility> // For pair
-#include "QtCore/qglobal.h"
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/io/qabstractfileengine.cpp b/src/corelib/io/qabstractfileengine.cpp
index 1841619400..d7cf7e3f15 100644
--- a/src/corelib/io/qabstractfileengine.cpp
+++ b/src/corelib/io/qabstractfileengine.cpp
@@ -155,7 +155,7 @@ QAbstractFileEngineHandler::~QAbstractFileEngineHandler()
}
/*
- \ìnternal
+ \internal
Handles calls to custom file engine handlers.
*/
diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp
index d19ab695ea..bd2ca4c325 100644
--- a/src/corelib/io/qprocess_win.cpp
+++ b/src/corelib/io/qprocess_win.cpp
@@ -82,7 +82,8 @@ static void qt_create_pipe(Q_PIPE *pipe, bool isInputPipe)
forever {
// ### The user must make sure to call qsrand() to make the pipe names less predictable.
// ### Replace the call to qrand() with a secure version, once we have it in Qt.
- swprintf(pipeName, L"\\\\.\\pipe\\qt-%X", qrand());
+ _snwprintf(pipeName, sizeof(pipeName) / sizeof(pipeName[0]),
+ L"\\\\.\\pipe\\qt-%X", qrand());
DWORD dwPipeFlags = PIPE_TYPE_BYTE | PIPE_WAIT;
if (QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA)
diff --git a/src/corelib/io/qstandardpaths.h b/src/corelib/io/qstandardpaths.h
index d9d572db08..cfd2b52e9b 100644
--- a/src/corelib/io/qstandardpaths.h
+++ b/src/corelib/io/qstandardpaths.h
@@ -51,8 +51,6 @@ QT_BEGIN_NAMESPACE
#ifndef QT_NO_STANDARDPATHS
-class QStringList;
-
class Q_CORE_EXPORT QStandardPaths
{
public:
diff --git a/src/corelib/io/qstandardpaths_unix.cpp b/src/corelib/io/qstandardpaths_unix.cpp
index 3fb36589d2..932ae6b6cc 100644
--- a/src/corelib/io/qstandardpaths_unix.cpp
+++ b/src/corelib/io/qstandardpaths_unix.cpp
@@ -127,6 +127,7 @@ QString QStandardPaths::writableLocation(StandardLocation type)
return QString();
}
}
+ qWarning("QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '%s'", qPrintable(xdgRuntimeDir));
}
// "The directory MUST be owned by the user"
QFileInfo fileInfo(xdgRuntimeDir);
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index a7a722bc46..2a439b3a7c 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -114,7 +114,7 @@
QUrl is capable of detecting many errors in URLs while parsing it or when
components of the URL are set with individual setter methods (like
setScheme(), setHost() or setPath()). If the parsing or setter function is
- succesful, any previously recorded error conditions will be discarded.
+ successful, any previously recorded error conditions will be discarded.
By default, QUrl setter methods operate in QUrl::TolerantMode, which means
they accept some common mistakes and mis-representation of data. An
@@ -363,6 +363,7 @@ public:
enum ErrorCode {
// the high byte of the error code matches the Section
+ // the first item in each value must be the generic "Invalid xxx Error"
InvalidSchemeError = Scheme << 8,
InvalidUserNameError = UserName << 8,
@@ -410,6 +411,9 @@ public:
void clearError();
void setError(ErrorCode errorCode, const QString &source, int supplement = -1);
ErrorCode validityError(QString *source = 0, int *position = 0) const;
+ bool validateComponent(Section section, const QString &input, int begin, int end);
+ bool validateComponent(Section section, const QString &input)
+ { return validateComponent(section, input, 0, uint(input.length())); }
// no QString scheme() const;
void appendAuthority(QString &appendTo, QUrl::FormattingOptions options, Section appendingTo) const;
@@ -895,58 +899,72 @@ inline void QUrlPrivate::setAuthority(const QString &auth, int from, int end, QU
{
sectionIsPresent &= ~Authority;
sectionIsPresent |= Host;
- if (from == end) {
- userName.clear();
- password.clear();
- host.clear();
- port = -1;
- return;
- }
- int userInfoIndex = auth.indexOf(QLatin1Char('@'), from);
- if (uint(userInfoIndex) < uint(end)) {
- setUserInfo(auth, from, userInfoIndex);
- from = userInfoIndex + 1;
- }
+ // we never actually _loop_
+ while (from != end) {
+ int userInfoIndex = auth.indexOf(QLatin1Char('@'), from);
+ if (uint(userInfoIndex) < uint(end)) {
+ setUserInfo(auth, from, userInfoIndex);
+ if (mode == QUrl::StrictMode && !validateComponent(UserInfo, auth, from, userInfoIndex))
+ break;
+ from = userInfoIndex + 1;
+ }
- int colonIndex = auth.lastIndexOf(QLatin1Char(':'), end - 1);
- if (colonIndex < from)
- colonIndex = -1;
+ int colonIndex = auth.lastIndexOf(QLatin1Char(':'), end - 1);
+ if (colonIndex < from)
+ colonIndex = -1;
- if (uint(colonIndex) < uint(end)) {
- if (auth.at(from).unicode() == '[') {
- // check if colonIndex isn't inside the "[...]" part
- int closingBracket = auth.indexOf(QLatin1Char(']'), from);
- if (uint(closingBracket) > uint(colonIndex))
- colonIndex = -1;
+ if (uint(colonIndex) < uint(end)) {
+ if (auth.at(from).unicode() == '[') {
+ // check if colonIndex isn't inside the "[...]" part
+ int closingBracket = auth.indexOf(QLatin1Char(']'), from);
+ if (uint(closingBracket) > uint(colonIndex))
+ colonIndex = -1;
+ }
}
- }
- if (colonIndex == end - 1) {
- // found a colon but no digits after it
- setError(PortEmptyError, auth, colonIndex + 1);
- } else if (uint(colonIndex) < uint(end)) {
- unsigned long x = 0;
- for (int i = colonIndex + 1; i < end; ++i) {
- ushort c = auth.at(i).unicode();
- if (c >= '0' && c <= '9') {
- x *= 10;
- x += c - '0';
+ if (colonIndex == end - 1) {
+ // found a colon but no digits after it
+ setError(PortEmptyError, auth, colonIndex + 1);
+ } else if (uint(colonIndex) < uint(end)) {
+ unsigned long x = 0;
+ for (int i = colonIndex + 1; i < end; ++i) {
+ ushort c = auth.at(i).unicode();
+ if (c >= '0' && c <= '9') {
+ x *= 10;
+ x += c - '0';
+ } else {
+ x = ulong(-1); // x != ushort(x)
+ break;
+ }
+ }
+ if (x == ushort(x)) {
+ port = ushort(x);
} else {
- x = ulong(-1); // x != ushort(x)
- break;
+ setError(InvalidPortError, auth, colonIndex + 1);
+ if (mode == QUrl::StrictMode)
+ break;
}
- }
- if (x == ushort(x)) {
- port = ushort(x);
} else {
- setError(InvalidPortError, auth, colonIndex + 1);
+ port = -1;
+ }
+
+ setHost(auth, from, qMin<uint>(end, colonIndex), mode);
+ if (mode == QUrl::StrictMode && !validateComponent(Host, auth, from, qMin<uint>(end, colonIndex))) {
+ // clear host too
+ sectionIsPresent &= ~Authority;
+ break;
}
- } else {
- port = -1;
- }
- setHost(auth, from, qMin<uint>(end, colonIndex), mode);
+ // success
+ return;
+ }
+ // clear all sections but host
+ sectionIsPresent &= ~Authority | Host;
+ userName.clear();
+ password.clear();
+ host.clear();
+ port = -1;
}
inline void QUrlPrivate::setUserInfo(const QString &userInfo, int from, int end)
@@ -1297,61 +1315,18 @@ inline void QUrlPrivate::parse(const QString &url, QUrl::ParsingMode parsingMode
if (error || parsingMode == QUrl::TolerantMode)
return;
- // The parsing so far was tolerant of errors, so the StrictMode
- // parsing is actually implemented here, as an extra post-check.
- // We only execute it if we haven't found any errors so far.
+ // The parsing so far was partially tolerant of errors, except for the
+ // scheme parser (which is always strict) and the authority (which was
+ // executed in strict mode).
+ // If we haven't found any errors so far, continue the strict-mode parsing
+ // from the path component onwards.
- // What we need to look out for, that the regular parser tolerates:
- // - percent signs not followed by two hex digits
- // - forbidden characters, which should always appear encoded
- // '"' / '<' / '>' / '\' / '^' / '`' / '{' / '|' / '}' / BKSP
- // control characters
- // - delimiters not allowed in certain positions
- // . scheme: parser is already strict
- // . user info: gen-delims (except for ':') disallowed
- // . host: parser is stricter than the standard
- // . port: parser is stricter than the standard
- // . path: all delimiters allowed
- // . fragment: all delimiters allowed
- // . query: all delimiters allowed
- // We would only need to check the user-info. However, the presence
- // of the disallowed gen-delims changes the parsing, so we don't
- // actually need to do anything
- static const char forbidden[] = "\"<>\\^`{|}\x7F";
- for (uint i = 0; i < uint(len); ++i) {
- register uint uc = data[i];
- if (uc >= 0x80)
- continue;
-
- if ((uc == '%' && (uint(len) < i + 2 || !isHex(data[i + 1]) || !isHex(data[i + 2])))
- || uc <= 0x20 || strchr(forbidden, uc)) {
- // found an error
- ErrorCode errorCode;
-
- // where are we?
- if (i > uint(hash)) {
- errorCode = InvalidFragmentError;
- } else if (i > uint(question)) {
- errorCode = InvalidQueryError;
- } else if (i > uint(pathStart)) {
- // pathStart is never -1
- errorCode = InvalidPathError;
- } else {
- // It must be in the authority, since the scheme is strict.
- // Since the port and hostname parsers are also strict,
- // the error can only have happened in the user info.
- int pos = url.indexOf(QLatin1Char(':'), hierStart);
- if (i > uint(pos)) {
- errorCode = InvalidPasswordError;
- } else {
- errorCode = InvalidUserNameError;
- }
- }
-
- setError(errorCode, url, i);
- return;
- }
- }
+ if (!validateComponent(Path, url, pathStart, hierEnd))
+ return;
+ if (uint(question) < uint(hash) && !validateComponent(Query, url, question + 1, qMin<uint>(hash, len)))
+ return;
+ if (hash != -1)
+ validateComponent(Fragment, url, hash + 1, len);
}
/*
@@ -1519,6 +1494,67 @@ inline QUrlPrivate::ErrorCode QUrlPrivate::validityError(QString *source, int *p
return NoError;
}
+bool QUrlPrivate::validateComponent(QUrlPrivate::Section section, const QString &input,
+ int begin, int end)
+{
+ // What we need to look out for, that the regular parser tolerates:
+ // - percent signs not followed by two hex digits
+ // - forbidden characters, which should always appear encoded
+ // '"' / '<' / '>' / '\' / '^' / '`' / '{' / '|' / '}' / BKSP
+ // control characters
+ // - delimiters not allowed in certain positions
+ // . scheme: parser is already strict
+ // . user info: gen-delims except ":" disallowed ("/" / "?" / "#" / "[" / "]" / "@")
+ // . host: parser is stricter than the standard
+ // . port: parser is stricter than the standard
+ // . path: all delimiters allowed
+ // . fragment: all delimiters allowed
+ // . query: all delimiters allowed
+ static const char forbidden[] = "\"<>\\^`{|}\x7F";
+ static const char forbiddenUserInfo[] = ":/?#[]@";
+
+ Q_ASSERT(section != Authority && section != Hierarchy && section != FullUrl);
+
+ const ushort *const data = reinterpret_cast<const ushort *>(input.constData());
+ for (uint i = uint(begin); i < uint(end); ++i) {
+ register uint uc = data[i];
+ if (uc >= 0x80)
+ continue;
+
+ bool error = false;
+ if ((uc == '%' && (uint(end) < i + 2 || !isHex(data[i + 1]) || !isHex(data[i + 2])))
+ || uc <= 0x20 || strchr(forbidden, uc)) {
+ // found an error
+ error = true;
+ } else if (section & UserInfo) {
+ if (section == UserInfo && strchr(forbiddenUserInfo + 1, uc))
+ error = true;
+ else if (section != UserInfo && strchr(forbiddenUserInfo, uc))
+ error = true;
+ }
+
+ if (!error)
+ continue;
+
+ ErrorCode errorCode = ErrorCode(int(section) << 8);
+ if (section == UserInfo) {
+ // is it the user name or the password?
+ errorCode = InvalidUserNameError;
+ for (uint j = uint(begin); j < i; ++j)
+ if (data[j] == ':') {
+ errorCode = InvalidPasswordError;
+ break;
+ }
+ }
+
+ setError(errorCode, input, i);
+ return false;
+ }
+
+ // no errors
+ return true;
+}
+
#if 0
inline void QUrlPrivate::validate() const
{
@@ -1954,6 +1990,10 @@ void QUrl::setUserInfo(const QString &userInfo, ParsingMode mode)
// QUrlPrivate::setUserInfo cleared almost everything
// but it leaves the UserName bit set
d->sectionIsPresent &= ~QUrlPrivate::UserInfo;
+ } else if (mode == StrictMode && !d->validateComponent(QUrlPrivate::UserInfo, userInfo)) {
+ d->sectionIsPresent &= ~QUrlPrivate::UserInfo;
+ d->userName.clear();
+ d->password.clear();
}
}
@@ -2010,10 +2050,11 @@ void QUrl::setUserName(const QString &userName, ParsingMode mode)
mode = TolerantMode;
}
-
d->setUserName(data, 0, data.length());
if (userName.isNull())
d->sectionIsPresent &= ~QUrlPrivate::UserName;
+ else if (mode == StrictMode && !d->validateComponent(QUrlPrivate::UserName, userName))
+ d->userName.clear();
}
/*!
@@ -2105,6 +2146,8 @@ void QUrl::setPassword(const QString &password, ParsingMode mode)
d->setPassword(data, 0, data.length());
if (password.isNull())
d->sectionIsPresent &= ~QUrlPrivate::Password;
+ else if (mode == StrictMode && !d->validateComponent(QUrlPrivate::Password, password))
+ d->password.clear();
}
/*!
@@ -2354,6 +2397,9 @@ void QUrl::setPath(const QString &path, ParsingMode mode)
// optimized out, since there is no path delimiter
// if (path.isNull())
// d->sectionIsPresent &= ~QUrlPrivate::Path;
+// else
+ if (mode == StrictMode && !d->validateComponent(QUrlPrivate::Path, path))
+ d->path.clear();
}
/*!
@@ -2474,6 +2520,8 @@ void QUrl::setQuery(const QString &query, ParsingMode mode)
d->setQuery(data, 0, data.length());
if (query.isNull())
d->sectionIsPresent &= ~QUrlPrivate::Query;
+ else if (mode == StrictMode && !d->validateComponent(QUrlPrivate::Query, query))
+ d->query.clear();
}
/*!
@@ -2835,6 +2883,8 @@ void QUrl::setFragment(const QString &fragment, ParsingMode mode)
d->setFragment(data, 0, data.length());
if (fragment.isNull())
d->sectionIsPresent &= ~QUrlPrivate::Fragment;
+ else if (mode == StrictMode && !d->validateComponent(QUrlPrivate::Fragment, fragment))
+ d->fragment.clear();
}
/*!
@@ -3812,7 +3862,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\list
\li qt.nokia.com becomes http://qt.nokia.com
- \li ftp.qt.nokia.com becomes ftp://ftp.qt.nokia.com
+ \li ftp.qt-project.org becomes ftp://ftp.qt-project.org
\li hostname becomes http://hostname
\li /home/user/test.html becomes file:///home/user/test.html
\endlist
@@ -3828,12 +3878,11 @@ QUrl QUrl::fromUserInput(const QString &userInput)
QUrl url = QUrl(trimmedString, QUrl::TolerantMode);
QUrl urlPrepended = QUrl(QStringLiteral("http://") + trimmedString, QUrl::TolerantMode);
- // Check the most common case of a valid url with scheme and host
+ // Check the most common case of a valid url with a scheme
// We check if the port would be valid by adding the scheme to handle the case host:port
// where the host would be interpretted as the scheme
if (url.isValid()
&& !url.scheme().isEmpty()
- && (!url.host().isEmpty() || !url.path().isEmpty())
&& urlPrepended.port() == -1)
return adjustFtpPath(url);
diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp
index e2361e11f9..db1db9aaed 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.cpp
+++ b/src/corelib/itemmodels/qabstractitemmodel.cpp
@@ -1437,7 +1437,7 @@ QAbstractItemModel::~QAbstractItemModel()
For example:
- \snippet itemviews/simpledommodel/dommodel.cpp 2
+ \snippet ../widgets/itemviews/simpledommodel/dommodel.cpp 2
\note When implementing a table based model, columnCount() should return 0
when the parent is valid.
diff --git a/src/corelib/itemmodels/qabstractproxymodel.cpp b/src/corelib/itemmodels/qabstractproxymodel.cpp
index 715a186b97..0175a0f2fa 100644
--- a/src/corelib/itemmodels/qabstractproxymodel.cpp
+++ b/src/corelib/itemmodels/qabstractproxymodel.cpp
@@ -124,6 +124,10 @@ QAbstractProxyModel::~QAbstractProxyModel()
/*!
Sets the given \a sourceModel to be processed by the proxy model.
+
+ Subclasses should call beginResetModel() at the beginning of the method,
+ disconnect from the old model, call this method, connect to the new model,
+ and call endResetModel().
*/
void QAbstractProxyModel::setSourceModel(QAbstractItemModel *sourceModel)
{
diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
index 6ab32a9366..857054558f 100644
--- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp
+++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
@@ -1616,7 +1616,7 @@ void QSortFilterProxyModelPrivate::_q_sourceColumnsMoved(
QSortFilterProxyModel and reimplementing lessThan(), which is
used to compare items. For example:
- \snippet itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 5
+ \snippet ../widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 5
(This code snippet comes from the
\l{itemviews/customsortfiltermodel}{Custom Sort/Filter Model}
@@ -1659,7 +1659,7 @@ void QSortFilterProxyModelPrivate::_q_sourceColumnsMoved(
the \l{QSortFilterProxyModel::filterKeyColumn}{filterKeyColumn} property
and performs filtering on columns 0, 1, and 2:
- \snippet itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 3
+ \snippet ../widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 3
(This code snippet comes from the
\l{itemviews/customsortfiltermodel}{Custom Sort/Filter Model}
diff --git a/src/corelib/json/qjsonarray.cpp b/src/corelib/json/qjsonarray.cpp
index 0cd436a3b9..a669a5533d 100644
--- a/src/corelib/json/qjsonarray.cpp
+++ b/src/corelib/json/qjsonarray.cpp
@@ -535,7 +535,7 @@ bool QJsonArray::operator!=(const QJsonArray &other) const
/*! \fn QJsonArray::iterator QJsonArray::begin()
- Returns an \l{STL-style iterator} pointing to the first item in
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in
the array.
\sa constBegin(), end()
@@ -548,7 +548,7 @@ bool QJsonArray::operator!=(const QJsonArray &other) const
/*! \fn QJsonArray::const_iterator QJsonArray::constBegin() const
- Returns a const \l{STL-style iterator} pointing to the first item
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the array.
\sa begin(), constEnd()
@@ -556,7 +556,7 @@ bool QJsonArray::operator!=(const QJsonArray &other) const
/*! \fn QJsonArray::iterator QJsonArray::end()
- Returns an \l{STL-style iterator} pointing to the imaginary item
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item
after the last item in the array.
\sa begin(), constEnd()
@@ -569,7 +569,7 @@ bool QJsonArray::operator!=(const QJsonArray &other) const
/*! \fn QJsonArray::const_iterator QJsonArray::constEnd() const
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the array.
\sa constBegin(), end()
diff --git a/src/corelib/json/qjsonobject.cpp b/src/corelib/json/qjsonobject.cpp
index 728bbbd0ec..1bdd872e78 100644
--- a/src/corelib/json/qjsonobject.cpp
+++ b/src/corelib/json/qjsonobject.cpp
@@ -390,13 +390,14 @@ QJsonValue QJsonObject::take(const QString &key)
if (!keyExists)
return QJsonValue(QJsonValue::Undefined);
- QJsonPrivate::Entry *e = o->entryAt(index);
+ QJsonValue v(d, o, o->entryAt(index)->value);
+ detach();
o->removeItems(index, 1);
++d->compactionCounter;
if (d->compactionCounter > 32u && d->compactionCounter >= unsigned(o->length) / 2u)
compact();
- return QJsonValue(d, o, e->value);
+ return v;
}
/*!
@@ -525,7 +526,7 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
/*! \fn QJsonObject::iterator QJsonObject::begin()
- Returns an \l{STL-style iterator} pointing to the first item in
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in
the object.
\sa constBegin(), end()
@@ -538,7 +539,7 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
/*! \fn QJsonObject::const_iterator QJsonObject::constBegin() const
- Returns a const \l{STL-style iterator} pointing to the first item
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the object.
\sa begin(), constEnd()
@@ -546,7 +547,7 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
/*! \fn QJsonObject::iterator QJsonObject::end()
- Returns an \l{STL-style iterator} pointing to the imaginary item
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item
after the last item in the object.
\sa begin(), constEnd()
@@ -559,7 +560,7 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
/*! \fn QJsonObject::const_iterator QJsonObject::constEnd() const
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the object.
\sa constBegin(), end()
diff --git a/src/corelib/kernel/qeventdispatcher_blackberry.cpp b/src/corelib/kernel/qeventdispatcher_blackberry.cpp
index 2252b73ad4..69b4a8b172 100644
--- a/src/corelib/kernel/qeventdispatcher_blackberry.cpp
+++ b/src/corelib/kernel/qeventdispatcher_blackberry.cpp
@@ -132,7 +132,7 @@ static int bpsIOHandler(int fd, int io_events, void *data)
}
// post unblock event to our thread; in this callback the bps channel is
- // guarenteed to be the same that was active when bps_add_fd was called
+ // guaranteed to be the same that was active when bps_add_fd was called
result = bps_push_event(event);
if (result != BPS_SUCCESS) {
qWarning("QEventDispatcherBlackberryPrivate::QEventDispatcherBlackberry: bps_push_event() failed");
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index 06d325f383..09c641e4a3 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -252,7 +252,8 @@ public:
IsEnumeration = 0x10,
SharedPointerToQObject = 0x20,
WeakPointerToQObject = 0x40,
- TrackingPointerToQObject = 0x80
+ TrackingPointerToQObject = 0x80,
+ WasDeclaredAsMetaType = 0x100
};
Q_DECLARE_FLAGS(TypeFlags, TypeFlag)
@@ -563,12 +564,19 @@ namespace QtPrivate {
| (Q_IS_ENUM(T) ? QMetaType::IsEnumeration : 0)
};
};
+
+ template<typename T, bool defined>
+ struct MetaTypeDefinedHelper
+ {
+ enum DefinedType { Defined = defined };
+ };
}
template <typename T>
int qRegisterNormalizedMetaType(const QT_PREPEND_NAMESPACE(QByteArray) &normalizedTypeName
#ifndef qdoc
, T * dummy = 0
+ , typename QtPrivate::MetaTypeDefinedHelper<T, QMetaTypeId2<T>::Defined && !QMetaTypeId2<T>::IsBuiltIn>::DefinedType defined = QtPrivate::MetaTypeDefinedHelper<T, QMetaTypeId2<T>::Defined && !QMetaTypeId2<T>::IsBuiltIn>::Defined
#endif
)
{
@@ -580,6 +588,10 @@ int qRegisterNormalizedMetaType(const QT_PREPEND_NAMESPACE(QByteArray) &normaliz
return QMetaType::registerNormalizedTypedef(normalizedTypeName, typedefOf);
QMetaType::TypeFlags flags(QtPrivate::QMetaTypeTypeFlags<T>::Flags);
+
+ if (defined)
+ flags |= QMetaType::WasDeclaredAsMetaType;
+
return QMetaType::registerNormalizedType(normalizedTypeName,
QtMetaTypePrivate::QMetaTypeFunctionHelper<T>::Delete,
QtMetaTypePrivate::QMetaTypeFunctionHelper<T>::Create,
@@ -594,6 +606,7 @@ template <typename T>
int qRegisterMetaType(const char *typeName
#ifndef qdoc
, T * dummy = 0
+ , typename QtPrivate::MetaTypeDefinedHelper<T, QMetaTypeId2<T>::Defined && !QMetaTypeId2<T>::IsBuiltIn>::DefinedType defined = QtPrivate::MetaTypeDefinedHelper<T, QMetaTypeId2<T>::Defined && !QMetaTypeId2<T>::IsBuiltIn>::Defined
#endif
)
{
@@ -602,7 +615,7 @@ int qRegisterMetaType(const char *typeName
#else
QT_PREPEND_NAMESPACE(QByteArray) normalizedTypeName = QMetaObject::normalizedType(typeName);
#endif
- return qRegisterNormalizedMetaType<T>(normalizedTypeName, dummy);
+ return qRegisterNormalizedMetaType<T>(normalizedTypeName, dummy, defined);
}
#ifndef QT_NO_DATASTREAM
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 9d0854f3a9..9091b5579e 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -1945,7 +1945,7 @@ void QObject::deleteLater()
is available.
Example:
- \snippet mainwindows/sdi/mainwindow.cpp implicit tr context
+ \snippet ../widgets/mainwindows/sdi/mainwindow.cpp implicit tr context
\dots
If the same \a sourceText is used in different roles within the
@@ -3864,9 +3864,9 @@ QDebug operator<<(QDebug dbg, const QObject *o) {
Example:
- \snippet tools/plugandpaintplugins/basictools/basictoolsplugin.h 1
+ \snippet ../widgets/tools/plugandpaintplugins/basictools/basictoolsplugin.h 1
\dots
- \snippet tools/plugandpaintplugins/basictools/basictoolsplugin.h 3
+ \snippet ../widgets/tools/plugandpaintplugins/basictools/basictoolsplugin.h 3
See the \l{tools/plugandpaintplugins/basictools}{Plug & Paint
Basic Tools} example for details.
@@ -4293,6 +4293,16 @@ bool QObject::disconnect(const QMetaObject::Connection &connection)
if (c->next)
c->next->prev = c->prev;
c->receiver = 0;
+
+ // destroy the QSlotObject, if possible
+ if (c->isSlotObject) {
+ c->slotObj->destroyIfLastRef();
+ c->isSlotObject = false;
+ }
+
+ const_cast<QMetaObject::Connection &>(connection).d_ptr = 0;
+ c->deref(); // has been removed from the QMetaObject::Connection object
+
// disconnectNotify() not called (the signal index is unknown).
return true;
diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp
index 9dea666363..9126d7ea17 100644
--- a/src/corelib/kernel/qtimer.cpp
+++ b/src/corelib/kernel/qtimer.cpp
@@ -62,9 +62,9 @@ QT_BEGIN_NAMESPACE
Example for a one second (1000 millisecond) timer (from the
\l{widgets/analogclock}{Analog Clock} example):
- \snippet widgets/analogclock/analogclock.cpp 4
- \snippet widgets/analogclock/analogclock.cpp 5
- \snippet widgets/analogclock/analogclock.cpp 6
+ \snippet ../widgets/widgets/analogclock/analogclock.cpp 4
+ \snippet ../widgets/widgets/analogclock/analogclock.cpp 5
+ \snippet ../widgets/widgets/analogclock/analogclock.cpp 6
From then on, the \c update() slot is called every second.
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp
index f934202cf6..58e4f202d5 100644
--- a/src/corelib/kernel/qtranslator.cpp
+++ b/src/corelib/kernel/qtranslator.cpp
@@ -343,10 +343,10 @@ public:
The most common use of QTranslator is to: load a translation
file, install it using QCoreApplication::installTranslator(), and use
- it via QObject::tr(). Here's the \c main() function from the
- \l{linguist/hellotr}{Hello tr()} example:
+ it via QObject::tr(). Here's an example \c main() function using the
+ QTranslator:
- \snippet linguist/hellotr/main.cpp 2
+ \snippet hellotrmain.cpp 0
Note that the translator must be created \e before the
application's widgets.
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 9ff9d10bf0..26deeba6a2 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -341,11 +341,9 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
*str = v_cast<QUrl>(d)->toString();
break;
#endif
-#ifndef QT_NO_QUUID_STRING
case QVariant::Uuid:
*str = v_cast<QUuid>(d)->toString();
break;
-#endif
default:
return false;
}
@@ -722,11 +720,9 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
#endif
case QVariant::Uuid:
switch (d->type) {
-#ifndef QT_NO_QUUID_STRING
case QVariant::String:
*static_cast<QUuid *>(result) = QUuid(*v_cast<QString>(d));
break;
-#endif
default:
return false;
}
diff --git a/src/corelib/kernel/qwineventnotifier.h b/src/corelib/kernel/qwineventnotifier.h
index d5e4d0f7e3..291d953e58 100644
--- a/src/corelib/kernel/qwineventnotifier.h
+++ b/src/corelib/kernel/qwineventnotifier.h
@@ -42,12 +42,9 @@
#ifndef QWINEVENTNOTIFIER_H
#define QWINEVENTNOTIFIER_H
-#if 0
-// inform syncqt
-#pragma qt_no_master_include
-#endif
-
#include "QtCore/qobject.h"
+
+#ifdef Q_OS_WIN
#include "QtCore/qt_windows.h"
QT_BEGIN_HEADER
@@ -88,4 +85,6 @@ QT_END_NAMESPACE
QT_END_HEADER
+#endif // Q_OS_WIN
+
#endif // QWINEVENTNOTIFIER_H
diff --git a/src/corelib/mimetypes/qmimedatabase.cpp b/src/corelib/mimetypes/qmimedatabase.cpp
index 5acc290475..f3705476c3 100644
--- a/src/corelib/mimetypes/qmimedatabase.cpp
+++ b/src/corelib/mimetypes/qmimedatabase.cpp
@@ -604,18 +604,4 @@ QList<QMimeType> QMimeDatabase::allMimeTypes() const
\value MatchContent The file content is used to look for a match
*/
-/*!
- \fn QMimeType QMimeDatabase::mimeTypeForNameAndData(const QString &fileName, QIODevice *device) const
- \obsolete
-
- This function is replaced by \l mimeTypeForFileNameAndData()
-*/
-
-/*!
- \fn QMimeType QMimeDatabase::mimeTypeForNameAndData(const QString &fileName, const QByteArray &data) const
- \obsolete
-
- This function is replaced by \l mimeTypeForFileNameAndData()
-*/
-
QT_END_NAMESPACE
diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp
index 75652b0902..aeb78e88b4 100644
--- a/src/corelib/plugin/qfactoryloader.cpp
+++ b/src/corelib/plugin/qfactoryloader.cpp
@@ -126,9 +126,30 @@ void QFactoryLoader::update()
QStringList plugins = QDir(path).entryList(QDir::Files);
QLibraryPrivate *library = 0;
+
+#ifdef Q_OS_MAC
+ // Loading both the debug and release version of the cocoa plugins causes the objective-c runtime
+ // to print "duplicate class definitions" warnings. Detect if QFactoryLoader is about to load both,
+ // skip one of them (below).
+ //
+ // ### FIXME find a proper solution
+ //
+ const bool isLoadingDebugAndReleaseCocoa = plugins.contains("libqcocoa_debug.dylib") && plugins.contains("libqcocoa.dylib");
+#endif
for (int j = 0; j < plugins.count(); ++j) {
QString fileName = QDir::cleanPath(path + QLatin1Char('/') + plugins.at(j));
+#ifdef Q_OS_MAC
+ if (isLoadingDebugAndReleaseCocoa) {
+#ifdef QT_DEBUG
+ if (fileName.contains(QStringLiteral("libqcocoa.dylib")))
+ continue; // Skip release plugin in debug mode
+#else
+ if (fileName.contains(QStringLiteral("libqcocoa_debug.dylib")))
+ continue; // Skip debug plugin in release mode
+#endif
+ }
+#endif
if (qt_debug_component()) {
qDebug() << "QFactoryLoader::QFactoryLoader() looking at" << fileName;
}
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index 26692ca3d4..8d2e890d87 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -73,7 +73,7 @@ QT_BEGIN_NAMESPACE
# define QLIBRARY_AS_DEBUG true
#endif
-#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
+#if defined(Q_OS_UNIX)
// We don't use separate debug and release libs on UNIX, so we want
// to allow loading plugins, regardless of how they were built.
# define QT_NO_DEBUG_PLUGIN_CHECK
diff --git a/src/corelib/plugin/qlibrary_p.h b/src/corelib/plugin/qlibrary_p.h
index 337c43acb9..8465d5cf06 100644
--- a/src/corelib/plugin/qlibrary_p.h
+++ b/src/corelib/plugin/qlibrary_p.h
@@ -92,6 +92,8 @@ public:
QFunctionPointer resolve(const char *);
static QLibraryPrivate *findOrCreate(const QString &fileName, const QString &version = QString());
+ static QStringList suffixes_sys(const QString &fullVersion);
+ static QStringList prefixes_sys();
static QVector<QStaticPlugin> staticPlugins();
diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp
index 2ef6f80466..35d8197306 100644
--- a/src/corelib/plugin/qlibrary_unix.cpp
+++ b/src/corelib/plugin/qlibrary_unix.cpp
@@ -80,6 +80,60 @@ static QString qdlerror()
return err ? QLatin1Char('(') + QString::fromLocal8Bit(err) + QLatin1Char(')'): QString();
}
+QStringList QLibraryPrivate::suffixes_sys(const QString& fullVersion)
+{
+ QStringList suffixes;
+#if defined(Q_OS_HPUX)
+ // according to
+ // http://docs.hp.com/en/B2355-90968/linkerdifferencesiapa.htm
+
+ // In PA-RISC (PA-32 and PA-64) shared libraries are suffixed
+ // with .sl. In IPF (32-bit and 64-bit), the shared libraries
+ // are suffixed with .so. For compatibility, the IPF linker
+ // also supports the .sl suffix.
+
+ // But since we don't know if we are built on HPUX or HPUXi,
+ // we support both .sl (and .<version>) and .so suffixes but
+ // .so is preferred.
+# if defined(__ia64)
+ if (!fullVersion.isEmpty()) {
+ suffixes << QString::fromLatin1(".so.%1").arg(fullVersion);
+ } else {
+ suffixes << QLatin1String(".so");
+ }
+# endif
+ if (!fullVersion.isEmpty()) {
+ suffixes << QString::fromLatin1(".sl.%1").arg(fullVersion);
+ suffixes << QString::fromLatin1(".%1").arg(fullVersion);
+ } else {
+ suffixes << QLatin1String(".sl");
+ }
+#elif defined(Q_OS_AIX)
+ suffixes << ".a";
+
+#else
+ if (!fullVersion.isEmpty()) {
+ suffixes << QString::fromLatin1(".so.%1").arg(fullVersion);
+ } else {
+ suffixes << QLatin1String(".so");
+ }
+#endif
+# ifdef Q_OS_MAC
+ if (!fullVersion.isEmpty()) {
+ suffixes << QString::fromLatin1(".%1.bundle").arg(fullVersion);
+ suffixes << QString::fromLatin1(".%1.dylib").arg(fullVersion);
+ } else {
+ suffixes << QLatin1String(".bundle") << QLatin1String(".dylib");
+ }
+#endif
+ return suffixes;
+}
+
+QStringList QLibraryPrivate::prefixes_sys()
+{
+ return QStringList() << QLatin1String("lib");
+}
+
bool QLibraryPrivate::load_sys()
{
QString attempt;
@@ -96,50 +150,8 @@ bool QLibraryPrivate::load_sys()
QStringList suffixes;
QStringList prefixes;
if (pluginState != IsAPlugin) {
- prefixes << QLatin1String("lib");
-#if defined(Q_OS_HPUX)
- // according to
- // http://docs.hp.com/en/B2355-90968/linkerdifferencesiapa.htm
-
- // In PA-RISC (PA-32 and PA-64) shared libraries are suffixed
- // with .sl. In IPF (32-bit and 64-bit), the shared libraries
- // are suffixed with .so. For compatibility, the IPF linker
- // also supports the .sl suffix.
-
- // But since we don't know if we are built on HPUX or HPUXi,
- // we support both .sl (and .<version>) and .so suffixes but
- // .so is preferred.
-# if defined(__ia64)
- if (!fullVersion.isEmpty()) {
- suffixes << QString::fromLatin1(".so.%1").arg(fullVersion);
- } else {
- suffixes << QLatin1String(".so");
- }
-# endif
- if (!fullVersion.isEmpty()) {
- suffixes << QString::fromLatin1(".sl.%1").arg(fullVersion);
- suffixes << QString::fromLatin1(".%1").arg(fullVersion);
- } else {
- suffixes << QLatin1String(".sl");
- }
-#elif defined(Q_OS_AIX)
- suffixes << ".a";
-
-#else
- if (!fullVersion.isEmpty()) {
- suffixes << QString::fromLatin1(".so.%1").arg(fullVersion);
- } else {
- suffixes << QLatin1String(".so");
- }
-#endif
-# ifdef Q_OS_MAC
- if (!fullVersion.isEmpty()) {
- suffixes << QString::fromLatin1(".%1.bundle").arg(fullVersion);
- suffixes << QString::fromLatin1(".%1.dylib").arg(fullVersion);
- } else {
- suffixes << QLatin1String(".bundle") << QLatin1String(".dylib");
- }
-#endif
+ prefixes = prefixes_sys();
+ suffixes = suffixes_sys(fullVersion);
}
int dlFlags = 0;
#if defined(QT_HPUX_LD)
diff --git a/src/corelib/plugin/qlibrary_win.cpp b/src/corelib/plugin/qlibrary_win.cpp
index 27796aedc1..ef3816a804 100644
--- a/src/corelib/plugin/qlibrary_win.cpp
+++ b/src/corelib/plugin/qlibrary_win.cpp
@@ -57,6 +57,17 @@ QT_BEGIN_NAMESPACE
extern QString qt_error_string(int code);
+QStringList QLibraryPrivate::suffixes_sys(const QString& fullVersion)
+{
+ Q_UNUSED(fullVersion);
+ return QStringList() << ".dll";
+}
+
+QStringList QLibraryPrivate::prefixes_sys()
+{
+ return QStringList();
+}
+
bool QLibraryPrivate::load_sys()
{
//avoid 'Bad Image' message box
diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp
index 31d9fda858..c16a340dbe 100644
--- a/src/corelib/plugin/qpluginloader.cpp
+++ b/src/corelib/plugin/qpluginloader.cpp
@@ -42,6 +42,7 @@
#include "qplatformdefs.h"
#include "qplugin.h"
+#include "qcoreapplication.h"
#include "qpluginloader.h"
#include <qfileinfo.h>
#include "qlibrary_p.h"
@@ -250,14 +251,52 @@ bool QPluginLoader::isLoaded() const
return d && d->pHnd && d->instance;
}
+static QString locatePlugin(const QString& fileName)
+{
+ QStringList prefixes = QLibraryPrivate::prefixes_sys();
+ prefixes.prepend(QString());
+ QStringList suffixes = QLibraryPrivate::suffixes_sys(QString());
+ suffixes.prepend(QString());
+
+ // Split up "subdir/filename"
+ const int slash = fileName.lastIndexOf('/');
+ const QString baseName = fileName.mid(slash + 1);
+ const QString basePath = fileName.left(slash + 1); // keep the '/'
+
+ const bool debug = qt_debug_component();
+
+ QStringList paths = QCoreApplication::libraryPaths();
+ paths.prepend(QStringLiteral("./")); // search in current dir first
+ foreach (const QString &path, paths) {
+ foreach (const QString &prefix, prefixes) {
+ foreach (const QString &suffix, suffixes) {
+ const QString fn = path + QLatin1Char('/') + basePath + prefix + baseName + suffix;
+ if (debug)
+ qDebug() << "Trying..." << fn;
+ if (QFileInfo(fn).isFile())
+ return fn;
+ }
+ }
+ }
+ if (debug)
+ qDebug() << fileName << "not found";
+ return QString();
+}
+
/*!
\property QPluginLoader::fileName
\brief the file name of the plugin
- To be loadable, the file's suffix must be a valid suffix for a
- loadable library in accordance with the platform, e.g. \c .so on
- Unix, \c .dylib on Mac OS X, and \c .dll on Windows. The suffix
- can be verified with QLibrary::isLibrary().
+ We recommend omitting the file's suffix in the file name, since
+ QPluginLoader will automatically look for the file with the appropriate
+ suffix (see QLibrary::isLibrary()).
+
+ When loading the plugin, QPluginLoader searches in the current directory and
+ in all plugin locations specified by QCoreApplication::libraryPaths(),
+ unless the file name has an absolute path. After loading the plugin
+ successfully, fileName() returns the fully-qualified file name of
+ the plugin, including the full path to the plugin if one was given
+ in the constructor or passed to setFileName().
If the file name does not exist, it will not be set. This property
will then contain an empty string.
@@ -277,7 +316,12 @@ void QPluginLoader::setFileName(const QString &fileName)
did_load = false;
}
- QString fn = QFileInfo(fileName).canonicalFilePath();
+ QFileInfo fi(fileName);
+ QString fn;
+ if (fi.isAbsolute())
+ fn = fi.canonicalFilePath();
+ else
+ fn = locatePlugin(fileName);
d = QLibraryPrivate::findOrCreate(fn);
d->loadHints = lh;
diff --git a/src/corelib/plugin/quuid.cpp b/src/corelib/plugin/quuid.cpp
index c1ebc57cf6..f9a9666de3 100644
--- a/src/corelib/plugin/quuid.cpp
+++ b/src/corelib/plugin/quuid.cpp
@@ -50,7 +50,6 @@
#endif
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_QUUID_STRING
template <class Char, class Integral>
void _q_toHex(Char *&dst, Integral value)
{
@@ -134,7 +133,6 @@ bool _q_uuidFromHex(const Char *&src, uint &d1, ushort &d2, ushort &d3, uchar (&
return true;
}
-#endif
#ifndef QT_BOOTSTRAPPED
static QUuid createFromName(const QUuid &ns, const QByteArray &baseData, QCryptographicHash::Algorithm algorithm, int version)
@@ -341,7 +339,6 @@ static QUuid createFromName(const QUuid &ns, const QByteArray &baseData, QCrypto
\snippet code/src_corelib_plugin_quuid.cpp 0
*/
-#ifndef QT_NO_QUUID_STRING
/*!
Creates a QUuid object from the string \a text, which must be
formatted as five hex fields separated by '-', e.g.,
@@ -422,8 +419,6 @@ QUuid::QUuid(const QByteArray &text)
}
}
-#endif
-
/*!
\since 5.0
\fn QUuid QUuid::createUuidV3(const QUuid &ns, const QByteArray &baseData);
@@ -527,7 +522,7 @@ QUuid QUuid::fromRfc4122(const QByteArray &bytes)
Returns true if this QUuid and the \a other QUuid are different;
otherwise returns false.
*/
-#ifndef QT_NO_QUUID_STRING
+
/*!
Returns the string representation of this QUuid. The string is
formatted as five hex fields separated by '-' and enclosed in
@@ -617,7 +612,6 @@ QByteArray QUuid::toByteArray() const
return result;
}
-#endif
/*!
Returns the binary representation of this QUuid. The byte array is in big
@@ -1016,12 +1010,7 @@ QUuid QUuid::createUuid()
*/
QDebug operator<<(QDebug dbg, const QUuid &id)
{
-#ifndef QT_NO_QUUID_STRING
dbg.nospace() << "QUuid(" << id.toString() << ')';
-#else
- Q_UNUSED(id)
- dbg.nospace() << "QUuid(QT_NO_QUUID_STRING)";
-#endif
return dbg.space();
}
#endif
diff --git a/src/corelib/plugin/quuid.h b/src/corelib/plugin/quuid.h
index ba475ac33b..d1b56002f3 100644
--- a/src/corelib/plugin/quuid.h
+++ b/src/corelib/plugin/quuid.h
@@ -115,13 +115,11 @@ public:
}
#endif
-#ifndef QT_NO_QUUID_STRING
QUuid(const QString &);
QUuid(const char *);
QString toString() const;
QUuid(const QByteArray &);
QByteArray toByteArray() const;
-#endif
QByteArray toRfc4122() const;
static QUuid fromRfc4122(const QByteArray &);
bool isNull() const;
@@ -193,7 +191,6 @@ public:
#ifndef QT_BOOTSTRAPPED
static QUuid createUuidV3(const QUuid &ns, const QByteArray &baseData);
static QUuid createUuidV5(const QUuid &ns, const QByteArray &baseData);
-#ifndef QT_NO_QUUID_STRING
static inline QUuid createUuidV3(const QUuid &ns, const QString &baseData)
{
return QUuid::createUuidV3(ns, baseData.toUtf8());
@@ -205,7 +202,6 @@ public:
}
#endif
-#endif
QUuid::Variant variant() const;
QUuid::Version version() const;
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index bf33500676..0d0bb45738 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -86,17 +86,15 @@ QT_BEGIN_NAMESPACE
\ingroup statemachine
QStateMachine is based on the concepts and notation of
- \l{Statecharts: A visual formalism for complex
- systems}{Statecharts}. QStateMachine is part of \l{The State
- Machine Framework}.
+ \l{http://www.wisdom.weizmann.ac.il/~dharel/SCANNED.PAPERS/Statecharts.pdf}{Statecharts}.
+ QStateMachine is part of \l{The State Machine Framework}.
A state machine manages a set of states (classes that inherit from
QAbstractState) and transitions (descendants of
QAbstractTransition) between those states; these states and
transitions define a state graph. Once a state graph has been
built, the state machine can execute it. QStateMachine's
- execution algorithm is based on the \l{State Chart XML: State
- Machine Notation for Control Abstraction}{State Chart XML (SCXML)}
+ execution algorithm is based on the \l{http://www.w3.org/TR/scxml/}{State Chart XML (SCXML)}
algorithm. The framework's \l{The State Machine
Framework}{overview} gives several state graphs and the code to
build them.
diff --git a/src/corelib/thread/qatomic.cpp b/src/corelib/thread/qatomic.cpp
index 87f1d84d4d..ef74ac40e8 100644
--- a/src/corelib/thread/qatomic.cpp
+++ b/src/corelib/thread/qatomic.cpp
@@ -53,12 +53,6 @@
The QAtomicInt class provides atomic reference counting, test-and-set, fetch-and-store,
and fetch-and-add for integers.
- \section1 Non-atomic convenience operators
-
- For convenience, QAtomicInt provides integer comparison, cast, and
- assignment operators. Note that a combination of these operators
- is \e not an atomic operation.
-
\section1 The Atomic API
\section2 Reference counting
@@ -222,6 +216,44 @@
this QAtomicInt.
*/
+/*!
+ \fn int QAtomicInt::load() const
+
+ Atomically loads the value of this QAtomicInt using relaxed memory
+ ordering. The value is not modified in any way, but note that there's no
+ guarantee that it remains so.
+
+ \sa store(), loadAcquire()
+*/
+
+/*!
+ \fn int QAtomicInt::loadAcquire() const
+
+ Atomically loads the value of this QAtomicInt using the "Acquire" memory
+ ordering. The value is not modified in any way, but note that there's no
+ guarantee that it remains so.
+
+ \sa store(), load()
+*/
+
+/*!
+ \fn void QAtomicInt::store(int newValue)
+
+ Atomically stores the \a newValue value into this atomic type, using
+ relaxed memory ordering.
+
+ \sa storeRelease(), load()
+*/
+
+/*!
+ \fn void QAtomicInt::storeRelease(int newValue)
+
+ Atomically stores the \a newValue value into this atomic type, using
+ the "Release" memory ordering.
+
+ \sa store(), load()
+*/
+
/*! \fn bool QAtomicInt::isReferenceCountingNative()
Returns true if reference counting is implemented using atomic
@@ -610,12 +642,6 @@
An \e atomic operation is a complex operation that completes without interruption.
The QAtomicPointer class provides atomic test-and-set, fetch-and-store, and fetch-and-add for pointers.
- \section1 Non-atomic convenience operators
-
- For convenience, QAtomicPointer provides pointer comparison, cast,
- dereference, and assignment operators. Note that these operators
- are \e not atomic.
-
\section1 The Atomic API
\section2 Memory ordering
@@ -762,6 +788,44 @@
this QAtomicPointer.
*/
+/*!
+ \fn T *QAtomicPointer::load() const
+
+ Atomically loads the value of this QAtomicPointer using relaxed memory
+ ordering. The value is not modified in any way, but note that there's no
+ guarantee that it remains so.
+
+ \sa store(), loadAcquire()
+*/
+
+/*!
+ \fn T *QAtomicPointer::loadAcquire() const
+
+ Atomically loads the value of this QAtomicPointerusing the "Acquire" memory
+ ordering. The value is not modified in any way, but note that there's no
+ guarantee that it remains so.
+
+ \sa store(), load()
+*/
+
+/*!
+ \fn void QAtomicPointer::store(T *newValue)
+
+ Atomically stores the \a newValue value into this atomic type, using
+ relaxed memory ordering.
+
+ \sa storeRelease(), load()
+*/
+
+/*!
+ \fn void QAtomicPointer::storeRelease(T *newValue)
+
+ Atomically stores the \a newValue value into this atomic type, using
+ the "Release" memory ordering.
+
+ \sa store(), load()
+*/
+
/*! \fn bool QAtomicPointer::isTestAndSetNative()
Returns true if test-and-set is implemented using atomic processor
diff --git a/src/corelib/thread/qatomic.h b/src/corelib/thread/qatomic.h
index 076cfba159..10001802ba 100644
--- a/src/corelib/thread/qatomic.h
+++ b/src/corelib/thread/qatomic.h
@@ -82,6 +82,11 @@ public:
}
#ifdef qdoc
+ int load() const;
+ int loadAcquire() const;
+ void store(int newValue);
+ void storeRelease(int newValue);
+
static Q_DECL_CONSTEXPR bool isReferenceCountingNative();
static Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree();
@@ -139,6 +144,11 @@ public:
}
#ifdef qdoc
+ T *load() const;
+ T *loadAcquire() const;
+ void store(T *newValue);
+ void storeRelease(T *newValue);
+
static Q_DECL_CONSTEXPR bool isTestAndSetNative();
static Q_DECL_CONSTEXPR bool isTestAndSetWaitFree();
diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h
index 4177ddbd39..70b69827c2 100644
--- a/src/corelib/thread/qbasicatomic.h
+++ b/src/corelib/thread/qbasicatomic.h
@@ -39,11 +39,11 @@
**
****************************************************************************/
+#include <QtCore/qatomic.h>
+
#ifndef QBASICATOMIC_H
#define QBASICATOMIC_H
-#include <QtCore/qglobal.h>
-
#if defined(QT_MOC) || defined(QT_BUILD_QMAKE) || defined(QT_RCC) || defined(QT_UIC) || defined(QT_BOOTSTRAPPED)
# include <QtCore/qatomic_bootstrap.h>
diff --git a/src/corelib/thread/qfuture.qdoc b/src/corelib/thread/qfuture.qdoc
index b67d711536..6ba5d564cf 100644
--- a/src/corelib/thread/qfuture.qdoc
+++ b/src/corelib/thread/qfuture.qdoc
@@ -328,7 +328,7 @@
/*! \fn QFuture::const_iterator QFuture::begin() const
- Returns a const \l{STL-style iterator} pointing to the first result in the
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first result in the
future.
\sa constBegin(), end()
@@ -336,7 +336,7 @@
/*! \fn QFuture::const_iterator QFuture::end() const
- Returns a const \l{STL-style iterator} pointing to the imaginary result
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary result
after the last result in the future.
\sa begin(), constEnd()
@@ -344,7 +344,7 @@
/*! \fn QFuture::const_iterator QFuture::constBegin() const
- Returns a const \l{STL-style iterator} pointing to the first result in the
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first result in the
future.
\sa begin(), constEnd()
@@ -352,7 +352,7 @@
/*! \fn QFuture::const_iterator QFuture::constEnd() const
- Returns a const \l{STL-style iterator} pointing to the imaginary result
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary result
after the last result in the future.
\sa constBegin(), end()
diff --git a/src/corelib/thread/qmutex.cpp b/src/corelib/thread/qmutex.cpp
index 3815ce16a7..97a5e5738c 100644
--- a/src/corelib/thread/qmutex.cpp
+++ b/src/corelib/thread/qmutex.cpp
@@ -394,7 +394,7 @@ bool QBasicMutex::isRecursive()
to wait on the mutex. There are two tricks to keep in mind:
We don't want to increment waiters after we checked no threads are waiting
(waiters == 0). That's why we atomically set the BigNumber flag on waiters when
- we check waiters. Similarily, if waiters is decremented right after we checked,
+ we check waiters. Similarly, if waiters is decremented right after we checked,
the mutex would be unlocked (d->wakeUp() has (or will) be called), but there is
no thread waiting. This is only happening if there was a timeout in tryLock at the
same time as the mutex is unlocked. So when there was a timeout, we set the
@@ -531,7 +531,7 @@ void QBasicMutex::unlockInternal() Q_DECL_NOTHROW
QMutexPrivate *d = reinterpret_cast<QMutexPrivate *>(copy);
- // If no one is waiting for the lock anymore, we shoud reset d to 0x0.
+ // If no one is waiting for the lock anymore, we should reset d to 0x0.
// Using fetchAndAdd, we atomically check that waiters was equal to 0, and add a flag
// to the waiters variable (BigNumber). That way, we avoid the race in which waiters is
// incremented right after we checked, because we won't increment waiters if is
diff --git a/src/corelib/thread/qmutex_linux.cpp b/src/corelib/thread/qmutex_linux.cpp
index 4f70014acb..94aec0ede0 100644
--- a/src/corelib/thread/qmutex_linux.cpp
+++ b/src/corelib/thread/qmutex_linux.cpp
@@ -187,7 +187,7 @@ bool lockInternal_helper(QBasicAtomicPointer<QMutexData> &d_ptr, int timeout = -
struct timespec ts, *pts = 0;
QElapsedTimer elapsedTimer;
checkElapsedTimerIsTrivial();
- if (IsTimed) {
+ if (IsTimed && timeout > 0) {
ts.tv_sec = timeout / 1000;
ts.tv_nsec = (timeout % 1000) * 1000 * 1000;
elapsedTimer.start();
@@ -206,7 +206,7 @@ bool lockInternal_helper(QBasicAtomicPointer<QMutexData> &d_ptr, int timeout = -
ts.tv_sec = xtimeout / Q_INT64_C(1000) / 1000 / 1000;
ts.tv_nsec = xtimeout % (Q_INT64_C(1000) * 1000 * 1000);
}
- if (IsTimed)
+ if (IsTimed && timeout > 0)
pts = &ts;
// successfully set the waiting bit, now sleep
@@ -232,7 +232,6 @@ void QBasicMutex::lockInternal() Q_DECL_NOTHROW
bool QBasicMutex::lockInternal(int timeout) Q_DECL_NOTHROW
{
Q_ASSERT(!isRecursive());
- Q_ASSERT(timeout >= 0);
return lockInternal_helper<true>(d_ptr, timeout);
}
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index b80653c07e..3b8a3f383b 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -392,10 +392,7 @@ int QThread::idealThreadCount() Q_DECL_NOTHROW
{
int cores = -1;
-#if defined(Q_OS_MAC) && !defined(Q_OS_IOS)
- // Mac OS X
- cores = MPProcessorsScheduled();
-#elif defined(Q_OS_HPUX)
+#if defined(Q_OS_HPUX)
// HP-UX
struct pst_dynamic psd;
if (pstat_getdynamic(&psd, sizeof(psd), 1, 0) == -1) {
@@ -405,7 +402,7 @@ int QThread::idealThreadCount() Q_DECL_NOTHROW
cores = (int)psd.psd_proc_cnt;
}
#elif defined(Q_OS_BSD4)
- // FreeBSD, OpenBSD, NetBSD, BSD/OS
+ // FreeBSD, OpenBSD, NetBSD, BSD/OS, Mac OS X
size_t len = sizeof(cores);
int mib[2];
mib[0] = CTL_HW;
diff --git a/src/corelib/thread/qwaitcondition.qdoc b/src/corelib/thread/qwaitcondition.qdoc
index e3a526d7f8..f0649c605a 100644
--- a/src/corelib/thread/qwaitcondition.qdoc
+++ b/src/corelib/thread/qwaitcondition.qdoc
@@ -38,7 +38,7 @@
QWaitCondition allows a thread to tell other threads that some
sort of condition has been met. One or many threads can block
waiting for a QWaitCondition to set a condition with wakeOne() or
- wakeAll(). Use wakeOne() to wake one randomly selected condition or
+ wakeAll(). Use wakeOne() to wake one randomly selected thread or
wakeAll() to wake them all.
For example, let's suppose that we have three tasks that should
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index feda8f441d..3685a8938a 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -3585,7 +3585,8 @@ QByteArray QByteArray::toBase64() const
Sets the byte array to the printed value of \a n in base \a base (10
by default) and returns a reference to the byte array. The \a base can
- be any value between 2 and 36.
+ be any value between 2 and 36. For bases other than 10, n is treated
+ as an unsigned integer.
Example:
\snippet code/src_corelib_tools_qbytearray.cpp 40
@@ -3623,7 +3624,7 @@ QByteArray QByteArray::toBase64() const
\sa toLongLong()
*/
-QByteArray &QByteArray::setNum(qlonglong n, int base)
+static char *qulltoa2(char *p, qulonglong n, int base)
{
#if defined(QT_CHECK_RANGE)
if (base < 2 || base > 36) {
@@ -3631,8 +3632,31 @@ QByteArray &QByteArray::setNum(qlonglong n, int base)
base = 10;
}
#endif
- QLocale locale(QLocale::C);
- *this = locale.d->longLongToString(n, -1, base).toLatin1();
+ const char b = 'a' - 10;
+ do {
+ const int c = n % base;
+ n /= base;
+ *--p = c + (c < 10 ? '0' : b);
+ } while (n);
+
+ return p;
+}
+
+QByteArray &QByteArray::setNum(qlonglong n, int base)
+{
+ const int buffsize = 66; // big enough for MAX_ULLONG in base 2
+ char buff[buffsize];
+ char *p;
+
+ if (n < 0 && base == 10) {
+ p = qulltoa2(buff + buffsize, qulonglong(-(1 + n)) + 1, base);
+ *--p = '-';
+ } else {
+ p = qulltoa2(buff + buffsize, qulonglong(n), base);
+ }
+
+ clear();
+ append(p, buffsize - (p - buff));
return *this;
}
@@ -3644,14 +3668,12 @@ QByteArray &QByteArray::setNum(qlonglong n, int base)
QByteArray &QByteArray::setNum(qulonglong n, int base)
{
-#if defined(QT_CHECK_RANGE)
- if (base < 2 || base > 36) {
- qWarning("QByteArray::setNum: Invalid base %d", base);
- base = 10;
- }
-#endif
- QLocale locale(QLocale::C);
- *this = locale.d->unsLongLongToString(n, -1, base).toLatin1();
+ const int buffsize = 66; // big enough for MAX_ULLONG in base 2
+ char buff[buffsize];
+ char *p = qulltoa2(buff + buffsize, n, base);
+
+ clear();
+ append(p, buffsize - (p - buff));
return *this;
}
diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h
index 50e52a1ca7..860869e9c3 100644
--- a/src/corelib/tools/qbytearray.h
+++ b/src/corelib/tools/qbytearray.h
@@ -581,11 +581,11 @@ inline QByteArray &QByteArray::replace(const char *before, const char *after)
{ return replace(before, qstrlen(before), after, qstrlen(after)); }
inline QByteArray &QByteArray::setNum(short n, int base)
-{ return setNum(qlonglong(n), base); }
+{ return base == 10 ? setNum(qlonglong(n), base) : setNum(qulonglong(ushort(n)), base); }
inline QByteArray &QByteArray::setNum(ushort n, int base)
{ return setNum(qulonglong(n), base); }
inline QByteArray &QByteArray::setNum(int n, int base)
-{ return setNum(qlonglong(n), base); }
+{ return base == 10 ? setNum(qlonglong(n), base) : setNum(qulonglong(uint(n)), base); }
inline QByteArray &QByteArray::setNum(uint n, int base)
{ return setNum(qulonglong(n), base); }
inline QByteArray &QByteArray::setNum(float n, char f, int prec)
diff --git a/src/corelib/tools/qelapsedtimer_unix.cpp b/src/corelib/tools/qelapsedtimer_unix.cpp
index 5dc18ce99f..b8f2180a5b 100644
--- a/src/corelib/tools/qelapsedtimer_unix.cpp
+++ b/src/corelib/tools/qelapsedtimer_unix.cpp
@@ -69,7 +69,7 @@ QT_BEGIN_NAMESPACE
* http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap02.html#tag_02_01_06 )
*
* The macro _POSIX_MONOTONIC_CLOCK can therefore assume the following values:
- * -1 monotonic clock is never supported on this sytem
+ * -1 monotonic clock is never supported on this system
* 0 monotonic clock might be supported, runtime check is needed
* >1 (such as 200809L) monotonic clock is always supported
*
diff --git a/src/corelib/tools/qharfbuzz_p.h b/src/corelib/tools/qharfbuzz_p.h
index 9efbdcb692..8b73b1d507 100644
--- a/src/corelib/tools/qharfbuzz_p.h
+++ b/src/corelib/tools/qharfbuzz_p.h
@@ -54,8 +54,7 @@
#define QHARFBUZZ_P_H
#include <QtCore/qchar.h>
-
-#include <harfbuzz-shaper.h>
+#include <private/harfbuzz-shaper.h>
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp
index 3fab2f68e6..eca66d75b0 100644
--- a/src/corelib/tools/qhash.cpp
+++ b/src/corelib/tools/qhash.cpp
@@ -1261,7 +1261,7 @@ void QHashData::checkSanity()
/*! \fn QHash::iterator QHash::begin()
- Returns an \l{STL-style iterator} pointing to the first item in
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in
the hash.
\sa constBegin(), end()
@@ -1275,7 +1275,7 @@ void QHashData::checkSanity()
/*! \fn QHash::const_iterator QHash::cbegin() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the first item
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the hash.
\sa begin(), cend()
@@ -1283,7 +1283,7 @@ void QHashData::checkSanity()
/*! \fn QHash::const_iterator QHash::constBegin() const
- Returns a const \l{STL-style iterator} pointing to the first item
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the hash.
\sa begin(), constEnd()
@@ -1291,7 +1291,7 @@ void QHashData::checkSanity()
/*! \fn QHash::iterator QHash::end()
- Returns an \l{STL-style iterator} pointing to the imaginary item
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item
after the last item in the hash.
\sa begin(), constEnd()
@@ -1304,7 +1304,7 @@ void QHashData::checkSanity()
/*! \fn QHash::const_iterator QHash::constEnd() const
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the hash.
\sa constBegin(), end()
@@ -1313,7 +1313,7 @@ void QHashData::checkSanity()
/*! \fn QHash::const_iterator QHash::cend() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the hash.
\sa cbegin(), end()
diff --git a/src/corelib/tools/qlinkedlist.cpp b/src/corelib/tools/qlinkedlist.cpp
index 025d48b595..0c5894f150 100644
--- a/src/corelib/tools/qlinkedlist.cpp
+++ b/src/corelib/tools/qlinkedlist.cpp
@@ -320,7 +320,7 @@ const QLinkedListData QLinkedListData::shared_null = {
/*! \fn QLinkedList::iterator QLinkedList::begin()
- Returns an \l{STL-style iterator} pointing to the first item in
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in
the list.
\sa constBegin(), end()
@@ -334,7 +334,7 @@ const QLinkedListData QLinkedListData::shared_null = {
/*! \fn QLinkedList::const_iterator QLinkedList::cbegin() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the first item
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the list.
\sa begin(), cend()
@@ -342,7 +342,7 @@ const QLinkedListData QLinkedListData::shared_null = {
/*! \fn QLinkedList::const_iterator QLinkedList::constBegin() const
- Returns a const \l{STL-style iterator} pointing to the first item
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the list.
\sa begin(), constEnd()
@@ -350,7 +350,7 @@ const QLinkedListData QLinkedListData::shared_null = {
/*! \fn QLinkedList::iterator QLinkedList::end()
- Returns an \l{STL-style iterator} pointing to the imaginary item
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item
after the last item in the list.
\sa begin(), constEnd()
@@ -364,7 +364,7 @@ const QLinkedListData QLinkedListData::shared_null = {
/*! \fn QLinkedList::const_iterator QLinkedList::cend() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the list.
\sa cbegin(), end()
@@ -372,7 +372,7 @@ const QLinkedListData QLinkedListData::shared_null = {
/*! \fn QLinkedList::const_iterator QLinkedList::constEnd() const
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the list.
\sa constBegin(), end()
diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp
index 4f26b25fec..f31b184f81 100644
--- a/src/corelib/tools/qlist.cpp
+++ b/src/corelib/tools/qlist.cpp
@@ -915,7 +915,7 @@ void **QListData::erase(void **xi)
/*! \fn QList::iterator QList::begin()
- Returns an \l{STL-style iterator} pointing to the first item in
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in
the list.
\sa constBegin(), end()
@@ -929,7 +929,7 @@ void **QListData::erase(void **xi)
/*! \fn QList::const_iterator QList::cbegin() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the first item
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the list.
\sa begin(), cend()
@@ -937,7 +937,7 @@ void **QListData::erase(void **xi)
/*! \fn QList::const_iterator QList::constBegin() const
- Returns a const \l{STL-style iterator} pointing to the first item
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the list.
\sa begin(), constEnd()
@@ -945,7 +945,7 @@ void **QListData::erase(void **xi)
/*! \fn QList::iterator QList::end()
- Returns an \l{STL-style iterator} pointing to the imaginary item
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item
after the last item in the list.
\sa begin(), constEnd()
@@ -959,7 +959,7 @@ void **QListData::erase(void **xi)
/*! \fn QList::const_iterator QList::cend() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the list.
\sa cbegin(), end()
@@ -967,7 +967,7 @@ void **QListData::erase(void **xi)
/*! \fn QList::const_iterator QList::constEnd() const
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the list.
\sa constBegin(), end()
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h
index f5858bf22a..0d4c10fecd 100644
--- a/src/corelib/tools/qlist.h
+++ b/src/corelib/tools/qlist.h
@@ -368,7 +368,7 @@ Q_INLINE_TEMPLATE void QList<T>::node_construct(Node *n, const T &t)
else *reinterpret_cast<T*>(n) = t;
#else
// This is always safe, but penaltizes unoptimized builds a lot.
- else ::memcpy(n, &t, sizeof(T));
+ else ::memcpy(n, static_cast<const void *>(&t), sizeof(T));
#endif
}
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 4b4c94872e..582ae9ebef 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -2240,16 +2240,23 @@ QLocale::MeasurementSystem QLocale::measurementSystem() const
*/
Qt::LayoutDirection QLocale::textDirection() const
{
- Language lang = language();
- if (lang == QLocale::Arabic ||
- lang == QLocale::Hebrew ||
- lang == QLocale::Persian ||
- lang == QLocale::Pashto ||
- lang == QLocale::Urdu ||
- lang == QLocale::Syriac ||
- lang == QLocale::Divehi)
+ switch (language()) {
+ case QLocale::Arabic:
+ case QLocale::Hebrew:
+ case QLocale::Persian:
+ case QLocale::Pashto:
+ case QLocale::Urdu:
+ case QLocale::Syriac:
+ case QLocale::Divehi:
return Qt::RightToLeft;
-
+ case QLocale::Punjabi:
+ case QLocale::Uzbek:
+ if (script() == QLocale::ArabicScript)
+ return Qt::RightToLeft;
+ // fall through
+ default:
+ break;
+ }
return Qt::LeftToRight;
}
diff --git a/src/corelib/tools/qlocale.h b/src/corelib/tools/qlocale.h
index 6b6beeff0a..c9cb31d03b 100644
--- a/src/corelib/tools/qlocale.h
+++ b/src/corelib/tools/qlocale.h
@@ -67,6 +67,7 @@ class Q_CORE_EXPORT QLocale
Q_GADGET
Q_ENUMS(Language)
Q_ENUMS(Country)
+ Q_ENUMS(MeasurementSystem)
friend class QString;
friend class QByteArray;
friend class QIntValidator;
diff --git a/src/corelib/tools/qlocale.qdoc b/src/corelib/tools/qlocale.qdoc
index a31e089eca..43d2b3ade6 100644
--- a/src/corelib/tools/qlocale.qdoc
+++ b/src/corelib/tools/qlocale.qdoc
@@ -450,6 +450,7 @@
\value Cambodia
\value Cameroon
\value Canada
+ \value CanaryIslands
\value CapeVerde
\value CaymanIslands
\value CentralAfricanRepublic
@@ -457,6 +458,7 @@
\value Chile
\value China
\value ChristmasIsland
+ \value ClippertonIsland
\value CocosIslands
\value Colombia
\value Comoros
@@ -503,6 +505,7 @@
\value Guadeloupe
\value Guam
\value Guatemala
+ \value Guernsey
\value Guinea
\value GuineaBissau
\value Guyana
@@ -647,7 +650,7 @@
\value Vanuatu
\value VaticanCityState
\value Venezuela
- \value VietNam
+ \value Vietnam
\value BritishVirginIslands
\value UnitedStatesVirginIslands
\value WallisAndFutunaIslands
@@ -718,7 +721,7 @@
\value SinhalaScript
\value SyriacScript
\value YiScript
- \value VaiiScript
+ \value VaiScript
\omitvalue LastScript
\sa script(), scriptToString(), languageToString()
diff --git a/src/corelib/tools/qmap.cpp b/src/corelib/tools/qmap.cpp
index 7c33d60750..9f6b5f3f4f 100644
--- a/src/corelib/tools/qmap.cpp
+++ b/src/corelib/tools/qmap.cpp
@@ -811,7 +811,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
/*! \fn QMap::iterator QMap::begin()
- Returns an \l{STL-style iterator} pointing to the first item in
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in
the map.
\sa constBegin(), end()
@@ -825,7 +825,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
/*! \fn QMap::const_iterator QMap::cbegin() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the first item
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the map.
\sa begin(), cend()
@@ -833,7 +833,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
/*! \fn QMap::const_iterator QMap::constBegin() const
- Returns a const \l{STL-style iterator} pointing to the first item
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the map.
\sa begin(), constEnd()
@@ -841,7 +841,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
/*! \fn QMap::iterator QMap::end()
- Returns an \l{STL-style iterator} pointing to the imaginary item
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item
after the last item in the map.
\sa begin(), constEnd()
@@ -855,7 +855,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
/*! \fn QMap::const_iterator QMap::cend() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the map.
\sa cbegin(), end()
@@ -863,7 +863,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
/*! \fn QMap::const_iterator QMap::constEnd() const
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the map.
\sa constBegin(), end()
diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp
index 4d73fc7478..e441d5320b 100644
--- a/src/corelib/tools/qregexp.cpp
+++ b/src/corelib/tools/qregexp.cpp
@@ -3920,7 +3920,7 @@ static void invalidateEngine(QRegExpPrivate *priv)
\value Wildcard This provides a simple pattern matching syntax
similar to that used by shells (command interpreters) for "file
- globbing". See \l{Wildcard Matching}.
+ globbing". See \l{QRegExp wildcard matching}.
\value WildcardUnix This is similar to Wildcard but with the
behavior of a Unix shell. The wildcard characters can be escaped
@@ -4150,7 +4150,7 @@ QRegExp::PatternSyntax QRegExp::patternSyntax() const
QRegExp::RegExp.
Setting \a syntax to QRegExp::Wildcard enables simple shell-like
- \l{wildcard matching}. For example, \b{r*.txt} matches the
+ \l{QRegExp wildcard matching}. For example, \b{r*.txt} matches the
string \c{readme.txt} in wildcard mode, but does not match
\c{readme}.
diff --git a/src/corelib/tools/qset.qdoc b/src/corelib/tools/qset.qdoc
index 6649d5ba69..dc07f482f9 100644
--- a/src/corelib/tools/qset.qdoc
+++ b/src/corelib/tools/qset.qdoc
@@ -330,7 +330,7 @@
/*! \fn QSet::const_iterator QSet::begin() const
- Returns a const \l{STL-style iterator} positioned at the first
+ Returns a const \l{STL-style iterators}{STL-style iterator} positioned at the first
item in the set.
\sa constBegin(), end()
@@ -340,14 +340,14 @@
\since 4.2
\overload
- Returns a non-const \l{STL-style iterator} positioned at the first
+ Returns a non-const \l{STL-style iterators}{STL-style iterator} positioned at the first
item in the set.
*/
/*! \fn QSet::const_iterator QSet::cbegin() const
\since 5.0
- Returns a const \l{STL-style iterator} positioned at the first
+ Returns a const \l{STL-style iterators}{STL-style iterator} positioned at the first
item in the set.
\sa begin(), cend()
@@ -355,7 +355,7 @@
/*! \fn QSet::const_iterator QSet::constBegin() const
- Returns a const \l{STL-style iterator} positioned at the first
+ Returns a const \l{STL-style iterators}{STL-style iterator} positioned at the first
item in the set.
\sa begin(), constEnd()
@@ -363,7 +363,7 @@
/*! \fn QSet::const_iterator QSet::end() const
- Returns a const \l{STL-style iterator} positioned at the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} positioned at the imaginary
item after the last item in the set.
\sa constEnd(), begin()
@@ -373,14 +373,14 @@
\since 4.2
\overload
- Returns a non-const \l{STL-style iterator} pointing to the
+ Returns a non-const \l{STL-style iterators}{STL-style iterator} pointing to the
imaginary item after the last item in the set.
*/
/*! \fn QSet::const_iterator QSet::cend() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the set.
\sa cbegin(), end()
@@ -388,7 +388,7 @@
/*! \fn QSet::const_iterator QSet::constEnd() const
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the set.
\sa constBegin(), end()
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 34a8cbe4c8..6db4fed0f8 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -840,7 +840,7 @@ const QString::Null QString::null = { };
/*! \fn QString::iterator QString::begin()
- Returns an \l{STL-style iterator} pointing to the first character in
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first character in
the string.
\sa constBegin(), end()
@@ -854,7 +854,7 @@ const QString::Null QString::null = { };
/*! \fn QString::const_iterator QString::cbegin() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the first character
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first character
in the string.
\sa begin(), cend()
@@ -862,7 +862,7 @@ const QString::Null QString::null = { };
/*! \fn QString::const_iterator QString::constBegin() const
- Returns a const \l{STL-style iterator} pointing to the first character
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first character
in the string.
\sa begin(), constEnd()
@@ -870,7 +870,7 @@ const QString::Null QString::null = { };
/*! \fn QString::iterator QString::end()
- Returns an \l{STL-style iterator} pointing to the imaginary character
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary character
after the last character in the string.
\sa begin(), constEnd()
@@ -884,7 +884,7 @@ const QString::Null QString::null = { };
/*! \fn QString::const_iterator QString::cend() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the list.
\sa cbegin(), end()
@@ -892,7 +892,7 @@ const QString::Null QString::null = { };
/*! \fn QString::const_iterator QString::constEnd() const
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the list.
\sa constBegin(), end()
diff --git a/src/corelib/tools/qunicodetools.cpp b/src/corelib/tools/qunicodetools.cpp
index 8bafb692ca..f83e2b5911 100644
--- a/src/corelib/tools/qunicodetools.cpp
+++ b/src/corelib/tools/qunicodetools.cpp
@@ -44,7 +44,8 @@
#include "qunicodetables_p.h"
#include "qvarlengtharray.h"
-#include "qharfbuzz_p.h"
+#include <private/harfbuzz-shaper.h>
+#include <private/qharfbuzz_p.h>
#define FLAG(x) (1 << (x))
diff --git a/src/corelib/tools/qvarlengtharray.qdoc b/src/corelib/tools/qvarlengtharray.qdoc
index 452bc0a598..0481373f2d 100644
--- a/src/corelib/tools/qvarlengtharray.qdoc
+++ b/src/corelib/tools/qvarlengtharray.qdoc
@@ -483,7 +483,7 @@
/*! \fn QVarLengthArray::iterator QVarLengthArray::begin()
\since 4.8
- Returns an \l{STL-style iterator} pointing to the first item in
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in
the array.
\sa constBegin(), end()
@@ -497,7 +497,7 @@
/*! \fn QVarLengthArray::const_iterator QVarLengthArray::cbegin() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the first item
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the array.
\sa begin(), cend()
@@ -506,7 +506,7 @@
/*! \fn QVarLengthArray::const_iterator QVarLengthArray::constBegin() const
\since 4.8
- Returns a const \l{STL-style iterator} pointing to the first item
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the array.
\sa begin(), constEnd()
@@ -515,7 +515,7 @@
/*! \fn QVarLengthArray::iterator QVarLengthArray::end()
\since 4.8
- Returns an \l{STL-style iterator} pointing to the imaginary item
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item
after the last item in the array.
\sa begin(), constEnd()
@@ -530,7 +530,7 @@
/*! \fn QVarLengthArray::const_iterator QVarLengthArray::cend() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the array.
\sa cbegin(), end()
@@ -539,7 +539,7 @@
/*! \fn QVarLengthArray::const_iterator QVarLengthArray::constEnd() const
\since 4.8
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the array.
\sa constBegin(), end()
diff --git a/src/corelib/tools/qvector.cpp b/src/corelib/tools/qvector.cpp
index f33bb930c2..ab8127159f 100644
--- a/src/corelib/tools/qvector.cpp
+++ b/src/corelib/tools/qvector.cpp
@@ -636,7 +636,7 @@
/*! \fn QVector::iterator QVector::begin()
- Returns an \l{STL-style iterator} pointing to the first item in
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in
the vector.
\sa constBegin(), end()
@@ -650,7 +650,7 @@
/*! \fn QVector::const_iterator QVector::cbegin() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the first item
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the vector.
\sa begin(), cend()
@@ -658,7 +658,7 @@
/*! \fn QVector::const_iterator QVector::constBegin() const
- Returns a const \l{STL-style iterator} pointing to the first item
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the vector.
\sa begin(), constEnd()
@@ -666,7 +666,7 @@
/*! \fn QVector::iterator QVector::end()
- Returns an \l{STL-style iterator} pointing to the imaginary item
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item
after the last item in the vector.
\sa begin(), constEnd()
@@ -680,7 +680,7 @@
/*! \fn QVector::const_iterator QVector::cend() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the vector.
\sa cbegin(), end()
@@ -688,7 +688,7 @@
/*! \fn QVector::const_iterator QVector::constEnd() const
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the vector.
\sa constBegin(), end()
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index 88a59f5f77..564aff9ab9 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -133,7 +133,6 @@ pcre {
}
DEFINES += HB_EXPORT=Q_CORE_EXPORT
-INCLUDEPATH += ../3rdparty/harfbuzz/src
HEADERS += ../3rdparty/harfbuzz/src/harfbuzz.h
SOURCES += ../3rdparty/harfbuzz/src/harfbuzz-buffer.c \
../3rdparty/harfbuzz/src/harfbuzz-gdef.c \
@@ -146,8 +145,6 @@ SOURCES += ../3rdparty/harfbuzz/src/harfbuzz-buffer.c \
tools/qharfbuzz.cpp
HEADERS += tools/qharfbuzz_p.h
-private_headers.files += ../3rdparty/harfbuzz/src/*.h
-
INCLUDEPATH += ../3rdparty/md5 \
../3rdparty/md4