summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qconfig-medium.h3
-rw-r--r--src/corelib/global/qconfig-minimal.h3
-rw-r--r--src/corelib/global/qconfig-small.h3
-rw-r--r--src/corelib/global/qfeatures.h3
-rw-r--r--src/corelib/global/qfeatures.txt6
-rw-r--r--src/corelib/global/qnamespace.h24
-rw-r--r--src/corelib/global/qnamespace.qdoc31
-rw-r--r--src/corelib/io/qresource.cpp2
-rw-r--r--src/corelib/kernel/qabstractitemmodel.cpp92
-rw-r--r--src/corelib/kernel/qcoreevent.h8
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian.cpp4
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp4
-rw-r--r--src/corelib/kernel/qeventloop.cpp4
-rw-r--r--src/corelib/kernel/qmetatype.cpp2
-rw-r--r--src/corelib/kernel/qtranslator.cpp2
-rw-r--r--src/corelib/tools/qelapsedtimer.cpp2
-rw-r--r--src/corelib/tools/qhash.h9
-rw-r--r--src/corelib/tools/qlocale.cpp19
-rw-r--r--src/corelib/tools/qlocale.h2
-rw-r--r--src/corelib/tools/qmap.h9
-rw-r--r--src/corelib/tools/qstring.cpp33
-rw-r--r--src/corelib/tools/qstring.h2
-rw-r--r--src/corelib/tools/qvarlengtharray.h7
-rw-r--r--src/corelib/tools/qvarlengtharray.qdoc49
24 files changed, 230 insertions, 93 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..a12e121 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
};
@@ -1554,7 +1561,8 @@ public:
enum LayoutDirection {
LeftToRight,
- RightToLeft
+ RightToLeft,
+ LayoutDirectionAuto
};
enum AnchorPoint {
@@ -1719,6 +1727,7 @@ public:
};
Q_DECLARE_FLAGS(TouchPointStates, TouchPointState)
+#ifndef QT_NO_GESTURES
enum GestureState
{
NoGesture,
@@ -1748,6 +1757,7 @@ public:
IgnoredGesturesPropagateToParent = 0x04
};
Q_DECLARE_FLAGS(GestureFlags, GestureFlag)
+#endif // QT_NO_GESTURES
enum NavigationMode
{
@@ -1777,7 +1787,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..abbc03e 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
@@ -2567,15 +2572,23 @@
/*!
\enum Qt::LayoutDirection
- Specifies the direction of Qt's layouts:
+ Specifies the direction of Qt's layouts and text handling.
\value LeftToRight Left-to-right layout.
\value RightToLeft Right-to-left layout.
+ \value LayoutDirectionAuto Automatic layout.
Right-to-left layouts are necessary for certain languages,
notably Arabic and Hebrew.
- \sa QApplication::setLayoutDirection(), QWidget::setLayoutDirection()
+ LayoutDirectionAuto serves two purposes. When used in conjunction with widgets and layouts, it
+ will imply to use the layout direction set on the parent widget or QApplication. This
+ has the same effect as QWidget::unsetLayoutDirection().
+
+ When LayoutDirectoinAuto is used in conjunction with text layouting, it will imply that the text
+ directionality is determined from the content of the string to be layouted.
+
+ \sa QApplication::setLayoutDirection(), QWidget::setLayoutDirection(), QTextOption::setTextDirection(), QString::isRightToLeft()
*/
/*!
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/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp
index 24c26b6..b0e2f48 100644
--- a/src/corelib/kernel/qabstractitemmodel.cpp
+++ b/src/corelib/kernel/qabstractitemmodel.cpp
@@ -2508,29 +2508,35 @@ bool QAbstractItemModelPrivate::allowMove(const QModelIndex &srcParent, int star
When reimplementing a subclass, this method simplifies moving
entities in your model. This method is responsible for moving
persistent indexes in the model, which you would otherwise be
- required to do yourself.
-
- Using beginMoveRows and endMoveRows is an alternative to emitting
- layoutAboutToBeChanged and layoutChanged directly along with
- changePersistentIndexes. layoutAboutToBeChanged is emitted by
- this method for compatibility reasons.
+ required to do yourself. Using beginMoveRows and endMoveRows
+ is an alternative to emitting layoutAboutToBeChanged and
+ layoutChanged directly along with changePersistentIndexes.
+ layoutAboutToBeChanged is emitted by this method for compatibility
+ reasons.
The \a sourceParent index corresponds to the parent from which the
- rows are moved; \a sourceFirst and \a sourceLast are the row
- numbers of the rows to be moved. The \a destinationParent index
- corresponds to the parent into which the rows are moved. The \a
+ rows are moved; \a sourceFirst and \a sourceLast are the first and last
+ row numbers of the rows to be moved. The \a destinationParent index
+ corresponds to the parent into which those rows are moved. The \a
destinationChild is the row to which the rows will be moved. That
is, the index at row \a sourceFirst in \a sourceParent will become
- row \a destinationChild in \a destinationParent. Its siblings will
- be moved correspondingly.
-
- Note that \a sourceParent and \a destinationParent may be the
- same, in which case you must ensure that the \a destinationChild is
- not within the range of \a sourceFirst and \a sourceLast. You
- must also ensure that you do not attempt to move a row to one of
- its own children or ancestors. This method returns false if either
- condition is true, in which case you should abort your move
- operation.
+ row \a destinationChild in \a destinationParent, followed by all other
+ rows up to \a sourceLast.
+
+ However, when moving rows down in the same parent (\a sourceParent
+ and \a destinationParent are equal), the rows will be placed before the
+ \a destinationChild index. That is, if you wish to move rows 0 and 1 so
+ they will become rows 1 and 2, \a destinationChild should be 3. In this
+ case, the new index for the source row \c i (which is between
+ \a sourceFirst and \a sourceLast) is equal to
+ \c {(destinationChild-sourceLast-1+i)}.
+
+ Note that if \a sourceParent and \a destinationParent are the same,
+ you must ensure that the \a destinationChild is not within the range
+ of \a sourceFirst and \a sourceLast + 1. You must also ensure that you
+ do not attempt to move a row to one of its own children or ancestors.
+ This method returns false if either condition is true, in which case you
+ should abort your move operation.
\table 80%
\row
@@ -2761,29 +2767,35 @@ void QAbstractItemModel::endRemoveColumns()
When reimplementing a subclass, this method simplifies moving
entities in your model. This method is responsible for moving
persistent indexes in the model, which you would otherwise be
- required to do yourself.
-
- Using beginMoveColumns and endMoveColumns is an alternative to
- emitting layoutAboutToBeChanged and layoutChanged directly along
- with changePersistentIndexes. layoutAboutToBeChanged is emitted
- by this method for compatibility reasons.
+ required to do yourself. Using beginMoveRows and endMoveRows
+ is an alternative to emitting layoutAboutToBeChanged and
+ layoutChanged directly along with changePersistentIndexes.
+ layoutAboutToBeChanged is emitted by this method for compatibility
+ reasons.
The \a sourceParent index corresponds to the parent from which the
- columns are moved; \a sourceFirst and \a sourceLast are the column
- numbers of the columns to be moved. The \a destinationParent index
- corresponds to the parent into which the columns are moved. The \a
- destinationChild is the column to which the columns will be
- moved. That is, the index at column \a sourceFirst in \a
- sourceParent will become column \a destinationChild in \a
- destinationParent. Its siblings will be moved correspondingly.
-
- Note that \a sourceParent and \a destinationParent may be the
- same, in which case you must ensure that the \a destinationChild
- is not within the range of \a sourceFirst and \a sourceLast. You
- must also ensure that you do not attempt to move a row to one of
- its own chilren or ancestors. This method returns false if either
- condition is true, in which case you should abort your move
- operation.
+ columns are moved; \a sourceFirst and \a sourceLast are the first and last
+ column numbers of the columns to be moved. The \a destinationParent index
+ corresponds to the parent into which those columns are moved. The \a
+ destinationChild is the column to which the columns will be moved. That
+ is, the index at column \a sourceFirst in \a sourceParent will become
+ column \a destinationChild in \a destinationParent, followed by all other
+ columns up to \a sourceLast.
+
+ However, when moving columns down in the same parent (\a sourceParent
+ and \a destinationParent are equal), the columnss will be placed before the
+ \a destinationChild index. That is, if you wish to move columns 0 and 1 so
+ they will become columns 1 and 2, \a destinationChild should be 3. In this
+ case, the new index for the source column \c i (which is between
+ \a sourceFirst and \a sourceLast) is equal to
+ \c {(destinationChild-sourceLast-1+i)}.
+
+ Note that if \a sourceParent and \a destinationParent are the same,
+ you must ensure that the \a destinationChild is not within the range
+ of \a sourceFirst and \a sourceLast + 1. You must also ensure that you
+ do not attempt to move a column to one of its own children or ancestors.
+ This method returns false if either condition is true, in which case you
+ should abort your move operation.
\sa endMoveColumns()
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/qeventloop.cpp b/src/corelib/kernel/qeventloop.cpp
index 628afa7..c19f718 100644
--- a/src/corelib/kernel/qeventloop.cpp
+++ b/src/corelib/kernel/qeventloop.cpp
@@ -43,7 +43,7 @@
#include "qabstracteventdispatcher.h"
#include "qcoreapplication.h"
-#include "qdatetime.h"
+#include "qelapsedtimer.h"
#include "qobject_p.h"
#include <private/qthread_p.h>
@@ -247,7 +247,7 @@ void QEventLoop::processEvents(ProcessEventsFlags flags, int maxTime)
if (!d->threadData->eventDispatcher)
return;
- QTime start;
+ QElapsedTimer start;
start.start();
if (flags & DeferredDeletion)
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index ce9ed58..6ebaaa3 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -378,6 +378,8 @@ void QMetaType::registerStreamOperators(const char *typeName, SaveOperator saveO
void QMetaType::registerStreamOperators(int idx, SaveOperator saveOp,
LoadOperator loadOp)
{
+ if (idx < User)
+ return; //builtin types should not be registered;
QVector<QCustomTypeInfo> *ct = customTypes();
if (!ct)
return;
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/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/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index c000dc8..a51ee81 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -3478,6 +3478,25 @@ QLocale::MeasurementSystem QLocale::measurementSystem() const
}
/*!
+ \since 4.7
+
+ Returns the text direction of the language.
+*/
+Qt::LayoutDirection QLocale::textDirection() const
+{
+ Language lang = language();
+ if (lang == QLocale::Arabic ||
+ lang == QLocale::Hebrew ||
+ lang == QLocale::Persian ||
+ lang == QLocale::Urdu ||
+ lang == QLocale::Syriac)
+ return Qt::RightToLeft;
+
+ return Qt::LeftToRight;
+}
+
+
+/*!
\since 4.5
Returns the localized name of the "AM" suffix for times specified using
diff --git a/src/corelib/tools/qlocale.h b/src/corelib/tools/qlocale.h
index f2fd892..8b424bb 100644
--- a/src/corelib/tools/qlocale.h
+++ b/src/corelib/tools/qlocale.h
@@ -666,6 +666,8 @@ public:
MeasurementSystem measurementSystem() const;
+ Qt::LayoutDirection textDirection() const;
+
inline bool operator==(const QLocale &other) const;
inline bool operator!=(const QLocale &other) const;
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/qstring.cpp b/src/corelib/tools/qstring.cpp
index 6acbcec..1d5fab3 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -113,7 +113,7 @@ int qFindStringBoyerMoore(const QChar *haystack, int haystackLen, int from,
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)
@@ -125,7 +125,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);
@@ -154,7 +154,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;
@@ -4640,9 +4640,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);
@@ -6913,20 +6916,23 @@ void QString::updateProperties() const
p++;
}
- p = d->data;
- d->righttoleft = false;
+ d->righttoleft = isRightToLeft();
+ d->clean = true;
+}
+
+bool QString::isRightToLeft() const
+{
+ ushort *p = d->data;
+ const ushort * const end = p + d->size;
+ bool righttoleft = false;
while (p < end) {
switch(QChar::direction(*p))
{
case QChar::DirL:
- case QChar::DirLRO:
- case QChar::DirLRE:
goto end;
case QChar::DirR:
case QChar::DirAL:
- case QChar::DirRLO:
- case QChar::DirRLE:
- d->righttoleft = true;
+ righttoleft = true;
goto end;
default:
break;
@@ -6934,8 +6940,7 @@ void QString::updateProperties() const
++p;
}
end:
- d->clean = true;
- return;
+ return righttoleft;
}
/*! \fn bool QString::isSimpleText() const
@@ -7093,7 +7098,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
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index a1c4e77..e52f59f 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -590,7 +590,7 @@ public:
#endif
bool isSimpleText() const { if (!d->clean) updateProperties(); return d->simpletext; }
- bool isRightToLeft() const { if (!d->clean) updateProperties(); return d->righttoleft; }
+ bool isRightToLeft() const;
QString(int size, Qt::Initialization);
diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h
index bfede94..4a6bb4b 100644
--- a/src/corelib/tools/qvarlengtharray.h
+++ b/src/corelib/tools/qvarlengtharray.h
@@ -127,6 +127,13 @@ public:
inline T *data() { return ptr; }
inline const T *data() const { return ptr; }
inline const T * constData() const { return ptr; }
+ typedef int size_type;
+ typedef T value_type;
+ typedef value_type *pointer;
+ typedef const value_type *const_pointer;
+ typedef value_type &reference;
+ typedef const value_type &const_reference;
+ typedef qptrdiff difference_type;
private:
friend class QPodList<T, Prealloc>;
diff --git a/src/corelib/tools/qvarlengtharray.qdoc b/src/corelib/tools/qvarlengtharray.qdoc
index 38901e5..ef2dc58 100644
--- a/src/corelib/tools/qvarlengtharray.qdoc
+++ b/src/corelib/tools/qvarlengtharray.qdoc
@@ -302,3 +302,52 @@
\a defaultValue.
*/
+/*!
+ \typedef QVarLengthArray::size_type
+ \since 4.7
+
+ Typedef for int. Provided for STL compatibility.
+*/
+
+/*!
+ \typedef QVarLengthArray::value_type
+ \since 4.7
+
+ Typedef for T. Provided for STL compatibility.
+*/
+
+/*!
+ \typedef QVarLengthArray::difference_type
+ \since 4.7
+
+ Typedef for ptrdiff_t. Provided for STL compatibility.
+*/
+
+/*!
+ \typedef QVarLengthArray::pointer
+ \since 4.7
+
+ Typedef for T *. Provided for STL compatibility.
+*/
+
+/*!
+ \typedef QVarLengthArray::const_pointer
+ \since 4.7
+
+ Typedef for const T *. Provided for STL compatibility.
+*/
+
+/*!
+ \typedef QVarLengthArray::reference
+ \since 4.7
+
+ Typedef for T &. Provided for STL compatibility.
+*/
+
+/*!
+ \typedef QVarLengthArray::const_reference
+ \since 4.7
+
+ Typedef for const T &. Provided for STL compatibility.
+*/
+