diff options
author | axis <qt-info@nokia.com> | 2009-11-04 14:07:39 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-11-04 14:07:39 (GMT) |
commit | 9cda9fb4bb496a7c589767bdcead131dbcdeeb79 (patch) | |
tree | 2302096f06d4629ea62a85317429daa74ce6f02d /src/corelib | |
parent | be6357bfa96cdaffa5797fef99e95cac7121e5b3 (diff) | |
parent | 7905101fb5ef18c776be515b9287356b1efc5ceb (diff) | |
download | Qt-9cda9fb4bb496a7c589767bdcead131dbcdeeb79.zip Qt-9cda9fb4bb496a7c589767bdcead131dbcdeeb79.tar.gz Qt-9cda9fb4bb496a7c589767bdcead131dbcdeeb79.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6-s60
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/global/qglobal.h | 13 | ||||
-rw-r--r-- | src/corelib/global/qlibraryinfo.cpp | 3 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.h | 16 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.qdoc | 51 | ||||
-rw-r--r-- | src/corelib/kernel/qmetaobject.cpp | 5 | ||||
-rw-r--r-- | src/corelib/kernel/qobject.cpp | 146 | ||||
-rw-r--r-- | src/corelib/statemachine/qstate.cpp | 31 | ||||
-rw-r--r-- | src/corelib/statemachine/qstate.h | 4 | ||||
-rw-r--r-- | src/corelib/statemachine/qstate_p.h | 2 | ||||
-rw-r--r-- | src/corelib/statemachine/qstatemachine.cpp | 30 | ||||
-rw-r--r-- | src/corelib/statemachine/qstatemachine.h | 8 | ||||
-rw-r--r-- | src/corelib/statemachine/qstatemachine_p.h | 2 |
12 files changed, 101 insertions, 210 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 95f09ea..d113e02 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1207,6 +1207,11 @@ class QDataStream; # else # define Q_SVG_EXPORT Q_DECL_IMPORT # endif +# if defined(QT_BUILD_DECLARATIVE_LIB) +# define Q_DECLARATIVE_EXPORT Q_DECL_EXPORT +# else +# define Q_DECLARATIVE_EXPORT Q_DECL_IMPORT +# endif # if defined(QT_BUILD_OPENGL_LIB) # define Q_OPENGL_EXPORT Q_DECL_EXPORT # else @@ -1259,6 +1264,7 @@ class QDataStream; # define Q_SQL_EXPORT Q_DECL_IMPORT # define Q_NETWORK_EXPORT Q_DECL_IMPORT # define Q_SVG_EXPORT Q_DECL_IMPORT +# define Q_DECLARATIVE_EXPORT Q_DECL_IMPORT # define Q_CANVAS_EXPORT Q_DECL_IMPORT # define Q_OPENGL_EXPORT Q_DECL_IMPORT # define Q_MULTIMEDIA_EXPORT Q_DECL_IMPORT @@ -1287,6 +1293,7 @@ class QDataStream; # define Q_SQL_EXPORT Q_DECL_EXPORT # define Q_NETWORK_EXPORT Q_DECL_EXPORT # define Q_SVG_EXPORT Q_DECL_EXPORT +# define Q_DECLARATIVE_EXPORT Q_DECL_EXPORT # define Q_OPENGL_EXPORT Q_DECL_EXPORT # define Q_MULTIMEDIA_EXPORT Q_DECL_EXPORT # define Q_OPENVG_EXPORT Q_DECL_EXPORT @@ -1301,6 +1308,7 @@ class QDataStream; # define Q_SQL_EXPORT # define Q_NETWORK_EXPORT # define Q_SVG_EXPORT +# define Q_DECLARATIVE_EXPORT # define Q_OPENGL_EXPORT # define Q_MULTIMEDIA_EXPORT # define Q_XML_EXPORT @@ -2471,6 +2479,7 @@ Q_CORE_EXPORT int qt_symbian_exception2Error(const std::exception& ex); #define QT_MODULE_SCRIPTTOOLS 0x10000 #define QT_MODULE_OPENVG 0x20000 #define QT_MODULE_MULTIMEDIA 0x40000 +#define QT_MODULE_DECLARATIVE 0x80000 /* Qt editions */ #define QT_EDITION_CONSOLE (QT_MODULE_CORE \ @@ -2501,6 +2510,7 @@ Q_CORE_EXPORT int qt_symbian_exception2Error(const std::exception& ex); | QT_MODULE_QT3SUPPORTLIGHT \ | QT_MODULE_QT3SUPPORT \ | QT_MODULE_SVG \ + | QT_MODULE_DECLARATIVE \ | QT_MODULE_GRAPHICSVIEW \ | QT_MODULE_HELP \ | QT_MODULE_TEST \ @@ -2572,6 +2582,9 @@ QT_LICENSED_MODULE(Qt3Support) #if (QT_EDITION & QT_MODULE_SVG) QT_LICENSED_MODULE(Svg) #endif +#if (QT_EDITION & QT_MODULE_DECLARATIVE) +QT_LICENSED_MODULE(Declarative) +#endif #if (QT_EDITION & QT_MODULE_ACTIVEQT) QT_LICENSED_MODULE(ActiveQt) #endif diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index 32693e0..15a06d7 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -215,8 +215,7 @@ QLibraryInfo::buildKey() QDate QLibraryInfo::buildDate() { - return QDate(); - //return QDate::fromString(QString::fromLatin1(qt_configure_installation + 12), Qt::ISODate); + return QDate::fromString(QString::fromLatin1(qt_configure_installation + 12), Qt::ISODate); } /*! diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index aeaca54..0ee9cd2 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1715,14 +1715,12 @@ public: LastGestureType = ~0u }; - enum GestureContext + enum GestureFlag { - WidgetGesture = 0, - WidgetWithChildrenGesture = 3, - - ItemGesture = WidgetGesture, - ItemWithChildrenGesture = WidgetWithChildrenGesture + DontStartGestureOnChildren = 0x01, + ReceivePartialGestures = 0x02 }; + Q_DECLARE_FLAGS(GestureFlags, GestureFlag) enum NavigationMode { @@ -1732,11 +1730,6 @@ public: NavigationModeCursorAuto, NavigationModeCursorForceVisible }; - - enum RenderHint { - QualityHint, - PerformanceHint - }; } #ifdef Q_MOC_RUN ; @@ -1757,6 +1750,7 @@ 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) +Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::GestureFlags) typedef bool (*qInternalCallback)(void **); diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 4e369c9..5ac3675 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2910,34 +2910,36 @@ \value PanGesture A Pan gesture. \value PinchGesture A Pinch gesture. \value SwipeGesture A Swipe gesture. - \value CustomGesture User-defined gesture ID. - \value LastGestureType Last user gesture ID. + \value CustomGesture A flag that can be used to test if the gesture is a + user-defined gesture ID. + \omitvalue LastGestureType User-defined gestures are registered with the - QApplication::registerGestureRecognizer() function which generates a custom gesture ID - in the range of values from CustomGesture to LastGestureType. + QGestureRecognizer::registerRecognizer() function which generates a custom + gesture ID with the Qt::CustomGesture flag set. - \sa QGesture, QWidget::grabGesture() + \sa QGesture, QWidget::grabGesture(), QGraphicsObject::grabGesture() */ /*! - \enum Qt::GestureContext + \enum Qt::GestureFlag \since 4.6 - This enum type describes the context of a gesture. + This enum type describes additional flags that can be used when subscribing + to a gesture. - For a QGesture to trigger, the gesture recognizer should filter events for - a widget tree. This enum describes for which widget the gesture recognizer - should filter events: + \value DontStartGestureOnChildren By default gestures can start on the + widget or over any of its children. Use this flag to disable this and allow + a gesture to start on the widget only. - \value WidgetGesture Gestures can only start over the widget itself. - \value WidgetWithChildrenGesture Gestures can start on the widget or over - any of its children. - \value ItemGesture Gestures can only start over the item itself. - \value ItemWithChildrenGesture Gestures can start on the item or over - any of its children. + \value ReceivePartialGestures Allows any ignored gesture events to be + propagated to parent widgets which have specified this hint. By default + only gestures that are in the Qt::GestureStarted state are propagated and + the widget always gets the full gesture sequence starting with a gesture in + the Qt::GestureStarted state and ending with a gesture in the + Qt::GestureFinished or Qt::GestureCanceled states. - \sa QWidget::grabGesture() + \sa QWidget::grabGesture(), QGraphicsObject::grabGesture() */ /*! @@ -2965,18 +2967,3 @@ \sa QApplication::setNavigationMode() \sa QApplication::navigationMode() */ - -/*! - \enum Qt::RenderHint - \since 4.6 - - This enum describes the possible hints that can be used to control various - rendering operations. - - \value QualityHint Indicates that rendering quality is the most important factor, - at the potential cost of lower performance. - - \value PerformanceHint Indicates that rendering performance is the most important factor, - at the potential cost of lower quality. -*/ - diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index 71afc5b..6e6da19 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -2237,7 +2237,10 @@ bool QMetaProperty::write(QObject *object, const QVariant &value) const // -1 (unchanged): normal qt_metacall, result stored in argv[0] // changed: result stored directly in value, return the value of status int status = -1; - void *argv[] = { 0, &v, &status }; + // the flags variable is used by the declarative module to implement + // interception of property writes. + int flags = 0; + void *argv[] = { 0, &v, &status, &flags }; if (t == QVariant::LastType) argv[0] = &v; else diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 5303975..1260d47 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -582,7 +582,7 @@ int QMetaCallEvent::placeMetaCall(QObject *object) QObjects organize themselves in object trees. When you create a QObject with another object as parent, the object will automatically add itself to the parent's children() list. The - parent takes ownership of the object i.e. it will automatically + parent takes ownership of the object; i.e., it will automatically delete its children in its destructor. You can look for an object by name and optionally type using findChild() or findChildren(). @@ -646,7 +646,7 @@ int QMetaCallEvent::placeMetaCall(QObject *object) to be stored in one of the container classes. You must store pointers. - \section2 Auto-Connection + \section1 Auto-Connection Qt's meta-object system provides a mechanism to automatically connect signals and slots between QObject subclasses and their children. As long @@ -660,7 +660,7 @@ int QMetaCallEvent::placeMetaCall(QObject *object) given in the \l{Using a Designer UI File in Your Application} section of the \QD manual. - \section2 Dynamic Properties + \section1 Dynamic Properties From Qt 4.2, dynamic properties can be added to and removed from QObject instances at run-time. Dynamic properties do not need to be declared at @@ -673,6 +673,15 @@ int QMetaCallEvent::placeMetaCall(QObject *object) and both standard Qt widgets and user-created forms can be given dynamic properties. + \section1 Internationalization (i18n) + + All QObject subclasses support Qt's translation features, making it possible + to translate an application's user interface into different languages. + + To make user-visible text translatable, it must be wrapped in calls to + the tr() function. This is explained in detail in the + \l{Writing Source Code for Translation} document. + \sa QMetaObject, QPointer, QObjectCleanupHandler, Q_DISABLE_COPY() {Object Trees and Object Ownership} */ @@ -2150,65 +2159,10 @@ void QObject::deleteLater() otherwise returns \a sourceText itself if no appropriate translated string is available. - See the sections below on Disambiguation and Handling Plurals for more - information about the optional \a disambiguation and \a n parameters. - - QObject and its subclasses obtain translated strings from any translator - objects that have been installed on the application object; see the - QTranslator documentation for details about this mechanism. - - A translatable string is referenced by its translation context; - this is the name of the QObject subclass whose tr() function is invoked, - as in the following example: - + Example: \snippet mainwindows/sdi/mainwindow.cpp implicit tr context \dots - Here, the context is \c MainWindow because it is the \c MainWindow::tr() - function that is invoked. Translation contexts can be given explicitly - by fully qualifying the call to tr(); for example: - - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp explicit tr context - - This call obtains the translated text for "Page up" from the \c QScrollBar - context. - - \section1 Defining Translation Contexts - - The translation context for QObject and each QObject subclass is the - class name itself. Developers subclassing QObject must use the - Q_OBJECT macro in their class definition to override the translation - context. This macro sets the context to the name of the subclass. - - If Q_OBJECT is not used in a class definition, the context will be - inherited from the base class. For example, since all QObject-based - classes in Qt provide a context, a new QWidget subclass defined without - a Q_OBJECT macro will use the "QWidget" context if its tr() function - is invoked. - - \section1 Translator Comments - - Developers can include information about each translatable string to - help translators with the translation process. These are extracted - when \l lupdate is used to process the source files. The recommended - way to add comments is to annotate the tr() calls in your code with - comments of the form: - - \tt{//: ...} - - or - - \tt{\begincomment: ... \endcomment} - - Examples: - - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 40 - - In these examples, the comments will be associated with the strings - passed to tr() in the context of each call. - - \section1 Disambiguation - If the same \a sourceText is used in different roles within the same context, an additional identifying string may be passed in \a disambiguation (0 by default). In Qt 4.4 and earlier, this was @@ -2217,76 +2171,12 @@ void QObject::deleteLater() Example: \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 17 + \dots - \section1 Meta Data - - Additional data can be attached to each translatable message. - The syntax: - - \tt{//= <id>} - - can be used to give the message a unique identifier to support tools - which need it. - The syntax: - - \tt{//~ <field name> <field contents>} - - can be used to attach meta data to the message. The field name should consist - of a domain prefix (possibly the conventional file extension of the file format - the field is inspired by), a hyphen and the actual field name in - underscore-delimited notation. For storage in TS files, the field name together - with the prefix "extra-" will form an XML element name. The field contents will - be XML-escaped, but otherwise appear verbatim as the element's contents. - Any number of unique fields can be added to each message. - - Example: - - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp meta data - - Meta data appearing right in front of a magic TRANSLATOR comment applies to the - whole TS file. - - \section1 Character Encodings - - You can set the encoding for \a sourceText by calling QTextCodec::setCodecForTr(). - By default \a sourceText is assumed to be in Latin-1 encoding. - - \section1 Handling Plurals - - If \a n >= 0, all occurrences of \c %n in the resulting string - are replaced with a decimal representation of \a n. In addition, - depending on \a n's value, the translation text may vary. - - Example: - - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 18 - - The table below shows what string is returned depending on the - active translation: - - \table - \header \o \o{3,1} Active Translation - \header \o \a n \o No Translation \o French \o English - \row \o 0 \o "0 message(s) saved" \o "0 message sauvegard\unicode{0xE9}" \o "0 message\bold{s} saved" - \row \o 1 \o "1 message(s) saved" \o "1 message sauvegard\unicode{0xE9}" \o "1 message saved" - \row \o 2 \o "2 message(s) saved" \o "2 message\bold{s} sauvegard\unicode{0xE9}\bold{s}" \o "2 message\bold{s} saved" - \row \o 37 \o "37 message(s) saved" \o "37 message\bold{s} sauvegard\unicode{0xE9}\bold{s}" \o "37 message\bold{s} saved" - \endtable - - This idiom is more flexible than the traditional approach; e.g., - - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 19 - - because it also works with target languages that have several - plural forms (e.g., Irish has a special "dual" form that should - be used when \c n is 2), and it handles the \e n == 0 case - correctly for languages such as French that require the singular. - See the \l{Qt Linguist Manual} for details. - - Instead of \c %n, you can use \c %Ln to produce a localized - representation of \a n. The conversion uses the default locale, - set using QLocale::setDefault(). (If no default locale was - specified, the "C" locale is used.) + See \l{Writing Source Code for Translation} for a detailed description of + Qt's translation mechanisms in general, and the + \l{Writing Source Code for Translation#Disambiguation}{Disambiguation} + section for information on disambiguation. \warning This method is reentrant only if all translators are installed \e before calling this method. Installing or removing diff --git a/src/corelib/statemachine/qstate.cpp b/src/corelib/statemachine/qstate.cpp index 5dc310b..cf718a5 100644 --- a/src/corelib/statemachine/qstate.cpp +++ b/src/corelib/statemachine/qstate.cpp @@ -140,10 +140,10 @@ void QStatePrivate::emitFinished() emit q->finished(); } -void QStatePrivate::emitPolished() +void QStatePrivate::emitPropertiesAssigned() { Q_Q(QState); - emit q->polished(); + emit q->propertiesAssigned(); } /*! @@ -229,7 +229,7 @@ QList<QAbstractTransition*> QStatePrivate::transitions() const Instructs this state to set the property with the given \a name of the given \a object to the given \a value when the state is entered. - \sa polished() + \sa propertiesAssigned() */ void QState::assignProperty(QObject *object, const char *name, const QVariant &value) @@ -287,15 +287,14 @@ void QState::setErrorState(QAbstractState *state) /*! Adds the given \a transition. The transition has this state as the source. - This state takes ownership of the transition. If the transition is successfully - added, the function will return the \a transition pointer. Otherwise it will return null. + This state takes ownership of the transition. */ -QAbstractTransition *QState::addTransition(QAbstractTransition *transition) +void QState::addTransition(QAbstractTransition *transition) { Q_D(QState); if (!transition) { qWarning("QState::addTransition: cannot add null transition"); - return 0; + return ; } transition->setParent(this); @@ -304,18 +303,17 @@ QAbstractTransition *QState::addTransition(QAbstractTransition *transition) QAbstractState *t = targets.at(i).data(); if (!t) { qWarning("QState::addTransition: cannot add transition to null state"); - return 0; + return ; } if ((QAbstractStatePrivate::get(t)->machine() != d->machine()) && QAbstractStatePrivate::get(t)->machine() && d->machine()) { qWarning("QState::addTransition: cannot add transition " "to a state in a different state machine"); - return 0; + return ; } } if (machine() != 0 && machine()->configuration().contains(this)) QStateMachinePrivate::get(machine())->registerTransitions(this); - return transition; } /*! @@ -380,7 +378,8 @@ QAbstractTransition *QState::addTransition(QAbstractState *target) return 0; } UnconditionalTransition *trans = new UnconditionalTransition(target); - return addTransition(trans); + addTransition(trans); + return trans; } /*! @@ -493,9 +492,15 @@ bool QState::event(QEvent *e) */ /*! - \fn QState::polished() + \fn QState::propertiesAssigned() + + This signal is emitted when all properties have been assigned their final value. If the state + assigns a value to one or more properties for which an animation exists (either set on the + transition or as a default animation on the state machine), then the signal will not be emitted + until all such animations have finished playing. - This signal is emitted when all properties have been assigned their final value. + If there are no relevant animations, or no property assignments defined for the state, then + the signal will be emitted immediately before the state is entered. \sa QState::assignProperty(), QAbstractTransition::addAnimation() */ diff --git a/src/corelib/statemachine/qstate.h b/src/corelib/statemachine/qstate.h index 7a47447..423f940 100644 --- a/src/corelib/statemachine/qstate.h +++ b/src/corelib/statemachine/qstate.h @@ -76,7 +76,7 @@ public: QAbstractState *errorState() const; void setErrorState(QAbstractState *state); - QAbstractTransition *addTransition(QAbstractTransition *transition); + void addTransition(QAbstractTransition *transition); QSignalTransition *addTransition(QObject *sender, const char *signal, QAbstractState *target); QAbstractTransition *addTransition(QAbstractState *target); void removeTransition(QAbstractTransition *transition); @@ -94,7 +94,7 @@ public: Q_SIGNALS: void finished(); - void polished(); + void propertiesAssigned(); protected: void onEntry(QEvent *event); diff --git a/src/corelib/statemachine/qstate_p.h b/src/corelib/statemachine/qstate_p.h index 34c8838..7fe6279 100644 --- a/src/corelib/statemachine/qstate_p.h +++ b/src/corelib/statemachine/qstate_p.h @@ -94,7 +94,7 @@ public: QList<QAbstractTransition*> transitions() const; void emitFinished(); - void emitPolished(); + void emitPropertiesAssigned(); QAbstractState *errorState; QAbstractState *initialState; diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index ea5587e..cf951c9 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -159,12 +159,12 @@ QT_BEGIN_NAMESPACE \brief the restore policy for states of this state machine. The default value of this property is - QStateMachine::DoNotRestoreProperties. + QStateMachine::DontRestoreProperties. */ #ifndef QT_NO_ANIMATION /*! - \property QStateMachine::animationsEnabled + \property QStateMachine::animated \brief whether animations are enabled @@ -187,10 +187,10 @@ QStateMachinePrivate::QStateMachinePrivate() stop = false; stopProcessingReason = EventQueueEmpty; error = QStateMachine::NoError; - globalRestorePolicy = QStateMachine::DoNotRestoreProperties; + globalRestorePolicy = QStateMachine::DontRestoreProperties; signalEventGenerator = 0; #ifndef QT_NO_ANIMATION - animationsEnabled = true; + animated = true; #endif } @@ -744,7 +744,7 @@ void QStateMachinePrivate::applyProperties(const QList<QAbstractTransition*> &tr // Find the animations to use for the state change. QList<QAbstractAnimation*> selectedAnimations; - if (animationsEnabled) { + if (animated) { for (int i = 0; i < transitionList.size(); ++i) { QAbstractTransition *transition = transitionList.at(i); @@ -809,7 +809,7 @@ void QStateMachinePrivate::applyProperties(const QList<QAbstractTransition*> &tr if (anim->state() == QAbstractAnimation::Running) { // The animation is still running. This can happen if the // animation is a group, and one of its children just finished, - // and that caused a state to emit its polished() signal, and + // and that caused a state to emit its propertiesAssigned() signal, and // that triggered a transition in the machine. // Just stop the animation so it is correctly restarted again. anim->stop(); @@ -831,7 +831,7 @@ void QStateMachinePrivate::applyProperties(const QList<QAbstractTransition*> &tr } } - // Emit polished signal for entered states that have no animated properties. + // Emit propertiesAssigned signal for entered states that have no animated properties. for (int i = 0; i < enteredStates.size(); ++i) { QState *s = toStandardState(enteredStates.at(i)); if (s @@ -839,7 +839,7 @@ void QStateMachinePrivate::applyProperties(const QList<QAbstractTransition*> &tr && !animationsForState.contains(s) #endif ) - QStatePrivate::get(s)->emitPolished(); + QStatePrivate::get(s)->emitPropertiesAssigned(); } } @@ -1130,7 +1130,7 @@ void QStateMachinePrivate::_q_animationFinished() animations.removeOne(anim); if (animations.isEmpty()) { animationsForState.erase(it); - QStatePrivate::get(toStandardState(state))->emitPolished(); + QStatePrivate::get(toStandardState(state))->emitPropertiesAssigned(); } } @@ -1726,7 +1726,7 @@ QStateMachine::~QStateMachine() already been saved by the state machine, it will not be overwritten until the property has been successfully restored. - \value DoNotRestoreProperties The state machine should not save the initial values of properties + \value DontRestoreProperties The state machine should not save the initial values of properties and restore them later. \value RestoreProperties The state machine should save the initial values of properties and restore them later. @@ -1776,7 +1776,7 @@ QStateMachine::RestorePolicy QStateMachine::globalRestorePolicy() const /*! Sets the restore policy of the state machine to \a restorePolicy. The default - restore policy is QAbstractState::DoNotRestoreProperties. + restore policy is QAbstractState::DontRestoreProperties. \sa globalRestorePolicy() */ @@ -2146,19 +2146,19 @@ void QStateMachine::onExit(QEvent *event) /*! Returns whether animations are enabled for this state machine. */ -bool QStateMachine::animationsEnabled() const +bool QStateMachine::isAnimated() const { Q_D(const QStateMachine); - return d->animationsEnabled; + return d->animated; } /*! Sets whether animations are \a enabled for this state machine. */ -void QStateMachine::setAnimationsEnabled(bool enabled) +void QStateMachine::setAnimated(bool enabled) { Q_D(QStateMachine); - d->animationsEnabled = enabled; + d->animated = enabled; } /*! diff --git a/src/corelib/statemachine/qstatemachine.h b/src/corelib/statemachine/qstatemachine.h index 13b6fe2..ff2b667 100644 --- a/src/corelib/statemachine/qstatemachine.h +++ b/src/corelib/statemachine/qstatemachine.h @@ -67,7 +67,7 @@ class Q_CORE_EXPORT QStateMachine : public QState Q_PROPERTY(RestorePolicy globalRestorePolicy READ globalRestorePolicy WRITE setGlobalRestorePolicy) Q_ENUMS(RestorePolicy) #ifndef QT_NO_ANIMATION - Q_PROPERTY(bool animationsEnabled READ animationsEnabled WRITE setAnimationsEnabled) + Q_PROPERTY(bool animated READ isAnimated WRITE setAnimated) #endif public: class SignalEvent : public QEvent @@ -109,7 +109,7 @@ public: }; enum RestorePolicy { - DoNotRestoreProperties, + DontRestoreProperties, RestoreProperties }; @@ -133,8 +133,8 @@ public: bool isRunning() const; #ifndef QT_NO_ANIMATION - bool animationsEnabled() const; - void setAnimationsEnabled(bool enabled); + bool isAnimated() const; + void setAnimated(bool enabled); void addDefaultAnimation(QAbstractAnimation *animation); QList<QAbstractAnimation *> defaultAnimations() const; diff --git a/src/corelib/statemachine/qstatemachine_p.h b/src/corelib/statemachine/qstatemachine_p.h index 01c9361..aad5c67 100644 --- a/src/corelib/statemachine/qstatemachine_p.h +++ b/src/corelib/statemachine/qstatemachine_p.h @@ -207,7 +207,7 @@ public: QSet<QAbstractState *> pendingErrorStatesForDefaultEntry; #ifndef QT_NO_ANIMATION - bool animationsEnabled; + bool animated; QPair<QList<QAbstractAnimation*>, QList<QAbstractAnimation*> > initializeAnimation(QAbstractAnimation *abstractAnimation, |