diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-07-22 18:00:32 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-07-22 18:00:32 (GMT) |
commit | 3d9f5b56f1c26c2bccedae04eb9536fed3474d43 (patch) | |
tree | b5530bab26b47f6a5b19d8970818e88403f2fd68 | |
parent | 71cc2f69171f5dd6d8ae094239230362fc8db081 (diff) | |
parent | 0b68204919a81c2aeca7924711cd5e159dca7903 (diff) | |
download | Qt-3d9f5b56f1c26c2bccedae04eb9536fed3474d43.zip Qt-3d9f5b56f1c26c2bccedae04eb9536fed3474d43.tar.gz Qt-3d9f5b56f1c26c2bccedae04eb9536fed3474d43.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
If the QEventDispatcherGlibc causes warnings, it should say so
Remove a warning message that no longer appears after all on Windows
Drag & Drop failing in itemviews on Cocoa.
qdoc: Removed debug code.
qdoc: Fixed reporting of read-only status for QML properties.
Fix the smallFont test failure for Mac and Linux
Revert "Compile fix for MSVC"
Compile fix for MSVC
Improve QAccessible for QAccessibleTabBar
Improve QAccessible for QTabBar
fix the export macros for the QtDBus module
rebuild configure.exe
make "configure -qt-gif" work again on Windows
Fix a typo in harfbuzz thai line breaking.
Ensure that font sizes that are > 0 and < 1 are still respected
53 files changed, 399 insertions, 150 deletions
diff --git a/configure.exe b/configure.exe Binary files differindex eea40f9..6dfd14e48 100755 --- a/configure.exe +++ b/configure.exe diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-thai.c b/src/3rdparty/harfbuzz/src/harfbuzz-thai.c index e153ba9..e80e2c5 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-thai.c +++ b/src/3rdparty/harfbuzz/src/harfbuzz-thai.c @@ -91,7 +91,7 @@ static void thaiWordBreaks(const HB_UChar16 *string, hb_uint32 len, HB_CharAttri for (i = 0; i < numbreaks; ++i) { if (break_positions[i] > 0) { attributes[break_positions[i]-1].lineBreakType = HB_Break; - attributes[i].wordBoundary = TRUE; + attributes[break_positions[i]-1].wordBoundary = TRUE; } } diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 8a3166d..7b915cd 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1277,6 +1277,11 @@ class QDataStream; # else # define Q_COMPAT_EXPORT Q_DECL_IMPORT # endif +# if defined(QT_BUILD_DBUS_LIB) +# define Q_DBUS_EXPORT Q_DECL_EXPORT +# else +# define Q_DBUS_EXPORT Q_DECL_IMPORT +# endif # define Q_TEMPLATEDLL # elif defined(QT_DLL) /* use a Qt DLL library */ # define Q_CORE_EXPORT Q_DECL_IMPORT @@ -1294,6 +1299,7 @@ class QDataStream; # define Q_SCRIPT_EXPORT Q_DECL_IMPORT # define Q_SCRIPTTOOLS_EXPORT Q_DECL_IMPORT # define Q_COMPAT_EXPORT Q_DECL_IMPORT +# define Q_DBUS_EXPORT Q_DECL_IMPORT # define Q_TEMPLATEDLL # endif # define Q_NO_DECLARED_NOT_DEFINED @@ -1322,6 +1328,7 @@ class QDataStream; # define Q_SCRIPT_EXPORT Q_DECL_EXPORT # define Q_SCRIPTTOOLS_EXPORT Q_DECL_EXPORT # define Q_COMPAT_EXPORT Q_DECL_EXPORT +# define Q_DBUS_EXPORT Q_DECL_EXPORT # else # define Q_CORE_EXPORT # define Q_GUI_EXPORT @@ -1336,6 +1343,7 @@ class QDataStream; # define Q_SCRIPT_EXPORT # define Q_SCRIPTTOOLS_EXPORT # define Q_COMPAT_EXPORT +# define Q_DBUS_EXPORT # endif #endif diff --git a/src/corelib/kernel/qeventdispatcher_glib.cpp b/src/corelib/kernel/qeventdispatcher_glib.cpp index 9c1c827..8390275 100644 --- a/src/corelib/kernel/qeventdispatcher_glib.cpp +++ b/src/corelib/kernel/qeventdispatcher_glib.cpp @@ -504,7 +504,7 @@ void QEventDispatcherGlib::registerTimer(int timerId, int interval, QObject *obj { #ifndef QT_NO_DEBUG if (timerId < 1 || interval < 0 || !object) { - qWarning("QEventDispatcherUNIX::registerTimer: invalid arguments"); + qWarning("QEventDispatcherGlib::registerTimer: invalid arguments"); return; } else if (object->thread() != thread() || thread() != QThread::currentThread()) { qWarning("QObject::startTimer: timers cannot be started from another thread"); @@ -520,7 +520,7 @@ bool QEventDispatcherGlib::unregisterTimer(int timerId) { #ifndef QT_NO_DEBUG if (timerId < 1) { - qWarning("QEventDispatcherUNIX::unregisterTimer: invalid argument"); + qWarning("QEventDispatcherGlib::unregisterTimer: invalid argument"); return false; } else if (thread() != QThread::currentThread()) { qWarning("QObject::killTimer: timers cannot be stopped from another thread"); @@ -536,7 +536,7 @@ bool QEventDispatcherGlib::unregisterTimers(QObject *object) { #ifndef QT_NO_DEBUG if (!object) { - qWarning("QEventDispatcherUNIX::unregisterTimers: invalid argument"); + qWarning("QEventDispatcherGlib::unregisterTimers: invalid argument"); return false; } else if (object->thread() != thread() || thread() != QThread::currentThread()) { qWarning("QObject::killTimers: timers cannot be stopped from another thread"); diff --git a/src/dbus/dbus.pro b/src/dbus/dbus.pro index 7c59808..46a723a 100644 --- a/src/dbus/dbus.pro +++ b/src/dbus/dbus.pro @@ -3,7 +3,7 @@ QPRO_PWD = $$PWD QT = core \ xml CONFIG += link_pkgconfig -DEFINES += QDBUS_MAKEDLL \ +DEFINES += QT_BUILD_DBUS_LIB \ DBUS_API_SUBJECT_TO_CHANGE QMAKE_CXXFLAGS += $$QT_CFLAGS_DBUS contains(QT_CONFIG, dbus-linked) { diff --git a/src/dbus/qdbusabstractadaptor.h b/src/dbus/qdbusabstractadaptor.h index fa64aef..af5a3ce 100644 --- a/src/dbus/qdbusabstractadaptor.h +++ b/src/dbus/qdbusabstractadaptor.h @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(DBus) class QDBusAbstractAdaptorPrivate; -class QDBUS_EXPORT QDBusAbstractAdaptor: public QObject +class Q_DBUS_EXPORT QDBusAbstractAdaptor: public QObject { Q_OBJECT protected: diff --git a/src/dbus/qdbusabstractinterface.h b/src/dbus/qdbusabstractinterface.h index 44f79a1..177af67 100644 --- a/src/dbus/qdbusabstractinterface.h +++ b/src/dbus/qdbusabstractinterface.h @@ -64,7 +64,7 @@ class QDBusPendingCall; class QDBusAbstractInterfacePrivate; -class QDBUS_EXPORT QDBusAbstractInterfaceBase: public QObject +class Q_DBUS_EXPORT QDBusAbstractInterfaceBase: public QObject { public: int qt_metacall(QMetaObject::Call, int, void**); @@ -74,7 +74,7 @@ private: Q_DECLARE_PRIVATE(QDBusAbstractInterface) }; -class QDBUS_EXPORT QDBusAbstractInterface: +class Q_DBUS_EXPORT QDBusAbstractInterface: #ifdef Q_QDOC public QObject #else diff --git a/src/dbus/qdbusargument.h b/src/dbus/qdbusargument.h index 73558b6..30f2cda 100644 --- a/src/dbus/qdbusargument.h +++ b/src/dbus/qdbusargument.h @@ -64,7 +64,7 @@ QT_MODULE(DBus) class QDBusArgumentPrivate; class QDBusDemarshaller; class QDBusMarshaller; -class QDBUS_EXPORT QDBusArgument +class Q_DBUS_EXPORT QDBusArgument { public: enum ElementType { @@ -184,43 +184,43 @@ template<> inline QVariant qdbus_cast<QVariant>(const QVariant &v, QVariant *) return qdbus_cast<QDBusVariant>(v).variant(); } -QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QVariant &v); +Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QVariant &v); // QVariant types #ifndef QDBUS_NO_SPECIALTYPES -QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QDate &date); -QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QDate &date); +Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QDate &date); +Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QDate &date); -QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QTime &time); -QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QTime &time); +Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QTime &time); +Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QTime &time); -QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QDateTime &dt); -QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QDateTime &dt); +Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QDateTime &dt); +Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QDateTime &dt); -QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QRect &rect); -QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QRect &rect); +Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QRect &rect); +Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QRect &rect); -QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QRectF &rect); -QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QRectF &rect); +Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QRectF &rect); +Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QRectF &rect); -QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QSize &size); -QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QSize &size); +Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QSize &size); +Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QSize &size); -QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QSizeF &size); -QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QSizeF &size); +Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QSizeF &size); +Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QSizeF &size); -QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QPoint &pt); -QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QPoint &pt); +Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QPoint &pt); +Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QPoint &pt); -QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QPointF &pt); -QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QPointF &pt); +Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QPointF &pt); +Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QPointF &pt); -QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QLine &line); -QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QLine &line); +Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QLine &line); +Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QLine &line); -QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QLineF &line); -QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QLineF &line); +Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QLineF &line); +Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QLineF &line); #endif template<template <typename> class Container, typename T> diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp index 4382032..6f86856 100644 --- a/src/dbus/qdbusconnection.cpp +++ b/src/dbus/qdbusconnection.cpp @@ -125,7 +125,7 @@ QDBusConnectionManager::~QDBusConnectionManager() connectionHash.clear(); } -QDBUS_EXPORT void qDBusBindToApplication(); +Q_DBUS_EXPORT void qDBusBindToApplication(); void qDBusBindToApplication() { } diff --git a/src/dbus/qdbusconnection.h b/src/dbus/qdbusconnection.h index a8ca551..0f365ec 100644 --- a/src/dbus/qdbusconnection.h +++ b/src/dbus/qdbusconnection.h @@ -72,7 +72,7 @@ class QDBusConnectionInterface; class QObject; class QDBusConnectionPrivate; -class QDBUS_EXPORT QDBusConnection +class Q_DBUS_EXPORT QDBusConnection { Q_GADGET Q_ENUMS(BusType UnregisterMode) diff --git a/src/dbus/qdbusconnectioninterface.h b/src/dbus/qdbusconnectioninterface.h index 1a020b7..4650e12 100644 --- a/src/dbus/qdbusconnectioninterface.h +++ b/src/dbus/qdbusconnectioninterface.h @@ -62,7 +62,7 @@ class QByteArray; /* * Proxy class for interface org.freedesktop.DBus */ -class QDBUS_EXPORT QDBusConnectionInterface: public QDBusAbstractInterface +class Q_DBUS_EXPORT QDBusConnectionInterface: public QDBusAbstractInterface { Q_OBJECT Q_ENUMS(ServiceQueueOptions ServiceReplacementOptions RegisterServiceReply) diff --git a/src/dbus/qdbuscontext.h b/src/dbus/qdbuscontext.h index 13fbe4b..cb9310c 100644 --- a/src/dbus/qdbuscontext.h +++ b/src/dbus/qdbuscontext.h @@ -57,7 +57,7 @@ class QDBusConnection; class QDBusMessage; class QDBusContextPrivate; -class QDBUS_EXPORT QDBusContext +class Q_DBUS_EXPORT QDBusContext { public: QDBusContext(); diff --git a/src/dbus/qdbuserror.h b/src/dbus/qdbuserror.h index ff9d1df..72736d0 100644 --- a/src/dbus/qdbuserror.h +++ b/src/dbus/qdbuserror.h @@ -57,7 +57,7 @@ QT_MODULE(DBus) class QDBusMessage; -class QDBUS_EXPORT QDBusError +class Q_DBUS_EXPORT QDBusError { public: enum ErrorType { @@ -115,7 +115,7 @@ private: }; #ifndef QT_NO_DEBUG_STREAM -QDBUS_EXPORT QDebug operator<<(QDebug, const QDBusError &); +Q_DBUS_EXPORT QDebug operator<<(QDebug, const QDBusError &); #endif QT_END_NAMESPACE diff --git a/src/dbus/qdbusextratypes.h b/src/dbus/qdbusextratypes.h index 205baff..544e63f 100644 --- a/src/dbus/qdbusextratypes.h +++ b/src/dbus/qdbusextratypes.h @@ -59,7 +59,7 @@ QT_MODULE(DBus) // defined in qhash.cpp Q_CORE_EXPORT uint qHash(const QString &key); -class QDBUS_EXPORT QDBusObjectPath : private QString +class Q_DBUS_EXPORT QDBusObjectPath : private QString { public: inline QDBusObjectPath() { } @@ -109,7 +109,7 @@ inline uint qHash(const QDBusObjectPath &objectPath) { return qHash(objectPath.path()); } -class QDBUS_EXPORT QDBusSignature : private QString +class Q_DBUS_EXPORT QDBusSignature : private QString { public: inline QDBusSignature() { } diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index efa6744..1f44bd2 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -508,7 +508,7 @@ static bool shouldWatchService(const QString &service) return !service.isEmpty() && !service.startsWith(QLatin1Char(':')); } -extern QDBUS_EXPORT void qDBusAddSpyHook(QDBusSpyHook); +extern Q_DBUS_EXPORT void qDBusAddSpyHook(QDBusSpyHook); void qDBusAddSpyHook(QDBusSpyHook hook) { qDBusSpyHookList()->append(hook); diff --git a/src/dbus/qdbusinterface.h b/src/dbus/qdbusinterface.h index 02a9059..141fbe5 100644 --- a/src/dbus/qdbusinterface.h +++ b/src/dbus/qdbusinterface.h @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(DBus) class QDBusInterfacePrivate; -class QDBUS_EXPORT QDBusInterface: public QDBusAbstractInterface +class Q_DBUS_EXPORT QDBusInterface: public QDBusAbstractInterface { friend class QDBusConnection; private: diff --git a/src/dbus/qdbusintrospection_p.h b/src/dbus/qdbusintrospection_p.h index aa1ae57..3a69321 100644 --- a/src/dbus/qdbusintrospection_p.h +++ b/src/dbus/qdbusintrospection_p.h @@ -63,7 +63,7 @@ QT_BEGIN_NAMESPACE -class QDBUS_EXPORT QDBusIntrospection +class Q_DBUS_EXPORT QDBusIntrospection { public: // forward declarations diff --git a/src/dbus/qdbusmacros.h b/src/dbus/qdbusmacros.h index 693a350..d8bfda5 100644 --- a/src/dbus/qdbusmacros.h +++ b/src/dbus/qdbusmacros.h @@ -46,14 +46,6 @@ #include <QtCore/qmetatype.h> #include <QtCore/qvariant.h> -#if defined(QDBUS_MAKEDLL) -# define QDBUS_EXPORT Q_DECL_EXPORT -#elif defined(QT_SHARED) -# define QDBUS_EXPORT Q_DECL_IMPORT -#else -# define QDBUS_EXPORT -#endif - #ifndef Q_MOC_RUN # define Q_NOREPLY #endif diff --git a/src/dbus/qdbusmessage.h b/src/dbus/qdbusmessage.h index f2e64b9..fa1f2c9 100644 --- a/src/dbus/qdbusmessage.h +++ b/src/dbus/qdbusmessage.h @@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(DBus) class QDBusMessagePrivate; -class QDBUS_EXPORT QDBusMessage +class Q_DBUS_EXPORT QDBusMessage { public: enum MessageType { @@ -120,7 +120,7 @@ private: }; #ifndef QT_NO_DEBUG_STREAM -QDBUS_EXPORT QDebug operator<<(QDebug, const QDBusMessage &); +Q_DBUS_EXPORT QDebug operator<<(QDebug, const QDBusMessage &); #endif QT_END_NAMESPACE diff --git a/src/dbus/qdbusmetaobject_p.h b/src/dbus/qdbusmetaobject_p.h index 777ef54..07f1cc0 100644 --- a/src/dbus/qdbusmetaobject_p.h +++ b/src/dbus/qdbusmetaobject_p.h @@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE class QDBusError; struct QDBusMetaObjectPrivate; -struct QDBUS_EXPORT QDBusMetaObject: public QMetaObject +struct Q_DBUS_EXPORT QDBusMetaObject: public QMetaObject { bool cached; diff --git a/src/dbus/qdbusmetatype.h b/src/dbus/qdbusmetatype.h index b487e23..9ae1944 100644 --- a/src/dbus/qdbusmetatype.h +++ b/src/dbus/qdbusmetatype.h @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(DBus) -class QDBUS_EXPORT QDBusMetaType +class Q_DBUS_EXPORT QDBusMetaType { public: typedef void (*MarshallFunction)(QDBusArgument &, const void *); diff --git a/src/dbus/qdbuspendingcall.h b/src/dbus/qdbuspendingcall.h index ca0eaaa..492eb3c 100644 --- a/src/dbus/qdbuspendingcall.h +++ b/src/dbus/qdbuspendingcall.h @@ -62,7 +62,7 @@ class QDBusError; class QDBusPendingCallWatcher; class QDBusPendingCallPrivate; -class QDBUS_EXPORT QDBusPendingCall +class Q_DBUS_EXPORT QDBusPendingCall { public: QDBusPendingCall(const QDBusPendingCall &other); @@ -96,7 +96,7 @@ private: }; class QDBusPendingCallWatcherPrivate; -class QDBUS_EXPORT QDBusPendingCallWatcher: public QObject, public QDBusPendingCall +class Q_DBUS_EXPORT QDBusPendingCallWatcher: public QObject, public QDBusPendingCall { Q_OBJECT public: diff --git a/src/dbus/qdbuspendingreply.h b/src/dbus/qdbuspendingreply.h index 4757115..61e561e 100644 --- a/src/dbus/qdbuspendingreply.h +++ b/src/dbus/qdbuspendingreply.h @@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(DBus) -class QDBUS_EXPORT QDBusPendingReplyData: public QDBusPendingCall +class Q_DBUS_EXPORT QDBusPendingReplyData: public QDBusPendingCall { protected: QDBusPendingReplyData(); diff --git a/src/dbus/qdbusreply.h b/src/dbus/qdbusreply.h index fbe7459..ba25308 100644 --- a/src/dbus/qdbusreply.h +++ b/src/dbus/qdbusreply.h @@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(DBus) -QDBUS_EXPORT void qDBusReplyFill(const QDBusMessage &reply, QDBusError &error, QVariant &data); +Q_DBUS_EXPORT void qDBusReplyFill(const QDBusMessage &reply, QDBusError &error, QVariant &data); template<typename T> class QDBusReply diff --git a/src/dbus/qdbusserver.h b/src/dbus/qdbusserver.h index 90d40f5..8e824a8 100644 --- a/src/dbus/qdbusserver.h +++ b/src/dbus/qdbusserver.h @@ -57,7 +57,7 @@ class QDBusConnectionPrivate; class QDBusError; class QDBusConnection; -class QDBUS_EXPORT QDBusServer: public QObject +class Q_DBUS_EXPORT QDBusServer: public QObject { Q_OBJECT public: diff --git a/src/dbus/qdbusservicewatcher.h b/src/dbus/qdbusservicewatcher.h index c7609a8..d9a0d92 100644 --- a/src/dbus/qdbusservicewatcher.h +++ b/src/dbus/qdbusservicewatcher.h @@ -56,7 +56,7 @@ QT_MODULE(DBus) class QDBusConnection; class QDBusServiceWatcherPrivate; -class QDBUS_EXPORT QDBusServiceWatcher: public QObject +class Q_DBUS_EXPORT QDBusServiceWatcher: public QObject { Q_OBJECT Q_PROPERTY(QStringList watchedServices READ watchedServices WRITE setWatchedServices) diff --git a/src/dbus/qdbusthreaddebug_p.h b/src/dbus/qdbusthreaddebug_p.h index e8d90c5..87cb4d6 100644 --- a/src/dbus/qdbusthreaddebug_p.h +++ b/src/dbus/qdbusthreaddebug_p.h @@ -63,8 +63,8 @@ #if QDBUS_THREAD_DEBUG QT_BEGIN_NAMESPACE typedef void (*qdbusThreadDebugFunc)(int, int, QDBusConnectionPrivate *); -QDBUS_EXPORT void qdbusDefaultThreadDebug(int, int, QDBusConnectionPrivate *); -extern QDBUS_EXPORT qdbusThreadDebugFunc qdbusThreadDebug; +Q_DBUS_EXPORT void qdbusDefaultThreadDebug(int, int, QDBusConnectionPrivate *); +extern Q_DBUS_EXPORT qdbusThreadDebugFunc qdbusThreadDebug; QT_END_NAMESPACE #endif diff --git a/src/dbus/qdbusutil_p.h b/src/dbus/qdbusutil_p.h index 8a1846a..2b53c6b 100644 --- a/src/dbus/qdbusutil_p.h +++ b/src/dbus/qdbusutil_p.h @@ -67,25 +67,25 @@ QT_BEGIN_NAMESPACE namespace QDBusUtil { - QDBUS_EXPORT bool isValidInterfaceName(const QString &ifaceName); + Q_DBUS_EXPORT bool isValidInterfaceName(const QString &ifaceName); - QDBUS_EXPORT bool isValidUniqueConnectionName(const QString &busName); + Q_DBUS_EXPORT bool isValidUniqueConnectionName(const QString &busName); - QDBUS_EXPORT bool isValidBusName(const QString &busName); + Q_DBUS_EXPORT bool isValidBusName(const QString &busName); - QDBUS_EXPORT bool isValidMemberName(const QString &memberName); + Q_DBUS_EXPORT bool isValidMemberName(const QString &memberName); - QDBUS_EXPORT bool isValidErrorName(const QString &errorName); + Q_DBUS_EXPORT bool isValidErrorName(const QString &errorName); - QDBUS_EXPORT bool isValidPartOfObjectPath(const QString &path); + Q_DBUS_EXPORT bool isValidPartOfObjectPath(const QString &path); - QDBUS_EXPORT bool isValidObjectPath(const QString &path); + Q_DBUS_EXPORT bool isValidObjectPath(const QString &path); - QDBUS_EXPORT bool isValidSignature(const QString &signature); + Q_DBUS_EXPORT bool isValidSignature(const QString &signature); - QDBUS_EXPORT bool isValidSingleSignature(const QString &signature); + Q_DBUS_EXPORT bool isValidSingleSignature(const QString &signature); - QDBUS_EXPORT QString argumentToString(const QVariant &variant); + Q_DBUS_EXPORT QString argumentToString(const QVariant &variant); enum AllowEmptyFlag { EmptyAllowed, diff --git a/src/dbus/qdbusxmlgenerator.cpp b/src/dbus/qdbusxmlgenerator.cpp index 463ac73..7cc5acb 100644 --- a/src/dbus/qdbusxmlgenerator.cpp +++ b/src/dbus/qdbusxmlgenerator.cpp @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE -extern QDBUS_EXPORT QString qDBusGenerateMetaObjectXml(QString interface, const QMetaObject *mo, +extern Q_DBUS_EXPORT QString qDBusGenerateMetaObjectXml(QString interface, const QMetaObject *mo, const QMetaObject *base, int flags); static inline QString typeNameToXml(const char *typeName) diff --git a/src/declarative/graphicsitems/qdeclarativeanchors_p.h b/src/declarative/graphicsitems/qdeclarativeanchors_p.h index 1bd7608..c929797 100644 --- a/src/declarative/graphicsitems/qdeclarativeanchors_p.h +++ b/src/declarative/graphicsitems/qdeclarativeanchors_p.h @@ -70,11 +70,11 @@ class Q_DECLARATIVE_EXPORT QDeclarativeAnchors : public QObject Q_PROPERTY(qreal margins READ margins WRITE setMargins NOTIFY marginsChanged) Q_PROPERTY(qreal leftMargin READ leftMargin WRITE setLeftMargin NOTIFY leftMarginChanged) Q_PROPERTY(qreal rightMargin READ rightMargin WRITE setRightMargin NOTIFY rightMarginChanged) - Q_PROPERTY(qreal horizontalCenterOffset READ horizontalCenterOffset WRITE setHorizontalCenterOffset NOTIFY horizontalCenterOffsetChanged()) + Q_PROPERTY(qreal horizontalCenterOffset READ horizontalCenterOffset WRITE setHorizontalCenterOffset NOTIFY horizontalCenterOffsetChanged) Q_PROPERTY(qreal topMargin READ topMargin WRITE setTopMargin NOTIFY topMarginChanged) Q_PROPERTY(qreal bottomMargin READ bottomMargin WRITE setBottomMargin NOTIFY bottomMarginChanged) - Q_PROPERTY(qreal verticalCenterOffset READ verticalCenterOffset WRITE setVerticalCenterOffset NOTIFY verticalCenterOffsetChanged()) - Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset NOTIFY baselineOffsetChanged()) + Q_PROPERTY(qreal verticalCenterOffset READ verticalCenterOffset WRITE setVerticalCenterOffset NOTIFY verticalCenterOffsetChanged) + Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset NOTIFY baselineOffsetChanged) Q_PROPERTY(QGraphicsObject *fill READ fill WRITE setFill RESET resetFill NOTIFY fillChanged) Q_PROPERTY(QGraphicsObject *centerIn READ centerIn WRITE setCenterIn RESET resetCenterIn NOTIFY centerInChanged) diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp index 67f2327..ba40443 100644 --- a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp +++ b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp @@ -50,6 +50,13 @@ QT_BEGIN_NAMESPACE + +/*! + \class QDeclarativeImageBase + \internal + \brief The base class for declarative images. + */ + QDeclarativeImageBase::QDeclarativeImageBase(QDeclarativeImageBasePrivate &dd, QDeclarativeItem *parent) : QDeclarativeItem(dd, parent) { diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index 367a5d0..36081f7 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -91,7 +91,7 @@ QT_BEGIN_NAMESPACE */ /*! - \qmlclass Translate QGraphicsTranslate + \qmlclass Translate QDeclarativeTranslate \since 4.7 \brief The Translate object provides a way to move an Item without changing its x or y properties. @@ -420,7 +420,7 @@ void QDeclarativeItemKeyFilter::componentComplete() /*! - \qmlclass KeyNavigation + \qmlclass KeyNavigation QDeclarativeKeyNavigationAttached \since 4.7 \brief The KeyNavigation attached property supports key navigation by arrow keys. @@ -714,7 +714,7 @@ void QDeclarativeKeyNavigationAttached::keyReleased(QKeyEvent *event, bool post) } /*! - \qmlclass Keys + \qmlclass Keys QDeclarativeKeysAttached \since 4.7 \brief The Keys attached property provides key handling to Items. @@ -2047,20 +2047,6 @@ QDeclarativeAnchorLine QDeclarativeItemPrivate::baseline() const } /*! - \qmlproperty AnchorLine Item::top - \qmlproperty AnchorLine Item::bottom - \qmlproperty AnchorLine Item::left - \qmlproperty AnchorLine Item::right - \qmlproperty AnchorLine Item::horizontalCenter - \qmlproperty AnchorLine Item::verticalCenter - \qmlproperty AnchorLine Item::baseline - - The anchor lines of the item. - - For more information see \l {anchor-layout}{Anchor Layouts}. -*/ - -/*! \qmlproperty AnchorLine Item::anchors.top \qmlproperty AnchorLine Item::anchors.bottom \qmlproperty AnchorLine Item::anchors.left diff --git a/src/declarative/graphicsitems/qdeclarativerepeater.cpp b/src/declarative/graphicsitems/qdeclarativerepeater.cpp index 3be4014..2b268fb 100644 --- a/src/declarative/graphicsitems/qdeclarativerepeater.cpp +++ b/src/declarative/graphicsitems/qdeclarativerepeater.cpp @@ -148,7 +148,6 @@ QDeclarativeRepeaterPrivate::~QDeclarativeRepeaterPrivate() /*! \internal \class QDeclarativeRepeater - \qmlclass Repeater */ /*! diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index 1935531..a552ce7 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -390,7 +390,10 @@ static int qCocoaViewCount = 0; if (QDragManager::self()->source()) mimeData = QDragManager::self()->dragPrivate()->data; QDragMoveEvent qDMEvent(posDrag, qtAllowed, mimeData, QApplication::mouseButtons(), modifiers); - qDMEvent.setDropAction(QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec).lastAction); + if (QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec).lastAction != Qt::IgnoreAction + && QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec).buttons == qDMEvent.mouseButtons() + && QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec).modifiers == qDMEvent.keyboardModifiers()) + qDMEvent.setDropAction(QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec).lastAction); qDMEvent.accept(); QApplication::sendEvent(qwidget, &qDMEvent); diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp index d692307..bbc7e5d 100644 --- a/src/gui/widgets/qtabbar.cpp +++ b/src/gui/widgets/qtabbar.cpp @@ -1219,6 +1219,12 @@ void QTabBar::setCurrentIndex(int index) if (oldIndex >= 0 && oldIndex < count()) d->layoutTab(oldIndex); d->layoutTab(index); +#ifndef QT_NO_ACCESSIBILITY + if (QAccessible::isActive()) { + QAccessible::updateAccessibility(this, index + 1, QAccessible::Focus); + QAccessible::updateAccessibility(this, index + 1, QAccessible::Selection); + } +#endif #ifdef QT3_SUPPORT emit selected(index); #endif diff --git a/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp b/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp index 9cf81ca..2f4d1df 100644 --- a/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp +++ b/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp @@ -93,7 +93,7 @@ public: }; /*! - \qmlclass FolderListModel + \qmlclass FolderListModel QDeclarativeFolderListModel \brief The FolderListModel provides a model of the contents of a folder in a filesystem. FolderListModel provides access to the local filesystem. The \e folder property diff --git a/src/imports/particles/qdeclarativeparticles.cpp b/src/imports/particles/qdeclarativeparticles.cpp index 8fe8a9f..b842109 100644 --- a/src/imports/particles/qdeclarativeparticles.cpp +++ b/src/imports/particles/qdeclarativeparticles.cpp @@ -153,7 +153,7 @@ void QDeclarativeParticleMotion::destroy(QDeclarativeParticle &particle) } /*! - \qmlclass ParticleMotionLinear + \qmlclass ParticleMotionLinear QDeclarativeParticleMotionLinear \since 4.7 \brief The ParticleMotionLinear object moves particles linearly. @@ -179,7 +179,7 @@ void QDeclarativeParticleMotionLinear::advance(QDeclarativeParticle &p, int inte } /*! - \qmlclass ParticleMotionGravity + \qmlclass ParticleMotionGravity QDeclarativeParticleMotionGravity \since 4.7 \brief The ParticleMotionGravity object moves particles towards a point. @@ -270,7 +270,7 @@ void QDeclarativeParticleMotionGravity::advance(QDeclarativeParticle &p, int int } /*! - \qmlclass ParticleMotionWander + \qmlclass ParticleMotionWander QDeclarativeParticleMotionWander \since 4.7 \brief The ParticleMotionWander object moves particles in a somewhat random fashion. @@ -633,7 +633,7 @@ void QDeclarativeParticlesPrivate::updateOpacity(QDeclarativeParticle &p, int ag } /*! - \qmlclass Particles + \qmlclass Particles QDeclarativeParticles \since 4.7 \brief The Particles object generates and moves particles. \inherits Item diff --git a/src/plugins/accessible/widgets/complexwidgets.cpp b/src/plugins/accessible/widgets/complexwidgets.cpp index 8be1560..803786f 100644 --- a/src/plugins/accessible/widgets/complexwidgets.cpp +++ b/src/plugins/accessible/widgets/complexwidgets.cpp @@ -1512,10 +1512,14 @@ QString QAccessibleTabBar::text(Text t, int child) const default: break; } - } else if (child > 0) { + } else { switch (t) { case Name: - return qt_accStripAmp(tabBar()->tabText(child - 1)); + if (child > 0) + return qt_accStripAmp(tabBar()->tabText(child - 1)); + else if (tabBar()->currentIndex() != -1) + return qt_accStripAmp(tabBar()->tabText(tabBar()->currentIndex())); + break; default: break; } diff --git a/src/svg/qsvgstyle.cpp b/src/svg/qsvgstyle.cpp index 0d1bad9..f228a77 100644 --- a/src/svg/qsvgstyle.cpp +++ b/src/svg/qsvgstyle.cpp @@ -241,7 +241,7 @@ void QSvgFontStyle::apply(QPainter *p, const QSvgNode *, QSvgExtraStates &states } if (m_sizeSet) - font.setPointSize(m_qfont.pointSizeF()); + font.setPointSizeF(m_qfont.pointSizeF()); if (m_styleSet) font.setStyle(m_qfont.style()); diff --git a/src/svg/qsvgstyle_p.h b/src/svg/qsvgstyle_p.h index af3b4e5..dfea12c 100644 --- a/src/svg/qsvgstyle_p.h +++ b/src/svg/qsvgstyle_p.h @@ -338,7 +338,7 @@ public: { // Store the _pixel_ size in the font. Since QFont::setPixelSize() only takes an int, call // QFont::SetPointSize() instead. Set proper font size just before rendering. - m_qfont.setPointSize(size); + m_qfont.setPointSizeF(size); m_sizeSet = 1; } diff --git a/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp b/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp index 106fd8c..02e2921 100644 --- a/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp +++ b/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp @@ -85,6 +85,7 @@ private slots: void testFillInheritance(); void testStopOffsetOpacity(); void testUseElement(); + void smallFont(); #ifndef QT_NO_COMPRESS void testGzLoading(); @@ -1342,5 +1343,28 @@ void tst_QSvgRenderer::testUseElement() } } +void tst_QSvgRenderer::smallFont() +{ + static const char *svgs[] = { "<svg width=\"50px\" height=\"50px\"><text x=\"10\" y=\"10\" font-size=\"0\">Hello world</text></svg>", + "<svg width=\"50px\" height=\"50px\"><text x=\"10\" y=\"10\" font-size=\"0.5\">Hello world</text></svg>" + }; + const int COUNT = sizeof(svgs) / sizeof(svgs[0]); + QImage images[COUNT]; + QPainter p; + + for (int i = 0; i < COUNT; ++i) { + QByteArray data(svgs[i]); + if (i == 0) + QTest::ignoreMessage(QtWarningMsg, "QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0"); + QSvgRenderer renderer(data); + images[i] = QImage(50, 50, QImage::Format_ARGB32_Premultiplied); + images[i].fill(-1); + p.begin(&images[i]); + renderer.render(&p); + p.end(); + } + QVERIFY(images[0] != images[1]); +} + QTEST_MAIN(tst_QSvgRenderer) #include "tst_qsvgrenderer.moc" diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index c3498e3..f7dac93 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -581,8 +581,8 @@ void Configure::parseCmdLine() // Image formats -------------------------------------------- else if (configCmdLine.at(i) == "-no-gif") dictionary[ "GIF" ] = "no"; - else if (configCmdLine.at(i) == "-qt-gif") - dictionary[ "GIF" ] = "yes"; + else if (configCmdLine.at(i) == "-qt-gif") + dictionary[ "GIF" ] = "plugin"; else if (configCmdLine.at(i) == "-no-libtiff") { dictionary[ "TIFF"] = "no"; diff --git a/tools/qdbus/qdbuscpp2xml/qdbuscpp2xml.cpp b/tools/qdbus/qdbuscpp2xml/qdbuscpp2xml.cpp index 3a80019..ba2bdd8 100644 --- a/tools/qdbus/qdbuscpp2xml/qdbuscpp2xml.cpp +++ b/tools/qdbus/qdbuscpp2xml/qdbuscpp2xml.cpp @@ -64,7 +64,7 @@ static const char docTypeHeader[] = // in qdbusxmlgenerator.cpp QT_BEGIN_NAMESPACE -extern QDBUS_EXPORT QString qDBusGenerateMetaObjectXml(QString interface, const QMetaObject *mo, +extern Q_DBUS_EXPORT QString qDBusGenerateMetaObjectXml(QString interface, const QMetaObject *mo, const QMetaObject *base, int flags); QT_END_NAMESPACE diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp index d5108fd..a120e45 100644 --- a/tools/qdoc3/cppcodeparser.cpp +++ b/tools/qdoc3/cppcodeparser.cpp @@ -1120,6 +1120,17 @@ bool CppCodeParser::match(int target) } /*! + Skip to \a target. If \a target is found before the end + of input, return true. Otherwise return false. + */ +bool CppCodeParser::skipTo(int target) +{ + while ((tok != Tok_Eoi) && (tok != target)) + readToken(); + return (tok == target ? true : false); +} + +/*! If the current token is one of the keyword thingees that are used in Qt, skip over it to the next token and return true. Otherwise just return false without reading the @@ -1362,7 +1373,9 @@ bool CppCodeParser::matchFunctionDecl(InnerNode *parent, if (!matchDataType(&returnType)) { if (tokenizer->parsingFnOrMacro() - && (match(Tok_Q_DECLARE_FLAGS) || match(Tok_Q_PROPERTY))) + && (match(Tok_Q_DECLARE_FLAGS) || + match(Tok_Q_PROPERTY) || + match(Tok_Q_PRIVATE_PROPERTY))) returnType = CodeChunk(previousLexeme()); else { return false; @@ -1796,11 +1809,19 @@ bool CppCodeParser::matchTypedefDecl(InnerNode *parent) bool CppCodeParser::matchProperty(InnerNode *parent) { - if (!match(Tok_Q_PROPERTY) && - !match(Tok_Q_OVERRIDE) && - !match(Tok_QDOC_PROPERTY)) + int expected_tok = Tok_LeftParen; + if (match(Tok_Q_PRIVATE_PROPERTY)) { + expected_tok = Tok_Comma; + if (!skipTo(Tok_Comma)) + return false; + } + else if (!match(Tok_Q_PROPERTY) && + !match(Tok_Q_OVERRIDE) && + !match(Tok_QDOC_PROPERTY)) { return false; - if (!match(Tok_LeftParen)) + } + + if (!match(expected_tok)) return false; QString name; @@ -1949,6 +1970,7 @@ bool CppCodeParser::matchDeclList(InnerNode *parent) break; case Tok_Q_OVERRIDE: case Tok_Q_PROPERTY: + case Tok_Q_PRIVATE_PROPERTY: case Tok_QDOC_PROPERTY: matchProperty(parent); break; diff --git a/tools/qdoc3/cppcodeparser.h b/tools/qdoc3/cppcodeparser.h index 3c53f72..55d9ddf 100644 --- a/tools/qdoc3/cppcodeparser.h +++ b/tools/qdoc3/cppcodeparser.h @@ -119,6 +119,7 @@ class CppCodeParser : public CodeParser QString previousLexeme(); QString lexeme(); bool match(int target); + bool skipTo(int target); bool matchCompat(); bool matchTemplateAngles(CodeChunk *type = 0); bool matchTemplateHeader(); diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index d7a9c9e..4789c67 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -4210,7 +4210,7 @@ void DitaXmlGenerator::generateDetailedQmlMember(const Node *node, out() << "<td><p>"; //out() << "<tr><td>"; // old out() << "<a name=\"" + refForNode(qpn) + "\"></a>"; - if (!qpn->isWritable()) + if (!qpn->isWritable(myTree)) out() << "<span class=\"qmlreadonly\">read-only</span>"; if (qpgn->isDefault()) out() << "<span class=\"qmldefault\">default</span>"; diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index e840a7f..1b62dc4 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -4107,8 +4107,10 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node, out() << "<td class=\"tblQmlPropNode\"><p>"; out() << "<a name=\"" + refForNode(qpn) + "\"></a>"; - if (!qpn->isWritable()) + + if (!qpn->isWritable(myTree)) { out() << "<span class=\"qmlreadonly\">read-only</span>"; + } if (qpgn->isDefault()) out() << "<span class=\"qmldefault\">default</span>"; generateQmlItem(qpn, relative, marker, false); @@ -4124,10 +4126,10 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node, out() << "<div class=\"qmlproto\">"; out() << "<table class=\"qmlname\">"; //out() << "<tr>"; - if (++numTableRows % 2 == 1) - out() << "<tr class=\"odd\">"; - else - out() << "<tr class=\"even\">"; + if (++numTableRows % 2 == 1) + out() << "<tr class=\"odd\">"; + else + out() << "<tr class=\"even\">"; out() << "<td class=\"tblQmlFuncNode\"><p>"; out() << "<a name=\"" + refForNode(qsn) + "\"></a>"; generateSynopsis(qsn,relative,marker,CodeMarker::Detailed,false); diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index 0ca4870..259641e 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -44,6 +44,8 @@ */ #include "node.h" +#include "tree.h" +#include "codemarker.h" #include <qdebug.h> QT_BEGIN_NAMESPACE @@ -171,6 +173,32 @@ QString Node::accessString() const return "public"; } +/*! + Extract a class name from the type \a string and return it. + */ +QString Node::extractClassName(const QString &string) const +{ + QString result; + for (int i=0; i<=string.size(); ++i) { + QChar ch; + if (i != string.size()) + ch = string.at(i); + + QChar lower = ch.toLower(); + if ((lower >= QLatin1Char('a') && lower <= QLatin1Char('z')) || + ch.digitValue() >= 0 || + ch == QLatin1Char('_') || + ch == QLatin1Char(':')) { + result += ch; + } + else if (!result.isEmpty()) { + if (result != QLatin1String("const")) + return result; + result.clear(); + } + } + return result; +} /*! Returns a string representing the access specifier. @@ -426,6 +454,9 @@ void InnerNode::setOverload(const FunctionNode *func, bool overlode) } /*! + Mark all child nodes that have no documentation as having + private access and internal status. qdoc will then ignore + them for documentation purposes. */ void InnerNode::makeUndocumentedChildrenInternal() { @@ -831,6 +862,7 @@ NamespaceNode::NamespaceNode(InnerNode *parent, const QString& name) /*! \class ClassNode + \brief This class represents a C++ class. */ /*! @@ -850,8 +882,8 @@ void ClassNode::addBaseClass(Access access, ClassNode *node, const QString &dataTypeWithTemplateArgs) { - bas.append(RelatedClass(access, node, dataTypeWithTemplateArgs)); - node->der.append(RelatedClass(access, this)); + bases.append(RelatedClass(access, node, dataTypeWithTemplateArgs)); + node->derived.append(RelatedClass(access, this)); } /*! @@ -859,16 +891,16 @@ void ClassNode::addBaseClass(Access access, void ClassNode::fixBaseClasses() { int i; - i = 0; - while (i < bas.size()) { - ClassNode *baseClass = bas.at(i).node; - if (baseClass->access() == Node::Private) { - bas.removeAt(i); - - const QList<RelatedClass> &basesBases = baseClass->baseClasses(); - for (int j = basesBases.size() - 1; j >= 0; --j) - bas.insert(i, basesBases.at(j)); + while (i < bases.size()) { + ClassNode* bc = bases.at(i).node; + if (bc->access() == Node::Private) { + RelatedClass rc = bases.at(i); + bases.removeAt(i); + ignoredBases.append(rc); + const QList<RelatedClass> &bb = bc->baseClasses(); + for (int j = bb.size() - 1; j >= 0; --j) + bases.insert(i, bb.at(j)); } else { ++i; @@ -876,15 +908,13 @@ void ClassNode::fixBaseClasses() } i = 0; - while (i < der.size()) { - ClassNode *derivedClass = der.at(i).node; - if (derivedClass->access() == Node::Private) { - der.removeAt(i); - - const QList<RelatedClass> &dersDers = - derivedClass->derivedClasses(); - for (int j = dersDers.size() - 1; j >= 0; --j) - der.insert(i, dersDers.at(j)); + while (i < derived.size()) { + ClassNode* dc = derived.at(i).node; + if (dc->access() == Node::Private) { + derived.removeAt(i); + const QList<RelatedClass> &dd = dc->derivedClasses(); + for (int j = dd.size() - 1; j >= 0; --j) + derived.insert(i, dd.at(j)); } else { ++i; @@ -893,6 +923,16 @@ void ClassNode::fixBaseClasses() } /*! + Search the child list to find the property node with the + specified \a name. + */ +const PropertyNode* ClassNode::findPropertyNode(const QString& name) const +{ + const Node* n = findNode(name,Node::Property); + return (n ? static_cast<const PropertyNode*>(n) : 0); +} + +/*! \class FakeNode */ @@ -1585,6 +1625,144 @@ bool QmlPropertyNode::fromTrool(Trool troolean, bool defaultValue) return defaultValue; } } + +static QString valueType(const QString& n) +{ + if (n == "QPoint") + return "QDeclarativePointValueType"; + if (n == "QPointF") + return "QDeclarativePointFValueType"; + if (n == "QSize") + return "QDeclarativeSizeValueType"; + if (n == "QSizeF") + return "QDeclarativeSizeFValueType"; + if (n == "QRect") + return "QDeclarativeRectValueType"; + if (n == "QRectF") + return "QDeclarativeRectFValueType"; + if (n == "QVector2D") + return "QDeclarativeVector2DValueType"; + if (n == "QVector3D") + return "QDeclarativeVector3DValueType"; + if (n == "QVector4D") + return "QDeclarativeVector4DValueType"; + if (n == "QQuaternion") + return "QDeclarativeQuaternionValueType"; + if (n == "QMatrix4x4") + return "QDeclarativeMatrix4x4ValueType"; + if (n == "QEasingCurve") + return "QDeclarativeEasingValueType"; + if (n == "QFont") + return "QDeclarativeFontValueType"; + return QString(); +} + +/*! + Returns true if a QML property or attached property is + read-only. The algorithm for figuring this out is long + amd tedious and almost certainly will break. It currently + doesn't work for qmlproperty bool PropertyChanges::explicit, + because the tokenized gets confused on "explicit" . + */ +bool QmlPropertyNode::isWritable(const Tree* tree) const +{ + Node* n = parent(); + while (n && n->subType() != Node::QmlClass) + n = n->parent(); + if (n) { + const QmlClassNode* qcn = static_cast<const QmlClassNode*>(n); + const ClassNode* cn = qcn->classNode(); + if (cn) { + QStringList dotSplit = name().split(QChar('.')); + const PropertyNode* pn = cn->findPropertyNode(dotSplit[0]); + if (pn) { + if (dotSplit.size() > 1) { + QStringList path(extractClassName(pn->qualifiedDataType())); + const Node* nn = tree->findNode(path,Class); + if (nn) { + const ClassNode* cn = static_cast<const ClassNode*>(nn); + pn = cn->findPropertyNode(dotSplit[1]); + if (pn) { + return pn->isWritable(); + } + else { + const QList<RelatedClass>& bases = cn->baseClasses(); + if (!bases.isEmpty()) { + for (int i=0; i<bases.size(); ++i) { + const ClassNode* cn = bases[i].node; + pn = cn->findPropertyNode(dotSplit[1]); + if (pn) { + return pn->isWritable(); + } + } + } + const QList<RelatedClass>& ignoredBases = cn->ignoredBaseClasses(); + if (!ignoredBases.isEmpty()) { + for (int i=0; i<ignoredBases.size(); ++i) { + const ClassNode* cn = ignoredBases[i].node; + pn = cn->findPropertyNode(dotSplit[1]); + if (pn) { + return pn->isWritable(); + } + } + } + QString vt = valueType(cn->name()); + if (!vt.isEmpty()) { + QStringList path(vt); + const Node* vtn = tree->findNode(path,Class); + if (vtn) { + const ClassNode* cn = static_cast<const ClassNode*>(vtn); + pn = cn->findPropertyNode(dotSplit[1]); + if (pn) { + return pn->isWritable(); + } + } + } + } + } + } + else { + return pn->isWritable(); + } + } + else { + const QList<RelatedClass>& bases = cn->baseClasses(); + if (!bases.isEmpty()) { + for (int i=0; i<bases.size(); ++i) { + const ClassNode* cn = bases[i].node; + pn = cn->findPropertyNode(dotSplit[0]); + if (pn) { + return pn->isWritable(); + } + } + } + const QList<RelatedClass>& ignoredBases = cn->ignoredBaseClasses(); + if (!ignoredBases.isEmpty()) { + for (int i=0; i<ignoredBases.size(); ++i) { + const ClassNode* cn = ignoredBases[i].node; + pn = cn->findPropertyNode(dotSplit[0]); + if (pn) { + return pn->isWritable(); + } + } + } + if (isAttached()) { + QString classNameAttached = cn->name() + "Attached"; + QStringList path(classNameAttached); + const Node* nn = tree->findNode(path,Class); + const ClassNode* acn = static_cast<const ClassNode*>(nn); + pn = acn->findPropertyNode(dotSplit[0]); + if (pn) { + return pn->isWritable(); + } + } + } + } + } + location().warning(tr("Can't determine read-only status of QML property %1; writable assumed.").arg(name())); + return true; +} + #endif QT_END_NAMESPACE diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index 121b818..40b78ef 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -193,6 +193,7 @@ class Node virtual QString fileBase() const; QUuid guid() const; QString ditaXmlHref(); + QString extractClassName(const QString &string) const; protected: Node(Type type, InnerNode* parent, const QString& name); @@ -326,6 +327,8 @@ struct RelatedClass QString dataTypeWithTemplateArgs; }; +class PropertyNode; + class ClassNode : public InnerNode { public: @@ -337,8 +340,9 @@ class ClassNode : public InnerNode const QString &dataTypeWithTemplateArgs = ""); void fixBaseClasses(); - const QList<RelatedClass> &baseClasses() const { return bas; } - const QList<RelatedClass> &derivedClasses() const { return der; } + const QList<RelatedClass> &baseClasses() const { return bases; } + const QList<RelatedClass> &derivedClasses() const { return derived; } + const QList<RelatedClass> &ignoredBaseClasses() const { return ignoredBases; } bool hideFromMainList() const { return hidden; } void setHideFromMainList(bool value) { hidden = value; } @@ -349,10 +353,12 @@ class ClassNode : public InnerNode void setQmlElement(const QString& value) { qmlelement = value; } virtual bool isAbstract() const { return abstract; } virtual void setAbstract(bool b) { abstract = b; } + const PropertyNode* findPropertyNode(const QString& name) const; private: - QList<RelatedClass> bas; - QList<RelatedClass> der; + QList<RelatedClass> bases; + QList<RelatedClass> derived; + QList<RelatedClass> ignoredBases; bool hidden; bool abstract; QString sname; @@ -436,6 +442,8 @@ class QmlPropGroupNode : public FakeNode bool att; }; +class Tree; + class QmlPropertyNode : public LeafNode { public: @@ -454,7 +462,7 @@ class QmlPropertyNode : public LeafNode QString qualifiedDataType() const { return dt; } bool isStored() const { return fromTrool(sto,true); } bool isDesignable() const { return fromTrool(des,false); } - bool isWritable() const { return fromTrool(wri,true); } + bool isWritable(const Tree* tree) const; bool isAttached() const { return att; } virtual bool isQmlNode() const { return true; } diff --git a/tools/qdoc3/test/qt-cpp-ignore.qdocconf b/tools/qdoc3/test/qt-cpp-ignore.qdocconf index 8cc4fd9..4963b96 100644 --- a/tools/qdoc3/test/qt-cpp-ignore.qdocconf +++ b/tools/qdoc3/test/qt-cpp-ignore.qdocconf @@ -91,4 +91,6 @@ Cpp.ignoredirectives = Q_DECLARE_HANDLE \ K_DECLARE_PRIVATE \ PHONON_OBJECT \ PHONON_HEIR \ - Q_PRIVATE_PROPERTY + Q_PRIVATE_PROPERTY \ + Q_DECLARE_PRIVATE_D \ + Q_CLASSINFO diff --git a/tools/qdoc3/tokenizer.cpp b/tools/qdoc3/tokenizer.cpp index 7c10de6..05ad5ee 100644 --- a/tools/qdoc3/tokenizer.cpp +++ b/tools/qdoc3/tokenizer.cpp @@ -67,7 +67,11 @@ static const char *kwords[] = { "private", "protected", "public", "short", "signals", "signed", "slots", "static", "struct", "template", "typedef", "typename", "union", "unsigned", "using", "virtual", "void", "volatile", - "__int64", "Q_OBJECT", "Q_OVERRIDE", "Q_PROPERTY", + "__int64", + "Q_OBJECT", + "Q_OVERRIDE", + "Q_PROPERTY", + "Q_PRIVATE_PROPERTY", "Q_DECLARE_SEQUENTIAL_ITERATOR", "Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR", "Q_DECLARE_ASSOCIATIVE_ITERATOR", diff --git a/tools/qdoc3/tokenizer.h b/tools/qdoc3/tokenizer.h index f55d2ef..bd35965 100644 --- a/tools/qdoc3/tokenizer.h +++ b/tools/qdoc3/tokenizer.h @@ -75,7 +75,7 @@ enum { Tok_Eoi, Tok_Ampersand, Tok_Aster, Tok_Caret, Tok_LeftParen, Tok_static, Tok_struct, Tok_template, Tok_typedef, Tok_typename, Tok_union, Tok_unsigned, Tok_using, Tok_virtual, Tok_void, Tok_volatile, Tok_int64, Tok_Q_OBJECT, Tok_Q_OVERRIDE, - Tok_Q_PROPERTY, Tok_Q_DECLARE_SEQUENTIAL_ITERATOR, + Tok_Q_PROPERTY, Tok_Q_PRIVATE_PROPERTY, Tok_Q_DECLARE_SEQUENTIAL_ITERATOR, Tok_Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR, Tok_Q_DECLARE_ASSOCIATIVE_ITERATOR, Tok_Q_DECLARE_MUTABLE_ASSOCIATIVE_ITERATOR, diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp index d22a09a..56e3484 100644 --- a/tools/qdoc3/tree.cpp +++ b/tools/qdoc3/tree.cpp @@ -469,8 +469,9 @@ void Tree::resolveInheritance(NamespaceNode *rootNode) for (int pass = 0; pass < 2; pass++) { NodeList::ConstIterator c = rootNode->childNodes().begin(); while (c != rootNode->childNodes().end()) { - if ((*c)->type() == Node::Class) + if ((*c)->type() == Node::Class) { resolveInheritance(pass, (ClassNode *) *c); + } else if ((*c)->type() == Node::Namespace) { NamespaceNode *ns = static_cast<NamespaceNode*>(*c); resolveInheritance(ns); @@ -542,14 +543,16 @@ void Tree::resolveInheritance(int pass, ClassNode *classe) while (b != bounds.end()) { ClassNode *baseClass = (ClassNode*)findNode((*b).basePath, Node::Class); - if (!baseClass && (*b).parent) + if (!baseClass && (*b).parent) { baseClass = (ClassNode*)findNode((*b).basePath, Node::Class, (*b).parent); - if (baseClass) + } + if (baseClass) { classe->addBaseClass((*b).access, baseClass, (*b).dataTypeWithTemplateArgs); + } ++b; } } |