public:
DummyModel();
void setCount(int count);
- int count() const Q_DECL_OVERRIDE;
- QHash<QByteArray, QVariant> data(int index) const Q_DECL_OVERRIDE;
+ int count() const override;
+ QHash<QByteArray, QVariant> data(int index) const override;
private:
int m_count;
QHash<QByteArray, QVariant> DummyModel::data(int index) const
{
- Q_UNUSED(index);
+ Q_UNUSED(index)
return QHash<QByteArray, QVariant>();
}
void KItemListSelectionManagerTest::cleanup()
{
delete m_selectionManager;
- m_selectionManager = 0;
+ m_selectionManager = nullptr;
delete m_model;
- m_model = 0;
+ m_model = nullptr;
}
void KItemListSelectionManagerTest::testConstructor()
void KItemListSelectionManagerTest::testCurrentItemAnchorItem()
{
- QSignalSpy spyCurrent(m_selectionManager, SIGNAL(currentChanged(int,int)));
+ QSignalSpy spyCurrent(m_selectionManager, &KItemListSelectionManager::currentChanged);
// Set current item and check that the selection manager emits the currentChanged(int,int) signal correctly.
m_selectionManager->setCurrentItem(4);
QFETCH(QList<QVariant>, data);
QFETCH(KItemSet, finalSelection);
- QSignalSpy spySelectionChanged(m_selectionManager, SIGNAL(selectionChanged(KItemSet,KItemSet)));
+ QSignalSpy spySelectionChanged(m_selectionManager, &KItemListSelectionManager::selectionChanged);
// Initial selection should be empty
QVERIFY(!m_selectionManager->hasSelection());
QVERIFY(m_selectionManager->selectedItems().isEmpty());
- // Perform the initial selectiion
+ // Perform the initial selection
m_selectionManager->setSelectedItems(initialSelection);
verifySelectionChange(spySelectionChanged, initialSelection, KItemSet());