Clean up some metatype declarations and registrations
Change-Id: I0826f6502cc45279f29f248f5f28f4fc9e6c8b4e Reviewed-by: David Faure <david.faure@kdab.com>
This commit is contained in:
parent
63f24f6ba8
commit
ccbff3fce5
@ -44,7 +44,6 @@
|
|||||||
#include <QtCore/qsequentialanimationgroup.h>
|
#include <QtCore/qsequentialanimationgroup.h>
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(QAbstractAnimation::State)
|
Q_DECLARE_METATYPE(QAbstractAnimation::State)
|
||||||
Q_DECLARE_METATYPE(QAbstractAnimation*)
|
|
||||||
|
|
||||||
class tst_QSequentialAnimationGroup : public QObject
|
class tst_QSequentialAnimationGroup : public QObject
|
||||||
{
|
{
|
||||||
@ -84,7 +83,6 @@ private slots:
|
|||||||
void tst_QSequentialAnimationGroup::initTestCase()
|
void tst_QSequentialAnimationGroup::initTestCase()
|
||||||
{
|
{
|
||||||
qRegisterMetaType<QAbstractAnimation::State>("QAbstractAnimation::State");
|
qRegisterMetaType<QAbstractAnimation::State>("QAbstractAnimation::State");
|
||||||
qRegisterMetaType<QAbstractAnimation*>("QAbstractAnimation*");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QSequentialAnimationGroup::construction()
|
void tst_QSequentialAnimationGroup::construction()
|
||||||
|
@ -1256,7 +1256,6 @@ void tst_QProcess::waitForBytesWrittenInABytesWrittenSlot()
|
|||||||
process->start("testProcessEcho/testProcessEcho");
|
process->start("testProcessEcho/testProcessEcho");
|
||||||
QVERIFY(process->waitForStarted(5000));
|
QVERIFY(process->waitForStarted(5000));
|
||||||
|
|
||||||
qRegisterMetaType<qint64>("qint64");
|
|
||||||
QSignalSpy spy(process, SIGNAL(bytesWritten(qint64)));
|
QSignalSpy spy(process, SIGNAL(bytesWritten(qint64)));
|
||||||
QVERIFY(spy.isValid());
|
QVERIFY(spy.isValid());
|
||||||
process->write("f");
|
process->write("f");
|
||||||
|
@ -467,9 +467,6 @@ typedef QPair<int, int> Position;
|
|||||||
typedef QVector<QPair<int, int> > Selection;
|
typedef QVector<QPair<int, int> > Selection;
|
||||||
typedef QVector<QVector<QString> > StringTable;
|
typedef QVector<QVector<QString> > StringTable;
|
||||||
typedef QVector<QString> StringTableRow;
|
typedef QVector<QString> StringTableRow;
|
||||||
Q_DECLARE_METATYPE(Position)
|
|
||||||
Q_DECLARE_METATYPE(Selection)
|
|
||||||
Q_DECLARE_METATYPE(StringTable)
|
|
||||||
|
|
||||||
static StringTableRow qStringTableRow(const QString &s1, const QString &s2, const QString &s3)
|
static StringTableRow qStringTableRow(const QString &s1, const QString &s2, const QString &s3)
|
||||||
{
|
{
|
||||||
@ -1922,8 +1919,6 @@ public:
|
|||||||
|
|
||||||
void tst_QAbstractItemModel::testDataChanged()
|
void tst_QAbstractItemModel::testDataChanged()
|
||||||
{
|
{
|
||||||
qRegisterMetaType<QVector<int> >();
|
|
||||||
|
|
||||||
CustomRoleModel model;
|
CustomRoleModel model;
|
||||||
|
|
||||||
QSignalSpy withRoles(&model, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>)));
|
QSignalSpy withRoles(&model, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>)));
|
||||||
|
@ -281,8 +281,6 @@ void tst_QAbstractProxyModel::revert()
|
|||||||
// public void setSourceModel(QAbstractItemModel* sourceModel)
|
// public void setSourceModel(QAbstractItemModel* sourceModel)
|
||||||
void tst_QAbstractProxyModel::setSourceModel()
|
void tst_QAbstractProxyModel::setSourceModel()
|
||||||
{
|
{
|
||||||
qRegisterMetaType<QAbstractItemModel*>();
|
|
||||||
|
|
||||||
SubQAbstractProxyModel model;
|
SubQAbstractProxyModel model;
|
||||||
|
|
||||||
QCOMPARE(model.property("sourceModel"), QVariant::fromValue<QAbstractItemModel*>(0));
|
QCOMPARE(model.property("sourceModel"), QVariant::fromValue<QAbstractItemModel*>(0));
|
||||||
|
@ -54,6 +54,8 @@ typedef QList<int> IntList;
|
|||||||
typedef QPair<int, int> IntPair;
|
typedef QPair<int, int> IntPair;
|
||||||
typedef QList<IntPair> IntPairList;
|
typedef QList<IntPair> IntPairList;
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(QList<QPersistentModelIndex>)
|
||||||
|
|
||||||
class tst_QSortFilterProxyModel : public QObject
|
class tst_QSortFilterProxyModel : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -174,9 +176,7 @@ tst_QSortFilterProxyModel::tst_QSortFilterProxyModel()
|
|||||||
|
|
||||||
void tst_QSortFilterProxyModel::initTestCase()
|
void tst_QSortFilterProxyModel::initTestCase()
|
||||||
{
|
{
|
||||||
qRegisterMetaType<IntList>("IntList");
|
qRegisterMetaType<QList<QPersistentModelIndex> >();
|
||||||
qRegisterMetaType<IntPair>("IntPair");
|
|
||||||
qRegisterMetaType<IntPairList>("IntPairList");
|
|
||||||
m_model = new QStandardItemModel(0, 1);
|
m_model = new QStandardItemModel(0, 1);
|
||||||
m_proxy = new QSortFilterProxyModel();
|
m_proxy = new QSortFilterProxyModel();
|
||||||
m_proxy->setSourceModel(m_model);
|
m_proxy->setSourceModel(m_model);
|
||||||
@ -3242,8 +3242,6 @@ void tst_QSortFilterProxyModel::resetInvalidate()
|
|||||||
QCOMPARE(ok, works);
|
QCOMPARE(ok, works);
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(QList<QPersistentModelIndex>)
|
|
||||||
|
|
||||||
void tst_QSortFilterProxyModel::testParentLayoutChanged()
|
void tst_QSortFilterProxyModel::testParentLayoutChanged()
|
||||||
{
|
{
|
||||||
QStandardItemModel model;
|
QStandardItemModel model;
|
||||||
@ -3276,8 +3274,6 @@ void tst_QSortFilterProxyModel::testParentLayoutChanged()
|
|||||||
proxy2.setSourceModel(&proxy);
|
proxy2.setSourceModel(&proxy);
|
||||||
proxy2.setObjectName("proxy2");
|
proxy2.setObjectName("proxy2");
|
||||||
|
|
||||||
qRegisterMetaType<QList<QPersistentModelIndex> >();
|
|
||||||
|
|
||||||
QSignalSpy dataChangedSpy(&model, SIGNAL(dataChanged(QModelIndex,QModelIndex)));
|
QSignalSpy dataChangedSpy(&model, SIGNAL(dataChanged(QModelIndex,QModelIndex)));
|
||||||
|
|
||||||
QVERIFY(dataChangedSpy.isValid());
|
QVERIFY(dataChangedSpy.isValid());
|
||||||
@ -3411,8 +3407,6 @@ private:
|
|||||||
|
|
||||||
void tst_QSortFilterProxyModel::moveSourceRows()
|
void tst_QSortFilterProxyModel::moveSourceRows()
|
||||||
{
|
{
|
||||||
qRegisterMetaType<QList<QPersistentModelIndex> >();
|
|
||||||
|
|
||||||
DynamicTreeModel model;
|
DynamicTreeModel model;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -2204,7 +2204,6 @@ void tst_QGraphicsItem::sceneMatrix()
|
|||||||
void tst_QGraphicsItem::setMatrix()
|
void tst_QGraphicsItem::setMatrix()
|
||||||
{
|
{
|
||||||
QGraphicsScene scene;
|
QGraphicsScene scene;
|
||||||
qRegisterMetaType<QList<QRectF> >("QList<QRectF>");
|
|
||||||
QSignalSpy spy(&scene, SIGNAL(changed(QList<QRectF>)));
|
QSignalSpy spy(&scene, SIGNAL(changed(QList<QRectF>)));
|
||||||
QRectF unrotatedRect(-12, -34, 56, 78);
|
QRectF unrotatedRect(-12, -34, 56, 78);
|
||||||
QGraphicsRectItem item(unrotatedRect, 0);
|
QGraphicsRectItem item(unrotatedRect, 0);
|
||||||
|
@ -316,7 +316,6 @@ void tst_QDateTimeEdit::getSetCheck()
|
|||||||
|
|
||||||
tst_QDateTimeEdit::tst_QDateTimeEdit()
|
tst_QDateTimeEdit::tst_QDateTimeEdit()
|
||||||
{
|
{
|
||||||
qRegisterMetaType<QList<int> >("QList<int>");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tst_QDateTimeEdit::~tst_QDateTimeEdit()
|
tst_QDateTimeEdit::~tst_QDateTimeEdit()
|
||||||
|
@ -1122,7 +1122,6 @@ void tst_QMenuBar::check_menuPosition()
|
|||||||
|
|
||||||
void tst_QMenuBar::task223138_triggered()
|
void tst_QMenuBar::task223138_triggered()
|
||||||
{
|
{
|
||||||
qRegisterMetaType<QAction *>("QAction *");
|
|
||||||
//we create a window with submenus and we check that both menubar and menus get the triggered signal
|
//we create a window with submenus and we check that both menubar and menus get the triggered signal
|
||||||
QMainWindow win;
|
QMainWindow win;
|
||||||
QMenu *menu = win.menuBar()->addMenu("test");
|
QMenu *menu = win.menuBar()->addMenu("test");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user