diff options
author | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-08-21 12:00:07 (GMT) |
---|---|---|
committer | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-08-21 12:00:07 (GMT) |
commit | 8d00a0a21f245d15962191e0690d3619735d118b (patch) | |
tree | 7aaa66528f0ee40d0d2d885f94835d0f09ea4a68 /src/corelib | |
parent | 97cec103793a4b9aae8337ffc2ce9a2bd98fb5fc (diff) | |
parent | 508b447075fb852e61ddf88c92c9099dad292747 (diff) | |
download | Qt-8d00a0a21f245d15962191e0690d3619735d118b.zip Qt-8d00a0a21f245d15962191e0690d3619735d118b.tar.gz Qt-8d00a0a21f245d15962191e0690d3619735d118b.tar.bz2 |
Merge commit 'qt/master' into kinetic-graphicseffect
Conflicts:
src/gui/graphicsview/graphicsview.pri
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/codecs/qtextcodec.cpp | 1 | ||||
-rw-r--r-- | src/corelib/global/qendian.qdoc | 2 | ||||
-rw-r--r-- | src/corelib/global/qfeatures.txt | 7 | ||||
-rw-r--r-- | src/corelib/global/qglobal.cpp | 10 | ||||
-rw-r--r-- | src/corelib/global/qlibraryinfo.cpp | 2 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.h | 11 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.qdoc | 18 | ||||
-rw-r--r-- | src/corelib/io/qdir.cpp | 2 | ||||
-rw-r--r-- | src/corelib/kernel/qabstracteventdispatcher_p.h | 2 | ||||
-rw-r--r-- | src/corelib/kernel/qobject.cpp | 8 | ||||
-rw-r--r-- | src/corelib/kernel/qvariant.cpp | 45 | ||||
-rw-r--r-- | src/corelib/kernel/qvariant.h | 6 | ||||
-rw-r--r-- | src/corelib/kernel/qvariant_p.h | 3 | ||||
-rw-r--r-- | src/corelib/statemachine/qeventtransition.cpp | 6 | ||||
-rw-r--r-- | src/corelib/statemachine/qeventtransition.h | 6 | ||||
-rw-r--r-- | src/corelib/statemachine/qstatemachine_p.h | 2 | ||||
-rw-r--r-- | src/corelib/tools/qalgorithms.qdoc | 4 | ||||
-rw-r--r-- | src/corelib/tools/qbytearray.h | 1 | ||||
-rw-r--r-- | src/corelib/tools/qregexp.cpp | 37 |
19 files changed, 117 insertions, 56 deletions
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp index b150e22..52c507d 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp @@ -696,6 +696,7 @@ static void setup() (void)new QJisCodec; (void)new QSjisCodec; (void)new QEucKrCodec; + (void)new QCP949Codec; (void)new QBig5Codec; (void)new QBig5hkscsCodec; # endif // QT_NO_ICONV && !QT_BOOTSTRAPPED diff --git a/src/corelib/global/qendian.qdoc b/src/corelib/global/qendian.qdoc index e0ef662..949f7b8 100644 --- a/src/corelib/global/qendian.qdoc +++ b/src/corelib/global/qendian.qdoc @@ -42,7 +42,7 @@ /*! \headerfile <QtEndian> \title Endian Conversion Functions - \ingroup classlists + \ingroup funclists \brief The <QtEndian> header provides functions to convert between little and big endian representations of numbers. */ diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt index 9408a5b..3a6c050 100644 --- a/src/corelib/global/qfeatures.txt +++ b/src/corelib/global/qfeatures.txt @@ -1143,13 +1143,6 @@ Requires: UNDOSTACK LISTVIEW Name: QUndoView SeeAlso: ??? -Feature: SCRIPT -Description: Provides support for the QtScript module -Section: Utilities -Requires: TEXTDATE DATESTRING PROPERTIES -Name: QtScript -SeeAlso: ??? - Feature: ACCESSIBILITY Description: Provides accessibility support. Section: Utilities diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 81a5ae5..5fe2b2f 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -401,13 +401,13 @@ QT_BEGIN_NAMESPACE /*! \headerfile <QtGlobal> \title Global Qt Declarations - \ingroup classlists + \ingroup funclists - \brief The <QtGlobal> header provides basic declarations and - is included by all other Qt headers. + \brief The <QtGlobal> header file includes the fundamental global + declarations. It is included by most other Qt header files. - The declarations include \l {types}, \l functions and - \l macros. + The global declarations include \l{types}, \l{functions} and + \l{macros}. The type definitions are partly convenience definitions for basic types (some of which guarantee certain bit-sizes on all platforms diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index f42a2ff..20e7845 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -487,7 +487,7 @@ QT_END_NAMESPACE extern const char qt_core_interpreter[] __attribute__((section(".interp"))) = ELF_INTERPRETER; -extern "C" +extern "C" void qt_core_boilerplate(); void qt_core_boilerplate() { printf("This is the QtCore library version " QT_VERSION_STR "\n" diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index e43a73a..d2ad108 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1435,6 +1435,17 @@ public: RightToLeft }; + enum AnchorPoint { + AnchorLeft = 0, + AnchorHorizontalCenter, + AnchorRight, + AnchorTop, + AnchorVerticalCenter, + AnchorBottom + }; + + + enum DropAction { CopyAction = 0x1, MoveAction = 0x2, diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index d1c16e5..669fc53 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2422,6 +2422,24 @@ */ /*! + \enum Qt::AnchorPoint + + Specifies a side of a layout item that can be anchored. This is used by + QGraphicsAnchorLayout. + + \value AnchorLeft The left side of a layout item. + \value AnchorHorizontalCenter A "virtual" side that is centered between the left and the + right side of a layout item. + \value AnchorRight The right side of a layout item. + \value AnchorTop The top side of a layout item. + \value AnchorVerticalCenter A "virtual" side that is centered between the top and the + bottom side of a layout item. + \value AnchorBottom The bottom side of a layout item. + + \sa QGraphicsAnchorLayout +*/ + +/*! \enum Qt::InputMethodHint \value ImhNone No hints. diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index ca178ce..fd1e367 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -2445,7 +2445,7 @@ QDebug operator<<(QDebug debug, QDir::Filters filters) return debug; } -QDebug operator<<(QDebug debug, QDir::SortFlags sorting) +static QDebug operator<<(QDebug debug, QDir::SortFlags sorting) { if (sorting == QDir::NoSort) { debug << "QDir::SortFlags(NoSort)"; diff --git a/src/corelib/kernel/qabstracteventdispatcher_p.h b/src/corelib/kernel/qabstracteventdispatcher_p.h index 86c9d79..dc69265 100644 --- a/src/corelib/kernel/qabstracteventdispatcher_p.h +++ b/src/corelib/kernel/qabstracteventdispatcher_p.h @@ -58,6 +58,8 @@ QT_BEGIN_NAMESPACE +Q_CORE_EXPORT uint qGlobalPostedEventsCount(); + class Q_CORE_EXPORT QAbstractEventDispatcherPrivate : public QObjectPrivate { Q_DECLARE_PUBLIC(QAbstractEventDispatcher) diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 022ae13..e874c90 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -3219,12 +3219,12 @@ static void blocking_activate(QObject *sender, int signal, QObjectPrivate::Conne /*!\internal \obsolete. - Used to be called from QMetaObject::activate(QObject *, QMetaObject *, int, int, void **) + Used to be called from QMetaObject::activate(QObject *, QMetaObject *, int, int, void **) before Qt 4.6 */ void QMetaObject::activate(QObject *sender, int from_signal_index, int to_signal_index, void **argv) { - int offset = sender->metaObject()->methodOffset(); - activate(sender, from_signal_index - offset, to_signal_index - offset, argv); + Q_UNUSED(to_signal_index); + activate(sender, from_signal_index, argv); } /*!\internal @@ -3371,7 +3371,7 @@ void QMetaObject::activate(QObject *sender, int signal_index, void **argv) const QMetaObject *mo = sender->metaObject(); while (mo && mo->methodOffset() > signal_index) mo = mo->superClass(); - activate(sender, signal_index - mo->methodOffset(), argv); + activate(sender, mo, signal_index - mo->methodOffset(), argv); } /*!\internal diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 54d6073..9adfa57 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -174,10 +174,13 @@ static void construct(QVariant::Private *x, const void *copy) case QVariant::UserType: break; default: - x->is_shared = true; - x->data.shared = new QVariant::PrivateShared(QMetaType::construct(x->type, copy)); - if (!x->data.shared->ptr) + void *ptr = QMetaType::construct(x->type, copy); + if (!ptr) { x->type = QVariant::Invalid; + } else { + x->is_shared = true; + x->data.shared = new QVariant::PrivateShared(ptr); + } break; } x->is_null = !copy; @@ -456,15 +459,17 @@ static bool compare(const QVariant::Private *a, const QVariant::Private *b) if (!QMetaType::isRegistered(a->type)) qFatal("QVariant::compare: type %d unknown to QVariant.", a->type); + const void *a_ptr = a->is_shared ? a->data.shared->ptr : &(a->data.ptr); + const void *b_ptr = b->is_shared ? b->data.shared->ptr : &(b->data.ptr); + /* The reason we cannot place this test in a case branch above for the types * QMetaType::VoidStar, QMetaType::QObjectStar and so forth, is that it wouldn't include * user defined pointer types. */ const char *const typeName = QMetaType::typeName(a->type); if (typeName[qstrlen(typeName) - 1] == '*') - return *static_cast<void **>(a->data.shared->ptr) == - *static_cast<void **>(b->data.shared->ptr); + return *static_cast<void *const *>(a_ptr) == *static_cast<void *const *>(b_ptr); - return a->data.shared->ptr == b->data.shared->ptr; + return a_ptr == b_ptr; } /*! @@ -1371,7 +1376,7 @@ void QVariant::create(int type, const void *copy) QVariant::~QVariant() { - if (d.type > Char && d.type != QMetaType::Float && d.type != QMetaType::QObjectStar && (!d.is_shared || !d.data.shared->ref.deref())) + if ((d.is_shared && !d.data.shared->ref.deref()) || (!d.is_shared && d.type > Char && d.type < UserType)) handler->clear(&d); } @@ -1387,7 +1392,7 @@ QVariant::QVariant(const QVariant &p) { if (d.is_shared) { d.data.shared->ref.ref(); - } else if (p.d.type > Char && p.d.type != QMetaType::Float && p.d.type != QMetaType::QObjectStar) { + } else if (p.d.type > Char && p.d.type < QVariant::UserType) { handler->construct(&d, p.constData()); d.is_null = p.d.is_null; } @@ -1627,6 +1632,22 @@ QVariant::QVariant(Type type) { create(type, 0); } QVariant::QVariant(int typeOrUserType, const void *copy) { create(typeOrUserType, copy); d.is_null = false; } + +/*! \internal + flags is true if it is a pointer type + */ +QVariant::QVariant(int typeOrUserType, const void *copy, uint flags) +{ + if (flags) { //type is a pointer type + d.type = typeOrUserType; + d.data.ptr = *reinterpret_cast<void *const*>(copy); + d.is_null = false; + } else { + create(typeOrUserType, copy); + d.is_null = false; + } +} + QVariant::QVariant(int val) { d.is_null = false; d.type = Int; d.data.i = val; } QVariant::QVariant(uint val) @@ -1743,7 +1764,7 @@ QVariant& QVariant::operator=(const QVariant &variant) if (variant.d.is_shared) { variant.d.data.shared->ref.ref(); d = variant.d; - } else if (variant.d.type > Char && variant.d.type != QMetaType::Float && variant.d.type != QMetaType::QObjectStar) { + } else if (variant.d.type > Char && variant.d.type < UserType) { d.type = variant.d.type; handler->construct(&d, variant.constData()); d.is_null = variant.d.is_null; @@ -1797,7 +1818,7 @@ const char *QVariant::typeName() const */ void QVariant::clear() { - if (!d.is_shared || !d.data.shared->ref.deref()) + if ((d.is_shared && !d.data.shared->ref.deref()) || (!d.is_shared && d.type < UserType && d.type > Char)) handler->clear(&d); d.type = Invalid; d.is_null = true; @@ -2467,7 +2488,7 @@ double QVariant::toDouble(bool *ok) const */ float QVariant::toFloat(bool *ok) const { - return qNumVariantToHelper<float>(d, handler, ok, d.data.d); + return qNumVariantToHelper<float>(d, handler, ok, d.data.f); } /*! @@ -2484,7 +2505,7 @@ float QVariant::toFloat(bool *ok) const */ qreal QVariant::toReal(bool *ok) const { - return qNumVariantToHelper<qreal>(d, handler, ok, d.data.d); + return qNumVariantToHelper<qreal>(d, handler, ok, d.data.real); } /*! diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index 79bd5b8..97af54b 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -174,6 +174,7 @@ class Q_CORE_EXPORT QVariant ~QVariant(); QVariant(Type type); QVariant(int typeOrUserType, const void *copy); + QVariant(int typeOrUserType, const void *copy, uint flags); QVariant(const QVariant &other); #ifndef QT_NO_DATASTREAM @@ -358,6 +359,7 @@ class Q_CORE_EXPORT QVariant bool b; double d; float f; + qreal real; qlonglong ll; qulonglong ull; QObject *o; @@ -444,7 +446,7 @@ inline bool qvariant_cast_helper(const QVariant &v, QVariant::Type tp, void *ptr template <typename T> inline QVariant qVariantFromValue(const T &t) { - return QVariant(qMetaTypeId<T>(reinterpret_cast<T *>(0)), &t); + return QVariant(qMetaTypeId<T>(reinterpret_cast<T *>(0)), &t, QTypeInfo<T>::isPointer); } template <> @@ -463,7 +465,7 @@ inline void qVariantSetValue(QVariant &v, const T &t) old->~T(); new (old) T(t); //call the copy constructor } else { - v = QVariant(type, &t); + v = QVariant(type, &t, QTypeInfo<T>::isPointer); } } diff --git a/src/corelib/kernel/qvariant_p.h b/src/corelib/kernel/qvariant_p.h index 993c43b..c36899d 100644 --- a/src/corelib/kernel/qvariant_p.h +++ b/src/corelib/kernel/qvariant_p.h @@ -57,6 +57,7 @@ // to a pointer of the input type #include <QtCore/qglobal.h> +#include <QtCore/qvariant.h> QT_BEGIN_NAMESPACE @@ -145,6 +146,8 @@ inline void v_clear(QVariant::Private *d, T* = 0) } +Q_CORE_EXPORT const QVariant::Handler *qcoreVariantHandler(); + QT_END_NAMESPACE #endif // QVARIANT_P_H diff --git a/src/corelib/statemachine/qeventtransition.cpp b/src/corelib/statemachine/qeventtransition.cpp index e2d1f69..89dabde 100644 --- a/src/corelib/statemachine/qeventtransition.cpp +++ b/src/corelib/statemachine/qeventtransition.cpp @@ -92,7 +92,7 @@ QT_BEGIN_NAMESPACE */ /*! - \property QEventTransition::eventObject + \property QEventTransition::eventSource \brief the event source that this event transition is associated with */ @@ -205,7 +205,7 @@ void QEventTransition::setEventType(QEvent::Type type) /*! Returns the event source associated with this event transition. */ -QObject *QEventTransition::eventObject() const +QObject *QEventTransition::eventSource() const { Q_D(const QEventTransition); return d->object; @@ -215,7 +215,7 @@ QObject *QEventTransition::eventObject() const Sets the event source associated with this event transition to be the given \a object. */ -void QEventTransition::setEventObject(QObject *object) +void QEventTransition::setEventSource(QObject *object) { Q_D(QEventTransition); if (d->object == object) diff --git a/src/corelib/statemachine/qeventtransition.h b/src/corelib/statemachine/qeventtransition.h index 6cf6a96..941bfa5 100644 --- a/src/corelib/statemachine/qeventtransition.h +++ b/src/corelib/statemachine/qeventtransition.h @@ -57,15 +57,15 @@ class QEventTransitionPrivate; class Q_CORE_EXPORT QEventTransition : public QAbstractTransition { Q_OBJECT - Q_PROPERTY(QObject* eventObject READ eventObject WRITE setEventObject) + Q_PROPERTY(QObject* eventSource READ eventSource WRITE setEventSource) Q_PROPERTY(QEvent::Type eventType READ eventType WRITE setEventType) public: QEventTransition(QState *sourceState = 0); QEventTransition(QObject *object, QEvent::Type type, QState *sourceState = 0); ~QEventTransition(); - QObject *eventObject() const; - void setEventObject(QObject *object); + QObject *eventSource() const; + void setEventSource(QObject *object); QEvent::Type eventType() const; void setEventType(QEvent::Type type); diff --git a/src/corelib/statemachine/qstatemachine_p.h b/src/corelib/statemachine/qstatemachine_p.h index 2853b1a..defa7af 100644 --- a/src/corelib/statemachine/qstatemachine_p.h +++ b/src/corelib/statemachine/qstatemachine_p.h @@ -217,6 +217,8 @@ public: static const Handler *handler; }; +Q_CORE_EXPORT const QStateMachinePrivate::Handler *qcoreStateMachineHandler(); + QT_END_NAMESPACE #endif diff --git a/src/corelib/tools/qalgorithms.qdoc b/src/corelib/tools/qalgorithms.qdoc index f7b7798..771c544 100644 --- a/src/corelib/tools/qalgorithms.qdoc +++ b/src/corelib/tools/qalgorithms.qdoc @@ -42,9 +42,9 @@ /*! \headerfile <QtAlgorithms> \title Generic Algorithms - \ingroup classlists + \ingroup funclists - \brief The <QtAlgorithms> header provides generic template-based algorithms. + \brief The <QtAlgorithms> header includes the generic, template-based algorithms. Qt provides a number of global template functions in \c <QtAlgorithms> that work on containers and perform well-know diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h index 635c799..e952ea2 100644 --- a/src/corelib/tools/qbytearray.h +++ b/src/corelib/tools/qbytearray.h @@ -310,6 +310,7 @@ public: // stl compatibility typedef const char & const_reference; typedef char & reference; + typedef char value_type; void push_back(char c); void push_back(const char *c); void push_back(const QByteArray &a); diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp index bebf141..f54a938 100644 --- a/src/corelib/tools/qregexp.cpp +++ b/src/corelib/tools/qregexp.cpp @@ -832,7 +832,7 @@ struct QRegExpEngineKey } }; -bool operator==(const QRegExpEngineKey &key1, const QRegExpEngineKey &key2) +static bool operator==(const QRegExpEngineKey &key1, const QRegExpEngineKey &key2) { return key1.pattern == key2.pattern && key1.patternSyntax == key2.patternSyntax && key1.cs == key2.cs; @@ -1261,28 +1261,35 @@ struct QRegExpLookahead }; #endif -QRegExpEngine::QRegExpEngine(const QRegExpEngineKey &key) - : cs(key.cs), greedyQuantifiers(key.patternSyntax == QRegExp::RegExp2), - xmlSchemaExtensions(false) -{ - setup(); - - QString rx; +/*! \internal + convert the pattern string to the RegExp syntax. - switch (key.patternSyntax) { - case QRegExp::Wildcard: + This is also used by QScriptEngine::newRegExp to convert to a pattern that JavaScriptCore can understan + */ +Q_CORE_EXPORT QString qt_regexp_toCanonical(const QString &pattern, QRegExp::PatternSyntax patternSyntax) +{ + switch (patternSyntax) { #ifndef QT_NO_REGEXP_WILDCARD - rx = wc2rx(key.pattern); -#endif + case QRegExp::Wildcard: + return wc2rx(pattern); break; +#endif case QRegExp::FixedString: - rx = QRegExp::escape(key.pattern); + return QRegExp::escape(pattern); break; case QRegExp::W3CXmlSchema11: - xmlSchemaExtensions = true; default: - rx = key.pattern; + return pattern; } +} + +QRegExpEngine::QRegExpEngine(const QRegExpEngineKey &key) + : cs(key.cs), greedyQuantifiers(key.patternSyntax == QRegExp::RegExp2), + xmlSchemaExtensions(key.patternSyntax == QRegExp::W3CXmlSchema11) +{ + setup(); + + QString rx = qt_regexp_toCanonical(key.pattern, key.patternSyntax); valid = (parse(rx.unicode(), rx.length()) == rx.length()); if (!valid) { |