diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-07-23 01:28:13 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-07-23 01:28:13 (GMT) |
commit | 18c3446a964791726c4e06f86344d5db0289b554 (patch) | |
tree | 4d405e0917d26d303e25f7bb4f5039f4914b8f79 | |
parent | d32adfd34f5cd2334b4041dfc0c07a5538ccdff7 (diff) | |
parent | 62d1160250274dc355d1998357e606131527db2c (diff) | |
download | Qt-18c3446a964791726c4e06f86344d5db0289b554.zip Qt-18c3446a964791726c4e06f86344d5db0289b554.tar.gz Qt-18c3446a964791726c4e06f86344d5db0289b554.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
64 files changed, 483 insertions, 175 deletions
@@ -733,7 +733,7 @@ CFG_OPENSSL=auto CFG_PTMALLOC=no CFG_STL=auto CFG_PRECOMPILE=auto -CFG_SEPARATE_DEBUG_INFO=auto +CFG_SEPARATE_DEBUG_INFO=no CFG_SEPARATE_DEBUG_INFO_NOCOPY=no CFG_REDUCE_EXPORTS=auto CFG_MMX=auto @@ -2307,7 +2307,7 @@ fi if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ] && [ "$CFG_DEBUG_RELEASE" = "yes" ]; then echo echo "WARNING: -debug-and-release is not supported anymore on Qt/X11 and Qt for Embedded Linux" - echo "By default, Qt is built in release mode with separate debug information, so" + echo "Qt can be built in release mode with separate debug information, so" echo "-debug-and-release is not necessary anymore" echo fi @@ -7080,6 +7080,13 @@ EOF canBuildWebKit="no" canBuildQtConcurrent="no" ;; + symbian/*-gcce) + canBuildWebKit="no" + canBuildQtConcurrent="no" + ;; + symbian/*-armcc) + canBuildQtConcurrent="no" + ;; esac if [ "$CFG_GUI" = "no" ]; then diff --git a/configure.exe b/configure.exe Binary files differindex eea40f9..6dfd14e48 100755 --- a/configure.exe +++ b/configure.exe diff --git a/mkspecs/features/symbian/armcc_warnings.prf b/mkspecs/features/symbian/armcc_warnings.prf index 72bc996..3331bff 100644 --- a/mkspecs/features/symbian/armcc_warnings.prf +++ b/mkspecs/features/symbian/armcc_warnings.prf @@ -1,13 +1,22 @@ +# 68: integer conversion resulted in a change of sign (sounds useful, but it's +# buggy and is reported even in places where it makes no sense) # 111: Statement is unreachable # 185: Dynamic initialization in unreachable code +# 187: use of "=" where "==" may have been intended # 191: Type qualifier is meaningless on cast type # 368: class "<class>" defines no constructor to initialize the following: <member> # (Disabled because there are other ways of assigning besides constructors) +# 830: function "xxx" has no corresponding operator delete (to be called if an +# exception is thrown during initialization of an allocated object) (used a +# lot in 3rd party code) +# 997: function "xxx" is hidden by "yyy" -- virtual function override intended? +# (used all over the place in the Symbian SDK) # 1293: Assignment in condition # 1294: pre-ANSI C style functions declarations (used a lot in 3rd party code) # 2874: <variable> may be used before being set (this one sounds useful, but # it's output also for class instances, making it useless in practice) -QMAKE_CFLAGS.ARMCC += --diag_suppress 111,185,191,368,1293,1294,2874 +QMAKE_CFLAGS.ARMCC += --diag_suppress 68,111,185,187,191,368,830,997,1293,1294,2874 +QMAKE_CXXFLAGS.ARMCC += --diag_suppress 68,111,185,187,191,368,830,997,1293,1294,2874 # 6780: <origvis> visibility removed from symbol '<symname>' through <impexp> QMAKE_LFLAGS.ARMCC += --diag_suppress 6780 diff --git a/mkspecs/features/symbian/symbian_building.prf b/mkspecs/features/symbian/symbian_building.prf index ce124ec..a36193e 100644 --- a/mkspecs/features/symbian/symbian_building.prf +++ b/mkspecs/features/symbian/symbian_building.prf @@ -1,3 +1,11 @@ +linux-armcc { + QMAKE_CFLAGS += $$QMAKE_CFLAGS.ARMCC + QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS.ARMCC +} else:linux-gcce { + QMAKE_CFLAGS += $$QMAKE_CFLAGS.GCCE + QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS.GCCE +} + # We need a target name without the INFIX'ed part, since flags are not infixed. equals(QMAKE_TARGET_PRODUCT, Qt4):clean_TARGET = $$replace(TARGET, "$${QT_LIBINFIX}$", "") else:clean_TARGET = $$TARGET @@ -131,6 +139,7 @@ contains(TEMPLATE, lib):!contains(CONFIG, static):!contains(CONFIG, staticlib) { $$capability \ $$QMAKE_ELF2E32_FLAGS \ $$QMAKE_POST_LINK + silent:QMAKE_POST_LINK = @echo postlinking $@ && $$QMAKE_POST_LINK QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.sym QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.dso QMAKE_CLEAN += $${symbianObjdir}/$${baseTarget}.dso @@ -154,7 +163,7 @@ contains(TEMPLATE, lib):!contains(CONFIG, static):!contains(CONFIG, staticlib) { DEFINES += __DLL__ } -contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@.*") { +contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@:.*") { !isEmpty(QMAKE_POST_LINK) { # No way to honor the '@' :-( QMAKE_POST_LINK = $$replace(QMAKE_POST_LINK, "^@", "") @@ -177,6 +186,7 @@ contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@.*") { $$QMAKE_ELF2E32_FLAGS \ && ln "$${symbianDestdir}/$${baseTarget}.exe" "$${symbianDestdir}/$${baseTarget}" \ $$QMAKE_POST_LINK + silent:QMAKE_POST_LINK = @echo postlinking $@ && $$QMAKE_POST_LINK QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.sym QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.exe QMAKE_CLEAN += $${symbianDestdir}/$${baseTarget} @@ -243,6 +253,7 @@ symbianresources.commands = cpp -nostdinc -undef \ -o$${symbianDestdir}/${QMAKE_FILE_BASE}$${QT_LIBINFIX}.rsc \ -h$${symbian_resources_RCC_DIR}/${QMAKE_FILE_BASE}$${QT_LIBINFIX}.rsg \ -i${QMAKE_FILE_NAME} +silent:symbianresources.commands = @echo rcomp $< && $$symbianresources.commands symbianresources.dependency_type = TYPE_C symbianresources.CONFIG = no_link target_predeps @@ -266,6 +277,7 @@ contains(TEMPLATE, "app"):!contains(CONFIG, "no_icon") { -o$${symbianDestdir}/$${baseResourceTarget}.rsc \ -h$${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg \ -i$${baseResourceTarget}.rss + silent:symbianGenResource.commands = @echo rcomp $${baseResourceTarget}.rss && $$symbianGenResource.commands symbianGenResource.depends = $${baseResourceTarget}.rss PRE_TARGETDEPS += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg @@ -284,6 +296,7 @@ contains(TEMPLATE, "app"):!contains(CONFIG, "no_icon") { -o$${symbianDestdir}/$${baseResourceTarget}_reg.rsc \ -h$${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rsg \ -i$${baseResourceTarget}_reg.rss + silent:symbianGenRegResource.commands = @echo rcomp $${baseResourceTarget}_reg.rss && $$symbianGenRegResource.commands symbianGenRegResource.depends = $${baseResourceTarget}_reg.rss $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg PRE_TARGETDEPS += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rsg QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rsg diff --git a/mkspecs/symbian/linux-armcc/qmake.conf b/mkspecs/symbian/linux-armcc/qmake.conf index 77fb1ea..f8072e3 100644 --- a/mkspecs/symbian/linux-armcc/qmake.conf +++ b/mkspecs/symbian/linux-armcc/qmake.conf @@ -31,8 +31,8 @@ QMAKE_QtWebKit_CXXFLAGS = --arm # Move RW-section base address to start from 0xE00000 instead of the toolchain default 0x400000. QMAKE_QtWebKit_LFLAGS = --rw-base 0xE00000 -QMAKE_CFLAGS += --dllimport_runtime --preinclude rvct2_2.h --diag_suppress 186,654,1300 --thumb --fpu softvfp --cpu 5T --enum_is_int -Ono_known_library --fpmode ieee_no_fenv --no_vfe --apcs /inter $$QMAKE_CFLAGS.ARMCC -QMAKE_CXXFLAGS += $$QMAKE_CFLAGS $$QMAKE_CXXFLAGS.ARMCC +QMAKE_CFLAGS += --dllimport_runtime --preinclude rvct2_2.h --diag_suppress 186,611,654,1300 --thumb --fpu softvfp --cpu 5T --enum_is_int -Ono_known_library --fpmode ieee_no_fenv --no_vfe --apcs /inter +QMAKE_CXXFLAGS += $$QMAKE_CFLAGS QMAKE_LFLAGS += --symver_soname --diag_suppress 6331,6780 --bpabi --reloc --datacompressor=off --split --dll --no_scanlib QMAKE_LFLAGS_APP += --entry _E32Startup QMAKE_LFLAGS_SHLIB += --entry _E32Dll 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 c5c1a47..83f9b20 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -89,7 +89,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. @@ -418,7 +418,7 @@ void QDeclarativeItemKeyFilter::componentComplete() /*! - \qmlclass KeyNavigation + \qmlclass KeyNavigation QDeclarativeKeyNavigationAttached \since 4.7 \brief The KeyNavigation attached property supports key navigation by arrow keys. @@ -712,7 +712,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. @@ -2048,20 +2048,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/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index 3617031..1a223d5 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -2071,17 +2071,16 @@ void QDeclarativePropertyAnimation::setTo(const QVariant &t) QEasingCurve QDeclarativePropertyAnimation::easing() const { Q_D(const QDeclarativePropertyAnimation); - return d->easing; + return d->va->easingCurve(); } void QDeclarativePropertyAnimation::setEasing(const QEasingCurve &e) { Q_D(QDeclarativePropertyAnimation); - if (d->easing == e) + if (d->va->easingCurve() == e) return; - d->easing = e; - d->va->setEasingCurve(d->easing); + d->va->setEasingCurve(e); emit easingChanged(e); } diff --git a/src/declarative/util/qdeclarativeanimation_p_p.h b/src/declarative/util/qdeclarativeanimation_p_p.h index b6d6bbb..e38580c 100644 --- a/src/declarative/util/qdeclarativeanimation_p_p.h +++ b/src/declarative/util/qdeclarativeanimation_p_p.h @@ -311,8 +311,6 @@ public: QVariant from; QVariant to; - QEasingCurve easing; - QObject *target; QString propertyName; QString properties; diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index e5930ac..713e765 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -2343,8 +2343,15 @@ static bool convert_indexed8_to_ARGB_PM_inplace(QImageData *data, Qt::ImageConve data->colortable.resize(256); for (int i = 0; i < 256; ++i) data->colortable[i] = qRgb(i, i, i); + } else { + for (int i = 0; i < data->colortable.size(); ++i) + data->colortable[i] = PREMUL(data->colortable.at(i)); + + // Fill the rest of the table in case src_data > colortable.size() + const int oldSize = data->colortable.size(); + const QRgb lastColor = data->colortable.at(oldSize - 1); + data->colortable.insert(oldSize, 256 - oldSize, lastColor); } - const int tableSize = data->colortable.size() - 1; for (int i = 0; i < data->height; ++i) { src_data -= src_pad; @@ -2352,11 +2359,11 @@ static bool convert_indexed8_to_ARGB_PM_inplace(QImageData *data, Qt::ImageConve for (int pixI = 0; pixI < width; ++pixI) { --src_data; --dest_data; - const uint pixel = data->colortable[qMin<int>(tableSize, *src_data)]; - *dest_data = (quint32) PREMUL(pixel); + *dest_data = data->colortable.at(*src_data); } } + data->colortable = QVector<QRgb>(); data->format = QImage::Format_ARGB32_Premultiplied; data->bytes_per_line = dst_bytes_per_line; data->depth = depth; @@ -2388,8 +2395,12 @@ static bool convert_indexed8_to_RGB_inplace(QImageData *data, Qt::ImageConversio data->colortable.resize(256); for (int i = 0; i < 256; ++i) data->colortable[i] = qRgb(i, i, i); + } else { + // Fill the rest of the table in case src_data > colortable.size() + const int oldSize = data->colortable.size(); + const QRgb lastColor = data->colortable.at(oldSize - 1); + data->colortable.insert(oldSize, 256 - oldSize, lastColor); } - const int tableSize = data->colortable.size() - 1; for (int i = 0; i < data->height; ++i) { src_data -= src_pad; @@ -2397,10 +2408,11 @@ static bool convert_indexed8_to_RGB_inplace(QImageData *data, Qt::ImageConversio for (int pixI = 0; pixI < width; ++pixI) { --src_data; --dest_data; - *dest_data = (quint32) data->colortable[qMin<int>(tableSize, *src_data)]; + *dest_data = (quint32) data->colortable.at(*src_data); } } + data->colortable = QVector<QRgb>(); data->format = QImage::Format_RGB32; data->bytes_per_line = dst_bytes_per_line; data->depth = depth; @@ -2428,12 +2440,23 @@ static bool convert_indexed8_to_RGB16_inplace(QImageData *data, Qt::ImageConvers const int width = data->width; const int src_pad = data->bytes_per_line - width; const int dest_pad = (dst_bytes_per_line >> 1) - width; - if (data->colortable.size() == 0) { - data->colortable.resize(256); + + quint16 colorTableRGB16[256]; + if (data->colortable.isEmpty()) { for (int i = 0; i < 256; ++i) - data->colortable[i] = qRgb(i, i, i); + colorTableRGB16[i] = qt_colorConvert<quint16, quint32>(qRgb(i, i, i), 0); + } else { + // 1) convert the existing colors to RGB16 + const int tableSize = data->colortable.size(); + for (int i = 0; i < tableSize; ++i) + colorTableRGB16[i] = qt_colorConvert<quint16, quint32>(data->colortable.at(i), 0); + data->colortable = QVector<QRgb>(); + + // 2) fill the rest of the table in case src_data > colortable.size() + const quint16 lastColor = colorTableRGB16[tableSize - 1]; + for (int i = tableSize; i < 256; ++i) + colorTableRGB16[i] = lastColor; } - const int tableSize = data->colortable.size() - 1; for (int i = 0; i < data->height; ++i) { src_data -= src_pad; @@ -2441,8 +2464,7 @@ static bool convert_indexed8_to_RGB16_inplace(QImageData *data, Qt::ImageConvers for (int pixI = 0; pixI < width; ++pixI) { --src_data; --dest_data; - const uint pixel = data->colortable[qMin<int>(tableSize, *src_data)]; - *dest_data = qt_colorConvert<quint16, quint32>(pixel, 0); + *dest_data = colorTableRGB16[*src_data]; } } 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/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri index ab8d846..494c64c 100644 --- a/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri +++ b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri @@ -13,6 +13,7 @@ && $$QMAKE_COPY ${QMAKE_FILE_OUT_BASE}.h ${QMAKE_FILE_OUT}.tmp \ && $$QMAKE_DEL_FILE ${QMAKE_FILE_OUT_BASE}.h \ && $$QMAKE_MOVE ${QMAKE_FILE_OUT}.tmp ${QMAKE_FILE_OUT} + silent:symbian_sqlite3_header.commands = @echo unzipping $@ && $$symbian_sqlite3_header.commands QMAKE_EXTRA_COMPILERS += symbian_sqlite3_header # The QMAKE_COPY section is to update timestamp on the file. @@ -24,6 +25,7 @@ && $$QMAKE_COPY ${QMAKE_FILE_OUT_BASE}.dso ${QMAKE_FILE_OUT}.tmp \ && $$QMAKE_DEL_FILE ${QMAKE_FILE_OUT_BASE}.dso \ && $$QMAKE_MOVE ${QMAKE_FILE_OUT}.tmp ${QMAKE_FILE_OUT} + silent:symbian_sqlite3_dso.commands = @echo unzipping $@ && $$symbian_sqlite3_dso.commands QMAKE_EXTRA_COMPILERS += symbian_sqlite3_dso symbian_sqlite3_ver_dso.input = symbian_sqlite3_zip_file diff --git a/src/sql/drivers/sqlite/qsql_sqlite.pri b/src/sql/drivers/sqlite/qsql_sqlite.pri index 3560c64..78a4e49 100644 --- a/src/sql/drivers/sqlite/qsql_sqlite.pri +++ b/src/sql/drivers/sqlite/qsql_sqlite.pri @@ -1,7 +1,7 @@ HEADERS += $$PWD/qsql_sqlite.h SOURCES += $$PWD/qsql_sqlite.cpp -symbian:include(../../plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri) +symbian:include($$QT_SOURCE_TREE/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri) !system-sqlite:!contains(LIBS, .*sqlite3.*) { include($$PWD/../../../3rdparty/sqlite.pri) 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/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp index bb7fc7b..174967b 100644 --- a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp +++ b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp @@ -401,6 +401,7 @@ void tst_qdeclarativebehaviors::sameValue() target->setProperty("x", 0); QTRY_VERIFY(target->x() != qreal(0) && target->x() != qreal(100)); + QTRY_VERIFY(target->x() == qreal(0)); //make sure Behavior has finished. target->setX(100); QCOMPARE(target->x(), qreal(100)); diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp index e5e495e..6e15a4a 100644 --- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp +++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp @@ -802,6 +802,9 @@ void tst_qdeclarativetextinput::echoMode() QDeclarativeView *canvas = createView(SRCDIR "/data/echoMode.qml"); canvas->show(); canvas->setFocus(); + QApplication::setActiveWindow(canvas); + QTest::qWaitForWindowShown(canvas); + QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas)); QVERIFY(canvas->rootObject() != 0); @@ -849,6 +852,7 @@ void tst_qdeclarativetextinput::echoMode() QCOMPARE(input->text(), QLatin1String("a")); QCOMPARE(input->displayText(), QLatin1String("a")); input->setFocus(false); + QVERIFY(input->hasActiveFocus() == false); QCOMPARE(input->displayText(), QLatin1String("Q")); } 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 9977df0..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); @@ -4415,8 +4417,8 @@ void HtmlGenerator::generateExtractionMark(const Node *node, ExtractionMarkType out() << "$$$" + func->name() + func->rawParameters().remove(' '); } } else if (node->type() == Node::Property) { - const PropertyNode *prop = static_cast<const PropertyNode *>(node); out() << "-prop"; + const PropertyNode *prop = static_cast<const PropertyNode *>(node); const NodeList &list = prop->functions(); foreach (const Node *propFuncNode, list) { if (propFuncNode->type() == Node::Function) { @@ -4424,6 +4426,10 @@ void HtmlGenerator::generateExtractionMark(const Node *node, ExtractionMarkType out() << "$$$" + func->name() + func->rawParameters().remove(' '); } } + } else if (node->type() == Node::Enum) { + const EnumNode *enumNode = static_cast<const EnumNode *>(node); + foreach (const EnumItem &item, enumNode->items()) + out() << "$$$" + item.name(); } } else if (markType == BriefMark) { out() << "-brief"; 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; } } |