diff options
Diffstat (limited to 'tests')
13 files changed, 190 insertions, 103 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp b/tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp index 6a04704..064e458 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp @@ -43,7 +43,7 @@ class BaseExtensionObject : public QObject { Q_OBJECT - Q_PROPERTY(int baseExtendedProperty READ extendedProperty WRITE setExtendedProperty NOTIFY extendedPropertyChanged); + Q_PROPERTY(int baseExtendedProperty READ extendedProperty WRITE setExtendedProperty NOTIFY extendedPropertyChanged) public: BaseExtensionObject(QObject *parent) : QObject(parent), m_value(0) {} @@ -59,7 +59,7 @@ private: class ExtensionObject : public QObject { Q_OBJECT - Q_PROPERTY(int extendedProperty READ extendedProperty WRITE setExtendedProperty NOTIFY extendedPropertyChanged); + Q_PROPERTY(int extendedProperty READ extendedProperty WRITE setExtendedProperty NOTIFY extendedPropertyChanged) public: ExtensionObject(QObject *parent) : QObject(parent), m_value(0) {} diff --git a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h index a283e3f..5dc5bdf 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h +++ b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h @@ -205,8 +205,8 @@ public slots: class MyDefaultObject1 : public QObject { Q_OBJECT - Q_PROPERTY(int horseLegs READ horseLegs CONSTANT); - Q_PROPERTY(int antLegs READ antLegs CONSTANT); + Q_PROPERTY(int horseLegs READ horseLegs CONSTANT) + Q_PROPERTY(int antLegs READ antLegs CONSTANT) public: int horseLegs() const { return 4; } int antLegs() const { return 6; } @@ -215,8 +215,8 @@ public: class MyDefaultObject2 : public QObject { Q_OBJECT - Q_PROPERTY(int antLegs READ antLegs CONSTANT); - Q_PROPERTY(int emuLegs READ emuLegs CONSTANT); + Q_PROPERTY(int antLegs READ antLegs CONSTANT) + Q_PROPERTY(int emuLegs READ emuLegs CONSTANT) public: int antLegs() const { return 5; } // Had an accident int emuLegs() const { return 2; } @@ -225,8 +225,8 @@ public: class MyDefaultObject3 : public QObject { Q_OBJECT - Q_PROPERTY(int antLegs READ antLegs CONSTANT); - Q_PROPERTY(int humanLegs READ humanLegs CONSTANT); + Q_PROPERTY(int antLegs READ antLegs CONSTANT) + Q_PROPERTY(int humanLegs READ humanLegs CONSTANT) public: int antLegs() const { return 7; } // Mutant int humanLegs() const { return 2; } @@ -237,9 +237,9 @@ class MyDeferredObject : public QObject { Q_OBJECT Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged) - Q_PROPERTY(QObject *objectProperty READ objectProperty WRITE setObjectProperty); - Q_PROPERTY(QObject *objectProperty2 READ objectProperty2 WRITE setObjectProperty2); - Q_CLASSINFO("DeferredPropertyNames", "value,objectProperty,objectProperty2"); + Q_PROPERTY(QObject *objectProperty READ objectProperty WRITE setObjectProperty) + Q_PROPERTY(QObject *objectProperty2 READ objectProperty2 WRITE setObjectProperty2) + Q_CLASSINFO("DeferredPropertyNames", "value,objectProperty,objectProperty2") public: MyDeferredObject() : m_value(0), m_object(0), m_object2(0) {} @@ -266,7 +266,7 @@ QML_DECLARE_TYPE(MyDeferredObject); class MyBaseExtendedObject : public QObject { Q_OBJECT -Q_PROPERTY(int baseProperty READ baseProperty WRITE setBaseProperty); +Q_PROPERTY(int baseProperty READ baseProperty WRITE setBaseProperty) public: MyBaseExtendedObject() : m_value(0) {} @@ -281,7 +281,7 @@ QML_DECLARE_TYPE(MyBaseExtendedObject); class MyExtendedObject : public MyBaseExtendedObject { Q_OBJECT -Q_PROPERTY(int coreProperty READ coreProperty WRITE setCoreProperty); +Q_PROPERTY(int coreProperty READ coreProperty WRITE setCoreProperty) public: MyExtendedObject() : m_value(0) {} @@ -299,34 +299,34 @@ class MyTypeObject : public QObject Q_ENUMS(MyEnum) Q_FLAGS(MyFlags) - Q_PROPERTY(QString id READ id WRITE setId); - Q_PROPERTY(QObject *objectProperty READ objectProperty WRITE setObjectProperty); - Q_PROPERTY(QDeclarativeComponent *componentProperty READ componentProperty WRITE setComponentProperty); - Q_PROPERTY(MyFlags flagProperty READ flagProperty WRITE setFlagProperty); - Q_PROPERTY(MyEnum enumProperty READ enumProperty WRITE setEnumProperty); - Q_PROPERTY(QString stringProperty READ stringProperty WRITE setStringProperty); - Q_PROPERTY(uint uintProperty READ uintProperty WRITE setUintProperty); - Q_PROPERTY(int intProperty READ intProperty WRITE setIntProperty); - Q_PROPERTY(qreal realProperty READ realProperty WRITE setRealProperty); - Q_PROPERTY(double doubleProperty READ doubleProperty WRITE setDoubleProperty); - Q_PROPERTY(float floatProperty READ floatProperty WRITE setFloatProperty); - Q_PROPERTY(QColor colorProperty READ colorProperty WRITE setColorProperty); - Q_PROPERTY(QDate dateProperty READ dateProperty WRITE setDateProperty); - Q_PROPERTY(QTime timeProperty READ timeProperty WRITE setTimeProperty); - Q_PROPERTY(QDateTime dateTimeProperty READ dateTimeProperty WRITE setDateTimeProperty); - Q_PROPERTY(QPoint pointProperty READ pointProperty WRITE setPointProperty); - Q_PROPERTY(QPointF pointFProperty READ pointFProperty WRITE setPointFProperty); - Q_PROPERTY(QSize sizeProperty READ sizeProperty WRITE setSizeProperty); - Q_PROPERTY(QSizeF sizeFProperty READ sizeFProperty WRITE setSizeFProperty); - Q_PROPERTY(QRect rectProperty READ rectProperty WRITE setRectProperty NOTIFY rectPropertyChanged); - Q_PROPERTY(QRect rectProperty2 READ rectProperty2 WRITE setRectProperty2); - Q_PROPERTY(QRectF rectFProperty READ rectFProperty WRITE setRectFProperty); - Q_PROPERTY(bool boolProperty READ boolProperty WRITE setBoolProperty); - Q_PROPERTY(QVariant variantProperty READ variantProperty WRITE setVariantProperty); - Q_PROPERTY(QVector3D vectorProperty READ vectorProperty WRITE setVectorProperty); - Q_PROPERTY(QUrl urlProperty READ urlProperty WRITE setUrlProperty); - - Q_PROPERTY(QDeclarativeScriptString scriptProperty READ scriptProperty WRITE setScriptProperty); + Q_PROPERTY(QString id READ id WRITE setId) + Q_PROPERTY(QObject *objectProperty READ objectProperty WRITE setObjectProperty) + Q_PROPERTY(QDeclarativeComponent *componentProperty READ componentProperty WRITE setComponentProperty) + Q_PROPERTY(MyFlags flagProperty READ flagProperty WRITE setFlagProperty) + Q_PROPERTY(MyEnum enumProperty READ enumProperty WRITE setEnumProperty) + Q_PROPERTY(QString stringProperty READ stringProperty WRITE setStringProperty) + Q_PROPERTY(uint uintProperty READ uintProperty WRITE setUintProperty) + Q_PROPERTY(int intProperty READ intProperty WRITE setIntProperty) + Q_PROPERTY(qreal realProperty READ realProperty WRITE setRealProperty) + Q_PROPERTY(double doubleProperty READ doubleProperty WRITE setDoubleProperty) + Q_PROPERTY(float floatProperty READ floatProperty WRITE setFloatProperty) + Q_PROPERTY(QColor colorProperty READ colorProperty WRITE setColorProperty) + Q_PROPERTY(QDate dateProperty READ dateProperty WRITE setDateProperty) + Q_PROPERTY(QTime timeProperty READ timeProperty WRITE setTimeProperty) + Q_PROPERTY(QDateTime dateTimeProperty READ dateTimeProperty WRITE setDateTimeProperty) + Q_PROPERTY(QPoint pointProperty READ pointProperty WRITE setPointProperty) + Q_PROPERTY(QPointF pointFProperty READ pointFProperty WRITE setPointFProperty) + Q_PROPERTY(QSize sizeProperty READ sizeProperty WRITE setSizeProperty) + Q_PROPERTY(QSizeF sizeFProperty READ sizeFProperty WRITE setSizeFProperty) + Q_PROPERTY(QRect rectProperty READ rectProperty WRITE setRectProperty NOTIFY rectPropertyChanged) + Q_PROPERTY(QRect rectProperty2 READ rectProperty2 WRITE setRectProperty2) + Q_PROPERTY(QRectF rectFProperty READ rectFProperty WRITE setRectFProperty) + Q_PROPERTY(bool boolProperty READ boolProperty WRITE setBoolProperty) + Q_PROPERTY(QVariant variantProperty READ variantProperty WRITE setVariantProperty) + Q_PROPERTY(QVector3D vectorProperty READ vectorProperty WRITE setVectorProperty) + Q_PROPERTY(QUrl urlProperty READ urlProperty WRITE setUrlProperty) + + Q_PROPERTY(QDeclarativeScriptString scriptProperty READ scriptProperty WRITE setScriptProperty) public: MyTypeObject() diff --git a/tests/auto/declarative/qdeclarativelanguage/testtypes.h b/tests/auto/declarative/qdeclarativelanguage/testtypes.h index df93dc8..4963e2e 100644 --- a/tests/auto/declarative/qdeclarativelanguage/testtypes.h +++ b/tests/auto/declarative/qdeclarativelanguage/testtypes.h @@ -106,8 +106,8 @@ class MyQmlObject : public QObject, public MyInterface, public QDeclarativeParse Q_PROPERTY(QRect rect READ rect WRITE setRect) Q_PROPERTY(QMatrix matrix READ matrix WRITE setMatrix) //assumed to be unsupported by QML Q_PROPERTY(MyInterface *interfaceProperty READ interface WRITE setInterface) - Q_PROPERTY(int onLiteralSignal READ onLiteralSignal WRITE setOnLiteralSignal); - Q_PROPERTY(MyCustomVariantType customType READ customType WRITE setCustomType); + Q_PROPERTY(int onLiteralSignal READ onLiteralSignal WRITE setOnLiteralSignal) + Q_PROPERTY(MyCustomVariantType customType READ customType WRITE setCustomType) Q_PROPERTY(MyQmlObject *qmlobjectProperty READ qmlobject WRITE setQmlobject) Q_PROPERTY(int propertyWithNotify READ propertyWithNotify WRITE setPropertyWithNotify NOTIFY oddlyNamedNotifySignal) @@ -135,7 +135,7 @@ public: static MyAttachedObject *qmlAttachedProperties(QObject *other) { return new MyAttachedObject(other); } - Q_CLASSINFO("DefaultMethod", "basicSlot()"); + Q_CLASSINFO("DefaultMethod", "basicSlot()") int onLiteralSignal() const { return m_value; } void setOnLiteralSignal(int v) { m_value = v; } @@ -171,8 +171,8 @@ QML_DECLARE_TYPE(MyQmlObject); class MyGroupedObject : public QObject { Q_OBJECT - Q_PROPERTY(QDeclarativeScriptString script READ script WRITE setScript); - Q_PROPERTY(int value READ value WRITE setValue); + Q_PROPERTY(QDeclarativeScriptString script READ script WRITE setScript) + Q_PROPERTY(int value READ value WRITE setValue) public: QDeclarativeScriptString script() const { return m_script; } void setScript(const QDeclarativeScriptString &s) { m_script = s; } @@ -194,36 +194,36 @@ class MyTypeObject : public QObject Q_ENUMS(MyEnum) Q_FLAGS(MyFlags) - Q_PROPERTY(QString id READ id WRITE setId); - Q_PROPERTY(QObject *objectProperty READ objectProperty WRITE setObjectProperty); - Q_PROPERTY(QDeclarativeComponent *componentProperty READ componentProperty WRITE setComponentProperty); - Q_PROPERTY(MyFlags flagProperty READ flagProperty WRITE setFlagProperty); - Q_PROPERTY(MyEnum enumProperty READ enumProperty WRITE setEnumProperty); - Q_PROPERTY(QString stringProperty READ stringProperty WRITE setStringProperty); - Q_PROPERTY(uint uintProperty READ uintProperty WRITE setUintProperty); - Q_PROPERTY(int intProperty READ intProperty WRITE setIntProperty); - Q_PROPERTY(qreal realProperty READ realProperty WRITE setRealProperty); - Q_PROPERTY(double doubleProperty READ doubleProperty WRITE setDoubleProperty); - Q_PROPERTY(float floatProperty READ floatProperty WRITE setFloatProperty); - Q_PROPERTY(QColor colorProperty READ colorProperty WRITE setColorProperty); - Q_PROPERTY(QDate dateProperty READ dateProperty WRITE setDateProperty); - Q_PROPERTY(QTime timeProperty READ timeProperty WRITE setTimeProperty); - Q_PROPERTY(QDateTime dateTimeProperty READ dateTimeProperty WRITE setDateTimeProperty); - Q_PROPERTY(QPoint pointProperty READ pointProperty WRITE setPointProperty); - Q_PROPERTY(QPointF pointFProperty READ pointFProperty WRITE setPointFProperty); - Q_PROPERTY(QSize sizeProperty READ sizeProperty WRITE setSizeProperty); - Q_PROPERTY(QSizeF sizeFProperty READ sizeFProperty WRITE setSizeFProperty); - Q_PROPERTY(QRect rectProperty READ rectProperty WRITE setRectProperty NOTIFY rectPropertyChanged); - Q_PROPERTY(QRect rectProperty2 READ rectProperty2 WRITE setRectProperty2); - Q_PROPERTY(QRectF rectFProperty READ rectFProperty WRITE setRectFProperty); - Q_PROPERTY(bool boolProperty READ boolProperty WRITE setBoolProperty); - Q_PROPERTY(QVariant variantProperty READ variantProperty WRITE setVariantProperty); - Q_PROPERTY(QVector3D vectorProperty READ vectorProperty WRITE setVectorProperty); - Q_PROPERTY(QUrl urlProperty READ urlProperty WRITE setUrlProperty); - - Q_PROPERTY(QDeclarativeScriptString scriptProperty READ scriptProperty WRITE setScriptProperty); - Q_PROPERTY(MyGroupedObject *grouped READ grouped CONSTANT); - Q_PROPERTY(MyGroupedObject *nullGrouped READ nullGrouped CONSTANT); + Q_PROPERTY(QString id READ id WRITE setId) + Q_PROPERTY(QObject *objectProperty READ objectProperty WRITE setObjectProperty) + Q_PROPERTY(QDeclarativeComponent *componentProperty READ componentProperty WRITE setComponentProperty) + Q_PROPERTY(MyFlags flagProperty READ flagProperty WRITE setFlagProperty) + Q_PROPERTY(MyEnum enumProperty READ enumProperty WRITE setEnumProperty) + Q_PROPERTY(QString stringProperty READ stringProperty WRITE setStringProperty) + Q_PROPERTY(uint uintProperty READ uintProperty WRITE setUintProperty) + Q_PROPERTY(int intProperty READ intProperty WRITE setIntProperty) + Q_PROPERTY(qreal realProperty READ realProperty WRITE setRealProperty) + Q_PROPERTY(double doubleProperty READ doubleProperty WRITE setDoubleProperty) + Q_PROPERTY(float floatProperty READ floatProperty WRITE setFloatProperty) + Q_PROPERTY(QColor colorProperty READ colorProperty WRITE setColorProperty) + Q_PROPERTY(QDate dateProperty READ dateProperty WRITE setDateProperty) + Q_PROPERTY(QTime timeProperty READ timeProperty WRITE setTimeProperty) + Q_PROPERTY(QDateTime dateTimeProperty READ dateTimeProperty WRITE setDateTimeProperty) + Q_PROPERTY(QPoint pointProperty READ pointProperty WRITE setPointProperty) + Q_PROPERTY(QPointF pointFProperty READ pointFProperty WRITE setPointFProperty) + Q_PROPERTY(QSize sizeProperty READ sizeProperty WRITE setSizeProperty) + Q_PROPERTY(QSizeF sizeFProperty READ sizeFProperty WRITE setSizeFProperty) + Q_PROPERTY(QRect rectProperty READ rectProperty WRITE setRectProperty NOTIFY rectPropertyChanged) + Q_PROPERTY(QRect rectProperty2 READ rectProperty2 WRITE setRectProperty2) + Q_PROPERTY(QRectF rectFProperty READ rectFProperty WRITE setRectFProperty) + Q_PROPERTY(bool boolProperty READ boolProperty WRITE setBoolProperty) + Q_PROPERTY(QVariant variantProperty READ variantProperty WRITE setVariantProperty) + Q_PROPERTY(QVector3D vectorProperty READ vectorProperty WRITE setVectorProperty) + Q_PROPERTY(QUrl urlProperty READ urlProperty WRITE setUrlProperty) + + Q_PROPERTY(QDeclarativeScriptString scriptProperty READ scriptProperty WRITE setScriptProperty) + Q_PROPERTY(MyGroupedObject *grouped READ grouped CONSTANT) + Q_PROPERTY(MyGroupedObject *nullGrouped READ nullGrouped CONSTANT) public: MyTypeObject() @@ -467,7 +467,7 @@ class MyContainer : public QObject Q_OBJECT Q_PROPERTY(QDeclarativeListProperty<QObject> children READ children) Q_PROPERTY(QDeclarativeListProperty<MyInterface> qlistInterfaces READ qlistInterfaces) - Q_CLASSINFO("DefaultProperty", "children"); + Q_CLASSINFO("DefaultProperty", "children") public: MyContainer() {} @@ -549,7 +549,7 @@ namespace MyNamespace { class MySecondNamespacedType : public QObject { Q_OBJECT - Q_PROPERTY(QDeclarativeListProperty<MyNamespace::MyNamespacedType> list READ list); + Q_PROPERTY(QDeclarativeListProperty<MyNamespace::MyNamespacedType> list READ list) public: QDeclarativeListProperty<MyNamespacedType> list() { return QDeclarativeListProperty<MyNamespacedType>(this, m_list); } diff --git a/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp b/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp index 1b7af19..bb7a7ce 100644 --- a/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp +++ b/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp @@ -91,8 +91,8 @@ private slots: class TestType : public QObject { Q_OBJECT - Q_PROPERTY(QDeclarativeListProperty<TestType> data READ dataProperty); - Q_PROPERTY(int intProperty READ intProperty); + Q_PROPERTY(QDeclarativeListProperty<TestType> data READ dataProperty) + Q_PROPERTY(int intProperty READ intProperty) public: TestType() : property(this, data) {} diff --git a/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp b/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp index 818f108..1857b0e 100644 --- a/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp +++ b/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp @@ -77,9 +77,9 @@ private slots: class TestType : public QObject { Q_OBJECT - Q_PROPERTY(int foo READ foo); + Q_PROPERTY(int foo READ foo) - Q_CLASSINFO("DefaultProperty", "foo"); + Q_CLASSINFO("DefaultProperty", "foo") public: int foo() { return 0; } }; @@ -88,7 +88,7 @@ QML_DECLARE_TYPE(TestType); class ParserStatusTestType : public QObject, public QDeclarativeParserStatus { Q_OBJECT - Q_CLASSINFO("DefaultProperty", "foo"); // Missing default property + Q_CLASSINFO("DefaultProperty", "foo") // Missing default property }; QML_DECLARE_TYPE(ParserStatusTestType); diff --git a/tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp b/tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp index 9b8a643..2288462 100644 --- a/tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp +++ b/tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp @@ -183,15 +183,15 @@ void tst_qdeclarativeproperty::qmlmetaproperty() class PropertyObject : public QObject { Q_OBJECT - Q_PROPERTY(int defaultProperty READ defaultProperty); - Q_PROPERTY(QRect rectProperty READ rectProperty); - Q_PROPERTY(QRect wrectProperty READ wrectProperty WRITE setWRectProperty); - Q_PROPERTY(QUrl url READ url WRITE setUrl); - Q_PROPERTY(int resettableProperty READ resettableProperty WRITE setResettableProperty RESET resetProperty); + Q_PROPERTY(int defaultProperty READ defaultProperty) + Q_PROPERTY(QRect rectProperty READ rectProperty) + Q_PROPERTY(QRect wrectProperty READ wrectProperty WRITE setWRectProperty) + Q_PROPERTY(QUrl url READ url WRITE setUrl) + Q_PROPERTY(int resettableProperty READ resettableProperty WRITE setResettableProperty RESET resetProperty) Q_PROPERTY(int propertyWithNotify READ propertyWithNotify WRITE setPropertyWithNotify NOTIFY oddlyNamedNotifySignal) - Q_PROPERTY(MyQmlObject *qmlObject READ qmlObject); + Q_PROPERTY(MyQmlObject *qmlObject READ qmlObject) - Q_CLASSINFO("DefaultProperty", "defaultProperty"); + Q_CLASSINFO("DefaultProperty", "defaultProperty") public: PropertyObject() : m_resetProperty(9) {} diff --git a/tests/auto/declarative/qdeclarativevaluetypes/testtypes.h b/tests/auto/declarative/qdeclarativevaluetypes/testtypes.h index dfc2829..0ad8449 100644 --- a/tests/auto/declarative/qdeclarativevaluetypes/testtypes.h +++ b/tests/auto/declarative/qdeclarativevaluetypes/testtypes.h @@ -59,14 +59,14 @@ class MyTypeObject : public QObject { Q_OBJECT - Q_PROPERTY(QPoint point READ point WRITE setPoint NOTIFY changed); - Q_PROPERTY(QPointF pointf READ pointf WRITE setPointf NOTIFY changed); - Q_PROPERTY(QSize size READ size WRITE setSize NOTIFY changed); - Q_PROPERTY(QSizeF sizef READ sizef WRITE setSizef NOTIFY changed); - Q_PROPERTY(QRect rect READ rect WRITE setRect NOTIFY changed); - Q_PROPERTY(QRectF rectf READ rectf WRITE setRectf NOTIFY changed); - Q_PROPERTY(QVector3D vector READ vector WRITE setVector NOTIFY changed); - Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY changed); + Q_PROPERTY(QPoint point READ point WRITE setPoint NOTIFY changed) + Q_PROPERTY(QPointF pointf READ pointf WRITE setPointf NOTIFY changed) + Q_PROPERTY(QSize size READ size WRITE setSize NOTIFY changed) + Q_PROPERTY(QSizeF sizef READ sizef WRITE setSizef NOTIFY changed) + Q_PROPERTY(QRect rect READ rect WRITE setRect NOTIFY changed) + Q_PROPERTY(QRectF rectf READ rectf WRITE setRectf NOTIFY changed) + Q_PROPERTY(QVector3D vector READ vector WRITE setVector NOTIFY changed) + Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY changed) public: MyTypeObject() : diff --git a/tests/auto/qdbuscontext/tst_qdbuscontext.cpp b/tests/auto/qdbuscontext/tst_qdbuscontext.cpp index be62d5b..2b7ac06 100644 --- a/tests/auto/qdbuscontext/tst_qdbuscontext.cpp +++ b/tests/auto/qdbuscontext/tst_qdbuscontext.cpp @@ -47,7 +47,7 @@ const char errorMsg[] = "A generic error"; class TestObject: public QObject, protected QDBusContext { Q_OBJECT - Q_CLASSINFO("D-Bus Interface", "com.trolltech.tst_QDBusContext.TestObject"); + Q_CLASSINFO("D-Bus Interface", "com.trolltech.tst_QDBusContext.TestObject") public: inline TestObject(QObject *parent) : QObject(parent) { } public Q_SLOTS: diff --git a/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp index 901099d..7138905 100644 --- a/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp +++ b/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp @@ -405,7 +405,7 @@ void tst_QFileSystemWatcher::removePaths() #if 0 class SignalTest : public QObject { - Q_OBJECT; + Q_OBJECT public slots: void fileSlot(const QString &file) { qDebug() << "file " << file;} void dirSlot(const QString &dir) { qDebug() << "dir" << dir;} diff --git a/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp b/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp index 16a621a..fa3e0f9 100644 --- a/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp +++ b/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp @@ -48,7 +48,7 @@ #include <QtGui/qwindowsstyle.h> class tst_QGraphicsAnchorLayout : public QObject { - Q_OBJECT; + Q_OBJECT public: tst_QGraphicsAnchorLayout() : QObject() { diff --git a/tests/auto/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp b/tests/auto/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp index a813110..99d775d 100644 --- a/tests/auto/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp +++ b/tests/auto/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp @@ -62,7 +62,7 @@ private slots: class DownloadCheckWidget : public QWidget { - Q_OBJECT; + Q_OBJECT public: DownloadCheckWidget(QWidget *parent = 0) : QWidget(parent) , progressDlg(this), netmanager(this) diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index 76e69c5..e11900e 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -3952,7 +3952,7 @@ void tst_QNetworkReply::httpReUsingConnectionSequential() } class HttpReUsingConnectionFromFinishedSlot : public QObject { - Q_OBJECT; + Q_OBJECT public: QNetworkReply* reply1; QNetworkReply* reply2; diff --git a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp index 56eaf25..2339b21 100644 --- a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp +++ b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp @@ -139,6 +139,8 @@ private slots: void taskQTBUG_7537_appearsAndSort(); void taskQTBUG_7716_unnecessaryDynamicSorting(); + void testMultipleProxiesWithSelection(); + protected: void buildHierarchy(const QStringList &data, QAbstractItemModel *model); void checkHierarchy(const QStringList &data, const QAbstractItemModel *model); @@ -2951,5 +2953,90 @@ void tst_QSortFilterProxyModel::taskQTBUG_7716_unnecessaryDynamicSorting() } } +class SelectionProxyModel : QAbstractProxyModel +{ + Q_OBJECT +public: + SelectionProxyModel() + : QAbstractProxyModel(), selectionModel(0) + { + } + + QModelIndex mapFromSource(QModelIndex const&) const + { return QModelIndex(); } + + QModelIndex mapToSource(QModelIndex const&) const + { return QModelIndex(); } + + QModelIndex index(int, int, const QModelIndex&) const + { return QModelIndex(); } + + QModelIndex parent(const QModelIndex&) const + { return QModelIndex(); } + + int rowCount(const QModelIndex&) const + { return 0; } + + int columnCount(const QModelIndex&) const + { return 0; } + + void setSourceModel( QAbstractItemModel *sourceModel ) + { + beginResetModel(); + disconnect( sourceModel, SIGNAL(modelAboutToBeReset()), this, SLOT(sourceModelAboutToBeReset()) ); + QAbstractProxyModel::setSourceModel( sourceModel ); + connect( sourceModel, SIGNAL(modelAboutToBeReset()), this, SLOT(sourceModelAboutToBeReset()) ); + endResetModel(); + } + + void setSelectionModel( QItemSelectionModel *_selectionModel ) + { + selectionModel = _selectionModel; + } + +private slots: + void sourceModelAboutToBeReset() + { + QVERIFY( selectionModel->selectedIndexes().size() == 1 ); + beginResetModel(); + } + + void sourceModelReset() + { + endResetModel(); + } + +private: + QItemSelectionModel *selectionModel; + +}; + +void tst_QSortFilterProxyModel::testMultipleProxiesWithSelection() +{ + QStringListModel model; + const QStringList initial = QString("bravo charlie delta echo").split(" "); + model.setStringList(initial); + + QSortFilterProxyModel proxy; + proxy.setSourceModel( &model ); + + SelectionProxyModel proxy1; + QSortFilterProxyModel proxy2; + + // Note that the order here matters. The order of the sourceAboutToBeReset + // exposes the bug in QSortFilterProxyModel. + proxy2.setSourceModel( &proxy ); + proxy1.setSourceModel( &proxy ); + + QItemSelectionModel selectionModel(&proxy2); + proxy1.setSelectionModel( &selectionModel ); + + selectionModel.select( proxy2.index( 0, 0 ), QItemSelectionModel::Select ); + + // trick the proxy into emitting begin/end reset signals. + proxy.setSourceModel(0); + +} + QTEST_MAIN(tst_QSortFilterProxyModel) #include "tst_qsortfilterproxymodel.moc" |