summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qabstracteventdispatcher.cpp24
-rw-r--r--src/corelib/kernel/qcore_mac_p.h23
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp29
-rw-r--r--src/corelib/kernel/qcoreapplication.h6
-rw-r--r--src/corelib/kernel/qcoreevent.h7
-rw-r--r--src/corelib/kernel/qeventdispatcher_glib.cpp5
-rw-r--r--src/corelib/kernel/qeventdispatcher_win_p.h3
-rw-r--r--src/corelib/kernel/qeventloop.cpp6
-rw-r--r--src/corelib/kernel/qmetaobject.cpp28
-rw-r--r--src/corelib/kernel/qmetatype.cpp7
-rw-r--r--src/corelib/kernel/qmetatype.h100
-rw-r--r--src/corelib/kernel/qmimedata.cpp18
-rw-r--r--src/corelib/kernel/qobject.cpp45
-rw-r--r--src/corelib/kernel/qobject.h9
-rw-r--r--src/corelib/kernel/qobject_p.h14
-rw-r--r--src/corelib/kernel/qobjectdefs.h18
-rw-r--r--src/corelib/kernel/qpointer.cpp4
-rw-r--r--src/corelib/kernel/qsharedmemory.cpp6
-rw-r--r--src/corelib/kernel/qsocketnotifier.cpp16
-rw-r--r--src/corelib/kernel/qsystemsemaphore.cpp8
-rw-r--r--src/corelib/kernel/qtranslator.cpp56
-rw-r--r--src/corelib/kernel/qvariant.cpp46
-rw-r--r--src/corelib/kernel/qwineventnotifier.cpp4
23 files changed, 255 insertions, 227 deletions
diff --git a/src/corelib/kernel/qabstracteventdispatcher.cpp b/src/corelib/kernel/qabstracteventdispatcher.cpp
index 3075eab753..b98f3f4a30 100644
--- a/src/corelib/kernel/qabstracteventdispatcher.cpp
+++ b/src/corelib/kernel/qabstracteventdispatcher.cpp
@@ -167,7 +167,7 @@ QAbstractEventDispatcher::~QAbstractEventDispatcher()
event dispatcher exists for the specified thread, this function
returns 0.
- \bold{Note:} If Qt is built without thread support, the \a thread
+ \b{Note:} If Qt is built without thread support, the \a thread
argument is ignored.
*/
QAbstractEventDispatcher *QAbstractEventDispatcher::instance(QThread *thread)
@@ -192,10 +192,10 @@ QAbstractEventDispatcher *QAbstractEventDispatcher::instance(QThread *thread)
\list
- \i If events are available, this function returns after processing
+ \li If events are available, this function returns after processing
them.
- \i If no events are available, this function will wait until more
+ \li If no events are available, this function will wait until more
are available and return after processing newly available events.
\endlist
@@ -204,7 +204,7 @@ QAbstractEventDispatcher *QAbstractEventDispatcher::instance(QThread *thread)
and no events are available, this function will return
immediately.
- \bold{Note:} This function does not process events continuously; it
+ \b{Note:} This function does not process events continuously; it
returns after all available events are processed.
\sa hasPendingEvents()
@@ -349,17 +349,17 @@ void QAbstractEventDispatcher::closingDown()
\table
\header
- \o Platform
- \o type
+ \li Platform
+ \li type
\row
- \o Windows
- \o MSG
+ \li Windows
+ \li MSG
\row
- \o X11
- \o XEvent
+ \li X11
+ \li XEvent
\row
- \o Mac
- \o NSEvent
+ \li Mac
+ \li NSEvent
\endtable
diff --git a/src/corelib/kernel/qcore_mac_p.h b/src/corelib/kernel/qcore_mac_p.h
index 78cb0eff3b..048d746183 100644
--- a/src/corelib/kernel/qcore_mac_p.h
+++ b/src/corelib/kernel/qcore_mac_p.h
@@ -57,17 +57,6 @@
# define __IMAGECAPTURE__
#endif
-#undef OLD_DEBUG
-#ifdef DEBUG
-# define OLD_DEBUG DEBUG
-# undef DEBUG
-#endif
-#define DEBUG 0
-#ifdef qDebug
-# define old_qDebug qDebug
-# undef qDebug
-#endif
-
#if defined(QT_BUILD_QMAKE) || defined(QT_BOOTSTRAPPED)
#include <ApplicationServices/ApplicationServices.h>
#else
@@ -82,18 +71,6 @@
#include <Foundation/Foundation.h>
#endif
-#undef DEBUG
-#ifdef OLD_DEBUG
-# define DEBUG OLD_DEBUG
-# undef OLD_DEBUG
-#endif
-
-#ifdef old_qDebug
-# undef qDebug
-# define qDebug QT_NO_QDEBUG_MACRO
-# undef old_qDebug
-#endif
-
#include "qstring.h"
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 2d49b271ce..967ed447d5 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -543,10 +543,6 @@ void QCoreApplication::init()
Q_ASSERT_X(!self, "QCoreApplication", "there should be only one application object");
QCoreApplication::self = this;
-#ifndef QT_NO_THREAD
- QThread::initialize();
-#endif
-
// use the event dispatcher created by the app programmer (if any)
if (!QCoreApplicationPrivate::eventDispatcher)
QCoreApplicationPrivate::eventDispatcher = d->threadData->eventDispatcher;
@@ -602,7 +598,6 @@ QCoreApplication::~QCoreApplication()
}
if (globalThreadPool)
globalThreadPool->waitForDone();
- QThread::cleanup();
#endif
d_func()->threadData->eventDispatcher = 0;
@@ -715,13 +710,13 @@ bool QCoreApplication::notifyInternal(QObject *receiver, QEvent *event)
reimplementing this virtual function is just one of them. All five
approaches are listed below:
\list 1
- \i Reimplementing paintEvent(), mousePressEvent() and so
+ \li Reimplementing paintEvent(), mousePressEvent() and so
on. This is the commonest, easiest and least powerful way.
- \i Reimplementing this function. This is very powerful, providing
+ \li Reimplementing this function. This is very powerful, providing
complete control; but only one subclass can be active at a time.
- \i Installing an event filter on QCoreApplication::instance(). Such
+ \li Installing an event filter on QCoreApplication::instance(). Such
an event filter is able to process all events for all widgets, so
it's just as powerful as reimplementing notify(); furthermore, it's
possible to have more than one application-global event filter.
@@ -730,11 +725,11 @@ bool QCoreApplication::notifyInternal(QObject *receiver, QEvent *event)
event filters are only called for objects that live in the main
thread.
- \i Reimplementing QObject::event() (as QWidget does). If you do
+ \li Reimplementing QObject::event() (as QWidget does). If you do
this you get Tab key presses, and you get to see the events before
any widget-specific event filters.
- \i Installing an event filter on the object. Such an event filter gets all
+ \li Installing an event filter on the object. Such an event filter gets all
the events, including Tab and Shift+Tab key press events, as long as they
do not change the focus widget.
\endlist
@@ -1438,11 +1433,9 @@ bool QCoreApplication::event(QEvent *e)
This enum type defines the 8-bit encoding of character string
arguments to translate():
- \value CodecForTr The encoding specified by
- QTextCodec::codecForTr() (Latin-1 if none has
- been set).
- \value UnicodeUTF8 UTF-8.
- \value DefaultCodec (Obsolete) Use CodecForTr instead.
+ \value UnicodeUTF8 UTF-8.
+ \value Latin1 Latin-1.
+ \value DefaultCodec Latin-1.
\sa QObject::tr(), QObject::trUtf8(), QString::fromUtf8()
*/
@@ -1617,7 +1610,7 @@ static void replacePercentN(QString *result, int n)
If none of the translation files contain a translation for \a
sourceText in \a context, this function returns a QString
equivalent of \a sourceText. The encoding of \a sourceText is
- specified by \e encoding; it defaults to CodecForTr.
+ specified by \e encoding; it defaults to DefaultCodec.
This function is not virtual. You can use alternative translation
techniques by subclassing \l QTranslator.
@@ -1628,7 +1621,7 @@ static void replacePercentN(QString *result, int n)
so will most likely result in crashes or other undesirable
behavior.
- \sa QObject::tr() installTranslator() QTextCodec::codecForTr()
+ \sa QObject::tr() installTranslator()
*/
@@ -1657,8 +1650,6 @@ QString QCoreApplication::translate(const char *context, const char *sourceText,
#else
if (encoding == UnicodeUTF8)
result = QString::fromUtf8(sourceText);
- else if (QTextCodec::codecForTr() != 0)
- result = QTextCodec::codecForTr()->toUnicode(sourceText);
else
#endif
result = QString::fromLatin1(sourceText);
diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h
index 18266a9a2c..0a5181a508 100644
--- a/src/corelib/kernel/qcoreapplication.h
+++ b/src/corelib/kernel/qcoreapplication.h
@@ -137,11 +137,11 @@ public:
static void installTranslator(QTranslator * messageFile);
static void removeTranslator(QTranslator * messageFile);
#endif
- enum Encoding { CodecForTr, UnicodeUTF8, DefaultCodec = CodecForTr };
+ enum Encoding { UnicodeUTF8, Latin1, DefaultCodec = Latin1 };
static QString translate(const char * context,
const char * key,
const char * disambiguation = 0,
- Encoding encoding = CodecForTr,
+ Encoding encoding = DefaultCodec,
int n = -1);
static void flush();
@@ -240,7 +240,7 @@ inline QString QCoreApplication::translate(const char *, const char *sourceText,
public: \
static inline QString tr(const char *sourceText, const char *disambiguation = 0, int n = -1) \
{ return QCoreApplication::translate(#context, sourceText, disambiguation, \
- QCoreApplication::CodecForTr, n); } \
+ QCoreApplication::DefaultCodec, n); } \
static inline QString trUtf8(const char *sourceText, const char *disambiguation = 0, int n = -1) \
{ return QCoreApplication::translate(#context, sourceText, disambiguation, \
QCoreApplication::UnicodeUTF8, n); } \
diff --git a/src/corelib/kernel/qcoreevent.h b/src/corelib/kernel/qcoreevent.h
index 1f36f9c9c8..1d54b32dfa 100644
--- a/src/corelib/kernel/qcoreevent.h
+++ b/src/corelib/kernel/qcoreevent.h
@@ -127,7 +127,6 @@ public:
DeactivateControl = 81, // ActiveX deactivation
ContextMenu = 82, // context popup menu
InputMethod = 83, // input method
- AccessibilityPrepare = 86, // accessibility information is requested
TabletMove = 87, // Wacom tablet event
LocaleChange = 88, // the system locale changed
LanguageChange = 89, // the application language changed
@@ -288,7 +287,7 @@ public:
MaxUser = 65535 // last user event id
};
- QEvent(Type type);
+ explicit QEvent(Type type);
virtual ~QEvent();
inline Type type() const { return static_cast<Type>(t); }
inline bool spontaneous() const { return spont; }
@@ -330,7 +329,7 @@ private:
class Q_CORE_EXPORT QTimerEvent : public QEvent
{
public:
- QTimerEvent( int timerId );
+ explicit QTimerEvent( int timerId );
~QTimerEvent();
int timerId() const { return id; }
protected:
@@ -355,7 +354,7 @@ protected:
class Q_CORE_EXPORT QDynamicPropertyChangeEvent : public QEvent
{
public:
- QDynamicPropertyChangeEvent(const QByteArray &name);
+ explicit QDynamicPropertyChangeEvent(const QByteArray &name);
~QDynamicPropertyChangeEvent();
inline QByteArray propertyName() const { return n; }
diff --git a/src/corelib/kernel/qeventdispatcher_glib.cpp b/src/corelib/kernel/qeventdispatcher_glib.cpp
index 4adcb7678c..3f272a2512 100644
--- a/src/corelib/kernel/qeventdispatcher_glib.cpp
+++ b/src/corelib/kernel/qeventdispatcher_glib.cpp
@@ -42,7 +42,6 @@
#include "qeventdispatcher_glib_p.h"
#include "qeventdispatcher_unix_p.h"
-#include <private/qmutexpool_p.h>
#include <private/qthread_p.h>
#include "qcoreapplication.h"
@@ -295,8 +294,8 @@ QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(GMainContext *context)
: mainContext(context)
{
if (qgetenv("QT_NO_THREADED_GLIB").isEmpty()) {
- static int dummyValue = 0; // only used for its address
- QMutexLocker locker(QMutexPool::instance()->get(&dummyValue));
+ static QBasicMutex mutex;
+ QMutexLocker locker(&mutex);
if (!g_thread_supported())
g_thread_init(NULL);
}
diff --git a/src/corelib/kernel/qeventdispatcher_win_p.h b/src/corelib/kernel/qeventdispatcher_win_p.h
index c404967e6a..565f1ef4b3 100644
--- a/src/corelib/kernel/qeventdispatcher_win_p.h
+++ b/src/corelib/kernel/qeventdispatcher_win_p.h
@@ -55,6 +55,7 @@
#include "QtCore/qabstracteventdispatcher.h"
#include "QtCore/qt_windows.h"
+#include "QtCore/qhash.h"
#include "qabstracteventdispatcher_p.h"
@@ -130,7 +131,7 @@ struct WinTimerInfo { // internal timer info
class QZeroTimerEvent : public QTimerEvent
{
public:
- inline QZeroTimerEvent(int timerId)
+ explicit inline QZeroTimerEvent(int timerId)
: QTimerEvent(timerId)
{ t = QEvent::ZeroTimerEvent; }
};
diff --git a/src/corelib/kernel/qeventloop.cpp b/src/corelib/kernel/qeventloop.cpp
index dfdd178c35..58e2c5cd2f 100644
--- a/src/corelib/kernel/qeventloop.cpp
+++ b/src/corelib/kernel/qeventloop.cpp
@@ -222,11 +222,11 @@ int QEventLoop::exec(ProcessEventsFlags flags)
operation and want to show its progress without allowing user
input, i.e. by using the \l ExcludeUserInputEvents flag.
- \bold{Notes:}
+ \b{Notes:}
\list
- \o This function does not process events continuously; it
+ \li This function does not process events continuously; it
returns after all available events are processed.
- \o Specifying the \l WaitForMoreEvents flag makes no sense
+ \li Specifying the \l WaitForMoreEvents flag makes no sense
and will be ignored.
\endlist
*/
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index e446d8b6ba..a8c21657cb 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -86,16 +86,16 @@ QT_BEGIN_NAMESPACE
The functions you are most likely to find useful are these:
\list
- \o className() returns the name of a class.
- \o superClass() returns the superclass's meta-object.
- \o method() and methodCount() provide information
+ \li className() returns the name of a class.
+ \li superClass() returns the superclass's meta-object.
+ \li method() and methodCount() provide information
about a class's meta-methods (signals, slots and other
\l{Q_INVOKABLE}{invokable} member functions).
- \o enumerator() and enumeratorCount() and provide information about
+ \li enumerator() and enumeratorCount() and provide information about
a class's enumerators.
- \o propertyCount() and property() provide information about a
+ \li propertyCount() and property() provide information about a
class's properties.
- \o constructor() and constructorCount() provide information
+ \li constructor() and constructorCount() provide information
about a class's meta-constructors.
\endlist
@@ -393,7 +393,7 @@ const QObject *QMetaObject::cast(const QObject *obj) const
*/
QString QMetaObject::tr(const char *s, const char *c, int n) const
{
- return QCoreApplication::translate(rawStringData(this, 0), s, c, QCoreApplication::CodecForTr, n);
+ return QCoreApplication::translate(rawStringData(this, 0), s, c, QCoreApplication::DefaultCodec, n);
}
/*!
@@ -1414,18 +1414,18 @@ enum { MaximumParamCount = 11 }; // up to 10 arguments + 1 return value
depending on \a type:
\list
- \o If \a type is Qt::DirectConnection, the member will be invoked immediately.
+ \li If \a type is Qt::DirectConnection, the member will be invoked immediately.
- \o If \a type is Qt::QueuedConnection,
+ \li If \a type is Qt::QueuedConnection,
a QEvent will be sent and the member is invoked as soon as the application
enters the main event loop.
- \o If \a type is Qt::BlockingQueuedConnection, the method will be invoked in
+ \li If \a type is Qt::BlockingQueuedConnection, the method will be invoked in
the same way as for Qt::QueuedConnection, except that the current thread
will block until the event is delivered. Using this connection type to
communicate between objects in the same thread will lead to deadlocks.
- \o If \a type is Qt::AutoConnection, the member is invoked
+ \li If \a type is Qt::AutoConnection, the member is invoked
synchronously if \a obj lives in the same thread as the
caller; otherwise it will invoke the member asynchronously.
\endlist
@@ -2034,13 +2034,13 @@ QMetaMethod::MethodType QMetaMethod::methodType() const
\a connectionType:
\list
- \o If \a connectionType is Qt::DirectConnection, the member will be invoked immediately.
+ \li If \a connectionType is Qt::DirectConnection, the member will be invoked immediately.
- \o If \a connectionType is Qt::QueuedConnection,
+ \li If \a connectionType is Qt::QueuedConnection,
a QEvent will be posted and the member is invoked as soon as the application
enters the main event loop.
- \o If \a connectionType is Qt::AutoConnection, the member is invoked
+ \li If \a connectionType is Qt::AutoConnection, the member is invoked
synchronously if \a object lives in the same thread as the
caller; otherwise it will invoke the member asynchronously.
\endlist
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index 6d5973a7d0..a5dc179113 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -454,7 +454,7 @@ static int qMetaTypeCustomType_unlocked(const char *typeName, int length)
int QMetaType::registerType(const char *typeName, Deleter deleter,
Creator creator)
{
- return registerType(typeName, deleter, creator, 0, 0, 0, TypeFlags());
+ return registerType(typeName, deleter, creator, qMetaTypeDestructHelper<void>, qMetaTypeConstructHelper<void>, 0, TypeFlags());
}
/*! \internal
@@ -472,7 +472,7 @@ int QMetaType::registerType(const char *typeName, Deleter deleter,
int size, TypeFlags flags)
{
QVector<QCustomTypeInfo> *ct = customTypes();
- if (!ct || !typeName || !deleter || !creator)
+ if (!ct || !typeName || !deleter || !creator || !destructor || !constructor)
return -1;
#ifdef QT_NO_QOBJECT
@@ -1337,6 +1337,7 @@ private:
return;
deleter = ct->at(type - QMetaType::User).deleter;
}
+ Q_ASSERT_X(deleter, "void QMetaType::destroy(int type, void *data)", "The type was not properly registered");
deleter(where);
}
@@ -1400,6 +1401,7 @@ private:
return 0;
ctor = ct->at(type - QMetaType::User).constructor;
}
+ Q_ASSERT_X(ctor, "void *QMetaType::construct(int type, void *where, const void *copy)", "The type was not properly registered");
return ctor(where, copy);
}
@@ -1489,6 +1491,7 @@ private:
return;
dtor = ct->at(type - QMetaType::User).destructor;
}
+ Q_ASSERT_X(dtor, "void QMetaType::destruct(int type, void *where)", "The type was not properly registered");
dtor(where);
}
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index 0f069dc45c..fb2bce7d7b 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -256,7 +256,7 @@ public:
static bool load(QDataStream &stream, int type, void *data);
#endif
- QMetaType(const int type);
+ explicit QMetaType(const int type);
inline ~QMetaType();
inline bool isValid() const;
@@ -365,33 +365,11 @@ void qMetaTypeLoadHelper(QDataStream &stream, void *t)
template <> inline void qMetaTypeLoadHelper<void>(QDataStream &, void *) {}
#endif // QT_NO_DATASTREAM
-template <typename T>
-struct QMetaTypeId
-{
- enum { Defined = 0 };
-};
-
-template <typename T>
-struct QMetaTypeId2
-{
- enum { Defined = QMetaTypeId<T>::Defined };
- static inline int qt_metatype_id() { return QMetaTypeId<T>::qt_metatype_id(); }
-};
-
class QObject;
class QWidget;
-namespace QtPrivate {
- template <typename T, bool Defined = QMetaTypeId2<T>::Defined>
- struct QMetaTypeIdHelper {
- static inline int qt_metatype_id()
- { return QMetaTypeId2<T>::qt_metatype_id(); }
- };
- template <typename T> struct QMetaTypeIdHelper<T, false> {
- static inline int qt_metatype_id()
- { return -1; }
- };
-
+namespace QtPrivate
+{
template<typename T>
struct IsPointerToTypeDerivedFromQObject
{
@@ -428,6 +406,38 @@ namespace QtPrivate {
Q_STATIC_ASSERT_X(sizeof(T), "Type argument of Q_DECLARE_METATYPE(T*) must be fully defined");
enum { Value = sizeof(checkType(static_cast<T*>(0))) == sizeof(yes_type) };
};
+}
+
+template <typename T, bool = QtPrivate::IsPointerToTypeDerivedFromQObject<T>::Value>
+struct QMetaTypeIdQObject
+{
+ enum {
+ Defined = 0
+ };
+};
+
+template <typename T>
+struct QMetaTypeId : public QMetaTypeIdQObject<T>
+{
+};
+
+template <typename T>
+struct QMetaTypeId2
+{
+ enum { Defined = QMetaTypeId<T>::Defined };
+ static inline int qt_metatype_id() { return QMetaTypeId<T>::qt_metatype_id(); }
+};
+
+namespace QtPrivate {
+ template <typename T, bool Defined = QMetaTypeId2<T>::Defined>
+ struct QMetaTypeIdHelper {
+ static inline int qt_metatype_id()
+ { return QMetaTypeId2<T>::qt_metatype_id(); }
+ };
+ template <typename T> struct QMetaTypeIdHelper<T, false> {
+ static inline int qt_metatype_id()
+ { return -1; }
+ };
// Function pointers don't derive from QObject
template <class Result> struct IsPointerToTypeDerivedFromQObject<Result(*)()> { enum { Value = false }; };
@@ -485,6 +495,7 @@ inline int qMetaTypeId(
#endif
)
{
+ Q_STATIC_ASSERT_X(QMetaTypeId2<T>::Defined, "Type is not registered, please use Q_DECLARE_METATYPE macro to make it know to Qt's meta-object system");
return QMetaTypeId2<T>::qt_metatype_id();
}
@@ -502,6 +513,23 @@ inline int qRegisterMetaType(
#endif
}
+template <typename T>
+struct QMetaTypeIdQObject<T*, /* isPointerToTypeDerivedFromQObject */ true>
+{
+ enum {
+ Defined = 1
+ };
+
+ static int qt_metatype_id()
+ {
+ static QBasicAtomicInt metatype_id = Q_BASIC_ATOMIC_INITIALIZER(0);
+ if (!metatype_id.load())
+ metatype_id.storeRelease(qRegisterMetaType<T*>(QByteArray(T::staticMetaObject.className() + QByteArrayLiteral("*")).constData(),
+ reinterpret_cast<T**>(quintptr(-1))));
+ return metatype_id.loadAcquire();
+ }
+};
+
#ifndef QT_NO_DATASTREAM
template <typename T>
inline int qRegisterMetaTypeStreamOperators()
@@ -566,6 +594,7 @@ template <class T> class QSet;
template <class T> class QSharedPointer;
template <class T1, class T2> class QMap;
template <class T1, class T2> class QHash;
+template <class T1, class T2> struct QPair;
typedef QList<QVariant> QVariantList;
typedef QMap<QString, QVariant> QVariantMap;
typedef QHash<QString, QVariant> QVariantHash;
@@ -587,6 +616,23 @@ struct QMetaTypeId< SINGLE_ARG_TEMPLATE<T> > \
} \
};
+#define Q_DECLARE_METATYPE_TEMPLATE_2ARG(DOUBLE_ARG_TEMPLATE) \
+template<typename T, typename U> \
+struct QMetaTypeId< DOUBLE_ARG_TEMPLATE<T, U> > \
+{ \
+ enum { \
+ Defined = QMetaTypeId2<T>::Defined && QMetaTypeId2<U>::Defined \
+ }; \
+ static int qt_metatype_id() \
+ { \
+ static QBasicAtomicInt metatype_id = Q_BASIC_ATOMIC_INITIALIZER(0); \
+ if (!metatype_id.load()) \
+ metatype_id.storeRelease(qRegisterMetaType< DOUBLE_ARG_TEMPLATE<T, U> >( QByteArray(QByteArray(#DOUBLE_ARG_TEMPLATE "<") + QMetaType::typeName(qMetaTypeId<T>()) + ", " + QMetaType::typeName(qMetaTypeId<U>()) + ">").constData(), \
+ reinterpret_cast< DOUBLE_ARG_TEMPLATE<T, U> *>(quintptr(-1)))); \
+ return metatype_id.loadAcquire(); \
+ } \
+};
+
Q_DECLARE_METATYPE_TEMPLATE_1ARG(QList)
Q_DECLARE_METATYPE_TEMPLATE_1ARG(QVector)
Q_DECLARE_METATYPE_TEMPLATE_1ARG(QQueue)
@@ -595,6 +641,10 @@ Q_DECLARE_METATYPE_TEMPLATE_1ARG(QSet)
Q_DECLARE_METATYPE_TEMPLATE_1ARG(QSharedPointer)
Q_DECLARE_METATYPE_TEMPLATE_1ARG(QLinkedList)
+Q_DECLARE_METATYPE_TEMPLATE_2ARG(QHash)
+Q_DECLARE_METATYPE_TEMPLATE_2ARG(QMap)
+Q_DECLARE_METATYPE_TEMPLATE_2ARG(QPair)
+
inline QMetaType::QMetaType(const ExtensionFlag extensionFlags, const QMetaTypeInterface *info,
Creator creator,
Deleter deleter,
diff --git a/src/corelib/kernel/qmimedata.cpp b/src/corelib/kernel/qmimedata.cpp
index cfe985da26..3a3464e43e 100644
--- a/src/corelib/kernel/qmimedata.cpp
+++ b/src/corelib/kernel/qmimedata.cpp
@@ -246,12 +246,12 @@ QVariant QMimeDataPrivate::retrieveTypedData(const QString &format, QVariant::Ty
functions to access the data:
\table
- \header \o Tester \o Getter \o Setter \o MIME Types
- \row \o hasText() \o text() \o setText() \o \c text/plain
- \row \o hasHtml() \o html() \o setHtml() \o \c text/html
- \row \o hasUrls() \o urls() \o setUrls() \o \c text/uri-list
- \row \o hasImage() \o imageData() \o setImageData() \o \c image/ *
- \row \o hasColor() \o colorData() \o setColorData() \o \c application/x-color
+ \header \li Tester \li Getter \li Setter \li MIME Types
+ \row \li hasText() \li text() \li setText() \li \c text/plain
+ \row \li hasHtml() \li html() \li setHtml() \li \c text/html
+ \row \li hasUrls() \li urls() \li setUrls() \li \c text/uri-list
+ \row \li hasImage() \li imageData() \li setImageData() \li \c image/ *
+ \row \li hasColor() \li colorData() \li setColorData() \li \c application/x-color
\endtable
For example, if your write a widget that accepts URL drags, you
@@ -263,15 +263,15 @@ QVariant QMimeDataPrivate::retrieveTypedData(const QString &format, QVariant::Ty
object:
\list 1
- \o Custom data can be stored directly in a QMimeData object as a
+ \li Custom data can be stored directly in a QMimeData object as a
QByteArray using setData(). For example:
\snippet doc/src/snippets/code/src_corelib_kernel_qmimedata.cpp 1
- \o We can subclass QMimeData and reimplement hasFormat(),
+ \li We can subclass QMimeData and reimplement hasFormat(),
formats(), and retrieveData().
- \o If the drag and drop operation occurs within a single
+ \li If the drag and drop operation occurs within a single
application, we can subclass QMimeData and add extra data in
it, and use a qobject_cast() in the receiver's drop event
handler. For example:
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 9977f96f99..edbb84a657 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -69,6 +69,16 @@
QT_BEGIN_NAMESPACE
+struct QObjectPrivate::ExtraData
+{
+ ExtraData() {}
+#ifndef QT_NO_USERDATA
+ QVector<QObjectUserData *> userData;
+#endif
+ QList<QByteArray> propertyNames;
+ QList<QVariant> propertyValues;
+};
+
static int DIRECT_CONNECTION_ONLY = 0;
static int *queuedConnectionTypes(const QList<QByteArray> &typeNames)
@@ -1829,7 +1839,7 @@ void QObject::removeEventFilter(QObject *obj)
deleted, the control must return to the event loop from which
deleteLater() was called.
- \bold{Note:} It is safe to call this function more than once; when the
+ \b{Note:} It is safe to call this function more than once; when the
first deferred deletion event is delivered, any pending events for the
object are removed from the event queue.
@@ -1873,7 +1883,7 @@ void QObject::deleteLater()
translators while performing translations is not supported. Doing
so will probably result in crashes or other undesirable behavior.
- \sa trUtf8(), QApplication::translate(), QTextCodec::setCodecForTr(), {Internationalization with Qt}
+ \sa trUtf8(), QApplication::translate(), {Internationalization with Qt}
*/
/*!
@@ -1885,11 +1895,6 @@ void QObject::deleteLater()
version. It is otherwise identical to tr(\a sourceText, \a
disambiguation, \a n).
- Note that using the Utf8 variants of the translation functions
- is not required if \c CODECFORTR is already set to UTF-8 in the
- qmake project file and QTextCodec::setCodecForTr("UTF-8") is
- used.
-
\warning This method is reentrant only if all translators are
installed \e before calling this method. Installing or removing
translators while performing translations is not supported. Doing
@@ -2147,9 +2152,9 @@ int QObject::receivers(const char *signal) const
member in the specified class.
\list
- \o If member.mobj is 0 then both signalIndex and methodIndex are set to -1.
+ \li If member.mobj is 0 then both signalIndex and methodIndex are set to -1.
- \o If specified member is not a member of obj instance class (or one of
+ \li If specified member is not a member of obj instance class (or one of
its parent classes) then both signalIndex and methodIndex are set to -1.
\endlist
@@ -2598,7 +2603,7 @@ QMetaObject::Connection QObject::connect(const QObject *sender, const QMetaMetho
disconnect() is typically used in three ways, as the following
examples demonstrate.
\list 1
- \i Disconnect everything connected to an object's signals:
+ \li Disconnect everything connected to an object's signals:
\snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 26
@@ -2606,7 +2611,7 @@ QMetaObject::Connection QObject::connect(const QObject *sender, const QMetaMetho
\snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 27
- \i Disconnect everything connected to a specific signal:
+ \li Disconnect everything connected to a specific signal:
\snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 28
@@ -2614,7 +2619,7 @@ QMetaObject::Connection QObject::connect(const QObject *sender, const QMetaMetho
\snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 29
- \i Disconnect a specific receiver:
+ \li Disconnect a specific receiver:
\snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 30
@@ -2775,11 +2780,11 @@ bool QObject::disconnect(const QObject *sender, const char *signal,
if:
\list 1
- \i \a signal is not a member of sender class or one of its parent classes.
+ \li \a signal is not a member of sender class or one of its parent classes.
- \i \a method is not a member of receiver class or one of its parent classes.
+ \li \a method is not a member of receiver class or one of its parent classes.
- \i \a signal instance represents not a signal.
+ \li \a signal instance represents not a signal.
\endlist
@@ -3460,7 +3465,7 @@ int QObjectPrivate::signalIndex(const char *signalName) const
Changing the value of a dynamic property causes a QDynamicPropertyChangeEvent
to be sent to the object.
- \bold{Note:} Dynamic properties starting with "_q_" are reserved for internal
+ \b{Note:} Dynamic properties starting with "_q_" are reserved for internal
purposes.
\sa property(), metaObject(), dynamicPropertyNames()
@@ -4219,19 +4224,19 @@ bool QObject::disconnect(const QMetaObject::Connection &connection)
disconnect() is typically used in three ways, as the following
examples demonstrate.
\list 1
- \i Disconnect everything connected to an object's signals:
+ \li Disconnect everything connected to an object's signals:
\snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 26
- \i Disconnect everything connected to a specific signal:
+ \li Disconnect everything connected to a specific signal:
\snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 47
- \i Disconnect a specific receiver:
+ \li Disconnect a specific receiver:
\snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 30
- \i Disconnect a connection from one specific signal to a specific slot:
+ \li Disconnect a connection from one specific signal to a specific slot:
\snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 48
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h
index 5f43b52939..9f09617071 100644
--- a/src/corelib/kernel/qobject.h
+++ b/src/corelib/kernel/qobject.h
@@ -198,6 +198,10 @@ public:
inline QMetaObject::Connection connect(const QObject *sender, const char *signal,
const char *member, Qt::ConnectionType type = Qt::AutoConnection) const;
+#ifdef Q_QDOC
+ QMetaObject::Connection QObject::connect(const QObject *sender, (T::*signal)(...), const QObject *receiver, (T::*method)(...), Qt::ConnectionType type)
+ QMetaObject::Connection QObject::connect(const QObject *sender, (T::*signal)(...), Functor functor)
+#else
//Connect a signal to a pointer to qobject member function
template <typename Func1, typename Func2>
static inline QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal,
@@ -261,6 +265,7 @@ public:
new QFunctorSlotObject<Func2, SignalType::ArgumentCount, typename SignalType::Arguments, typename SignalType::ReturnType>(slot),
Qt::DirectConnection, 0, &SignalType::Object::staticMetaObject);
}
+#endif //Q_QDOC
static bool disconnect(const QObject *sender, const char *signal,
const QObject *receiver, const char *member);
@@ -273,6 +278,9 @@ public:
{ return disconnect(this, 0, receiver, member); }
static bool disconnect(const QMetaObject::Connection &);
+#ifdef Q_QDOC
+ bool QObject::disconnect(const QObject *sender, (T::*signal)(...), const Qbject *receiver, (T::*method)(...))
+#else
template <typename Func1, typename Func2>
static inline bool disconnect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal,
const typename QtPrivate::FunctionPointer<Func2>::Object *receiver, Func2 slot)
@@ -300,6 +308,7 @@ public:
return disconnectImpl(sender, reinterpret_cast<void **>(&signal), receiver, zero,
&SignalType::Object::staticMetaObject);
}
+#endif //Q_QDOC
void dumpObjectTree();
diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h
index fa1aee8173..c8edadce9d 100644
--- a/src/corelib/kernel/qobject_p.h
+++ b/src/corelib/kernel/qobject_p.h
@@ -60,7 +60,6 @@
#include "QtCore/qlist.h"
#include "QtCore/qvector.h"
#include "QtCore/qreadwritelock.h"
-#include "QtCore/qvariant.h"
QT_BEGIN_NAMESPACE
@@ -98,16 +97,8 @@ class Q_CORE_EXPORT QObjectPrivate : public QObjectData
{
Q_DECLARE_PUBLIC(QObject)
+ struct ExtraData;
public:
- struct ExtraData
- {
- ExtraData() {}
-#ifndef QT_NO_USERDATA
- QVector<QObjectUserData *> userData;
-#endif
- QList<QByteArray> propertyNames;
- QList<QVariant> propertyValues;
- };
typedef void (*StaticMetaCallFunction)(QObject *, QMetaObject::Call, int, void **);
struct Connection
@@ -284,8 +275,9 @@ private:
class QBoolBlocker
{
+ Q_DISABLE_COPY(QBoolBlocker)
public:
- inline QBoolBlocker(bool &b, bool value=true):block(b), reset(b){block = value;}
+ explicit inline QBoolBlocker(bool &b, bool value=true):block(b), reset(b){block = value;}
inline ~QBoolBlocker(){block = reset; }
private:
bool &block;
diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
index 8751d0f5a1..4c98bad0f9 100644
--- a/src/corelib/kernel/qobjectdefs.h
+++ b/src/corelib/kernel/qobjectdefs.h
@@ -66,8 +66,10 @@ class QString;
# if defined(QT_NO_KEYWORDS)
# define QT_NO_EMIT
# else
-# define slots
-# define signals public
+# ifndef QT_NO_SIGNALS_SLOTS_KEYWORDS
+# define slots
+# define signals public
+# endif
# endif
# define Q_SLOTS
# define Q_SIGNALS public
@@ -209,16 +211,16 @@ Q_CORE_EXPORT const char *qFlagLocation(const char *method);
#ifndef QT_NO_DEBUG
# define QLOCATION "\0" __FILE__ ":" QTOSTRING(__LINE__)
# ifndef QT_NO_KEYWORDS
-# define METHOD(a) qFlagLocation("0"#a QLOCATION)
+# define METHOD(a) qFlagLocation("0" QTOSTRING(a) QLOCATION)
# endif
-# define SLOT(a) qFlagLocation("1"#a QLOCATION)
-# define SIGNAL(a) qFlagLocation("2"#a QLOCATION)
+# define SLOT(a) qFlagLocation("1" QTOSTRING(a) QLOCATION)
+# define SIGNAL(a) qFlagLocation("2" QTOSTRING(a) QLOCATION)
#else
# ifndef QT_NO_KEYWORDS
-# define METHOD(a) "0"#a
+# define METHOD(a) "0" QTOSTRING(a)
# endif
-# define SLOT(a) "1"#a
-# define SIGNAL(a) "2"#a
+# define SLOT(a) "1" QTOSTRING(a)
+# define SIGNAL(a) "2" QTOSTRING(a)
#endif
#define QMETHOD_CODE 0 // member type codes
diff --git a/src/corelib/kernel/qpointer.cpp b/src/corelib/kernel/qpointer.cpp
index 936a933d2d..b983bef5fe 100644
--- a/src/corelib/kernel/qpointer.cpp
+++ b/src/corelib/kernel/qpointer.cpp
@@ -61,13 +61,13 @@
\list
- \i When using QPointer on a QWidget (or a subclass of QWidget), previously
+ \li When using QPointer on a QWidget (or a subclass of QWidget), previously
the QPointer would be cleared by the QWidget destructor. Now, the QPointer
is cleared by the QObject destructor (since this is when QWeakPointers are
cleared). Any QPointers tracking a widget will \b NOT be cleared before the
QWidget destructor destroys the children for the widget being tracked.
- \i When constructing a QSharedPointer to take ownership of an object after a
+ \li When constructing a QSharedPointer to take ownership of an object after a
QPointer is already tracking the object. Previously, the shared pointer
construction would not be affected by the QPointer, but now that QPointer
is implemented using QWeakPoiner, constructing the QSharedPointer will
diff --git a/src/corelib/kernel/qsharedmemory.cpp b/src/corelib/kernel/qsharedmemory.cpp
index 640dfc0f94..d8578a8059 100644
--- a/src/corelib/kernel/qsharedmemory.cpp
+++ b/src/corelib/kernel/qsharedmemory.cpp
@@ -100,13 +100,13 @@ QSharedMemoryPrivate::makePlatformSafeKey(const QString &key,
\list
- \o Windows: QSharedMemory does not "own" the shared memory segment.
+ \li Windows: QSharedMemory does not "own" the shared memory segment.
When all threads or processes that have an instance of QSharedMemory
attached to a particular shared memory segment have either destroyed
their instance of QSharedMemory or exited, the Windows kernel
releases the shared memory segment automatically.
- \o Unix: QSharedMemory "owns" the shared memory segment. When the
+ \li Unix: QSharedMemory "owns" the shared memory segment. When the
last thread or process that has an instance of QSharedMemory
attached to a particular shared memory segment detaches from the
segment by destroying its instance of QSharedMemory, the Unix kernel
@@ -114,7 +114,7 @@ QSharedMemoryPrivate::makePlatformSafeKey(const QString &key,
process crashes without running the QSharedMemory destructor, the
shared memory segment survives the crash.
- \o HP-UX: Only one attach to a shared memory segment is allowed per
+ \li HP-UX: Only one attach to a shared memory segment is allowed per
process. This means that QSharedMemory should not be used across
multiple threads in the same process in HP-UX.
diff --git a/src/corelib/kernel/qsocketnotifier.cpp b/src/corelib/kernel/qsocketnotifier.cpp
index d7689bb7b1..0a2a66b6b2 100644
--- a/src/corelib/kernel/qsocketnotifier.cpp
+++ b/src/corelib/kernel/qsocketnotifier.cpp
@@ -111,9 +111,9 @@ QT_BEGIN_NAMESPACE
follow these steps when you receive a notification:
\list 1
- \o Disable the notifier.
- \o Read data from the socket.
- \o Re-enable the notifier if you are interested in more data (such as after
+ \li Disable the notifier.
+ \li Read data from the socket.
+ \li Re-enable the notifier if you are interested in more data (such as after
having written a new command to a remote server).
\endlist
@@ -121,12 +121,12 @@ QT_BEGIN_NAMESPACE
follow these steps when you receive a notification:
\list 1
- \o Disable the notifier.
- \o Write as much data as you can (before \c EWOULDBLOCK is returned).
- \o Re-enable notifier if you have more data to write.
+ \li Disable the notifier.
+ \li Write as much data as you can (before \c EWOULDBLOCK is returned).
+ \li Re-enable notifier if you have more data to write.
\endlist
- \bold{Further information:}
+ \b{Further information:}
On Windows, Qt always disables the notifier after getting a notification,
and only re-enables it if more data is expected. For example, if data is
read from the socket and it can be used to read more, or if reading or
@@ -162,7 +162,7 @@ QT_BEGIN_NAMESPACE
It is generally advisable to explicitly enable or disable the
socket notifier, especially for write notifiers.
- \bold{Note for Windows users:} The socket passed to QSocketNotifier
+ \b{Note for Windows users:} The socket passed to QSocketNotifier
will become non-blocking, even if it was created as a blocking socket.
\sa setEnabled(), isEnabled()
diff --git a/src/corelib/kernel/qsystemsemaphore.cpp b/src/corelib/kernel/qsystemsemaphore.cpp
index d0a67834dd..0558f3cb59 100644
--- a/src/corelib/kernel/qsystemsemaphore.cpp
+++ b/src/corelib/kernel/qsystemsemaphore.cpp
@@ -90,16 +90,16 @@ QT_BEGIN_NAMESPACE
When using this class, be aware of the following platform
differences:
- \bold{Windows:} QSystemSemaphore does not own its underlying system
+ \b{Windows:} QSystemSemaphore does not own its underlying system
semaphore. Windows owns it. This means that when all instances of
QSystemSemaphore for a particular key have been destroyed, either by
having their destructors called, or because one or more processes
crash, Windows removes the underlying system semaphore.
- \bold{Unix:}
+ \b{Unix:}
\list
- \o QSystemSemaphore owns the underlying system semaphore
+ \li QSystemSemaphore owns the underlying system semaphore
in Unix systems. This means that the last process having an instance of
QSystemSemaphore for a particular key must remove the underlying
system semaphore in its destructor. If the last process crashes
@@ -117,7 +117,7 @@ QT_BEGIN_NAMESPACE
{QSystemSemaphore::} {Create}, which will force Unix to reset the
resource count in the underlying system semaphore.
- \o When a process using QSystemSemaphore terminates for
+ \li When a process using QSystemSemaphore terminates for
any reason, Unix automatically reverses the effect of all acquire
operations that were not released. Thus if the process acquires a
resource and then exits without releasing it, Unix will release that
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp
index a11bcb26c9..dad3318870 100644
--- a/src/corelib/kernel/qtranslator.cpp
+++ b/src/corelib/kernel/qtranslator.cpp
@@ -279,9 +279,9 @@ public:
up to three parameters:
\list
- \o The \e context - usually the class name for the tr() caller.
- \o The \e {source text} - usually the argument to tr().
- \o The \e disambiguation - an optional string that helps disambiguate
+ \li The \e context - usually the class name for the tr() caller.
+ \li The \e {source text} - usually the argument to tr().
+ \li The \e disambiguation - an optional string that helps disambiguate
different uses of the same text in the same context.
\endlist
@@ -361,12 +361,12 @@ QTranslator::~QTranslator()
in the following order:
\list 1
- \o File name without \a suffix appended.
- \o File name with text after a character in \a search_delimiters
+ \li File name without \a suffix appended.
+ \li File name with text after a character in \a search_delimiters
stripped ("_." is the default for \a search_delimiters if it is
an empty string) and \a suffix.
- \o File name stripped without \a suffix appended.
- \o File name stripped further, etc.
+ \li File name stripped without \a suffix appended.
+ \li File name stripped further, etc.
\endlist
For example, an application running in the fr_CA locale
@@ -375,12 +375,12 @@ QTranslator::~QTranslator()
readable file from this list:
\list 1
- \o \c /opt/foolib/foo.fr_ca.qm
- \o \c /opt/foolib/foo.fr_ca
- \o \c /opt/foolib/foo.fr.qm
- \o \c /opt/foolib/foo.fr
- \o \c /opt/foolib/foo.qm
- \o \c /opt/foolib/foo
+ \li \c /opt/foolib/foo.fr_ca.qm
+ \li \c /opt/foolib/foo.fr_ca
+ \li \c /opt/foolib/foo.fr.qm
+ \li \c /opt/foolib/foo.fr
+ \li \c /opt/foolib/foo.qm
+ \li \c /opt/foolib/foo
\endlist
*/
@@ -599,10 +599,10 @@ static QString find_translation(const QLocale & locale,
in the following order:
\list 1
- \o File name without \a suffix appended.
- \o File name with ui language part after a "_" character stripped and \a suffix.
- \o File name with ui language part stripped without \a suffix appended.
- \o File name with ui language part stripped further, etc.
+ \li File name without \a suffix appended.
+ \li File name with ui language part after a "_" character stripped and \a suffix.
+ \li File name with ui language part stripped without \a suffix appended.
+ \li File name with ui language part stripped further, etc.
\endlist
For example, an application running in the locale with the following
@@ -612,17 +612,17 @@ static QString find_translation(const QLocale & locale,
open the first existing readable file from this list:
\list 1
- \o \c /opt/foolib/foo.es.qm
- \o \c /opt/foolib/foo.es
- \o \c /opt/foolib/foo.fr_CA.qm
- \o \c /opt/foolib/foo.fr_CA
- \o \c /opt/foolib/foo.de.qm
- \o \c /opt/foolib/foo.de
- \o \c /opt/foolib/foo.fr.qm
- \o \c /opt/foolib/foo.fr
- \o \c /opt/foolib/foo.qm
- \o \c /opt/foolib/foo.
- \o \c /opt/foolib/foo
+ \li \c /opt/foolib/foo.es.qm
+ \li \c /opt/foolib/foo.es
+ \li \c /opt/foolib/foo.fr_CA.qm
+ \li \c /opt/foolib/foo.fr_CA
+ \li \c /opt/foolib/foo.de.qm
+ \li \c /opt/foolib/foo.de
+ \li \c /opt/foolib/foo.fr.qm
+ \li \c /opt/foolib/foo.fr
+ \li \c /opt/foolib/foo.qm
+ \li \c /opt/foolib/foo.
+ \li \c /opt/foolib/foo
\endlist
On operating systems where file system is case sensitive, QTranslator also
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index ae51764c0a..39e8b4360f 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -1696,7 +1696,7 @@ void QVariant::load(QDataStream &s)
if (typeId == QVariant::UserType) {
QByteArray name;
s >> name;
- typeId = QMetaType::type(name);
+ typeId = QMetaType::type(name.constData());
if (typeId == QMetaType::UnknownType) {
s.setStatus(QDataStream::ReadCorruptData);
return;
@@ -2174,7 +2174,7 @@ inline T qNumVariantToHelper(const QVariant::Private &d,
If \a ok is non-null: \c{*}\a{ok} is set to true if the value could be
converted to an int; otherwise \c{*}\a{ok} is set to false.
- \bold{Warning:} If the value is convertible to a \l LongLong but is too
+ \b{Warning:} If the value is convertible to a \l LongLong but is too
large to be represented in an int, the resulting arithmetic overflow will
not be reflected in \a ok. A simple workaround is to use QString::toInt().
Fixing this bug has been postponed to Qt 5 in order to avoid breaking existing code.
@@ -2194,7 +2194,7 @@ int QVariant::toInt(bool *ok) const
If \a ok is non-null: \c{*}\a{ok} is set to true if the value could be
converted to an unsigned int; otherwise \c{*}\a{ok} is set to false.
- \bold{Warning:} If the value is convertible to a \l ULongLong but is too
+ \b{Warning:} If the value is convertible to a \l ULongLong but is too
large to be represented in an unsigned int, the resulting arithmetic overflow will
not be reflected in \a ok. A simple workaround is to use QString::toUInt().
Fixing this bug has been postponed to Qt 5 in order to avoid breaking existing code.
@@ -2411,28 +2411,28 @@ static const quint32 qCanConvertMatrix[QVariant::LastCoreType + 1] =
The following casts are done automatically:
\table
- \header \o Type \o Automatically Cast To
- \row \o \l Bool \o \l Char, \l Double, \l Int, \l LongLong, \l String, \l UInt, \l ULongLong
- \row \o \l ByteArray \o \l Double, \l Int, \l LongLong, \l String, \l UInt, \l ULongLong
- \row \o \l Char \o \l Bool, \l Int, \l UInt, \l LongLong, \l ULongLong
- \row \o \l Color \o \l String
- \row \o \l Date \o \l DateTime, \l String
- \row \o \l DateTime \o \l Date, \l String, \l Time
- \row \o \l Double \o \l Bool, \l Int, \l LongLong, \l String, \l UInt, \l ULongLong
- \row \o \l Font \o \l String
- \row \o \l Int \o \l Bool, \l Char, \l Double, \l LongLong, \l String, \l UInt, \l ULongLong
- \row \o \l KeySequence \o \l Int, \l String
- \row \o \l List \o \l StringList (if the list's items can be converted to strings)
- \row \o \l LongLong \o \l Bool, \l ByteArray, \l Char, \l Double, \l Int, \l String, \l UInt, \l ULongLong
- \row \o \l Point \o PointF
- \row \o \l Rect \o RectF
- \row \o \l String \o \l Bool, \l ByteArray, \l Char, \l Color, \l Date, \l DateTime, \l Double,
+ \header \li Type \li Automatically Cast To
+ \row \li \l Bool \li \l Char, \l Double, \l Int, \l LongLong, \l String, \l UInt, \l ULongLong
+ \row \li \l ByteArray \li \l Double, \l Int, \l LongLong, \l String, \l UInt, \l ULongLong
+ \row \li \l Char \li \l Bool, \l Int, \l UInt, \l LongLong, \l ULongLong
+ \row \li \l Color \li \l String
+ \row \li \l Date \li \l DateTime, \l String
+ \row \li \l DateTime \li \l Date, \l String, \l Time
+ \row \li \l Double \li \l Bool, \l Int, \l LongLong, \l String, \l UInt, \l ULongLong
+ \row \li \l Font \li \l String
+ \row \li \l Int \li \l Bool, \l Char, \l Double, \l LongLong, \l String, \l UInt, \l ULongLong
+ \row \li \l KeySequence \li \l Int, \l String
+ \row \li \l List \li \l StringList (if the list's items can be converted to strings)
+ \row \li \l LongLong \li \l Bool, \l ByteArray, \l Char, \l Double, \l Int, \l String, \l UInt, \l ULongLong
+ \row \li \l Point \li PointF
+ \row \li \l Rect \li RectF
+ \row \li \l String \li \l Bool, \l ByteArray, \l Char, \l Color, \l Date, \l DateTime, \l Double,
\l Font, \l Int, \l KeySequence, \l LongLong, \l StringList, \l Time, \l UInt,
\l ULongLong
- \row \o \l StringList \o \l List, \l String (if the list contains exactly one item)
- \row \o \l Time \o \l String
- \row \o \l UInt \o \l Bool, \l Char, \l Double, \l Int, \l LongLong, \l String, \l ULongLong
- \row \o \l ULongLong \o \l Bool, \l Char, \l Double, \l Int, \l LongLong, \l String, \l UInt
+ \row \li \l StringList \li \l List, \l String (if the list contains exactly one item)
+ \row \li \l Time \li \l String
+ \row \li \l UInt \li \l Bool, \l Char, \l Double, \l Int, \l LongLong, \l String, \l ULongLong
+ \row \li \l ULongLong \li \l Bool, \l Char, \l Double, \l Int, \l LongLong, \l String, \l UInt
\endtable
\sa convert()
diff --git a/src/corelib/kernel/qwineventnotifier.cpp b/src/corelib/kernel/qwineventnotifier.cpp
index 11a2dc83f5..58ca046d9d 100644
--- a/src/corelib/kernel/qwineventnotifier.cpp
+++ b/src/corelib/kernel/qwineventnotifier.cpp
@@ -75,7 +75,7 @@ QT_BEGIN_NAMESPACE
Finally, you can use the setHandle() function to register a new event
object, and the handle() function to retrieve the event handle.
- \bold{Further information:}
+ \b{Further information:}
Although the class is called QWinEventNotifier, it can be used for
certain other objects which are so-called synchronization
objects, such as Processes, Threads, Waitable timers.
@@ -140,7 +140,7 @@ QWinEventNotifier::~QWinEventNotifier()
Register the HANDLE \a hEvent. The old HANDLE will be automatically
unregistered.
- \bold Note: The notifier will be disabled as a side effect and needs
+ \b Note: The notifier will be disabled as a side effect and needs
to be re-enabled.
\sa handle(), setEnabled()