From: Jędrzej Nowacki Date: Fri, 2 Nov 2012 16:21:38 +0000 (+0100) Subject: Declare type information for some internal qml types. X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=51c12b2d4899db31d62e930ffbe5a8849fa7336b;p=konrad%2Fqtdeclarative.git Declare type information for some internal qml types. QQmlVME::State and QBitField are movable and used in QStack. Declaring them as movable may improve potential reallocation time, although it is hard to prove. Change-Id: Ia42b8104e2f24ca7574370c76084df44b9f9298e Reviewed-by: Alan Alpert --- diff --git a/src/qml/qml/ftw/qbitfield_p.h b/src/qml/qml/ftw/qbitfield_p.h index 95ca372..f225c27 100644 --- a/src/qml/qml/ftw/qbitfield_p.h +++ b/src/qml/qml/ftw/qbitfield_p.h @@ -54,6 +54,7 @@ // #include +#include QT_BEGIN_NAMESPACE @@ -160,6 +161,8 @@ bool QBitField::testBit(int b) const } } +Q_DECLARE_TYPEINFO(QBitField, Q_MOVABLE_TYPE); + QT_END_NAMESPACE #endif // QBITFIELD_P_H diff --git a/src/qml/qml/qqmlvme_p.h b/src/qml/qml/qqmlvme_p.h index d2df630..e710943 100644 --- a/src/qml/qml/qqmlvme_p.h +++ b/src/qml/qml/qqmlvme_p.h @@ -62,6 +62,7 @@ #include #include #include +#include #include #include @@ -87,8 +88,20 @@ namespace QQmlVMETypes { int type; QQmlListProperty qListProperty; }; + struct State { + enum Flag { Deferred = 0x00000001 }; + + State() : flags(0), context(0), compiledData(0), instructionStream(0) {} + quint32 flags; + QQmlContextData *context; + QQmlCompiledData *compiledData; + const char *instructionStream; + QBitField bindingSkipList; + }; } Q_DECLARE_TYPEINFO(QQmlVMETypes::List, Q_PRIMITIVE_TYPE | Q_MOVABLE_TYPE); +template<> +class QTypeInfo : public QTypeInfoMerger {}; //Q_DECLARE_TYPEINFO class Q_QML_PRIVATE_EXPORT QQmlVME { @@ -161,17 +174,7 @@ private: QQmlGuardedContextData rootContext; QQmlGuardedContextData creationContext; - struct State { - enum Flag { Deferred = 0x00000001 }; - - State() : flags(0), context(0), compiledData(0), instructionStream(0) {} - quint32 flags; - QQmlContextData *context; - QQmlCompiledData *compiledData; - const char *instructionStream; - QBitField bindingSkipList; - }; - + typedef QQmlVMETypes::State State; QStack states; static void blank(QFiniteStack &);