qRegisterMetaType<Qt::Orientation>("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);
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;
}
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);
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);
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));
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);
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;
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);
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)),
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)),
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;
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)));
}
}