summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2009-09-17 07:19:14 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2009-09-17 07:19:14 (GMT)
commit8be000bc99de86e0aed57bfb50036eaa695308e9 (patch)
tree9548b7a179beb2974d352720dab53727404caf91 /src/corelib
parentebd0823fa2e8b1a19bff32a39c4051ba8535d501 (diff)
parentdfcf988a3f0c88f96e202482e5d363d880b9d6d2 (diff)
downloadQt-8be000bc99de86e0aed57bfb50036eaa695308e9.zip
Qt-8be000bc99de86e0aed57bfb50036eaa695308e9.tar.gz
Qt-8be000bc99de86e0aed57bfb50036eaa695308e9.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qfeatures.h10
-rw-r--r--src/corelib/global/qglobal.cpp2
-rw-r--r--src/corelib/global/qglobal.h5
-rw-r--r--src/corelib/global/qnamespace.h8
-rw-r--r--src/corelib/global/qnamespace.qdoc26
-rw-r--r--src/corelib/io/qfile.cpp2
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian.cpp33
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian_p.h2
-rw-r--r--src/corelib/kernel/qobject.cpp18
-rw-r--r--src/corelib/kernel/qobject_p.h18
-rw-r--r--src/corelib/kernel/qobjectdefs.h10
-rw-r--r--src/corelib/tools/qhash.h1
-rw-r--r--src/corelib/tools/qmap.h1
-rw-r--r--src/corelib/tools/qmargins.cpp1
14 files changed, 103 insertions, 34 deletions
diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h
index d925f40..29f46f6 100644
--- a/src/corelib/global/qfeatures.h
+++ b/src/corelib/global/qfeatures.h
@@ -446,6 +446,11 @@
#define QT_NO_SPLITTER
#endif
+// State machine
+#if !defined(QT_NO_STATEMACHINE) && (defined(QT_NO_PROPERTIES))
+#define QT_NO_STATEMACHINE
+#endif
+
// QCDEStyle
#if !defined(QT_NO_STYLE_CDE) && (defined(QT_NO_STYLE_MOTIF))
#define QT_NO_STYLE_CDE
@@ -616,11 +621,6 @@
#define QT_NO_QWS_SOUNDSERVER
#endif
-// QtScript
-#if !defined(QT_NO_SCRIPT) && (defined(QT_NO_TEXTDATE) || defined(QT_NO_DATESTRING) || defined(QT_NO_PROPERTIES))
-#define QT_NO_SCRIPT
-#endif
-
// QSvgGenerator
#if !defined(QT_NO_SVGGENERATOR) && (defined(QT_NO_SVG))
#define QT_NO_SVGGENERATOR
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 9909b7b..1d29b3b 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -2065,7 +2065,7 @@ QString qt_error_string(int errorCode)
NULL,
errorCode,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- string,
+ (LPWSTR)&string,
0,
NULL);
ret = QString::fromWCharArray(string);
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index d98421c..f93e613 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -2386,6 +2386,11 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf();
#if defined(Q_OS_SYMBIAN)
+#ifdef SYMBIAN_GRAPHICS_USE_GCE
+//RWsPointerCursor is fixed, so don't use low performance sprites
+#define Q_SYMBIAN_FIXED_POINTER_CURSORS
+#endif
+
//Symbian does not support data imports from a DLL
#define Q_NO_DATA_RELOCATION
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index c8e30d4..c39e602 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -1618,6 +1618,14 @@ public:
GestureFinished = 3
};
+ enum NavigationMode
+ {
+ NavigationModeNone,
+ NavigationModeKeypadTabOrder,
+ NavigationModeKeypadDirectional,
+ NavigationModeCursorAuto,
+ NavigationModeCursorForceVisible
+ };
}
#ifdef Q_MOC_RUN
;
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 52fed47..fafbec5 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -2781,3 +2781,29 @@
\sa QGesture
*/
+
+/*!
+ \enum Qt::NavigationMode
+ \since 4.6
+
+ This enum type describes the mode for moving focus.
+
+ \value NavigationModeNone Only the touch screen is used.
+ \value NavigationModeKeypadTabOrder Qt::Key_Up and Qt::Key_Down are used to change focus.
+ \value NavigationModeKeypadDirectional Qt::Key_Up, Qt::Key_Down, Qt::Key_Left and Qt::Key_Right are used to change focus.
+ \value NavigationModeCursorAuto The mouse cursor is used to change focus,
+ it is displayed only on non touchscreen devices.
+ The keypad is used to implement a virtual cursor, unless
+ the device has an analog mouse type of input device (e.g. touchpad).
+ This is the recommended setting for an application such as a web browser that
+ needs pointer control on both touch and non-touch devices.
+ \value NavigationModeCursorForceVisible The mouse cursor is used to change focus,
+ it is displayed regardless of device type.
+ The keypad is used to implement a virtual cursor, unless
+ the device has an analog mouse type of input device (e.g. touchpad)
+
+ \note: in 4.6, cursor navigation is only implemented for Symbian OS.
+ On other platforms, it behaves as NavigationModeNone.
+ \sa QApplication::setNavigationMode()
+ \sa QApplication::navigationMode()
+*/
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index c52a665..134c4b8 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -1370,7 +1370,7 @@ QFile::flush()
}
/*!
- Flushes the file and then closes it.
+ Calls QFile::flush() and closes the file. Errors from flush are ignored.
\sa QIODevice::close()
*/
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
index b1c8734..11a0da6 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian.cpp
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -231,15 +231,39 @@ void QTimerActiveObject::RunL()
}
}
+#define MAX_SYMBIAN_TIMEOUT_MS 2000000
+void QTimerActiveObject::StartTimer()
+{
+ if (m_timerInfo->msLeft > MAX_SYMBIAN_TIMEOUT_MS) {
+ //There is loss of accuracy anyway due to needing to restart the timer every 33 minutes,
+ //so the 1/64s res of After() is acceptable for these very long timers.
+ m_rTimer.After(iStatus, MAX_SYMBIAN_TIMEOUT_MS * 1000);
+ m_timerInfo->msLeft -= MAX_SYMBIAN_TIMEOUT_MS;
+ } else {
+ //HighRes gives the 1ms accuracy expected by Qt, the +1 is to ensure that
+ //"Timers will never time out earlier than the specified timeout value"
+ //condition is always met.
+ m_rTimer.HighRes(iStatus, (m_timerInfo->msLeft + 1) * 1000);
+ m_timerInfo->msLeft = 0;
+ }
+ SetActive();
+}
+
void QTimerActiveObject::Run()
{
+ //restart timer immediately, if the timeout has been split because it overflows max for platform.
+ if (m_timerInfo->msLeft > 0) {
+ StartTimer();
+ return;
+ }
+
if (!okToRun())
return;
if (m_timerInfo->interval > 0) {
// Start a new timer immediately so that we don't lose time.
- SetActive();
- m_rTimer.After(iStatus, m_timerInfo->interval*1000);
+ m_timerInfo->msLeft = m_timerInfo->interval;
+ StartTimer();
m_timerInfo->dispatcher->timerFired(m_timerInfo->timerId);
} else {
@@ -261,11 +285,10 @@ void QTimerActiveObject::Run()
void QTimerActiveObject::Start()
{
CActiveScheduler::Add(this);
+ m_timerInfo->msLeft = m_timerInfo->interval;
if (m_timerInfo->interval > 0) {
m_rTimer.CreateLocal();
- iStatus = KRequestPending;
- SetActive();
- m_rTimer.After(iStatus, m_timerInfo->interval*1000);
+ StartTimer();
} else {
iStatus = KRequestPending;
SetActive();
diff --git a/src/corelib/kernel/qeventdispatcher_symbian_p.h b/src/corelib/kernel/qeventdispatcher_symbian_p.h
index 53f92a9..fd0350d 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian_p.h
+++ b/src/corelib/kernel/qeventdispatcher_symbian_p.h
@@ -117,6 +117,7 @@ struct SymbianTimerInfo : public QSharedData
int timerId;
int interval;
+ int msLeft;
bool inTimerEvent;
QObject *receiver;
QTimerActiveObject *timerAO;
@@ -140,6 +141,7 @@ protected:
private:
void Run();
+ void StartTimer();
private:
SymbianTimerInfo *m_timerInfo;
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index b4e3959..a8120cf 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -129,7 +129,7 @@ QObjectData::~QObjectData() {}
QDeclarativeData::~QDeclarativeData() {}
QObjectPrivate::QObjectPrivate(int version)
- : threadData(0), connectionLists(0), senders(0), currentSender(0), currentChildBeingDeleted(0), declarativeData(0), objectGuards(0)
+ : threadData(0), connectionLists(0), senders(0), currentSender(0), currentChildBeingDeleted(0)
{
if (version != QObjectPrivateVersion)
qFatal("Cannot mix incompatible Qt libraries");
@@ -496,18 +496,14 @@ void QMetaObject::changeGuard(QObject **ptr, QObject *o)
void QObjectPrivate::clearGuards(QObject *object)
{
QObjectPrivate *priv = QObjectPrivate::get(object);
- QGuard<QObject> *guard = priv->objectGuards;
+ QGuard<QObject> *guard = priv->extraData ? priv->extraData->objectGuards : 0;
while (guard) {
- guard->o = 0;
+ QGuard<QObject> *g = guard;
guard = guard->next;
- }
- while (priv->objectGuards) {
- guard = priv->objectGuards;
- guard->prev = 0;
- if (guard->next) guard->next->prev = &priv->objectGuards;
- priv->objectGuards = guard->next;
- guard->next = 0;
- guard->objectDestroyed(object);
+ g->o = 0;
+ g->prev = 0;
+ g->next = 0;
+ g->objectDestroyed(object);
}
if (!priv->hasGuards)
diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h
index e7d824b..f087407 100644
--- a/src/corelib/kernel/qobject_p.h
+++ b/src/corelib/kernel/qobject_p.h
@@ -99,11 +99,13 @@ class Q_CORE_EXPORT QObjectPrivate : public QObjectData
public:
struct ExtraData
{
+ ExtraData() : objectGuards(0) {}
#ifndef QT_NO_USERDATA
QVector<QObjectUserData *> userData;
#endif
QList<QByteArray> propertyNames;
QList<QVariant> propertyValues;
+ QGuard<QObject> *objectGuards; //linked list handle of QGuards
};
struct Connection
@@ -192,12 +194,13 @@ public:
#endif
QList<QPointer<QObject> > eventFilters;
- QObject *currentChildBeingDeleted;
+ union {
+ QObject *currentChildBeingDeleted;
+ QDeclarativeData *declarativeData; //extra data used by the DeclarativeUI project.
+ };
// these objects are all used to indicate that a QObject was deleted
// plus QPointer, which keeps a separate list
- QDeclarativeData *declarativeData;
- QGuard<QObject> *objectGuards;
QAtomicPointer<QtSharedPointer::ExternalRefCountData> sharedRefcount;
int *deleteWatch;
};
@@ -211,9 +214,12 @@ inline void q_guard_addGuard(QGuard<QObject> *g)
return;
}
- g->next = p->objectGuards;
- p->objectGuards = g;
- g->prev = &p->objectGuards;
+ if (!p->extraData)
+ p->extraData = new QObjectPrivate::ExtraData;
+
+ g->next = p->extraData->objectGuards;
+ p->extraData->objectGuards = g;
+ g->prev = &p->extraData->objectGuards;
if (g->next)
g->next->prev = &g->next;
}
diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
index 63502cc..6a9cead 100644
--- a/src/corelib/kernel/qobjectdefs.h
+++ b/src/corelib/kernel/qobjectdefs.h
@@ -145,12 +145,18 @@ template <typename T1, typename T2>
inline void qYouForgotTheQ_OBJECT_Macro(T1, T2) {}
#endif // QT_NO_MEMBER_TEMPLATES
+#ifdef Q_NO_DATA_RELOCATION
+#define Q_OBJECT_GETSTATICMETAOBJECT static const QMetaObject &getStaticMetaObject();
+#else
+#define Q_OBJECT_GETSTATICMETAOBJECT
+#endif
+
/* tmake ignore Q_OBJECT */
#define Q_OBJECT \
public: \
Q_OBJECT_CHECK \
static const QMetaObject staticMetaObject; \
- static const QMetaObject &getStaticMetaObject(); \
+ Q_OBJECT_GETSTATICMETAOBJECT \
virtual const QMetaObject *metaObject() const; \
virtual void *qt_metacast(const char *); \
QT_TR_FUNCTIONS \
@@ -162,7 +168,7 @@ private:
#define Q_GADGET \
public: \
static const QMetaObject staticMetaObject; \
- static const QMetaObject &getStaticMetaObject(); \
+ Q_OBJECT_GETSTATICMETAOBJECT \
private:
#else // Q_MOC_RUN
#define slots slots
diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h
index 06f6688..b65f1d3 100644
--- a/src/corelib/tools/qhash.h
+++ b/src/corelib/tools/qhash.h
@@ -52,7 +52,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-#undef QT_QHASH_DEBUG
QT_MODULE(Core)
class QBitArray;
diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h
index 18d1f5c..c1be49a 100644
--- a/src/corelib/tools/qmap.h
+++ b/src/corelib/tools/qmap.h
@@ -51,7 +51,6 @@
#endif
#include <new>
-#undef QT_MAP_DEBUG
QT_BEGIN_HEADER
diff --git a/src/corelib/tools/qmargins.cpp b/src/corelib/tools/qmargins.cpp
index f5441a3..b5e5ebd 100644
--- a/src/corelib/tools/qmargins.cpp
+++ b/src/corelib/tools/qmargins.cpp
@@ -58,7 +58,6 @@ QT_BEGIN_NAMESPACE
The isNull() function returns true only if all margins are set to zero.
QMargin objects can be streamed as well as compared.
-
*/