diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2010-06-15 07:37:43 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2010-06-15 07:37:43 (GMT) |
commit | 6100dd1ccda7fce60625e99ffb2a90dc62cb1486 (patch) | |
tree | 7de5d72c227a163c3d042d8c04b8551176e4460a /src/corelib | |
parent | 7b7f3869b15cee6f6815e10d49dcb8209a415edd (diff) | |
parent | 3a54e5ead647a318641d9a2bcf75eda4b8859d1b (diff) | |
download | Qt-6100dd1ccda7fce60625e99ffb2a90dc62cb1486.zip Qt-6100dd1ccda7fce60625e99ffb2a90dc62cb1486.tar.gz Qt-6100dd1ccda7fce60625e99ffb2a90dc62cb1486.tar.bz2 |
Merge remote branch 'origin/master'
Conflicts:
src/gui/painting/qpainter.cpp
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/global/qconfig-medium.h | 3 | ||||
-rw-r--r-- | src/corelib/global/qconfig-minimal.h | 3 | ||||
-rw-r--r-- | src/corelib/global/qconfig-small.h | 3 | ||||
-rw-r--r-- | src/corelib/global/qfeatures.h | 3 | ||||
-rw-r--r-- | src/corelib/global/qfeatures.txt | 6 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.h | 21 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.qdoc | 19 | ||||
-rw-r--r-- | src/corelib/io/qresource.cpp | 2 | ||||
-rw-r--r-- | src/corelib/kernel/qcoreevent.h | 8 | ||||
-rw-r--r-- | src/corelib/kernel/qeventdispatcher_symbian.cpp | 4 | ||||
-rw-r--r-- | src/corelib/kernel/qeventdispatcher_win.cpp | 4 | ||||
-rw-r--r-- | src/corelib/kernel/qtranslator.cpp | 2 | ||||
-rw-r--r-- | src/corelib/plugin/qlibrary_unix.cpp | 12 | ||||
-rw-r--r-- | src/corelib/tools/qelapsedtimer.cpp | 2 | ||||
-rw-r--r-- | src/corelib/tools/qhash.h | 9 | ||||
-rw-r--r-- | src/corelib/tools/qmap.h | 9 | ||||
-rw-r--r-- | src/corelib/tools/qscopedpointer.h | 24 | ||||
-rw-r--r-- | src/corelib/tools/qstring.cpp | 13 |
18 files changed, 102 insertions, 45 deletions
diff --git a/src/corelib/global/qconfig-medium.h b/src/corelib/global/qconfig-medium.h index ccd6759..6cb6c2c 100644 --- a/src/corelib/global/qconfig-medium.h +++ b/src/corelib/global/qconfig-medium.h @@ -213,6 +213,9 @@ #ifndef QT_NO_UNDOVIEW # define QT_NO_UNDOVIEW #endif +#ifndef QT_NO_GESTURES +# define QT_NO_GESTURES +#endif /* Widgets */ #ifndef QT_NO_LCDNUMBER diff --git a/src/corelib/global/qconfig-minimal.h b/src/corelib/global/qconfig-minimal.h index 99b16e8..c285e99 100644 --- a/src/corelib/global/qconfig-minimal.h +++ b/src/corelib/global/qconfig-minimal.h @@ -447,6 +447,9 @@ #ifndef QT_NO_UNDOVIEW # define QT_NO_UNDOVIEW #endif +#ifndef QT_NO_GESTURES +# define QT_NO_GESTURES +#endif /* Widgets */ #ifndef QT_NO_GROUPBOX diff --git a/src/corelib/global/qconfig-small.h b/src/corelib/global/qconfig-small.h index 1716b8d..dd74dcf 100644 --- a/src/corelib/global/qconfig-small.h +++ b/src/corelib/global/qconfig-small.h @@ -250,6 +250,9 @@ #ifndef QT_NO_SYSTEMTRAYICON # define QT_NO_SYSTEMTRAYICON #endif +#ifndef QT_NO_GESTURES +# define QT_NO_GESTURES +#endif /* Widgets */ #ifndef QT_NO_LCDNUMBER diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h index a333153..b606843 100644 --- a/src/corelib/global/qfeatures.h +++ b/src/corelib/global/qfeatures.h @@ -85,6 +85,9 @@ // Freetype Font Engine //#define QT_NO_FREETYPE +// Gesture +//#define QT_NO_GESTURES + // QGroupBox //#define QT_NO_GROUPBOX diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt index 3e6af24..4d938a9 100644 --- a/src/corelib/global/qfeatures.txt +++ b/src/corelib/global/qfeatures.txt @@ -1185,6 +1185,12 @@ Requires: PROPERTIES Name: State machine SeeAlso: ??? +Feature: GESTURES +Description: Provides a framework for gestures. +Section: Utilities +Requires: +Name: Gesture +SeeAlso: ??? # SVG diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 08674d2..a9c56f6 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -236,7 +236,8 @@ public: TextJustificationForced = 0x10000, TextForceLeftToRight = 0x20000, TextForceRightToLeft = 0x40000, - TextLongestVariant = 0x80000 + TextLongestVariant = 0x80000, + TextBypassShaping = 0x100000 #if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN) ,SingleLine = TextSingleLine, @@ -947,6 +948,8 @@ public: #endif Key_MediaNext = 0x01000083, Key_MediaRecord = 0x01000084, + Key_MediaPause = 0x1000085, + Key_MediaTogglePlayPause = 0x1000086, Key_HomePage = 0x01000090, Key_Favorites = 0x01000091, Key_Search = 0x01000092, @@ -1089,11 +1092,15 @@ public: Key_Context2 = 0x01100001, Key_Context3 = 0x01100002, Key_Context4 = 0x01100003, - Key_Call = 0x01100004, - Key_Hangup = 0x01100005, + Key_Call = 0x01100004, // set absolute state to in a call (do not toggle state) + Key_Hangup = 0x01100005, // set absolute state to hang up (do not toggle state) Key_Flip = 0x01100006, - Key_Camera = 0x01100007, - Key_CameraFocus = 0x01100008, + Key_ToggleCallHangup = 0x01100007, // a toggle key for answering, or hanging up, based on current call state + Key_VoiceDial = 0x01100008, + Key_LastNumberRedial = 0x01100009, + + Key_Camera = 0x01100020, + Key_CameraFocus = 0x01100021, Key_unknown = 0x01ffffff }; @@ -1719,6 +1726,7 @@ public: }; Q_DECLARE_FLAGS(TouchPointStates, TouchPointState) +#ifndef QT_NO_GESTURES enum GestureState { NoGesture, @@ -1748,6 +1756,7 @@ public: IgnoredGesturesPropagateToParent = 0x04 }; Q_DECLARE_FLAGS(GestureFlags, GestureFlag) +#endif // QT_NO_GESTURES enum NavigationMode { @@ -1777,7 +1786,9 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::MatchFlags) Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::TextInteractionFlags) Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::InputMethodHints) Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::TouchPointStates) +#ifndef QT_NO_GESTURES Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::GestureFlags) +#endif typedef bool (*qInternalCallback)(void **); diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index f71ba9d..7eae3a5 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -1317,7 +1317,7 @@ \value Key_Enter Typically located on the keypad. \value Key_Insert \value Key_Delete - \value Key_Pause + \value Key_Pause The Pause/Break key (\note Not anything to do with pausing media) \value Key_Print \value Key_SysReq \value Key_Clear @@ -1615,12 +1615,14 @@ \value Key_BassDown \value Key_TrebleUp \value Key_TrebleDown - \value Key_MediaPlay - \value Key_MediaStop + \value Key_MediaPlay A key setting the state of the media player to play + \value Key_MediaStop A key setting the state of the media player to stop \value Key_MediaPrevious \omitvalue Key_MediaPrev \value Key_MediaNext \value Key_MediaRecord + \value Key_MediaPause A key setting the state of the media player to pause (\note not the pause/break key) + \value Key_MediaTogglePlayPause A key to toggle the play/pause state in the media player (rather than setting an absolute state) \value Key_HomePage \value Key_Favorites \value Key_Search @@ -1741,18 +1743,21 @@ \value Key_MediaLast \value Key_unknown - \value Key_Call - \value Key_Camera - \value Key_CameraFocus + \value Key_Call A key to answer or initiate a call (\see Key_ToggleCallHangup for a key to toggle current call state) + \value Key_Camera A key to activate the camera shutter + \value Key_CameraFocus A key to focus the camera \value Key_Context1 \value Key_Context2 \value Key_Context3 \value Key_Context4 \value Key_Flip - \value Key_Hangup + \value Key_Hangup A key to end an ongoing call (\see Key_ToggleCallHangup for a key to toggle current call state) \value Key_No \value Key_Select \value Key_Yes + \value Key_ToggleCallHangup A key to toggle the current call state (ie. either answer, or hangup) depending on current call state + \value Key_VoiceDial + \value Key_LastNumberRedial \value Key_Execute \value Key_Printer diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp index 8e76e9e..ce9c57e 100644 --- a/src/corelib/io/qresource.cpp +++ b/src/corelib/io/qresource.cpp @@ -928,7 +928,7 @@ public: } }; -#if defined(Q_OS_UNIX) +#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) #define QT_USE_MMAP #endif diff --git a/src/corelib/kernel/qcoreevent.h b/src/corelib/kernel/qcoreevent.h index a20d171..9d3513a 100644 --- a/src/corelib/kernel/qcoreevent.h +++ b/src/corelib/kernel/qcoreevent.h @@ -275,17 +275,19 @@ public: TouchUpdate = 195, TouchEnd = 196, +#ifndef QT_NO_GESTURES NativeGesture = 197, // Internal for platform gesture support - +#endif RequestSoftwareInputPanel = 199, CloseSoftwareInputPanel = 200, UpdateSoftKeys = 201, // Internal for compressing soft key updates WinIdChange = 203, +#ifndef QT_NO_GESTURES Gesture = 198, GestureOverride = 202, - +#endif // 512 reserved for Qt Jambi's MetaCall event // 513 reserved for Qt Jambi's DeleteOnMainThread event @@ -327,7 +329,9 @@ private: friend class QGraphicsView; friend class QGraphicsViewPrivate; friend class QGraphicsScenePrivate; +#ifndef QT_NO_GESTURES friend class QGestureManager; +#endif }; class Q_CORE_EXPORT QTimerEvent : public QEvent diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp index 1cb8455..9d8ee5a 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian.cpp +++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp @@ -484,9 +484,9 @@ void QSelectThread::run() } // end for // traversed all, so update + updateActivatedNotifiers(QSocketNotifier::Exception, &exceptionfds); updateActivatedNotifiers(QSocketNotifier::Read, &readfds); updateActivatedNotifiers(QSocketNotifier::Write, &writefds); - updateActivatedNotifiers(QSocketNotifier::Exception, &exceptionfds); break; case EINTR: // Should never occur on Symbian, but this is future proof! @@ -496,9 +496,9 @@ void QSelectThread::run() break; } } else { + updateActivatedNotifiers(QSocketNotifier::Exception, &exceptionfds); updateActivatedNotifiers(QSocketNotifier::Read, &readfds); updateActivatedNotifiers(QSocketNotifier::Write, &writefds); - updateActivatedNotifiers(QSocketNotifier::Exception, &exceptionfds); } m_waitCond.wait(&m_mutex); diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp index 135ec303..cede810 100644 --- a/src/corelib/kernel/qeventdispatcher_win.cpp +++ b/src/corelib/kernel/qeventdispatcher_win.cpp @@ -71,10 +71,12 @@ extern uint qGlobalPostedEventsCount(); #ifndef WM_TOUCH # define WM_TOUCH 0x0240 #endif +#ifndef QT_NO_GESTURES #ifndef WM_GESTURE # define WM_GESTURE 0x0119 # define WM_GESTURENOTIFY 0x011A #endif +#endif // QT_NO_GESTURES enum { WM_QT_SOCKETNOTIFIER = WM_USER, @@ -738,8 +740,10 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags) || msg.message == WM_MOUSEWHEEL || msg.message == WM_MOUSEHWHEEL || msg.message == WM_TOUCH +#ifndef QT_NO_GESTURES || msg.message == WM_GESTURE || msg.message == WM_GESTURENOTIFY +#endif || msg.message == WM_CLOSE)) { // queue user input events for later processing haveMessage = false; diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp index ca54c6c..1321b14 100644 --- a/src/corelib/kernel/qtranslator.cpp +++ b/src/corelib/kernel/qtranslator.cpp @@ -56,7 +56,7 @@ #include "qhash.h" #include "qtranslator_p.h" -#if defined(Q_OS_UNIX) +#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) #define QT_USE_MMAP #include "private/qcore_unix_p.h" #endif diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp index e8f0eae..9ad1c01 100644 --- a/src/corelib/plugin/qlibrary_unix.cpp +++ b/src/corelib/plugin/qlibrary_unix.cpp @@ -223,11 +223,15 @@ bool QLibraryPrivate::load_sys() #ifdef Q_OS_MAC if (!pHnd) { - if (CFBundleRef bundle = CFBundleGetBundleWithIdentifier(QCFString(fileName))) { + QByteArray utf8Bundle = fileName.toUtf8(); + QCFType<CFURLRef> bundleUrl = CFURLCreateFromFileSystemRepresentation(NULL, reinterpret_cast<const UInt8*>(utf8Bundle.data()), utf8Bundle.length(), true); + QCFType<CFBundleRef> bundle = CFBundleCreate(NULL, bundleUrl); + if(bundle) { QCFType<CFURLRef> url = CFBundleCopyExecutableURL(bundle); - QCFString str = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle); - pHnd = dlopen(QFile::encodeName(str), dlFlags); - attempt = str; + char executableFile[FILENAME_MAX]; + CFURLGetFileSystemRepresentation(url, true, reinterpret_cast<UInt8*>(executableFile), FILENAME_MAX); + attempt = QString::fromUtf8(executableFile); + pHnd = dlopen(QFile::encodeName(attempt), dlFlags); } } #endif diff --git a/src/corelib/tools/qelapsedtimer.cpp b/src/corelib/tools/qelapsedtimer.cpp index 28dfc23..cb5e701 100644 --- a/src/corelib/tools/qelapsedtimer.cpp +++ b/src/corelib/tools/qelapsedtimer.cpp @@ -137,7 +137,7 @@ QT_BEGIN_NAMESPACE used. \value SystemTime The human-readable system time. This clock is not monotonic. - \value MonotonicClock The system's monotonic clock, usually found in Unix systems. This clock is not monotonic and does not overflow. + \value MonotonicClock The system's monotonic clock, usually found in Unix systems. This clock is monotonic and does not overflow. \value TickCounter The system's tick counter, used on Windows and Symbian systems. This clock may overflow. \value MachAbsoluteTime The Mach kernel's absolute time (Mac OS X). This clock is monotonic and does not overflow. diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index 3374c80..0777f06 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -931,7 +931,7 @@ public: { return QHash<Key, T>::insertMulti(key, value); } inline QMultiHash &operator+=(const QMultiHash &other) - { unite(other); return *this; } + { this->unite(other); return *this; } inline QMultiHash operator+(const QMultiHash &other) const { QMultiHash result = *this; result += other; return result; } @@ -1006,12 +1006,7 @@ Q_INLINE_TEMPLATE int QMultiHash<Key, T>::remove(const Key &key, const T &value) typename QHash<Key, T>::iterator end(QHash<Key, T>::end()); while (i != end && i.key() == key) { if (i.value() == value) { -#if defined(Q_CC_RVCT) - // RVCT has problems with scoping, apparently. - i = QHash<Key, T>::erase(i); -#else - i = erase(i); -#endif + i = this->erase(i); ++n; } else { ++i; diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h index 5696ba6..e4b73a1 100644 --- a/src/corelib/tools/qmap.h +++ b/src/corelib/tools/qmap.h @@ -977,7 +977,7 @@ public: { return QMap<Key, T>::insertMulti(key, value); } inline QMultiMap &operator+=(const QMultiMap &other) - { unite(other); return *this; } + { this->unite(other); return *this; } inline QMultiMap operator+(const QMultiMap &other) const { QMultiMap result = *this; result += other; return result; } @@ -1052,12 +1052,7 @@ Q_INLINE_TEMPLATE int QMultiMap<Key, T>::remove(const Key &key, const T &value) typename QMap<Key, T>::iterator end(QMap<Key, T>::end()); while (i != end && !qMapLessThanKey<Key>(key, i.key())) { if (i.value() == value) { -#if defined(Q_CC_RVCT) - // RVCT has problems with scoping, apparently. - i = QMap<Key, T>::erase(i); -#else - i = erase(i); -#endif + i = this->erase(i); ++n; } else { ++i; diff --git a/src/corelib/tools/qscopedpointer.h b/src/corelib/tools/qscopedpointer.h index bc76a3b..e972d71 100644 --- a/src/corelib/tools/qscopedpointer.h +++ b/src/corelib/tools/qscopedpointer.h @@ -54,7 +54,7 @@ struct QScopedPointerDeleter static inline void cleanup(T *pointer) { // Enforce a complete type. - // If you get a compile error here, read the secion on forward declared + // If you get a compile error here, read the section on forward declared // classes in the QScopedPointer documentation. typedef char IsIncompleteType[ sizeof(T) ? 1 : -1 ]; (void) sizeof(IsIncompleteType); @@ -69,7 +69,7 @@ struct QScopedPointerArrayDeleter static inline void cleanup(T *pointer) { // Enforce a complete type. - // If you get a compile error here, read the secion on forward declared + // If you get a compile error here, read the section on forward declared // classes in the QScopedPointer documentation. typedef char IsIncompleteType[ sizeof(T) ? 1 : -1 ]; (void) sizeof(IsIncompleteType); @@ -186,11 +186,18 @@ template <class T, class Cleanup> Q_INLINE_TEMPLATE void qSwap(QScopedPointer<T, Cleanup> &p1, QScopedPointer<T, Cleanup> &p2) { p1.swap(p2); } +namespace QtPrivate { + template <typename X, typename Y> struct QScopedArrayEnsureSameType; + template <typename X> struct QScopedArrayEnsureSameType<X,X> { typedef X* Type; }; + template <typename X> struct QScopedArrayEnsureSameType<const X, X> { typedef X* Type; }; +} + template <typename T, typename Cleanup = QScopedPointerArrayDeleter<T> > class QScopedArrayPointer : public QScopedPointer<T, Cleanup> { public: - explicit inline QScopedArrayPointer(T *p = 0) + template <typename D> + explicit inline QScopedArrayPointer(D *p = 0, typename QtPrivate::QScopedArrayEnsureSameType<T,D>::Type = 0) : QScopedPointer<T, Cleanup>(p) { } @@ -206,6 +213,17 @@ public: } private: + explicit inline QScopedArrayPointer(void *p) { + // Enforce the same type. + + // If you get a compile error here, make sure you declare + // QScopedArrayPointer with the same template type as you pass to the + // constructor. See also the QScopedPointer documentation. + + // Storing a scalar array as a pointer to a different type is not + // allowed and results in undefined behavior. + } + Q_DISABLE_COPY(QScopedArrayPointer) }; diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index e1167fa..c8d641a 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -129,7 +129,7 @@ static inline bool qt_ends_with(const QChar *haystack, int haystackLen, static int ucstricmp(const ushort *a, const ushort *ae, const ushort *b, const ushort *be) { if (a == b) - return 0; + return (ae - be); if (a == 0) return 1; if (b == 0) @@ -141,7 +141,7 @@ static int ucstricmp(const ushort *a, const ushort *ae, const ushort *b, const u uint alast = 0; uint blast = 0; - while (a != e) { + while (a < e) { // qDebug() << hex << alast << blast; // qDebug() << hex << "*a=" << *a << "alast=" << alast << "folded=" << foldCase (*a, alast); // qDebug() << hex << "*b=" << *b << "blast=" << blast << "folded=" << foldCase (*b, blast); @@ -170,7 +170,7 @@ static int ucstricmp(const ushort *a, const ushort *ae, const uchar *b) if (b == 0) return -1; - while (a != ae && *b) { + while (a < ae && *b) { int diff = foldCase(*a) - foldCase(*b); if ((diff)) return diff; @@ -4665,9 +4665,12 @@ int QString::compare_helper(const QChar *data1, int length1, QLatin1String s2, return length1; if (cs == Qt::CaseSensitive) { - while (uc != e && *c && *uc == *c) + while (uc < e && *c && *uc == *c) uc++, c++; + if (uc == e) + return -*c; + return *uc - *c; } else { return ucstricmp(uc, e, c); @@ -7118,7 +7121,7 @@ QString QString::fromRawData(const QChar *unicode, int size) */ QString &QString::setRawData(const QChar *unicode, int size) { - if (d->ref != 1 || d->alloc) { + if (d->ref != 1 || (d->data == d->array && d->alloc)) { *this = fromRawData(unicode, size); } else { #ifdef QT3_SUPPORT |