summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2014-11-21 13:44:26 +0100
committerFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2014-11-21 13:44:26 +0100
commit245acbf6e81518958228d295bdb6a64298b09351 (patch)
tree10a78831737274c2c55480437e60c74c884fde4d /src/corelib
parenteb466b636b97251d273aedddfe66b15fe994d375 (diff)
parent087aa1f3cb5975ef55e42db54487f737c93a4f0f (diff)
Merge remote-tracking branch 'origin/5.4.0' into 5.4
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/doc/snippets/qstring/main.cpp8
-rw-r--r--src/corelib/doc/src/animation.qdoc9
-rw-r--r--src/corelib/doc/src/containers.qdoc22
-rw-r--r--src/corelib/doc/src/datastreamformat.qdoc2
-rw-r--r--src/corelib/doc/src/filestorage.qdoc4
-rw-r--r--src/corelib/doc/src/implicit-sharing.qdoc1
-rw-r--r--src/corelib/doc/src/objectmodel/signalsandslots.qdoc10
-rw-r--r--src/corelib/doc/src/statemachine.qdoc1
-rw-r--r--src/corelib/global/qnamespace.qdoc23
-rw-r--r--src/corelib/io/qstandardpaths.cpp2
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.cpp8
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel.cpp2
-rw-r--r--src/corelib/json/qjsonarray.cpp2
-rw-r--r--src/corelib/json/qjsonarray.h2
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp69
-rw-r--r--src/corelib/kernel/qeventdispatcher_win_p.h3
-rw-r--r--src/corelib/mimetypes/qmimedatabase.cpp4
-rw-r--r--src/corelib/mimetypes/qmimetype.cpp4
-rw-r--r--src/corelib/tools/qbytearray.cpp9
-rw-r--r--src/corelib/tools/qstring.cpp27
-rw-r--r--src/corelib/tools/qversionnumber.cpp3
-rw-r--r--src/corelib/tools/qversionnumber_p.h (renamed from src/corelib/tools/qversionnumber.h)0
-rw-r--r--src/corelib/tools/tools.pri2
23 files changed, 120 insertions, 97 deletions
diff --git a/src/corelib/doc/snippets/qstring/main.cpp b/src/corelib/doc/snippets/qstring/main.cpp
index bf45a31c29..f49c4dd359 100644
--- a/src/corelib/doc/snippets/qstring/main.cpp
+++ b/src/corelib/doc/snippets/qstring/main.cpp
@@ -760,14 +760,6 @@ void Widget::splitCaseSensitiveFunction()
void Widget::sprintfFunction()
{
- //! [63]
- size_t BufSize;
- char buf[BufSize];
-
- ::snprintf(buf, BufSize, "%lld", 123456789LL);
- QString str = QString::fromUtf8(buf);
- //! [63]
-
//! [64]
QString result;
QTextStream(&result) << "pi = " << 3.14;
diff --git a/src/corelib/doc/src/animation.qdoc b/src/corelib/doc/src/animation.qdoc
index 6910b18937..9385c08995 100644
--- a/src/corelib/doc/src/animation.qdoc
+++ b/src/corelib/doc/src/animation.qdoc
@@ -27,6 +27,7 @@
/*!
\group animation
+ \brief Provides an easy way for creating animated GUIs.
\title Animation Framework
This page lists classes belonging to \l{Qt Core}'s
@@ -46,8 +47,8 @@
\keyword Animation
The animation framework aims to provide an easy way for creating animated
- and smooth GUI's. By animating Qt properties, the framework provides great
- freedom for animating widgets and other \l{QObject}s. The framework can
+ and smooth GUIs. By animating Qt properties, the framework provides great
+ freedom for animating widgets and other {QObject}s. The framework can
also be used with the Graphics View framework. Many of the concepts
available in the animation framework are also available in \l{Qt Quick},
where it offers a declarative way of defining animations. Much of the
@@ -56,7 +57,7 @@
In this overview, we explain the basics of its architecture. We
also show examples of the most common techniques that the
- framework allows for animating QObjects and graphics items.
+ framework allows for animating {QObject}s and graphics items.
\tableofcontents
@@ -84,7 +85,7 @@
over the property using an easing curve. So when you want to
animate a value, you can declare it as a property and make your
class a QObject. Note that this gives us great freedom in
- animating already existing widgets and other \l{QObject}s.
+ animating already existing widgets and other {QObject}s.
Complex animations can be constructed by building a tree structure
of \l{QAbstractAnimation}s. The tree is built by using
diff --git a/src/corelib/doc/src/containers.qdoc b/src/corelib/doc/src/containers.qdoc
index 6017269272..a517ca32d3 100644
--- a/src/corelib/doc/src/containers.qdoc
+++ b/src/corelib/doc/src/containers.qdoc
@@ -386,7 +386,7 @@
\l{QMapIterator::hasPrevious()}{hasPrevious()},
\l{QMapIterator::previous()}{previous()}, and
\l{QMapIterator::peekPrevious()}{peekPrevious()}. The key and
- value components are extracted by calling key() and value() on
+ value components are extracted by calling \l{QMapIterator::key()}{key()} and \l{QMapIterator::value()}{value()} on
the object returned by next(), peekNext(), previous(), or
peekPrevious().
@@ -395,7 +395,7 @@
\snippet code/doc_src_containers.cpp 7
- QMapIterator also provides a key() and a value() function that
+ QMapIterator also provides a \l{QMapIterator::key()}{key()} and a \l{QMapIterator::value()}{value()} function that
operate directly on the iterator and that return the key and
value of the last item that the iterator jumped above. For
example, the following code copies the contents of a QMap into a
@@ -459,13 +459,13 @@
\snippet code/doc_src_containers.cpp 10
Unlike \l{Java-style iterators}, STL-style iterators point
- directly at items. The begin() function of a container returns an
+ directly at items. The \l{QList::begin()}{begin()} function of a container returns an
iterator that points to the first item in the container. The
- end() function of a container returns an iterator to the
+ \l{QList::end()}{end()} function of a container returns an iterator to the
imaginary item one position past the last item in the container.
- end() marks an invalid position; it must never be dereferenced.
+ \l {QList::end()}{end()} marks an invalid position; it must never be dereferenced.
It is typically used in a loop's break condition. If the list is
- empty, begin() equals end(), so we never execute the loop.
+ empty, \l{QList::begin}{begin()} equals \l{QList:end()}{end()}, so we never execute the loop.
The diagram below shows the valid iterator positions as red
arrows for a vector containing four items:
@@ -484,8 +484,8 @@
compilers also allow us to write \c{i->toLower()}, but some
don't.
- For read-only access, you can use const_iterator, constBegin(),
- and constEnd(). For example:
+ For read-only access, you can use const_iterator, \l{QList::constBegin}{constBegin()},
+ and \l{QList::constEnd()}{constEnd()}. For example:
\snippet code/doc_src_containers.cpp 12
@@ -759,7 +759,7 @@
QString.
QVector<T> also uses that algorithm for data types that can be
- moved around in memory using memcpy() (including the basic C++
+ moved around in memory using \c memcpy() (including the basic C++
types, the pointer types, and Qt's \l{shared classes}) but uses a
different algorithm for data types that can only be moved by
calling the copy constructor and a destructor. Since the cost of
@@ -790,7 +790,7 @@
\endlist
If you know approximately how many items you will store in a
- container, you can start by calling reserve(), and when you are
- done populating the container, you can call squeeze() to release
+ container, you can start by calling \l{QString::reserve()}{reserve()}, and when you are
+ done populating the container, you can call \l{QString::squeeze()}{squeeze()} to release
the extra preallocated memory.
*/
diff --git a/src/corelib/doc/src/datastreamformat.qdoc b/src/corelib/doc/src/datastreamformat.qdoc
index b6efe6aa33..56a6d0aafa 100644
--- a/src/corelib/doc/src/datastreamformat.qdoc
+++ b/src/corelib/doc/src/datastreamformat.qdoc
@@ -173,7 +173,7 @@
\li If the image is null a "null image" marker is saved;
otherwise the image is saved in PNG or BMP format (depending
on the stream version). If you want control of the format,
- stream the image into a QBuffer (using QImageIO) and stream
+ stream the image into a QBuffer (using QImageIOHandler/QImageIOPlugin) and stream
that.
\endlist
\row \li QKeySequence
diff --git a/src/corelib/doc/src/filestorage.qdoc b/src/corelib/doc/src/filestorage.qdoc
index 394d920923..a60c5846ff 100644
--- a/src/corelib/doc/src/filestorage.qdoc
+++ b/src/corelib/doc/src/filestorage.qdoc
@@ -86,8 +86,8 @@ read console input and write console output.
There are three general ways to use QTextStream when reading text files:
\list
- \li Chunk by chunk, by calling readLine() or readAll().
- \li Word by word. QTextStream supports streaming into QStrings, QByteArrays
+ \li Chunk by chunk, by calling \l{QBuffer::readLine()}{readLine()} or \l{QBuffer::readAll()}{readAll()}.
+ \li Word by word. QTextStream supports streaming into {QString}s, {QByteArray}s
and char* buffers. Words are delimited by space, and leading white space
is automatically skipped.
\li Character by character, by streaming into QChar or char types. This
diff --git a/src/corelib/doc/src/implicit-sharing.qdoc b/src/corelib/doc/src/implicit-sharing.qdoc
index 1185fe8348..ec8edb4b6b 100644
--- a/src/corelib/doc/src/implicit-sharing.qdoc
+++ b/src/corelib/doc/src/implicit-sharing.qdoc
@@ -30,6 +30,7 @@
/*!
\group shared
+ \brief How to maximize resource usage by implicit data sharing.
\title Implicitly Shared Classes
These \l{Qt Core} classes provides a safe and efficient way of sharing and
diff --git a/src/corelib/doc/src/objectmodel/signalsandslots.qdoc b/src/corelib/doc/src/objectmodel/signalsandslots.qdoc
index f79e8a7dca..b9b1874d0f 100644
--- a/src/corelib/doc/src/objectmodel/signalsandslots.qdoc
+++ b/src/corelib/doc/src/objectmodel/signalsandslots.qdoc
@@ -242,7 +242,7 @@
By default, for every connection you make, a signal is emitted;
two signals are emitted for duplicate connections. You can break
- all of these connections with a single disconnect() call.
+ all of these connections with a single \l{QObject::disconnect()}{disconnect()} call.
If you pass the Qt::UniqueConnection \a type, the connection will only
be made if it is not a duplicate. If there is already a duplicate
(exact same signal to the exact same slot on the same objects),
@@ -251,9 +251,7 @@
This example illustrates that objects can work together without needing to
know any information about each other. To enable this, the objects only
need to be connected together, and this can be achieved with some simple
- QObject::connect() function calls, or with \c{uic}'s
- \l{Using a Designer UI File in Your Application#Automatic Connections}
- {automatic connections} feature.
+ QObject::connect() function calls, or with \c{uic}'s {automatic connections} feature.
\section1 A Real Example
@@ -354,7 +352,7 @@
connect(sender, &QObject::destroyed, this, &MyObject::objectDestroyed);
\endcode
- There are several advantages to using connect() with function pointers.
+ There are several advantages to using QObject::connect() with function pointers.
First, it allows the compiler to check that the signal's arguments are
compatible with the slot's arguments. Arguments can also be implicitly
converted by the compiler, if needed.
@@ -407,7 +405,7 @@
will open: "Tax File", "Accounts File", or "Report File".
In order to open the correct file, you use QSignalMapper::setMapping() to
- map all the clicked() signals to a QSignalMapper object. Then you connect
+ map all the QPushButton::clicked() signals to a QSignalMapper object. Then you connect
the file's QPushButton::clicked() signal to the QSignalMapper::map() slot.
\snippet signalmapper/filereader.cpp 0
diff --git a/src/corelib/doc/src/statemachine.qdoc b/src/corelib/doc/src/statemachine.qdoc
index b281eb177b..846eb7d1f0 100644
--- a/src/corelib/doc/src/statemachine.qdoc
+++ b/src/corelib/doc/src/statemachine.qdoc
@@ -27,6 +27,7 @@
/*!
\group statemachine
+ \brief How to create and execute state graphs.
\title State Machine Classes
These \l{Qt Core} classes are part of the \l{The State Machine Framework}{
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 28d26f848d..53d2b7b58b 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -134,7 +134,7 @@
\value AA_MacDontSwapCtrlAndMeta On Mac OS X by default, Qt swaps the
Control and Meta (Command) keys (i.e., whenever Control is pressed, Qt
sends Meta, and whenever Meta is pressed Control is sent). When this
- attribute is true, Qt will not do the flip. QKeySequence::StandardShortcuts
+ attribute is true, Qt will not do the flip. \l QKeySequence::StandardKey
will also flip accordingly (i.e., QKeySequence::Copy will be
Command+C on the keyboard regardless of the value set, though what is output for
QKeySequence::toString(QKeySequence::PortableText) will be different).
@@ -144,7 +144,7 @@
to be consistent in pixels-per-point across devices rather than
defining 1 point as 1/72 inch.
- \value AA_X11InitThreads Calls XInitThreads() as part of the QApplication
+ \value AA_X11InitThreads Calls \c XInitThreads() as part of the QApplication
construction in order to make Xlib calls thread-safe. This
attribute must be set before QApplication is constructed.
@@ -159,10 +159,11 @@
\value AA_UseHighDpiPixmaps Make QIcon::pixmap() generate high-dpi pixmaps
that can be larger than the requested size. Such pixmaps will have
- devicePixelRatio set to a value higher than 1. After setting this
- attribute application code that uses pixmap sizes in layout geometry
- calculations should typically divide by QPixmap::devicePixelRatio()
- to get device-independent layout geometry.
+ \l {QPixmap::devicePixelRatio}{devicePixelRatio()} set to a value higher than 1.
+
+ After setting this attribute, application code that uses pixmap
+ sizes in layout geometry calculations should typically divide by
+ \l {QPixmap::devicePixelRatio}{devicePixelRatio()} to get device-independent layout geometry.
\value AA_ForceRasterWidgets Make top-level widgets use pure raster surfaces,
and do not support non-native GL-based child widgets.
@@ -182,7 +183,7 @@
\l{http://www.mesa3d.org/llvmpipe.html}{Mesa llvmpipe}, providing
OpenGL 2.1. The value may have no effect if no such OpenGL
implementation is available. The default name of this library is
- opengl32sw.dll and can be overridden by setting the environment
+ \c opengl32sw.dll and can be overridden by setting the environment
variable \e QT_OPENGL_DLL. See the platform-specific pages, for
instance \l{Qt for Windows}, for more information. This value has
been added in Qt 5.4.
@@ -221,7 +222,7 @@
\value AllButtons This value corresponds to a mask of all
possible mouse buttons. Use to set the 'acceptedButtons'
- property of a mouseArea to accept ALL mouse buttons.
+ property of a MouseArea to accept ALL mouse buttons.
\value LeftButton The left button is pressed, or an event refers
to the left button. (The left button may be the right button on
@@ -2443,7 +2444,7 @@
\value ImhExclusiveInputMask This mask yields nonzero if any of the exclusive flags are used.
- \note If several exclusive flags are ORed together, the resulting character set will
+ \note If several exclusive flags are OR-ed together, the resulting character set will
consist of the union of the specified sets. For instance specifying \c ImhNumbersOnly and
\c ImhUppercaseOnly would yield a set consisting of numbers and uppercase letters.
@@ -2969,8 +2970,8 @@
This enum provides additional information concerning a QMouseEvent.
\value MouseEventCreatedDoubleClick Indicates that Qt has created a
- MouseButtonDblClick event from this event. The flag is set in the causing
- MouseButtonPress, and not in the resulting MouseButtonDblCLick.
+ \l {QEvent::MouseButtonDblClick}{MouseButtonDblClick} event from this event. The flag is set in the causing
+ \l {QEvent::MouseButtonPress}{MouseButtonPress}, and not in the resulting \l {QEvent::MouseButtonDblClick}{MouseButtonDblClick}.
\omitvalue MouseEventFlagMask
*/
diff --git a/src/corelib/io/qstandardpaths.cpp b/src/corelib/io/qstandardpaths.cpp
index 2583e46ad8..c206e432f6 100644
--- a/src/corelib/io/qstandardpaths.cpp
+++ b/src/corelib/io/qstandardpaths.cpp
@@ -526,7 +526,7 @@ QString QStandardPaths::findExecutable(const QString &executableName, const QStr
an empty QString if no relevant location can be found.
*/
-#if !defined(Q_OS_MAC) && !defined(QT_BOOTSTRAPPED)
+#if !defined(Q_OS_OSX) && !defined(QT_BOOTSTRAPPED)
QString QStandardPaths::displayName(StandardLocation type)
{
switch (type) {
diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp
index 6b89c8377a..b15d255e66 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.cpp
+++ b/src/corelib/itemmodels/qabstractitemmodel.cpp
@@ -2711,7 +2711,7 @@ bool QAbstractItemModelPrivate::allowMove(const QModelIndex &srcParent, int star
persistent indexes in the model, which you would otherwise be
required to do yourself. Using beginMoveRows and endMoveRows
is an alternative to emitting layoutAboutToBeChanged and
- layoutChanged directly along with changePersistentIndexes.
+ layoutChanged directly along with changePersistentIndex.
The \a sourceParent index corresponds to the parent from which the
rows are moved; \a sourceFirst and \a sourceLast are the first and last
@@ -2978,7 +2978,7 @@ void QAbstractItemModel::endRemoveColumns()
persistent indexes in the model, which you would otherwise be
required to do yourself. Using beginMoveRows and endMoveRows
is an alternative to emitting layoutAboutToBeChanged and
- layoutChanged directly along with changePersistentIndexes.
+ layoutChanged directly along with changePersistentIndex.
The \a sourceParent index corresponds to the parent from which the
columns are moved; \a sourceFirst and \a sourceLast are the first and last
@@ -3165,11 +3165,11 @@ void QAbstractItemModel::changePersistentIndex(const QModelIndex &from, const QM
/*!
\since 4.1
- Changes the QPersistentModelIndexes that is equal to the indexes in the
+ Changes the {QPersistentModelIndex}es that are equal to the indexes in the
given \a from model index list to the given \a to model index list.
If no persistent model indexes equal to the indexes in the given \a from
- model index list was found, nothing is changed.
+ model index list are found, nothing is changed.
\sa persistentIndexList(), changePersistentIndex()
*/
diff --git a/src/corelib/itemmodels/qitemselectionmodel.cpp b/src/corelib/itemmodels/qitemselectionmodel.cpp
index db78af8cf8..5395fd5d09 100644
--- a/src/corelib/itemmodels/qitemselectionmodel.cpp
+++ b/src/corelib/itemmodels/qitemselectionmodel.cpp
@@ -1076,7 +1076,7 @@ void QItemSelectionModelPrivate::_q_layoutChanged(const QList<QPersistentModelIn
If you omit the QItemSelectionModel::Current command, a new current
selection will be created, and the previous one added to the whole
selection. All functions operate on both layers; for example,
- selectedItems() will return items from both layers.
+ \l {QTableWidget::selectedItems()}{selecteditems()} will return items from both layers.
\sa {Model/View Programming}, QAbstractItemModel, {Chart Example}
*/
diff --git a/src/corelib/json/qjsonarray.cpp b/src/corelib/json/qjsonarray.cpp
index fd407af2cd..73c53ea649 100644
--- a/src/corelib/json/qjsonarray.cpp
+++ b/src/corelib/json/qjsonarray.cpp
@@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE
removing QJsonValue's from the array.
A QJsonArray can be converted to and from a QVariantList. You can query the
- number of entries with size(), insert(), and remove() entries from it
+ number of entries with size(), insert(), and removeAt() entries from it
and iterate over its content using the standard C++ iterator pattern.
QJsonArray is an implicitly shared class and shares the data with the document
diff --git a/src/corelib/json/qjsonarray.h b/src/corelib/json/qjsonarray.h
index 87d14a7703..a8307ae5aa 100644
--- a/src/corelib/json/qjsonarray.h
+++ b/src/corelib/json/qjsonarray.h
@@ -105,6 +105,7 @@ public:
typedef int difference_type;
typedef QJsonValue value_type;
typedef QJsonValueRef reference;
+ typedef QJsonValueRefPtr pointer;
inline iterator() : a(0), i(0) { }
explicit inline iterator(QJsonArray *array, int index) : a(array), i(index) { }
@@ -149,6 +150,7 @@ public:
typedef qptrdiff difference_type;
typedef QJsonValue value_type;
typedef QJsonValue reference;
+ typedef QJsonValuePtr pointer;
inline const_iterator() : a(0), i(0) { }
explicit inline const_iterator(const QJsonArray *array, int index) : a(array), i(index) { }
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index a3d00faf31..1a8bb381aa 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -307,8 +307,9 @@ static void resolveTimerAPI()
}
QEventDispatcherWin32Private::QEventDispatcherWin32Private()
- : threadId(GetCurrentThreadId()), interrupt(false), internalHwnd(0), getMessageHook(0),
- serialNumber(0), lastSerialNumber(0), sendPostedEventsWindowsTimerId(0), wakeUps(0)
+ : threadId(GetCurrentThreadId()), interrupt(false), closingDown(false), internalHwnd(0),
+ getMessageHook(0), serialNumber(0), lastSerialNumber(0), sendPostedEventsWindowsTimerId(0),
+ wakeUps(0)
{
resolveTimerAPI();
}
@@ -434,9 +435,10 @@ static inline UINT inputTimerMask()
LRESULT QT_WIN_CALLBACK qt_GetMessageHook(int code, WPARAM wp, LPARAM lp)
{
+ QEventDispatcherWin32 *q = qobject_cast<QEventDispatcherWin32 *>(QAbstractEventDispatcher::instance());
+ Q_ASSERT(q != 0);
+
if (wp == PM_REMOVE) {
- QEventDispatcherWin32 *q = qobject_cast<QEventDispatcherWin32 *>(QAbstractEventDispatcher::instance());
- Q_ASSERT(q != 0);
if (q) {
MSG *msg = (MSG *) lp;
QEventDispatcherWin32Private *d = q->d_func();
@@ -472,7 +474,7 @@ LRESULT QT_WIN_CALLBACK qt_GetMessageHook(int code, WPARAM wp, LPARAM lp)
#ifdef Q_OS_WINCE
return 0;
#else
- return CallNextHookEx(0, code, wp, lp);
+ return q->d_func()->getMessageHook ? CallNextHookEx(0, code, wp, lp) : 0;
#endif
}
@@ -643,15 +645,7 @@ void QEventDispatcherWin32::createInternalHwnd()
return;
d->internalHwnd = qt_create_internal_window(this);
-#ifndef Q_OS_WINCE
- // setup GetMessage hook needed to drive our posted events
- d->getMessageHook = SetWindowsHookEx(WH_GETMESSAGE, (HOOKPROC) qt_GetMessageHook, NULL, GetCurrentThreadId());
- if (!d->getMessageHook) {
- int errorCode = GetLastError();
- qFatal("Qt: INTERNAL ERROR: failed to install GetMessage hook: %d, %s",
- errorCode, qPrintable(qt_error_string(errorCode)));
- }
-#endif
+ installMessageHook();
// register all socket notifiers
QList<int> sockets = (d->sn_read.keys().toSet()
@@ -665,6 +659,35 @@ void QEventDispatcherWin32::createInternalHwnd()
d->registerTimer(d->timerVec.at(i));
}
+void QEventDispatcherWin32::installMessageHook()
+{
+ Q_D(QEventDispatcherWin32);
+
+ if (d->getMessageHook)
+ return;
+
+#ifndef Q_OS_WINCE
+ // setup GetMessage hook needed to drive our posted events
+ d->getMessageHook = SetWindowsHookEx(WH_GETMESSAGE, (HOOKPROC) qt_GetMessageHook, NULL, GetCurrentThreadId());
+ if (!d->getMessageHook) {
+ int errorCode = GetLastError();
+ qFatal("Qt: INTERNAL ERROR: failed to install GetMessage hook: %d, %s",
+ errorCode, qPrintable(qt_error_string(errorCode)));
+ }
+#endif
+}
+
+void QEventDispatcherWin32::uninstallMessageHook()
+{
+ Q_D(QEventDispatcherWin32);
+
+#ifndef Q_OS_WINCE
+ if (d->getMessageHook)
+ UnhookWindowsHookEx(d->getMessageHook);
+#endif
+ d->getMessageHook = 0;
+}
+
QEventDispatcherWin32::QEventDispatcherWin32(QObject *parent)
: QAbstractEventDispatcher(*new QEventDispatcherWin32Private, parent)
{
@@ -750,10 +773,9 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags)
}
}
if (haveMessage) {
-#ifdef Q_OS_WINCE
// WinCE doesn't support hooks at all, so we have to call this by hand :(
- (void) qt_GetMessageHook(0, PM_REMOVE, (LPARAM) &msg);
-#endif
+ if (!d->getMessageHook)
+ (void) qt_GetMessageHook(0, PM_REMOVE, (LPARAM) &msg);
if (d->internalHwnd == msg.hwnd && msg.message == WM_QT_SENDPOSTEDEVENTS) {
if (seenWM_QT_SENDPOSTEDEVENTS) {
@@ -910,6 +932,11 @@ void QEventDispatcherWin32::registerTimer(int timerId, int interval, Qt::TimerTy
Q_D(QEventDispatcherWin32);
+ // exiting ... do not register new timers
+ // (QCoreApplication::closingDown() is set too late to be used here)
+ if (d->closingDown)
+ return;
+
WinTimerInfo *t = new WinTimerInfo;
t->dispatcher = this;
t->timerId = timerId;
@@ -1134,11 +1161,9 @@ void QEventDispatcherWin32::closingDown()
d->timerVec.clear();
d->timerDict.clear();
-#ifndef Q_OS_WINCE
- if (d->getMessageHook)
- UnhookWindowsHookEx(d->getMessageHook);
- d->getMessageHook = 0;
-#endif
+ d->closingDown = true;
+
+ uninstallMessageHook();
}
bool QEventDispatcherWin32::event(QEvent *e)
diff --git a/src/corelib/kernel/qeventdispatcher_win_p.h b/src/corelib/kernel/qeventdispatcher_win_p.h
index 369c276615..8022299a76 100644
--- a/src/corelib/kernel/qeventdispatcher_win_p.h
+++ b/src/corelib/kernel/qeventdispatcher_win_p.h
@@ -67,6 +67,8 @@ class Q_CORE_EXPORT QEventDispatcherWin32 : public QAbstractEventDispatcher
protected:
void createInternalHwnd();
+ void installMessageHook();
+ void uninstallMessageHook();
public:
explicit QEventDispatcherWin32(QObject *parent = 0);
@@ -145,6 +147,7 @@ public:
DWORD threadId;
bool interrupt;
+ bool closingDown;
// internal window handle used for socketnotifiers/timers/etc
HWND internalHwnd;
diff --git a/src/corelib/mimetypes/qmimedatabase.cpp b/src/corelib/mimetypes/qmimedatabase.cpp
index 9d14e5f90b..c5103ebe59 100644
--- a/src/corelib/mimetypes/qmimedatabase.cpp
+++ b/src/corelib/mimetypes/qmimedatabase.cpp
@@ -248,7 +248,7 @@ bool QMimeDatabasePrivate::inherits(const QString &mime, const QString &parent)
\endcode
On a typical Unix system, this will be /usr/share/mime/packages/, but it is also
possible to extend the list of directories by setting the environment variable
- XDG_DATA_DIRS. For instance adding /opt/myapp/share to XDG_DATA_DIRS will result
+ \c XDG_DATA_DIRS. For instance adding /opt/myapp/share to \c XDG_DATA_DIRS will result
in /opt/myapp/share/mime/packages/ being searched for MIME definitions.
Here is an example of MIME XML:
@@ -575,7 +575,7 @@ QMimeType QMimeDatabase::mimeTypeForFileNameAndData(const QString &fileName, con
This can be useful for showing all MIME types to the user, for instance
in a MIME type editor. Do not use unless really necessary in other cases
- though, prefer using the mimeTypeFor* methods for performance reasons.
+ though, prefer using the \l {mimeTypeForData()}{mimeTypeForXxx()} methods for performance reasons.
*/
QList<QMimeType> QMimeDatabase::allMimeTypes() const
{
diff --git a/src/corelib/mimetypes/qmimetype.cpp b/src/corelib/mimetypes/qmimetype.cpp
index d1bf27eae0..1ad2a449c1 100644
--- a/src/corelib/mimetypes/qmimetype.cpp
+++ b/src/corelib/mimetypes/qmimetype.cpp
@@ -89,8 +89,8 @@ void QMimeTypePrivate::addGlobPattern(const QString &pattern)
Determining the MIME type of a file can be useful to make sure your
application supports it. It is also useful in file-manager-like applications
- or widgets, in order to display an appropriate icon() for the file, or even
- the descriptive comment() in detailed views.
+ or widgets, in order to display an appropriate \l {QMimeType::iconName}{icon} for the file, or even
+ the descriptive \l {QMimeType::comment()}{comment} in detailed views.
To check if a file has the expected MIME type, you should use inherits()
rather than a simple string comparison based on the name(). This is because
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index dd235ef7a5..a622221bd3 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -725,7 +725,7 @@ static inline char qToLower(char c)
occurrences of a particular value with another, use one of the
two-parameter replace() overloads.
- QByteArrays can be compared using overloaded operators such as
+ {QByteArray}s can be compared using overloaded operators such as
operator<(), operator<=(), operator==(), operator>=(), and so on.
The comparison is based exclusively on the numeric values
of the characters and is very fast, but is not what a human would
@@ -770,7 +770,7 @@ static inline char qToLower(char c)
lastIndexOf(), operator<(), operator<=(), operator>(),
operator>=(), toLower() and toUpper().
- This issue does not apply to QStrings since they represent
+ This issue does not apply to {QString}s since they represent
characters using Unicode.
\sa QString, QBitArray
@@ -3105,6 +3105,7 @@ QDataStream &operator>>(QDataStream &in, QByteArray &ba)
replaced with a single space.
Whitespace means any character for which the standard C++
+ \c isspace() function returns \c true in the C locale. This includes the ASCII
isspace() function returns \c true in the C locale. This includes the ASCII
characters '\\t', '\\n', '\\v', '\\f', '\\r', and ' '.
@@ -3143,13 +3144,13 @@ QByteArray QByteArray::simplified() const
and the end.
Whitespace means any character for which the standard C++
- isspace() function returns \c true in the C locale. This includes the ASCII
+ \c isspace() function returns \c true in the C locale. This includes the ASCII
characters '\\t', '\\n', '\\v', '\\f', '\\r', and ' '.
Example:
\snippet code/src_corelib_tools_qbytearray.cpp 33
- Unlike simplified(), trimmed() leaves internal whitespace alone.
+ Unlike simplified(), \l {QByteArray::trimmed()}{trimmed()} leaves internal whitespace alone.
\sa simplified()
*/
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index ed581e43e9..29b546770c 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -5726,21 +5726,18 @@ QString QString::toUpper() const
Safely builds a formatted string from the format string \a cformat
and an arbitrary list of arguments.
- The %lc escape sequence expects a unicode character of type ushort
- (as returned by QChar::unicode()). The %ls escape sequence expects
- a pointer to a zero-terminated array of unicode characters of type
- ushort (as returned by QString::utf16()).
-
- \note This function expects a UTF-8 string for %s and Latin-1 for
- the format string.
-
- The format string supports most of the conversion specifiers
- provided by printf() in the standard C++ library. It doesn't
- honor the length modifiers (e.g. \c h for \c short, \c ll for
- \c{long long}). If you need those, use the standard snprintf()
- function instead:
-
- \snippet qstring/main.cpp 63
+ The format string supports the conversion specifiers, length modifiers,
+ and flags provided by printf() in the standard C++ library. The \a cformat
+ string and \c{%s} arguments must be UTF-8 encoded.
+
+ \note The \c{%lc} escape sequence expects a unicode character of type
+ \c char16_t, or \c ushort (as returned by QChar::unicode()).
+ The \c{%ls} escape sequence expects a pointer to a zero-terminated array
+ of unicode characters of type \c char16_t, or ushort (as returned by
+ QString::utf16()). This is at odds with the printf() in the standard C++
+ library, which defines \c {%lc} to print a wchar_t and \c{%ls} to print
+ a \c{wchar_t*}, and might also produce compiler warnings on platforms
+ where the size of \c {wchar_t} is not 16 bits.
\warning We do not recommend using QString::sprintf() in new Qt
code. Instead, consider using QTextStream or arg(), both of
diff --git a/src/corelib/tools/qversionnumber.cpp b/src/corelib/tools/qversionnumber.cpp
index 4d148249c0..3c8a9db086 100644
--- a/src/corelib/tools/qversionnumber.cpp
+++ b/src/corelib/tools/qversionnumber.cpp
@@ -40,7 +40,7 @@
**
****************************************************************************/
-#include <QtCore/qversionnumber.h>
+#include <QtCore/private/qversionnumber_p.h>
#include <QtCore/qhash.h>
#include <QtCore/private/qlocale_tools_p.h>
#include <QtCore/qcollator.h>
@@ -61,6 +61,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QVersionNumber
\inmodule QtCore
+ \internal
\since 5.4
\brief The QVersionNumber class contains a version number with an arbitrary
number of segments.
diff --git a/src/corelib/tools/qversionnumber.h b/src/corelib/tools/qversionnumber_p.h
index a951b2f1a0..a951b2f1a0 100644
--- a/src/corelib/tools/qversionnumber.h
+++ b/src/corelib/tools/qversionnumber_p.h
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index af0ed228bd..cef802fa76 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -71,7 +71,7 @@ HEADERS += \
tools/qunicodetools_p.h \
tools/qvarlengtharray.h \
tools/qvector.h \
- tools/qversionnumber.h
+ tools/qversionnumber_p.h
SOURCES += \