tests/auto/corelib/animation: clean up
- port from inefficient QLists to QVector - mark types held in Qt containers (incl. QVariant) as Q_MOVABLE/PRIMITIVE_TYPE - remove pointless user-defined copy special members which prevent the class from having nothrow move special members Fixes errors reported by my local tree's static checks. Change-Id: If3910484cea81a8e2c5ab737908c9443f75782c5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
parent
b9e510ff8f
commit
2ccb7ecbca
@ -786,6 +786,9 @@ struct AnimState {
|
|||||||
int time;
|
int time;
|
||||||
int state;
|
int state;
|
||||||
};
|
};
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
Q_DECLARE_TYPEINFO(AnimState, Q_MOVABLE_TYPE);
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#define Running QAbstractAnimation::Running
|
#define Running QAbstractAnimation::Running
|
||||||
#define Stopped QAbstractAnimation::Stopped
|
#define Stopped QAbstractAnimation::Stopped
|
||||||
|
@ -427,7 +427,7 @@ public:
|
|||||||
void setOle(int v) { o = v; values << v; }
|
void setOle(int v) { o = v; values << v; }
|
||||||
|
|
||||||
int o;
|
int o;
|
||||||
QList<int> values;
|
QVector<int> values;
|
||||||
};
|
};
|
||||||
|
|
||||||
void tst_QPropertyAnimation::noStartValue()
|
void tst_QPropertyAnimation::noStartValue()
|
||||||
@ -674,19 +674,15 @@ struct Number
|
|||||||
Number(int n)
|
Number(int n)
|
||||||
: n(n) {}
|
: n(n) {}
|
||||||
|
|
||||||
Number(const Number &other)
|
|
||||||
: n(other.n){}
|
|
||||||
|
|
||||||
Number &operator=(const Number &other) {
|
|
||||||
n = other.n;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
bool operator==(const Number &other) const {
|
bool operator==(const Number &other) const {
|
||||||
return n == other.n;
|
return n == other.n;
|
||||||
}
|
}
|
||||||
|
|
||||||
int n;
|
int n;
|
||||||
};
|
};
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
Q_DECLARE_TYPEINFO(Number, Q_PRIMITIVE_TYPE);
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(Number)
|
Q_DECLARE_METATYPE(Number)
|
||||||
|
|
||||||
|
@ -563,7 +563,7 @@ void tst_QSequentialAnimationGroup::seekingBackwards()
|
|||||||
QCOMPARE(a1_s_o3->state(), QAnimationGroup::Stopped);
|
QCOMPARE(a1_s_o3->state(), QAnimationGroup::Stopped);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef QList<QAbstractAnimation::State> StateList;
|
typedef QVector<QAbstractAnimation::State> StateList;
|
||||||
|
|
||||||
static bool compareStates(const QSignalSpy& spy, const StateList &expectedStates)
|
static bool compareStates(const QSignalSpy& spy, const StateList &expectedStates)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user