void tst_QAnimationGroup::emptyGroup()
{
QSequentialAnimationGroup group;
- QSignalSpy groupStateChangedSpy(&group, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy groupStateChangedSpy(&group, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
QVERIFY(groupStateChangedSpy.isValid());
QCOMPARE(group.state(), QAnimationGroup::Stopped);
group.addAnimation(anim3);
group.addAnimation(anim4);
- QSignalSpy spy1(anim1, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
- QSignalSpy spy2(anim2, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
- QSignalSpy spy3(anim3, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
- QSignalSpy spy4(anim4, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy spy1(anim1, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
+ QSignalSpy spy2(anim2, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
+ QSignalSpy spy3(anim3, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
+ QSignalSpy spy4(anim4, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
QVERIFY(spy1.isValid());
QVERIFY(spy2.isValid());
anim.setEndValue(100);
anim.setDuration(200);
- QSignalSpy groupStateChangedSpy(&group, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
- QSignalSpy childStateChangedSpy(&anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy groupStateChangedSpy(&group, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
+ QSignalSpy childStateChangedSpy(&anim, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
QVERIFY(groupStateChangedSpy.isValid());
QVERIFY(childStateChangedSpy.isValid());
anim2.setEndValue(100);
anim2.setDuration(200);
- QSignalSpy stateChangedSpy1(&anim1, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
- QSignalSpy stateChangedSpy2(&anim2, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy stateChangedSpy1(&anim1, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
+ QSignalSpy stateChangedSpy2(&anim2, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
QVERIFY(stateChangedSpy1.isValid());
QVERIFY(stateChangedSpy2.isValid());
anim3.setEndValue(100);
anim3.setDuration(10);
- QSignalSpy stateChangedSpy1(&anim1, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy stateChangedSpy1(&anim1, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
QSignalSpy finishedSpy1(&anim1, SIGNAL(finished()));
QVERIFY(stateChangedSpy1.isValid());
QVERIFY(finishedSpy1.isValid());
- QSignalSpy stateChangedSpy2(&anim2, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy stateChangedSpy2(&anim2, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
QSignalSpy finishedSpy2(&anim2, SIGNAL(finished()));
QVERIFY(stateChangedSpy2.isValid());
QVERIFY(finishedSpy2.isValid());
- QSignalSpy stateChangedSpy3(&anim3, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy stateChangedSpy3(&anim3, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
QSignalSpy finishedSpy3(&anim3, SIGNAL(finished()));
QVERIFY(stateChangedSpy3.isValid());
loopsForever.setDuration(100);
loopsForever.setLoopCount(-1);
- QSignalSpy stateChangedSpy(&anim1, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy stateChangedSpy(&anim1, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
QVERIFY(stateChangedSpy.isValid());
group.addAnimation(&anim1);
{
QParallelAnimationGroup group;
TestAnimation2 *anim = new TestAnimation2(250, &group); // 0, duration = 250;
- QSignalSpy spy(anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy spy(anim, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
QVERIFY(spy.isValid());
QCOMPARE(group.duration(), 250);
group.start();
anim->setDuration(100);
QSignalSpy finishedSpy(anim, SIGNAL(finished()));
- QSignalSpy runningSpy(anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy runningSpy(anim, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
QSignalSpy currentLoopSpy(anim, SIGNAL(currentLoopChanged(int)));
QVERIFY(finishedSpy.isValid());
QPointer<QPropertyAnimation> anim = new QPropertyAnimation(object, "minimumWidth");
//test that the animation is deleted correctly depending of the deletion flag passed in start()
- QSignalSpy runningSpy(anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy runningSpy(anim, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
QSignalSpy finishedSpy(anim, SIGNAL(finished()));
QVERIFY(runningSpy.isValid());
QVERIFY(finishedSpy.isValid());
anim->setEndValue(20);
anim->setDuration(200);
- QSignalSpy runningSpy(anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy runningSpy(anim, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
QSignalSpy finishedSpy(anim, SIGNAL(finished()));
QVERIFY(runningSpy.isValid());
anim->setEndValue(20);
anim->setDuration(200);
- QSignalSpy runningSpy(anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy runningSpy(anim, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
QSignalSpy finishedSpy(anim, SIGNAL(finished()));
QVERIFY(runningSpy.isValid());
//normal case: the animation finishes and is deleted
QPointer<QVariantAnimation> anim = new QPropertyAnimation(&o, "ole");
anim->setEndValue(100);
- QSignalSpy runningSpy(anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy runningSpy(anim, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
QVERIFY(runningSpy.isValid());
anim->start(QVariantAnimation::DeleteWhenStopped);
QTest::qWait(anim->duration() + 100);
{
QPointer<QVariantAnimation> anim = new QPropertyAnimation(&o, "ole");
anim->setEndValue(100);
- QSignalSpy runningSpy(anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy runningSpy(anim, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
QVERIFY(runningSpy.isValid());
anim->start(QVariantAnimation::DeleteWhenStopped);
QTest::qWait(anim->duration()/2);
void tst_QPropertyAnimation::zeroDurationStart()
{
DummyPropertyAnimation anim;
- QSignalSpy spy(&anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy spy(&anim, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
QVERIFY(spy.isValid());
anim.setDuration(0);
QCOMPARE(anim.state(), QAbstractAnimation::Stopped);
o.setProperty("ole", 42);
QPropertyAnimation anim(&o, "ole");
anim.setEndValue(100);
- QSignalSpy spy(&anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy spy(&anim, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
QVERIFY(spy.isValid());
anim.stop();
anim->setDuration(20);
anim->setLoopCount(0);
- QSignalSpy runningSpy(anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy runningSpy(anim, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
QSignalSpy finishedSpy(anim, SIGNAL(finished()));
QVERIFY(runningSpy.isValid());
sequence->addAnimation(a3_s_o1);
sequence->setLoopCount(2);
- QSignalSpy a1StateChangedSpy(a1_s_o1, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
- QSignalSpy seqStateChangedSpy(sequence, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy a1StateChangedSpy(a1_s_o1, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
+ QSignalSpy seqStateChangedSpy(sequence, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
QVERIFY(a1StateChangedSpy.isValid());
QVERIFY(seqStateChangedSpy.isValid());
// sequence operating on same object/property
QAnimationGroup *sequence = new QSequentialAnimationGroup();
QSignalSpy seqCurrentAnimChangedSpy(sequence, SIGNAL(currentAnimationChanged(QAbstractAnimation*)));
- QSignalSpy seqStateChangedSpy(sequence, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy seqStateChangedSpy(sequence, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
QVERIFY(seqCurrentAnimChangedSpy.isValid());
QVERIFY(seqStateChangedSpy.isValid());
for (int i = 0; i < 3; i++) {
anims[i] = new DummyPropertyAnimation;
anims[i]->setDuration(100);
- animsStateChanged[i] = new QSignalSpy(anims[i], SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ animsStateChanged[i] = new QSignalSpy(anims[i], SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
QVERIFY(animsStateChanged[i]->isValid());
}
QAbstractAnimation *a2_s_o1 = new DummyPropertyAnimation;
QAbstractAnimation *a3_s_o1 = new DummyPropertyAnimation;
- QSignalSpy a1Spy(a1_s_o1, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
- QSignalSpy a2Spy(a2_s_o1, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
- QSignalSpy a3Spy(a3_s_o1, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
- QSignalSpy seqSpy(sequence, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy a1Spy(a1_s_o1, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
+ QSignalSpy a2Spy(a2_s_o1, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
+ QSignalSpy a3Spy(a3_s_o1, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
+ QSignalSpy seqSpy(sequence, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
QVERIFY(a1Spy.isValid());
QVERIFY(a2Spy.isValid());
sequence->setLoopCount(2);
QSequentialAnimationGroup group;
- QSignalSpy groupSpy(&group, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy groupSpy(&group, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
QVERIFY(groupSpy.isValid());
group.addAnimation(sequence);
anim.setEndValue(100);
anim.setDuration(200);
- QSignalSpy groupStateChangedSpy(&group, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
- QSignalSpy childStateChangedSpy(&anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy groupStateChangedSpy(&group, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
+ QSignalSpy childStateChangedSpy(&anim, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
QVERIFY(groupStateChangedSpy.isValid());
QVERIFY(childStateChangedSpy.isValid());
anim2->setEndValue(100);
anim2->setDuration(200);
- QSignalSpy stateChangedSpy1(anim1, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
- QSignalSpy stateChangedSpy2(anim2, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy stateChangedSpy1(anim1, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
+ QSignalSpy stateChangedSpy2(anim2, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
QVERIFY(stateChangedSpy1.isValid());
QVERIFY(stateChangedSpy2.isValid());
anim3->setEndValue(100);
anim3->setDuration(0);
- QSignalSpy stateChangedSpy(anim1, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy stateChangedSpy(anim1, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
QVERIFY(stateChangedSpy.isValid());
group.addAnimation(anim1);
// lets make sure the seeking will work again
spy.clear();
DummyPropertyAnimation anim(&group);
- QSignalSpy animStateChangedSpy(&anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy animStateChangedSpy(&anim, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
QVERIFY(animStateChangedSpy.isValid());
group.setCurrentTime(300);
QPropertyAnimation *anim = new QPropertyAnimation(&dummy, "foo", &group);
anim->setDuration(250);
anim->setEndValue(250);
- QSignalSpy spy(anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy spy(anim, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
QVERIFY(spy.isValid());
QCOMPARE(group.duration(), 250);
group.start();
watcher.setObjectName(QLatin1String("_qt_autotest_force_engine_") + backend);
QVERIFY(watcher.addPath(testFile.fileName()));
- QSignalSpy changedSpy(&watcher, SIGNAL(fileChanged(const QString &)));
+ QSignalSpy changedSpy(&watcher, SIGNAL(fileChanged(QString)));
QVERIFY(changedSpy.isValid());
QEventLoop eventLoop;
QTimer timer;
watcher.setObjectName(QLatin1String("_qt_autotest_force_engine_") + backend);
QVERIFY(watcher.addPath(testDir.absolutePath()));
- QSignalSpy changedSpy(&watcher, SIGNAL(directoryChanged(const QString &)));
+ QSignalSpy changedSpy(&watcher, SIGNAL(directoryChanged(QString)));
QVERIFY(changedSpy.isValid());
QEventLoop eventLoop;
QTimer timer;
QVERIFY(watcher.addPath(testDir.absolutePath()));
QVERIFY(watcher.addPath(testFileName));
- QSignalSpy fileChangedSpy(&watcher, SIGNAL(fileChanged(const QString &)));
- QSignalSpy dirChangedSpy(&watcher, SIGNAL(directoryChanged(const QString &)));
+ QSignalSpy fileChangedSpy(&watcher, SIGNAL(fileChanged(QString)));
+ QSignalSpy dirChangedSpy(&watcher, SIGNAL(directoryChanged(QString)));
QVERIFY(fileChangedSpy.isValid());
QVERIFY(dirChangedSpy.isValid());
QEventLoop eventLoop;
qRegisterMetaType<QProcess::ProcessError>("QProcess::ExitStatus");
QSignalSpy spy(process, SIGNAL(error(QProcess::ProcessError)));
- QSignalSpy spy2(process, SIGNAL(finished(int, QProcess::ExitStatus)));
+ QSignalSpy spy2(process, SIGNAL(finished(int,QProcess::ExitStatus)));
QVERIFY(spy.isValid());
QVERIFY(spy2.isValid());
qRegisterMetaType<QProcess::ProcessError>("QProcess::ExitStatus");
QSignalSpy spy(process, SIGNAL(error(QProcess::ProcessError)));
- QSignalSpy spy2(process, SIGNAL(finished(int, QProcess::ExitStatus)));
+ QSignalSpy spy2(process, SIGNAL(finished(int,QProcess::ExitStatus)));
QVERIFY(spy.isValid());
QVERIFY(spy2.isValid());
SoftExitProcess(int n) : waitedForFinished(false), n(n), killing(false)
{
- connect(this, SIGNAL(finished(int, QProcess::ExitStatus)),
- this, SLOT(finishedSlot(int, QProcess::ExitStatus)));
+ connect(this, SIGNAL(finished(int,QProcess::ExitStatus)),
+ this, SLOT(finishedSlot(int,QProcess::ExitStatus)));
switch (n) {
case 0:
QSignalSpy stateSpy(&process, SIGNAL(stateChanged(QProcess::ProcessState)));
QSignalSpy errorSpy(&process, SIGNAL(error(QProcess::ProcessError)));
QSignalSpy finishedSpy(&process, SIGNAL(finished(int)));
- QSignalSpy finishedSpy2(&process, SIGNAL(finished(int, QProcess::ExitStatus)));
+ QSignalSpy finishedSpy2(&process, SIGNAL(finished(int,QProcess::ExitStatus)));
QVERIFY(stateSpy.isValid());
QVERIFY(errorSpy.isValid());
QEventLoop loop;
QSignalSpy errorSpy(&process, SIGNAL(error(QProcess::ProcessError)));
QSignalSpy finishedSpy(&process, SIGNAL(finished(int)));
- QSignalSpy finishedSpy2(&process, SIGNAL(finished(int, QProcess::ExitStatus)));
+ QSignalSpy finishedSpy2(&process, SIGNAL(finished(int,QProcess::ExitStatus)));
QVERIFY(errorSpy.isValid());
QVERIFY(finishedSpy.isValid());
QEventLoop loop;
QSignalSpy errorSpy(&process, SIGNAL(error(QProcess::ProcessError)));
QSignalSpy finishedSpy(&process, SIGNAL(finished(int)));
- QSignalSpy finishedSpy2(&process, SIGNAL(finished(int, QProcess::ExitStatus)));
+ QSignalSpy finishedSpy2(&process, SIGNAL(finished(int,QProcess::ExitStatus)));
QVERIFY(errorSpy.isValid());
QVERIFY(finishedSpy.isValid());
QProcess process;
QSignalSpy errorSpy(&process, SIGNAL(error(QProcess::ProcessError)));
QSignalSpy finishedSpy1(&process, SIGNAL(finished(int)));
- QSignalSpy finishedSpy2(&process, SIGNAL(finished(int, QProcess::ExitStatus)));
+ QSignalSpy finishedSpy2(&process, SIGNAL(finished(int,QProcess::ExitStatus)));
QVERIFY(errorSpy.isValid());
QVERIFY(finishedSpy1.isValid());
QProcess process;
QSignalSpy spyStarted(&process, SIGNAL(started()));
- QSignalSpy spyFinished(&process, SIGNAL(finished(int, QProcess::ExitStatus)));
+ QSignalSpy spyFinished(&process, SIGNAL(finished(int,QProcess::ExitStatus)));
QVERIFY(spyStarted.isValid());
QVERIFY(spyFinished.isValid());
{
QtTestModel model(10, 10);
- QSignalSpy rowsAboutToBeRemovedSpy(&model, SIGNAL(rowsAboutToBeRemoved( const QModelIndex &, int , int )));
- QSignalSpy rowsRemovedSpy(&model, SIGNAL(rowsRemoved( const QModelIndex &, int, int )));
+ QSignalSpy rowsAboutToBeRemovedSpy(&model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)));
+ QSignalSpy rowsRemovedSpy(&model, SIGNAL(rowsRemoved(QModelIndex,int,int)));
QVERIFY(rowsAboutToBeRemovedSpy.isValid());
QVERIFY(rowsRemovedSpy.isValid());
{
QtTestModel model(10, 10);
- QSignalSpy columnsAboutToBeRemovedSpy(&model, SIGNAL(columnsAboutToBeRemoved( const QModelIndex &, int , int )));
- QSignalSpy columnsRemovedSpy(&model, SIGNAL(columnsRemoved( const QModelIndex &, int, int )));
+ QSignalSpy columnsAboutToBeRemovedSpy(&model, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)));
+ QSignalSpy columnsRemovedSpy(&model, SIGNAL(columnsRemoved(QModelIndex,int,int)));
QVERIFY(columnsAboutToBeRemovedSpy.isValid());
QVERIFY(columnsRemovedSpy.isValid());
{
QtTestModel model(10, 10);
- QSignalSpy rowsAboutToBeInsertedSpy(&model, SIGNAL(rowsAboutToBeInserted( const QModelIndex &, int , int )));
- QSignalSpy rowsInsertedSpy(&model, SIGNAL(rowsInserted( const QModelIndex &, int, int )));
+ QSignalSpy rowsAboutToBeInsertedSpy(&model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)));
+ QSignalSpy rowsInsertedSpy(&model, SIGNAL(rowsInserted(QModelIndex,int,int)));
QVERIFY(rowsAboutToBeInsertedSpy.isValid());
QVERIFY(rowsInsertedSpy.isValid());
{
QtTestModel model(10, 10);
- QSignalSpy columnsAboutToBeInsertedSpy(&model, SIGNAL(columnsAboutToBeInserted( const QModelIndex &, int , int )));
- QSignalSpy columnsInsertedSpy(&model, SIGNAL(columnsInserted( const QModelIndex &, int, int )));
+ QSignalSpy columnsAboutToBeInsertedSpy(&model, SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int)));
+ QSignalSpy columnsInsertedSpy(&model, SIGNAL(columnsInserted(QModelIndex,int,int)));
QVERIFY(columnsAboutToBeInsertedSpy.isValid());
QVERIFY(columnsInsertedSpy.isValid());
{
QtTestModel model(10, 10);
- QSignalSpy rowsAboutToBeMovedSpy(&model, SIGNAL(rowsAboutToBeMoved(const QModelIndex &, int , int, const QModelIndex &, int)));
- QSignalSpy rowsMovedSpy(&model, SIGNAL(rowsMoved(const QModelIndex &, int , int, const QModelIndex &, int)));
+ QSignalSpy rowsAboutToBeMovedSpy(&model, SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)));
+ QSignalSpy rowsMovedSpy(&model, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)));
QVERIFY(rowsAboutToBeMovedSpy.isValid());
QVERIFY(rowsMovedSpy.isValid());
{
QtTestModel model(10, 10);
- QSignalSpy columnsAboutToBeMovedSpy(&model, SIGNAL(columnsAboutToBeMoved(const QModelIndex &, int , int, const QModelIndex &, int)));
- QSignalSpy columnsMovedSpy(&model, SIGNAL(columnsMoved(const QModelIndex &, int , int, const QModelIndex &, int)));
+ QSignalSpy columnsAboutToBeMovedSpy(&model, SIGNAL(columnsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)));
+ QSignalSpy columnsMovedSpy(&model, SIGNAL(columnsMoved(QModelIndex,int,int,QModelIndex,int)));
QVERIFY(columnsAboutToBeMovedSpy.isValid());
QVERIFY(columnsMovedSpy.isValid());
}
}
- QSignalSpy beforeSpy(m_model, SIGNAL(rowsAboutToBeMoved(const QModelIndex &, int, int, const QModelIndex &, int)));
- QSignalSpy afterSpy(m_model, SIGNAL(rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int)));
+ QSignalSpy beforeSpy(m_model, SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)));
+ QSignalSpy afterSpy(m_model, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)));
QVERIFY(beforeSpy.isValid());
QVERIFY(afterSpy.isValid());
}
}
- QSignalSpy beforeSpy(m_model, SIGNAL(rowsAboutToBeMoved(const QModelIndex &, int, int, const QModelIndex &, int)));
- QSignalSpy afterSpy(m_model, SIGNAL(rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int)));
+ QSignalSpy beforeSpy(m_model, SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)));
+ QSignalSpy afterSpy(m_model, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)));
QVERIFY(beforeSpy.isValid());
QVERIFY(afterSpy.isValid());
}
}
- QSignalSpy beforeSpy(m_model, SIGNAL(rowsAboutToBeMoved(const QModelIndex &, int, int, const QModelIndex &, int)));
- QSignalSpy afterSpy(m_model, SIGNAL(rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int)));
+ QSignalSpy beforeSpy(m_model, SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)));
+ QSignalSpy afterSpy(m_model, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)));
QVERIFY(beforeSpy.isValid());
QVERIFY(afterSpy.isValid());
persistentList << QPersistentModelIndex(idx);
}
- QSignalSpy beforeSpy(m_model, SIGNAL(rowsAboutToBeMoved(const QModelIndex &, int, int, const QModelIndex &, int)));
- QSignalSpy afterSpy(m_model, SIGNAL(rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int)));
+ QSignalSpy beforeSpy(m_model, SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)));
+ QSignalSpy afterSpy(m_model, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)));
QVERIFY(beforeSpy.isValid());
QVERIFY(afterSpy.isValid());
persistentList << QPersistentModelIndex(idx);
}
- QSignalSpy beforeSpy(m_model, SIGNAL(rowsAboutToBeMoved(const QModelIndex &, int, int, const QModelIndex &, int)));
- QSignalSpy afterSpy(m_model, SIGNAL(rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int)));
+ QSignalSpy beforeSpy(m_model, SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)));
+ QSignalSpy afterSpy(m_model, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)));
QVERIFY(beforeSpy.isValid());
QVERIFY(afterSpy.isValid());
persistentList << QPersistentModelIndex(idx);
}
- QSignalSpy beforeSpy(m_model, SIGNAL(rowsAboutToBeMoved(const QModelIndex &, int, int, const QModelIndex &, int)));
- QSignalSpy afterSpy(m_model, SIGNAL(rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int)));
+ QSignalSpy beforeSpy(m_model, SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)));
+ QSignalSpy afterSpy(m_model, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)));
QVERIFY(beforeSpy.isValid());
QVERIFY(afterSpy.isValid());
QFETCH(int, endRow);
QFETCH(int, destRow);
- QSignalSpy beforeSpy(m_model, SIGNAL(rowsAboutToBeMoved(const QModelIndex &, int, int, const QModelIndex &, int)));
- QSignalSpy afterSpy(m_model, SIGNAL(rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int)));
+ QSignalSpy beforeSpy(m_model, SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)));
+ QSignalSpy afterSpy(m_model, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)));
QVERIFY(beforeSpy.isValid());
QVERIFY(afterSpy.isValid());
QFETCH(QString, modelType);
currentModel = testModels->createModel(modelType);
QVERIFY(currentModel);
- QSignalSpy spy(currentModel, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)));
+ QSignalSpy spy(currentModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)));
QVERIFY(spy.isValid());
QCOMPARE(currentModel->setData(QModelIndex(), QVariant()), false);
QCOMPARE(spy.count(), 0);
QVERIFY(index.isValid());
qRegisterMetaType<Qt::Orientation>("Qt::Orientation");
- QSignalSpy spy(currentModel, SIGNAL(headerDataChanged( Qt::Orientation, int , int )));
+ QSignalSpy spy(currentModel, SIGNAL(headerDataChanged(Qt::Orientation,int,int)));
QVERIFY(spy.isValid());
QString text = "Index private pointers should always be the same";
// When a row or column is removed there should be two signals.
// Watch to make sure they are emitted and get the row/column count when they do get emitted by connecting them to a slot
- QSignalSpy columnsAboutToBeRemovedSpy(currentModel, SIGNAL(columnsAboutToBeRemoved( const QModelIndex &, int , int )));
- QSignalSpy rowsAboutToBeRemovedSpy(currentModel, SIGNAL(rowsAboutToBeRemoved( const QModelIndex &, int , int )));
- QSignalSpy columnsRemovedSpy(currentModel, SIGNAL(columnsRemoved( const QModelIndex &, int, int )));
- QSignalSpy rowsRemovedSpy(currentModel, SIGNAL(rowsRemoved( const QModelIndex &, int, int )));
+ QSignalSpy columnsAboutToBeRemovedSpy(currentModel, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)));
+ QSignalSpy rowsAboutToBeRemovedSpy(currentModel, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)));
+ QSignalSpy columnsRemovedSpy(currentModel, SIGNAL(columnsRemoved(QModelIndex,int,int)));
+ QSignalSpy rowsRemovedSpy(currentModel, SIGNAL(rowsRemoved(QModelIndex,int,int)));
QSignalSpy modelResetSpy(currentModel, SIGNAL(modelReset()));
QSignalSpy modelLayoutChangedSpy(currentModel, SIGNAL(layoutChanged()));
//
// test removeRow()
//
- connect(currentModel, SIGNAL(rowsAboutToBeRemoved( const QModelIndex &, int , int )),
- this, SLOT(slot_rowsAboutToRemove(const QModelIndex &)));
- connect(currentModel, SIGNAL(rowsRemoved( const QModelIndex &, int , int )),
- this, SLOT(slot_rowsRemoved(const QModelIndex &)));
+ connect(currentModel, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
+ this, SLOT(slot_rowsAboutToRemove(QModelIndex)));
+ connect(currentModel, SIGNAL(rowsRemoved(QModelIndex,int,int)),
+ this, SLOT(slot_rowsRemoved(QModelIndex)));
int beforeRemoveRowCount = currentModel->rowCount(parentOfRemoved);
QPersistentModelIndex dyingIndex = currentModel->index(start + count + 1, 0, parentOfRemoved);
QCOMPARE(currentModel->removeRows(start, count, parentOfRemoved), shouldSucceed);
QCOMPARE(currentModel->rowCount(parentOfRemoved), beforeRemoveRowCount);
}
- disconnect(currentModel, SIGNAL(rowsAboutToBeRemoved( const QModelIndex &, int , int )),
- this, SLOT(slot_rowsAboutToRemove(const QModelIndex &)));
- disconnect(currentModel, SIGNAL(rowsRemoved( const QModelIndex &, int , int )),
- this, SLOT(slot_rowsRemoved(const QModelIndex &)));
+ disconnect(currentModel, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
+ this, SLOT(slot_rowsAboutToRemove(QModelIndex)));
+ disconnect(currentModel, SIGNAL(rowsRemoved(QModelIndex,int,int)),
+ this, SLOT(slot_rowsRemoved(QModelIndex)));
modelResetSpy.clear();
QCOMPARE(modelResetSpy.count(), 0);
//
// Test remove column
//
- connect(currentModel, SIGNAL(columnsAboutToBeRemoved( const QModelIndex &, int , int )),
- this, SLOT(slot_columnsAboutToRemove(const QModelIndex &)));
- connect(currentModel, SIGNAL(columnsRemoved( const QModelIndex &, int , int )),
- this, SLOT(slot_columnsRemoved(const QModelIndex &)));
+ connect(currentModel, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)),
+ this, SLOT(slot_columnsAboutToRemove(QModelIndex)));
+ connect(currentModel, SIGNAL(columnsRemoved(QModelIndex,int,int)),
+ this, SLOT(slot_columnsRemoved(QModelIndex)));
int beforeRemoveColumnCount = currentModel->columnCount(parentOfRemoved);
// Some models don't let you remove the column, only row
else
QCOMPARE(currentModel->rowCount(parentOfRemoved), beforeRemoveRowCount);
}
- disconnect(currentModel, SIGNAL(columnsAboutToBeRemoved( const QModelIndex &, int , int )),
- this, SLOT(slot_columnsAboutToRemove(const QModelIndex &)));
- disconnect(currentModel, SIGNAL(columnsRemoved( const QModelIndex &, int , int )),
- this, SLOT(slot_columnsRemoved(const QModelIndex &)));
+ disconnect(currentModel, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)),
+ this, SLOT(slot_columnsAboutToRemove(QModelIndex)));
+ disconnect(currentModel, SIGNAL(columnsRemoved(QModelIndex,int,int)),
+ this, SLOT(slot_columnsRemoved(QModelIndex)));
if (columnsAboutToBeRemovedSpy.count() > 0){
QList<QVariant> arguments = columnsAboutToBeRemovedSpy.at(0);
// When a row or column is inserted there should be two signals.
// Watch to make sure they are emitted and get the row/column count when they do get emitted by connecting them to a slot
- QSignalSpy columnsAboutToBeInsertedSpy(currentModel, SIGNAL(columnsAboutToBeInserted( const QModelIndex &, int , int )));
- QSignalSpy rowsAboutToBeInsertedSpy(currentModel, SIGNAL(rowsAboutToBeInserted( const QModelIndex &, int , int )));
- QSignalSpy columnsInsertedSpy(currentModel, SIGNAL(columnsInserted( const QModelIndex &, int, int )));
- QSignalSpy rowsInsertedSpy(currentModel, SIGNAL(rowsInserted( const QModelIndex &, int, int )));
+ QSignalSpy columnsAboutToBeInsertedSpy(currentModel, SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int)));
+ QSignalSpy rowsAboutToBeInsertedSpy(currentModel, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)));
+ QSignalSpy columnsInsertedSpy(currentModel, SIGNAL(columnsInserted(QModelIndex,int,int)));
+ QSignalSpy rowsInsertedSpy(currentModel, SIGNAL(rowsInserted(QModelIndex,int,int)));
QSignalSpy modelResetSpy(currentModel, SIGNAL(modelReset()));
QSignalSpy modelLayoutChangedSpy(currentModel, SIGNAL(layoutChanged()));
//
// test insertRow()
//
- connect(currentModel, SIGNAL(rowsAboutToBeInserted( const QModelIndex &, int , int )),
- this, SLOT(slot_rowsAboutToInserted(const QModelIndex &)));
- connect(currentModel, SIGNAL(rowsInserted( const QModelIndex &, int , int )),
- this, SLOT(slot_rowsInserted(const QModelIndex &)));
+ connect(currentModel, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),
+ this, SLOT(slot_rowsAboutToInserted(QModelIndex)));
+ connect(currentModel, SIGNAL(rowsInserted(QModelIndex,int,int)),
+ this, SLOT(slot_rowsInserted(QModelIndex)));
int beforeInsertRowCount = currentModel->rowCount(parentOfInserted);
QCOMPARE(currentModel->insertRows(start, count, parentOfInserted), shouldSucceed);
currentModel->submit();
QCOMPARE(currentModel->rowCount(parentOfInserted), beforeInsertRowCount);
}
- disconnect(currentModel, SIGNAL(rowsAboutToBeInserted( const QModelIndex &, int , int )),
- this, SLOT(slot_rowsAboutToInserted(const QModelIndex &)));
- disconnect(currentModel, SIGNAL(rowsInserted( const QModelIndex &, int , int )),
- this, SLOT(slot_rowsInserted(const QModelIndex &)));
+ disconnect(currentModel, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),
+ this, SLOT(slot_rowsAboutToInserted(QModelIndex)));
+ disconnect(currentModel, SIGNAL(rowsInserted(QModelIndex,int,int)),
+ this, SLOT(slot_rowsInserted(QModelIndex)));
modelResetSpy.clear();
//
// Test insertColumn()
//
- connect(currentModel, SIGNAL(columnsAboutToBeInserted( const QModelIndex &, int , int )),
- this, SLOT(slot_columnsAboutToInserted(const QModelIndex &)));
- connect(currentModel, SIGNAL(columnsInserted( const QModelIndex &, int , int )),
- this, SLOT(slot_columnsInserted(const QModelIndex &)));
+ connect(currentModel, SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int)),
+ this, SLOT(slot_columnsAboutToInserted(QModelIndex)));
+ connect(currentModel, SIGNAL(columnsInserted(QModelIndex,int,int)),
+ this, SLOT(slot_columnsInserted(QModelIndex)));
int beforeInsertColumnCount = currentModel->columnCount(parentOfInserted);
// Some models don't let you insert the column, only row
else
QCOMPARE(currentModel->rowCount(parentOfInserted), beforeInsertRowCount);
}
- disconnect(currentModel, SIGNAL(columnsAboutToBeInserted( const QModelIndex &, int , int )),
- this, SLOT(slot_columnsAboutToInserted(const QModelIndex &)));
- disconnect(currentModel, SIGNAL(columnsInserted( const QModelIndex &, int , int )),
- this, SLOT(slot_columnsInserted(const QModelIndex &)));
+ disconnect(currentModel, SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int)),
+ this, SLOT(slot_columnsAboutToInserted(QModelIndex)));
+ disconnect(currentModel, SIGNAL(columnsInserted(QModelIndex,int,int)),
+ this, SLOT(slot_columnsInserted(QModelIndex)));
if (columnsAboutToBeInsertedSpy.count() > 0){
QList<QVariant> arguments = columnsAboutToBeInsertedSpy.at(0);
QItemSelectionModel selectionModel(&model);
selectionModel.select(sel, QItemSelectionModel::SelectCurrent);
- QSignalSpy deselectSpy(&selectionModel, SIGNAL(selectionChanged(const QItemSelection& , const QItemSelection&)));
+ QSignalSpy deselectSpy(&selectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)));
QVERIFY(deselectSpy.isValid());
model.removeRows(0, 1, root);
QVERIFY(deselectSpy.count() == 1);
RemovalObserver(QItemSelectionModel *selectionModel)
: m_itemSelectionModel(selectionModel)
{
- connect(m_itemSelectionModel, SIGNAL(selectionChanged(QItemSelection, QItemSelection)), SLOT(selectionChanged(QItemSelection, QItemSelection)));
+ connect(m_itemSelectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)), SLOT(selectionChanged(QItemSelection,QItemSelection)));
}
public slots:
RemovalObserver ro(&selModel);
- QSignalSpy spy(&selModel, SIGNAL(selectionChanged(QItemSelection, QItemSelection)));
+ QSignalSpy spy(&selModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)));
QVERIFY(spy.isValid());
bool ok = model.removeRows(4, 2);
view.show();
view.setModel(&proxy);
- QSignalSpy spy(view.selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)));
+ QSignalSpy spy(view.selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)));
QVERIFY(spy.isValid());
view.setCurrentIndex(proxy.index(0, 0));
proxy.sort(0, static_cast<Qt::SortOrder>(sortOrder));
(void)proxy.rowCount(QModelIndex()); // force mapping
- QSignalSpy removeSpy(&proxy, SIGNAL(rowsRemoved(QModelIndex, int, int)));
- QSignalSpy insertSpy(&proxy, SIGNAL(rowsInserted(QModelIndex, int, int)));
- QSignalSpy aboutToRemoveSpy(&proxy, SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)));
- QSignalSpy aboutToInsertSpy(&proxy, SIGNAL(rowsAboutToBeInserted(QModelIndex, int, int)));
+ QSignalSpy removeSpy(&proxy, SIGNAL(rowsRemoved(QModelIndex,int,int)));
+ QSignalSpy insertSpy(&proxy, SIGNAL(rowsInserted(QModelIndex,int,int)));
+ QSignalSpy aboutToRemoveSpy(&proxy, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)));
+ QSignalSpy aboutToInsertSpy(&proxy, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)));
QVERIFY(removeSpy.isValid());
QVERIFY(insertSpy.isValid());
proxy.sort(0, static_cast<Qt::SortOrder>(sortOrder));
(void)proxy.rowCount(QModelIndex()); // force mapping
- QSignalSpy initialRemoveSpy(&proxy, SIGNAL(rowsRemoved(QModelIndex, int, int)));
- QSignalSpy initialInsertSpy(&proxy, SIGNAL(rowsInserted(QModelIndex, int, int)));
+ QSignalSpy initialRemoveSpy(&proxy, SIGNAL(rowsRemoved(QModelIndex,int,int)));
+ QSignalSpy initialInsertSpy(&proxy, SIGNAL(rowsInserted(QModelIndex,int,int)));
QVERIFY(initialRemoveSpy.isValid());
QVERIFY(initialInsertSpy.isValid());
QCOMPARE(proxy.data(index, Qt::DisplayRole).toString(), initialProxyItems.at(i));
}
- QSignalSpy finalRemoveSpy(&proxy, SIGNAL(rowsRemoved(QModelIndex, int, int)));
- QSignalSpy finalInsertSpy(&proxy, SIGNAL(rowsInserted(QModelIndex, int, int)));
+ QSignalSpy finalRemoveSpy(&proxy, SIGNAL(rowsRemoved(QModelIndex,int,int)));
+ QSignalSpy finalInsertSpy(&proxy, SIGNAL(rowsInserted(QModelIndex,int,int)));
QVERIFY(finalRemoveSpy.isValid());
QVERIFY(finalInsertSpy.isValid());
proxy.setFilterRegExp(filter);
- QSignalSpy removeSpy(&proxy, SIGNAL(rowsRemoved(QModelIndex, int, int)));
- QSignalSpy insertSpy(&proxy, SIGNAL(rowsInserted(QModelIndex, int, int)));
+ QSignalSpy removeSpy(&proxy, SIGNAL(rowsRemoved(QModelIndex,int,int)));
+ QSignalSpy insertSpy(&proxy, SIGNAL(rowsInserted(QModelIndex,int,int)));
QVERIFY(removeSpy.isValid());
QVERIFY(insertSpy.isValid());
view.show();
view.setModel(&proxy);
- QSignalSpy spy(view.selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)));
+ QSignalSpy spy(view.selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)));
QVERIFY(spy.isValid());
view.setCurrentIndex(proxy.index(0, 0));
QSortFilterProxyModel proxy;
proxy.setSourceModel(&model);
- QSignalSpy colsInsertedSpy(&proxy, SIGNAL(columnsInserted(const QModelIndex&, int, int)));
- QSignalSpy rowsInsertedSpy(&proxy, SIGNAL(rowsInserted(const QModelIndex&, int, int)));
+ QSignalSpy colsInsertedSpy(&proxy, SIGNAL(columnsInserted(QModelIndex,int,int)));
+ QSignalSpy rowsInsertedSpy(&proxy, SIGNAL(rowsInserted(QModelIndex,int,int)));
QVERIFY(colsInsertedSpy.isValid());
QVERIFY(rowsInsertedSpy.isValid());
EvenOddFilterModel proxy;
proxy.setSourceModel(&model);
- QSignalSpy spy(&proxy, SIGNAL(rowsInserted(const QModelIndex&, int, int)));
+ QSignalSpy spy(&proxy, SIGNAL(rowsInserted(QModelIndex,int,int)));
QVERIFY(spy.isValid());
QStandardItem *itemA = new QStandardItem();
QStandardItem *itemC = new QStandardItem("C");
itemA->appendRow(itemC); // filtered
- QSignalSpy removedSpy(&proxy, SIGNAL(rowsRemoved(const QModelIndex&, int, int)));
- QSignalSpy insertedSpy(&proxy, SIGNAL(rowsInserted(const QModelIndex&, int, int)));
+ QSignalSpy removedSpy(&proxy, SIGNAL(rowsRemoved(QModelIndex,int,int)));
+ QSignalSpy insertedSpy(&proxy, SIGNAL(rowsInserted(QModelIndex,int,int)));
QVERIFY(removedSpy.isValid());
QVERIFY(insertedSpy.isValid());
QStringListModel *model = new QStringListModel(input);
QModelListener *pListener = new QModelListener(&aboutto, &res, model);
- pListener->connect(model, SIGNAL( rowsAboutToBeRemoved(const QModelIndex & , int , int )),
- pListener, SLOT( rowsAboutToBeRemovedOrInserted(const QModelIndex & , int , int )) );
+ pListener->connect(model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
+ pListener, SLOT(rowsAboutToBeRemovedOrInserted(QModelIndex,int,int)) );
- pListener->connect(model, SIGNAL( rowsRemoved(const QModelIndex & , int , int )),
- pListener, SLOT( rowsRemovedOrInserted(const QModelIndex & , int , int )) );
+ pListener->connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
+ pListener, SLOT(rowsRemovedOrInserted(QModelIndex,int,int)) );
model->removeRows(row,count);
// At this point, control goes to our connected slots inn this order:
QStringListModel *model = new QStringListModel(input);
QModelListener *pListener = new QModelListener(&aboutto, &res, model);
- connect(model, SIGNAL( rowsAboutToBeInserted(const QModelIndex & , int , int )),
- pListener, SLOT( rowsAboutToBeRemovedOrInserted(const QModelIndex & , int , int )) );
+ connect(model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),
+ pListener, SLOT(rowsAboutToBeRemovedOrInserted(QModelIndex,int,int)) );
- connect(model, SIGNAL( rowsInserted(const QModelIndex & , int , int )),
- pListener, SLOT( rowsRemovedOrInserted(const QModelIndex & , int , int )) );
+ connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)),
+ pListener, SLOT(rowsRemovedOrInserted(QModelIndex,int,int)) );
model->insertRows(row,count);
// At this point, control goes to our connected slots inn this order:
if (::Step == 5)
{
- disconnect (s, SIGNAL (fired ()), s->d, SLOT (received ()));
+ disconnect (s, SIGNAL(fired()), s->d, SLOT(received()));
- connect (&RandomSender, SIGNAL (fired ()), s->d, SLOT (received ()));
+ connect (&RandomSender, SIGNAL(fired()), s->d, SLOT(received()));
}
TRACE (stepCopy, "ends Disconnector::received()");
{
this->r = r; this->d = d;
if (r)
- connect (this, SIGNAL (fired ()), r, SLOT (received ()));
+ connect (this, SIGNAL(fired()), r, SLOT(received()));
if (d)
- connect (this, SIGNAL (fired ()), d, SLOT (received ()));
+ connect (this, SIGNAL(fired()), d, SLOT(received()));
};
void Sender::fire ()
ReceiverObject *r1 = new ReceiverObject;
ReceiverObject *r2 = new ReceiverObject;
- connect( s, SIGNAL( signal1() ), r1, SLOT( slot1() ) );
+ connect( s, SIGNAL(signal1()), r1, SLOT(slot1()) );
- connect( s, SIGNAL( signal2() ), r1, SLOT( slot2() ) );
- connect( s, SIGNAL( signal3() ), r1, SLOT( slot3() ) );
- connect( s, SIGNAL( signal4() ), r1, SLOT( slot4() ) );
+ connect( s, SIGNAL(signal2()), r1, SLOT(slot2()) );
+ connect( s, SIGNAL(signal3()), r1, SLOT(slot3()) );
+ connect( s, SIGNAL(signal4()), r1, SLOT(slot4()) );
s->emitSignal1();
s->emitSignal2();
r1->reset();
// usual disconnect with all parameters given
- bool ret = QObject::disconnect( s, SIGNAL( signal1() ), r1, SLOT( slot1() ) );
+ bool ret = QObject::disconnect( s, SIGNAL(signal1()), r1, SLOT(slot1()) );
s->emitSignal1();
r1->reset();
QVERIFY(ret);
- ret = QObject::disconnect( s, SIGNAL( signal1() ), r1, SLOT( slot1() ) );
+ ret = QObject::disconnect( s, SIGNAL(signal1()), r1, SLOT(slot1()) );
QVERIFY(!ret);
// disconnect all signals from s from all slots from r1
QVERIFY(!r1->called(4));
r1->reset();
- connect( s, SIGNAL( signal1() ), r1, SLOT( slot1() ) );
- connect( s, SIGNAL( signal1() ), r1, SLOT( slot2() ) );
- connect( s, SIGNAL( signal1() ), r1, SLOT( slot3() ) );
- connect( s, SIGNAL( signal2() ), r1, SLOT( slot4() ) );
+ connect( s, SIGNAL(signal1()), r1, SLOT(slot1()) );
+ connect( s, SIGNAL(signal1()), r1, SLOT(slot2()) );
+ connect( s, SIGNAL(signal1()), r1, SLOT(slot3()) );
+ connect( s, SIGNAL(signal2()), r1, SLOT(slot4()) );
// disconnect s's signal1() from all slots of r1
- QObject::disconnect( s, SIGNAL( signal1() ), r1, 0 );
+ QObject::disconnect( s, SIGNAL(signal1()), r1, 0 );
s->emitSignal1();
s->emitSignal2();
// make sure all is disconnected again
QObject::disconnect( s, 0, r1, 0 );
- connect( s, SIGNAL( signal1() ), r1, SLOT( slot1() ) );
- connect( s, SIGNAL( signal1() ), r2, SLOT( slot1() ) );
- connect( s, SIGNAL( signal2() ), r1, SLOT( slot2() ) );
- connect( s, SIGNAL( signal2() ), r2, SLOT( slot2() ) );
- connect( s, SIGNAL( signal3() ), r1, SLOT( slot3() ) );
- connect( s, SIGNAL( signal3() ), r2, SLOT( slot3() ) );
+ connect( s, SIGNAL(signal1()), r1, SLOT(slot1()) );
+ connect( s, SIGNAL(signal1()), r2, SLOT(slot1()) );
+ connect( s, SIGNAL(signal2()), r1, SLOT(slot2()) );
+ connect( s, SIGNAL(signal2()), r2, SLOT(slot2()) );
+ connect( s, SIGNAL(signal3()), r1, SLOT(slot3()) );
+ connect( s, SIGNAL(signal3()), r2, SLOT(slot3()) );
// disconnect signal1() from all receivers
- QObject::disconnect( s, SIGNAL( signal1() ), 0, 0 );
+ QObject::disconnect( s, SIGNAL(signal1()), 0, 0 );
s->emitSignal1();
s->emitSignal2();
s->emitSignal3();
void tst_QObject::dumpObjectInfo()
{
QObject a, b;
- QObject::connect(&a, SIGNAL(destroyed(QObject *)), &b, SLOT(deleteLater()));
+ QObject::connect(&a, SIGNAL(destroyed(QObject*)), &b, SLOT(deleteLater()));
a.disconnect(&b);
#ifdef QT_DEBUG
QTest::ignoreMessage(QtDebugMsg, "OBJECT QObject::unnamed");
r2->reset();
ReceiverObject::sequence = 0;
- QVERIFY( connect( s, SIGNAL( signal1() ), r1, SLOT( slot1() ) , Qt::UniqueConnection) );
- QVERIFY( connect( s, SIGNAL( signal1() ), r2, SLOT( slot1() ) , Qt::UniqueConnection) );
- QVERIFY( connect( s, SIGNAL( signal1() ), r1, SLOT( slot3() ) , Qt::UniqueConnection) );
- QVERIFY( connect( s, SIGNAL( signal3() ), r1, SLOT( slot3() ) , Qt::UniqueConnection) );
+ QVERIFY( connect( s, SIGNAL(signal1()), r1, SLOT(slot1()) , Qt::UniqueConnection) );
+ QVERIFY( connect( s, SIGNAL(signal1()), r2, SLOT(slot1()) , Qt::UniqueConnection) );
+ QVERIFY( connect( s, SIGNAL(signal1()), r1, SLOT(slot3()) , Qt::UniqueConnection) );
+ QVERIFY( connect( s, SIGNAL(signal3()), r1, SLOT(slot3()) , Qt::UniqueConnection) );
s->emitSignal1();
s->emitSignal2();
r2->reset();
ReceiverObject::sequence = 0;
- QVERIFY( connect( s, SIGNAL( signal4() ), r1, SLOT( slot4() ) , Qt::UniqueConnection) );
- QVERIFY( connect( s, SIGNAL( signal4() ), r2, SLOT( slot4() ) , Qt::UniqueConnection) );
- QVERIFY(!connect( s, SIGNAL( signal4() ), r2, SLOT( slot4() ) , Qt::UniqueConnection) );
- QVERIFY( connect( s, SIGNAL( signal1() ), r2, SLOT( slot4() ) , Qt::UniqueConnection) );
- QVERIFY(!connect( s, SIGNAL( signal4() ), r1, SLOT( slot4() ) , Qt::UniqueConnection) );
+ QVERIFY( connect( s, SIGNAL(signal4()), r1, SLOT(slot4()) , Qt::UniqueConnection) );
+ QVERIFY( connect( s, SIGNAL(signal4()), r2, SLOT(slot4()) , Qt::UniqueConnection) );
+ QVERIFY(!connect( s, SIGNAL(signal4()), r2, SLOT(slot4()) , Qt::UniqueConnection) );
+ QVERIFY( connect( s, SIGNAL(signal1()), r2, SLOT(slot4()) , Qt::UniqueConnection) );
+ QVERIFY(!connect( s, SIGNAL(signal4()), r1, SLOT(slot4()) , Qt::UniqueConnection) );
s->emitSignal4();
QCOMPARE( r1->count_slot4, 1 );
r2->reset();
ReceiverObject::sequence = 0;
- connect( s, SIGNAL( signal4() ), r1, SLOT( slot4() ) );
+ connect( s, SIGNAL(signal4()), r1, SLOT(slot4()) );
s->emitSignal4();
QCOMPARE( r1->count_slot4, 2 );
obj2.s_num = 0;
connect (&obj1, SIGNAL(sig(int)) , &obj1, SLOT(slo(int)));
- connect (&obj1, SIGNAL(sig(QObject *, QObject *, QObject *)) , &obj1, SLOT(slo(QObject * , QObject *, QObject *)));
+ connect (&obj1, SIGNAL(sig(QObject*,QObject*,QObject*)) , &obj1, SLOT(slo(QObject*,QObject*,QObject*)));
- connect (&obj1, SIGNAL(sig(QObject *, QObject *, QObject *, QObject *)) , &obj2, SLOT(slo(QObject * , QObject *, QObject *)));
- connect (&obj1, SIGNAL(sig(QObject *)) , &obj2, SLOT(slo()));
- connect (&obj1, SIGNAL(sig(int, int)) , &obj2, SLOT(slo(int, int)));
+ connect (&obj1, SIGNAL(sig(QObject*,QObject*,QObject*,QObject*)) , &obj2, SLOT(slo(QObject*,QObject*,QObject*)));
+ connect (&obj1, SIGNAL(sig(QObject*)) , &obj2, SLOT(slo()));
+ connect (&obj1, SIGNAL(sig(int,int)) , &obj2, SLOT(slo(int,int)));
emit obj1.sig(0.5); //connected to nothing
emit obj1.sig(1, 'a'); //connected to nothing
mapper.setMapping(&src3, "three");
connect(&mapper, SIGNAL(mapped(int)), &target, SLOT(myslot(int)));
- connect(&mapper, SIGNAL(mapped(const QString &)), &target, SLOT(myslot(const QString &)));
+ connect(&mapper, SIGNAL(mapped(QString)), &target, SLOT(myslot(QString)));
src1.emit_mysignal(20);
QVERIFY(target.id == 1);
SignalEmitter emitter;
QState *s0 = new QState(&machine);
QFinalState *s1 = new QFinalState(&machine);
- QSignalTransition *t0 = s0->addTransition(&emitter, SIGNAL( signalWithNoArg( ) ), s1);
+ QSignalTransition *t0 = s0->addTransition(&emitter, SIGNAL(signalWithNoArg()), s1);
QVERIFY(t0 != 0);
- QCOMPARE(t0->signal(), QByteArray(SIGNAL( signalWithNoArg( ) )));
+ QCOMPARE(t0->signal(), QByteArray(SIGNAL(signalWithNoArg())));
- QSignalTransition *t1 = s0->addTransition(&emitter, SIGNAL( signalWithStringArg( const QString & ) ), s1);
+ QSignalTransition *t1 = s0->addTransition(&emitter, SIGNAL(signalWithStringArg(QString)), s1);
QVERIFY(t1 != 0);
- QCOMPARE(t1->signal(), QByteArray(SIGNAL( signalWithStringArg( const QString & ) )));
+ QCOMPARE(t1->signal(), QByteArray(SIGNAL(signalWithStringArg(QString))));
QSignalSpy startedSpy(&machine, SIGNAL(started()));
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
s1->addTransition(at);
QPropertyAnimation *defaultAnimation = new QPropertyAnimation(object, "foo");
- connect(defaultAnimation, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)), &counter, SLOT(slot()));
+ connect(defaultAnimation, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)), &counter, SLOT(slot()));
QPropertyAnimation *moreSpecificAnimation = new QPropertyAnimation(object, "foo");
s2->addTransition(moreSpecificAnimation, SIGNAL(finished()), s3);
- connect(moreSpecificAnimation, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)), &counter, SLOT(slot()));
+ connect(moreSpecificAnimation, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)), &counter, SLOT(slot()));
machine.addDefaultAnimation(defaultAnimation);
at->addAnimation(moreSpecificAnimation);
machine.setInitialState(s0);
QState *s1 = new QState(&machine);
SignalEmitter emitter;
- TestSignalTransition *t0 = new TestSignalTransition(&emitter, SIGNAL( signalWithNoArg( ) ), s1);
+ TestSignalTransition *t0 = new TestSignalTransition(&emitter, SIGNAL(signalWithNoArg()), s1);
s0->addTransition(t0);
machine.start();
connect(&watcher, SIGNAL(canceled()), &object, SLOT(canceled()));
connect(&watcher, SIGNAL(finished()), &object, SLOT(finished()));
connect(&watcher, SIGNAL(progressValueChanged(int)), &object, SLOT(progressValueChanged(int)));
- connect(&watcher, SIGNAL(progressRangeChanged(int, int)), &object, SLOT(progressRangeChanged(int, int)));
+ connect(&watcher, SIGNAL(progressRangeChanged(int,int)), &object, SLOT(progressRangeChanged(int,int)));
#endif
connect(&watcher, SIGNAL(resultReadyAt(int)), &object, SLOT(resultReadyAt(int)));
connect(&watcher, SIGNAL(canceled()), &object, SLOT(canceled()));
connect(&watcher, SIGNAL(finished()), &object, SLOT(finished()));
connect(&watcher, SIGNAL(progressValueChanged(int)), &object, SLOT(progressValueChanged(int)));
- connect(&watcher, SIGNAL(progressRangeChanged(int, int)), &object, SLOT(progressRangeChanged(int, int)));
+ connect(&watcher, SIGNAL(progressRangeChanged(int,int)), &object, SLOT(progressRangeChanged(int,int)));
#endif
connect(&watcher, SIGNAL(resultReadyAt(int)), &object, SLOT(resultReadyAt(int)));
QObject::connect(&watcher, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
#ifdef PRINT
QObject::connect(&watcher, SIGNAL(progressValueChanged(int)), &o, SLOT(printProgress(int)));
- QObject::connect(&watcher, SIGNAL(progressTextChanged(const QString &)), &o, SLOT(printText(const QString &)));
+ QObject::connect(&watcher, SIGNAL(progressTextChanged(QString)), &o, SLOT(printText(QString)));
#endif
QObject::connect(&watcher, SIGNAL(progressValueChanged(int)), &o, SLOT(registerProgress(int)));
- QObject::connect(&watcher, SIGNAL(progressTextChanged(const QString &)), &o, SLOT(registerText(const QString &)));
+ QObject::connect(&watcher, SIGNAL(progressTextChanged(QString)), &o, SLOT(registerText(QString)));
watcher.setFuture(f);
QTestEventLoop::instance().enterLoop(5);
if (!model)
qFatal("%s: model must not be null", Q_FUNC_INFO);
- connect ( model, SIGNAL ( columnsAboutToBeInserted ( const QModelIndex &, int, int ) ),
- this, SLOT ( runAllTests() ) );
- connect ( model, SIGNAL ( columnsAboutToBeRemoved ( const QModelIndex &, int, int ) ),
- this, SLOT ( runAllTests() ) );
- connect ( model, SIGNAL ( columnsInserted ( const QModelIndex &, int, int ) ),
- this, SLOT ( runAllTests() ) );
- connect ( model, SIGNAL ( columnsRemoved ( const QModelIndex &, int, int ) ),
- this, SLOT ( runAllTests() ) );
- connect ( model, SIGNAL ( dataChanged ( const QModelIndex &, const QModelIndex & ) ),
- this, SLOT ( runAllTests() ) );
- connect ( model, SIGNAL ( headerDataChanged ( Qt::Orientation, int, int ) ),
- this, SLOT ( runAllTests() ) );
- connect ( model, SIGNAL ( layoutAboutToBeChanged () ), this, SLOT ( runAllTests() ) );
- connect ( model, SIGNAL ( layoutChanged () ), this, SLOT ( runAllTests() ) );
- connect ( model, SIGNAL ( modelReset () ), this, SLOT ( runAllTests() ) );
- connect ( model, SIGNAL ( rowsAboutToBeInserted ( const QModelIndex &, int, int ) ),
- this, SLOT ( runAllTests() ) );
- connect ( model, SIGNAL ( rowsAboutToBeRemoved ( const QModelIndex &, int, int ) ),
- this, SLOT ( runAllTests() ) );
- connect ( model, SIGNAL ( rowsInserted ( const QModelIndex &, int, int ) ),
- this, SLOT ( runAllTests() ) );
- connect ( model, SIGNAL ( rowsRemoved ( const QModelIndex &, int, int ) ),
- this, SLOT ( runAllTests() ) );
+ connect(model, SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int)),
+ this, SLOT(runAllTests()) );
+ connect(model, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)),
+ this, SLOT(runAllTests()) );
+ connect(model, SIGNAL(columnsInserted(QModelIndex,int,int)),
+ this, SLOT(runAllTests()) );
+ connect(model, SIGNAL(columnsRemoved(QModelIndex,int,int)),
+ this, SLOT(runAllTests()) );
+ connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
+ this, SLOT(runAllTests()) );
+ connect(model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
+ this, SLOT(runAllTests()) );
+ connect(model, SIGNAL(layoutAboutToBeChanged()), this, SLOT(runAllTests()) );
+ connect(model, SIGNAL(layoutChanged()), this, SLOT(runAllTests()) );
+ connect(model, SIGNAL(modelReset()), this, SLOT(runAllTests()) );
+ connect(model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),
+ this, SLOT(runAllTests()) );
+ connect(model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
+ this, SLOT(runAllTests()) );
+ connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)),
+ this, SLOT(runAllTests()) );
+ connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
+ this, SLOT(runAllTests()) );
// Special checks for changes
- connect ( model, SIGNAL ( layoutAboutToBeChanged() ),
- this, SLOT ( layoutAboutToBeChanged() ) );
- connect ( model, SIGNAL ( layoutChanged() ),
- this, SLOT ( layoutChanged() ) );
-
- connect ( model, SIGNAL ( rowsAboutToBeInserted ( const QModelIndex &, int, int ) ),
- this, SLOT ( rowsAboutToBeInserted ( const QModelIndex &, int, int ) ) );
- connect ( model, SIGNAL ( rowsAboutToBeRemoved ( const QModelIndex &, int, int ) ),
- this, SLOT ( rowsAboutToBeRemoved ( const QModelIndex &, int, int ) ) );
- connect ( model, SIGNAL ( rowsInserted ( const QModelIndex &, int, int ) ),
- this, SLOT ( rowsInserted ( const QModelIndex &, int, int ) ) );
- connect ( model, SIGNAL ( rowsRemoved ( const QModelIndex &, int, int ) ),
- this, SLOT ( rowsRemoved ( const QModelIndex &, int, int ) ) );
- connect ( model, SIGNAL ( dataChanged ( const QModelIndex &, const QModelIndex & ) ),
- this, SLOT ( dataChanged ( const QModelIndex &, const QModelIndex & ) ) );
- connect ( model, SIGNAL ( headerDataChanged ( Qt::Orientation, int, int ) ),
- this, SLOT ( headerDataChanged ( Qt::Orientation, int, int ) ) );
+ connect(model, SIGNAL(layoutAboutToBeChanged()),
+ this, SLOT(layoutAboutToBeChanged()) );
+ connect(model, SIGNAL(layoutChanged()),
+ this, SLOT(layoutChanged()) );
+
+ connect(model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),
+ this, SLOT(rowsAboutToBeInserted(QModelIndex,int,int)) );
+ connect(model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
+ this, SLOT(rowsAboutToBeRemoved(QModelIndex,int,int)) );
+ connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)),
+ this, SLOT(rowsInserted(QModelIndex,int,int)) );
+ connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
+ this, SLOT(rowsRemoved(QModelIndex,int,int)) );
+ connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
+ this, SLOT(dataChanged(QModelIndex,QModelIndex)) );
+ connect(model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
+ this, SLOT(headerDataChanged(Qt::Orientation,int,int)) );
runAllTests();
}
case 1: {
QTreeView obj;
QBENCHMARK {
- QObject::connect (&obj, SIGNAL(viewportEntered( )), &obj, SLOT(expandAll( )));
- QObject::disconnect(&obj, SIGNAL(viewportEntered( )), &obj, SLOT(expandAll( )));
+ QObject::connect (&obj, SIGNAL(viewportEntered( )), &obj, SLOT(expandAll( ))); // sic: non-normalised
+ QObject::disconnect(&obj, SIGNAL(viewportEntered( )), &obj, SLOT(expandAll( ))); // sic: non-normalised
}
} break;
case 2: {
case 4: {
QTreeView obj;
QBENCHMARK {
- QObject::disconnect(QObject::connect(&obj, SIGNAL(viewportEntered( )), &obj, SLOT(expandAll( ))));
+ QObject::disconnect(QObject::connect(&obj, SIGNAL(viewportEntered( )), &obj, SLOT(expandAll( )))); // sic: non-normalised
}
} break;
case 5: {