From 2ec2edc24d118d9c13482f0306df3cf2314f8898 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 16 Oct 2012 11:02:34 +0200 Subject: [PATCH] normalise signal/slot signatures [QtGui tests] Change-Id: I42e11de9ef1d8a04b2a8e200afb84f2245f3361a Reviewed-by: Stephen Kelly --- .../qstandarditemmodel/tst_qstandarditemmodel.cpp | 80 +++++++++++----------- .../kernel/qguiapplication/tst_qguiapplication.cpp | 2 +- .../gui/text/qtextdocument/tst_qtextdocument.cpp | 16 ++--- .../util/qregexpvalidator/tst_qregexpvalidator.cpp | 2 +- tests/auto/other/atwrapper/atWrapper.cpp | 8 +-- .../widgets/abstractitemview.cpp | 20 +++--- 6 files changed, 64 insertions(+), 64 deletions(-) diff --git a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp index acb6ce8..d28e429 100644 --- a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp +++ b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp @@ -183,23 +183,23 @@ void tst_QStandardItemModel::init() qRegisterMetaType("Qt::Orientation"); m_model = new QStandardItemModel(defaultSize, defaultSize); - connect(m_model, SIGNAL(rowsAboutToBeInserted(QModelIndex, int, int)), - this, SLOT(rowsAboutToBeInserted(QModelIndex, int, int))); - connect(m_model, SIGNAL(rowsInserted(QModelIndex, int, int)), - this, SLOT(rowsInserted(QModelIndex, int, int))); - connect(m_model, SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)), - this, SLOT(rowsAboutToBeRemoved(QModelIndex, int, int))); - connect(m_model, SIGNAL(rowsRemoved(QModelIndex, int, int)), - this, SLOT(rowsRemoved(QModelIndex, int, int))); - - connect(m_model, SIGNAL(columnsAboutToBeInserted(QModelIndex, int, int)), - this, SLOT(columnsAboutToBeInserted(QModelIndex, int, int))); - connect(m_model, SIGNAL(columnsInserted(QModelIndex, int, int)), - this, SLOT(columnsInserted(QModelIndex, int, int))); - connect(m_model, SIGNAL(columnsAboutToBeRemoved(QModelIndex, int, int)), - this, SLOT(columnsAboutToBeRemoved(QModelIndex, int, int))); - connect(m_model, SIGNAL(columnsRemoved(QModelIndex, int, int)), - this, SLOT(columnsRemoved(QModelIndex, int, int))); + connect(m_model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)), + this, SLOT(rowsAboutToBeInserted(QModelIndex,int,int))); + connect(m_model, SIGNAL(rowsInserted(QModelIndex,int,int)), + this, SLOT(rowsInserted(QModelIndex,int,int))); + connect(m_model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), + this, SLOT(rowsAboutToBeRemoved(QModelIndex,int,int))); + connect(m_model, SIGNAL(rowsRemoved(QModelIndex,int,int)), + this, SLOT(rowsRemoved(QModelIndex,int,int))); + + connect(m_model, SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int)), + this, SLOT(columnsAboutToBeInserted(QModelIndex,int,int))); + connect(m_model, SIGNAL(columnsInserted(QModelIndex,int,int)), + this, SLOT(columnsInserted(QModelIndex,int,int))); + connect(m_model, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)), + this, SLOT(columnsAboutToBeRemoved(QModelIndex,int,int))); + connect(m_model, SIGNAL(columnsRemoved(QModelIndex,int,int)), + this, SLOT(columnsRemoved(QModelIndex,int,int))); rcFirst.fill(-1); rcLast.fill(-1); @@ -207,23 +207,23 @@ void tst_QStandardItemModel::init() void tst_QStandardItemModel::cleanup() { - disconnect(m_model, SIGNAL(rowsAboutToBeInserted(QModelIndex, int, int)), - this, SLOT(rowsAboutToBeInserted(QModelIndex, int, int))); - disconnect(m_model, SIGNAL(rowsInserted(QModelIndex, int, int)), - this, SLOT(rowsInserted(QModelIndex, int, int))); - disconnect(m_model, SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)), - this, SLOT(rowsAboutToBeRemoved(QModelIndex, int, int))); - disconnect(m_model, SIGNAL(rowsRemoved(QModelIndex, int, int)), - this, SLOT(rowsRemoved(QModelIndex, int, int))); - - disconnect(m_model, SIGNAL(columnsAboutToBeInserted(QModelIndex, int, int)), - this, SLOT(columnsAboutToBeInserted(QModelIndex, int, int))); - disconnect(m_model, SIGNAL(columnsInserted(QModelIndex, int, int)), - this, SLOT(columnsInserted(QModelIndex, int, int))); - disconnect(m_model, SIGNAL(columnsAboutToBeRemoved(QModelIndex, int, int)), - this, SLOT(columnsAboutToBeRemoved(QModelIndex, int, int))); - disconnect(m_model, SIGNAL(columnsRemoved(QModelIndex, int, int)), - this, SLOT(columnsRemoved(QModelIndex, int, int))); + disconnect(m_model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)), + this, SLOT(rowsAboutToBeInserted(QModelIndex,int,int))); + disconnect(m_model, SIGNAL(rowsInserted(QModelIndex,int,int)), + this, SLOT(rowsInserted(QModelIndex,int,int))); + disconnect(m_model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), + this, SLOT(rowsAboutToBeRemoved(QModelIndex,int,int))); + disconnect(m_model, SIGNAL(rowsRemoved(QModelIndex,int,int)), + this, SLOT(rowsRemoved(QModelIndex,int,int))); + + disconnect(m_model, SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int)), + this, SLOT(columnsAboutToBeInserted(QModelIndex,int,int))); + disconnect(m_model, SIGNAL(columnsInserted(QModelIndex,int,int)), + this, SLOT(columnsInserted(QModelIndex,int,int))); + disconnect(m_model, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)), + this, SLOT(columnsAboutToBeRemoved(QModelIndex,int,int))); + disconnect(m_model, SIGNAL(columnsRemoved(QModelIndex,int,int)), + this, SLOT(columnsRemoved(QModelIndex,int,int))); delete m_model; m_model = 0; } @@ -470,9 +470,9 @@ void tst_QStandardItemModel::setHeaderData() QCOMPARE(m_model->headerData(i, orient).toString(), QString::number(i + 1)); QSignalSpy headerDataChangedSpy( - m_model, SIGNAL(headerDataChanged(Qt::Orientation, int, int))); + m_model, SIGNAL(headerDataChanged(Qt::Orientation,int,int))); QSignalSpy dataChangedSpy( - m_model, SIGNAL(dataChanged(QModelIndex, QModelIndex))); + m_model, SIGNAL(dataChanged(QModelIndex,QModelIndex))); // insert custom values and check for (int i = 0; i < count; ++i) { QString customString = QString("custom") + QString::number(i); @@ -752,7 +752,7 @@ void tst_QStandardItemModel::clear() QSignalSpy modelResetSpy(&model, SIGNAL(modelReset())); QSignalSpy layoutChangedSpy(&model, SIGNAL(layoutChanged())); - QSignalSpy rowsRemovedSpy(&model, SIGNAL(rowsRemoved(QModelIndex, int, int))); + QSignalSpy rowsRemovedSpy(&model, SIGNAL(rowsRemoved(QModelIndex,int,int))); model.clear(); QCOMPARE(modelResetSpy.count(), 1); @@ -1135,7 +1135,7 @@ void tst_QStandardItemModel::getSetItemData() QModelIndex idx = model.index(0, 0, QModelIndex()); QSignalSpy modelDataChangedSpy( - &model, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&))); + &model, SIGNAL(dataChanged(QModelIndex,QModelIndex))); QVERIFY(model.setItemData(idx, roles)); QCOMPARE(modelDataChangedSpy.count(), 1); QVERIFY(model.setItemData(idx, roles)); @@ -1218,9 +1218,9 @@ void tst_QStandardItemModel::itemDataChanged() QStandardItemModel model(6, 4); QStandardItem item; QSignalSpy dataChangedSpy( - &model, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &))); + &model, SIGNAL(dataChanged(QModelIndex,QModelIndex))); QSignalSpy itemChangedSpy( - &model, SIGNAL(itemChanged(QStandardItem *))); + &model, SIGNAL(itemChanged(QStandardItem*))); model.setItem(0, &item); QCOMPARE(dataChangedSpy.count(), 1); diff --git a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp index ccb54b5..cc291f7 100644 --- a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp +++ b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp @@ -107,7 +107,7 @@ void tst_QGuiApplication::focusObject() DummyWindow window2; window1.show(); - QSignalSpy spy(&app, SIGNAL(focusObjectChanged(QObject *))); + QSignalSpy spy(&app, SIGNAL(focusObjectChanged(QObject*))); // verify active window focus propagates to qguiapplication diff --git a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp index 04d994d..cf3265d 100644 --- a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp +++ b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp @@ -1927,8 +1927,8 @@ public: CursorPosSignalSpy(QTextDocument *doc) { calls = 0; - connect(doc, SIGNAL(cursorPositionChanged(const QTextCursor &)), - this, SLOT(cursorPositionChanged(const QTextCursor &))); + connect(doc, SIGNAL(cursorPositionChanged(QTextCursor)), + this, SLOT(cursorPositionChanged(QTextCursor))); } int calls; @@ -2054,17 +2054,17 @@ void tst_QTextDocument::markContentsDirty() QTestDocumentLayout *lout = new QTestDocumentLayout(doc); doc->setDocumentLayout(lout); TestSyntaxHighlighter *highlighter = new TestSyntaxHighlighter(doc); - connect(doc, SIGNAL(contentsChange(int, int, int)), - highlighter, SLOT(markBlockDirty(int, int, int))); + connect(doc, SIGNAL(contentsChange(int,int,int)), + highlighter, SLOT(markBlockDirty(int,int,int))); highlighter->ok = false; cursor.insertText("Some dummy text blah blah"); QVERIFY(highlighter->ok); - disconnect(doc, SIGNAL(contentsChange(int, int, int)), - highlighter, SLOT(markBlockDirty(int, int, int))); - connect(doc, SIGNAL(contentsChange(int, int, int)), - highlighter, SLOT(modifyBlockAgain(int, int, int))); + disconnect(doc, SIGNAL(contentsChange(int,int,int)), + highlighter, SLOT(markBlockDirty(int,int,int))); + connect(doc, SIGNAL(contentsChange(int,int,int)), + highlighter, SLOT(modifyBlockAgain(int,int,int))); highlighter->ok = false; cursor.insertText("FooBar"); QVERIFY(highlighter->ok); diff --git a/tests/auto/gui/util/qregexpvalidator/tst_qregexpvalidator.cpp b/tests/auto/gui/util/qregexpvalidator/tst_qregexpvalidator.cpp index b3631d2..7a2006b 100644 --- a/tests/auto/gui/util/qregexpvalidator/tst_qregexpvalidator.cpp +++ b/tests/auto/gui/util/qregexpvalidator/tst_qregexpvalidator.cpp @@ -112,7 +112,7 @@ void tst_QRegExpValidator::validate() QFETCH( int, state ); QRegExpValidator rv( 0 ); - QSignalSpy spy(&rv, SIGNAL(regExpChanged(const QRegExp&))); + QSignalSpy spy(&rv, SIGNAL(regExpChanged(QRegExp))); QSignalSpy changedSpy(&rv, SIGNAL(changed())); rv.setRegExp( QRegExp( rx ) ); diff --git a/tests/auto/other/atwrapper/atWrapper.cpp b/tests/auto/other/atwrapper/atWrapper.cpp index 46e2291..7297c7a 100644 --- a/tests/auto/other/atwrapper/atWrapper.cpp +++ b/tests/auto/other/atwrapper/atWrapper.cpp @@ -89,7 +89,7 @@ void atWrapper::downloadBaseline() QFtp ftp; - QObject::connect( &ftp, SIGNAL( listInfo( const QUrlInfo & ) ), this, SLOT( ftpMgetAddToList(const QUrlInfo & ) ) ); + QObject::connect( &ftp, SIGNAL(listInfo(QUrlInfo)), this, SLOT(ftpMgetAddToList(QUrlInfo)) ); //Making sure that the needed local directories exist. @@ -268,8 +268,8 @@ void atWrapper::ftpRmDir( QString dir ) //Hack to remove a populated directory. (caveat: containing only files and empty dirs, not recursive!) qDebug() << "Now removing directory: " << dir; QFtp ftp; - QObject::connect( &ftp, SIGNAL( listInfo( const QUrlInfo & ) ), this, SLOT( ftpRmDirAddToList(const QUrlInfo & ) ) ); - QObject::connect( &ftp, SIGNAL( done( bool ) ), this, SLOT( ftpRmDirDone( bool ) ) ); + QObject::connect( &ftp, SIGNAL(listInfo(QUrlInfo)), this, SLOT(ftpRmDirAddToList(QUrlInfo)) ); + QObject::connect( &ftp, SIGNAL(done(bool)), this, SLOT(ftpRmDirDone(bool)) ); ftp.connectToHost( ftpHost ); ftp.login( ftpUser, ftpPass ); @@ -308,7 +308,7 @@ bool atWrapper::ftpMkDir( QString dir ) // IE: conveniance. QFtp ftp; - QSignalSpy commandSpy(&ftp, SIGNAL(commandFinished(int, bool))); + QSignalSpy commandSpy(&ftp, SIGNAL(commandFinished(int,bool))); ftp.connectToHost( ftpHost ); ftp.login( ftpUser, ftpPass ); diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.cpp index bec4e1f..dda99d4 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.cpp @@ -71,7 +71,7 @@ void AbstractItemView::setModel(QAbstractItemModel *model, AbstractViewItem *pro disconnect(m_model, SIGNAL(destroyed()), this, SLOT(_q_modelDestroyed())); disconnect(m_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), - this, SLOT( dataChanged(QModelIndex,QModelIndex))); + this, SLOT(dataChanged(QModelIndex,QModelIndex))); disconnect(m_model, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(rowsInserted(QModelIndex,int,int))); disconnect(m_model, SIGNAL(rowsRemoved(QModelIndex,int,int)), @@ -112,7 +112,7 @@ void AbstractItemView::setModel(QAbstractItemModel *model, AbstractViewItem *pro connect(m_model, SIGNAL(destroyed()), this, SLOT(modelDestroyed())); connect(m_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), - this, SLOT( dataChanged(QModelIndex,QModelIndex))); + this, SLOT(dataChanged(QModelIndex,QModelIndex))); connect(m_model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)), this, SLOT(rowsAboutToBeInserted(QModelIndex,int,int))); connect(m_model, SIGNAL(rowsInserted(QModelIndex,int,int)), @@ -205,11 +205,11 @@ void AbstractItemView::setSelectionModel(QItemSelectionModel *smodel) return; } if (m_selectionModel) { - disconnect(m_selectionModel, SIGNAL(selectionChanged(QItemSelection, QItemSelection)), - this, SLOT(currentSelectionChanged(QItemSelection, QItemSelection))); + disconnect(m_selectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)), + this, SLOT(currentSelectionChanged(QItemSelection,QItemSelection))); - disconnect(m_selectionModel, SIGNAL(currentChanged(QModelIndex, QModelIndex)), - this, SLOT(currentIndexChanged(QModelIndex, QModelIndex))); + disconnect(m_selectionModel, SIGNAL(currentChanged(QModelIndex,QModelIndex)), + this, SLOT(currentIndexChanged(QModelIndex,QModelIndex))); delete m_selectionModel; m_selectionModel = 0; @@ -218,10 +218,10 @@ void AbstractItemView::setSelectionModel(QItemSelectionModel *smodel) m_selectionModel = smodel; if (m_selectionModel) { - connect(m_selectionModel, SIGNAL(selectionChanged(QItemSelection, QItemSelection)), - this, SLOT(currentSelectionChanged(QItemSelection, QItemSelection))); - connect(m_selectionModel, SIGNAL(currentChanged(QModelIndex, QModelIndex)), - this, SLOT(currentIndexChanged(QModelIndex, QModelIndex))); + connect(m_selectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)), + this, SLOT(currentSelectionChanged(QItemSelection,QItemSelection))); + connect(m_selectionModel, SIGNAL(currentChanged(QModelIndex,QModelIndex)), + this, SLOT(currentIndexChanged(QModelIndex,QModelIndex))); } } -- 2.7.4