diff options
Diffstat (limited to 'tests/auto')
8 files changed, 29 insertions, 25 deletions
diff --git a/tests/auto/network/socket/qudpsocket/clientserver/main.cpp b/tests/auto/network/socket/qudpsocket/clientserver/main.cpp index 233d9d1a1c..645aacf22e 100644 --- a/tests/auto/network/socket/qudpsocket/clientserver/main.cpp +++ b/tests/auto/network/socket/qudpsocket/clientserver/main.cpp @@ -79,7 +79,7 @@ public: } fflush(stdout); - connect(this, SIGNAL(readyRead()), this, SLOT(readData())); + connect(this, SIGNAL(readyRead()), this, SLOT(readTestData())); } protected: @@ -101,7 +101,7 @@ protected: } private slots: - void readData() + void readTestData() { printf("readData()\n"); switch (type) { diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp index b80c00e88e..fe1df6c8f0 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp @@ -240,7 +240,7 @@ private slots: void update(); void update2(); void views(); - void event(); + void testEvent(); void eventsToDisabledItems(); void exposedRect(); void tabFocus_emptyScene(); @@ -2911,7 +2911,7 @@ protected: } }; -void tst_QGraphicsScene::event() +void tst_QGraphicsScene::testEvent() { // Test that QGraphicsScene properly propagates events to QObject. CustomScene scene; diff --git a/tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp b/tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp index 81736ad0d0..3fa3fbe0ee 100644 --- a/tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp +++ b/tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp @@ -165,7 +165,8 @@ public: QColumnView::setSelection(rect, command); } - QRegion visualRegionForSelection(QItemSelection selection){ + // visualRegionForSelection() is protected in QColumnView. + QRegion getVisualRegionForSelection(const QItemSelection &selection){ return QColumnView::visualRegionForSelection(selection); } protected: @@ -664,7 +665,7 @@ void tst_QColumnView::visualRegionForSelection() { ColumnView view; QItemSelection emptyItemSelection; - QCOMPARE(QRegion(), view.visualRegionForSelection(emptyItemSelection)); + QCOMPARE(QRegion(), view.getVisualRegionForSelection(emptyItemSelection)); // a region that isn't empty QDirModel model; @@ -680,7 +681,7 @@ void tst_QColumnView::visualRegionForSelection() QModelIndex home = model.index(location); QVERIFY(model.rowCount(home) > 1); QItemSelection itemSelection(model.index(0, 0, home), model.index(model.rowCount(home) - 1, 0, home)); - QVERIFY(QRegion() != view.visualRegionForSelection(itemSelection)); + QVERIFY(QRegion() != view.getVisualRegionForSelection(itemSelection)); } void tst_QColumnView::moveGrip_basic() diff --git a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp index 63d5389e12..fa67e16db9 100644 --- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp +++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp @@ -157,7 +157,7 @@ private slots: void sortIndicatorTracking(); void removeAndInsertRow(); void unhideSection(); - void event(); + void testEvent(); void headerDataChanged(); void currentChanged(); void horizontalOffset(); @@ -1368,7 +1368,7 @@ void tst_QHeaderView::unhideSection() } -void tst_QHeaderView::event() +void tst_QHeaderView::testEvent() { protected_QHeaderView x(Qt::Vertical); x.testEvent(); diff --git a/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp b/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp index 0224f9019a..22a1743ff1 100644 --- a/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp +++ b/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp @@ -220,7 +220,7 @@ private slots: void doLayout(); void rect_data(); void rect(); - void eventFilter(); + void testEventFilter(); void dateTimeEditor_data(); void dateTimeEditor(); void dateAndTimeEditorTest2(); @@ -695,7 +695,7 @@ void tst_QItemDelegate::rect() //TODO : Add a test for the keyPress event //with Qt::Key_Enter and Qt::Key_Return -void tst_QItemDelegate::eventFilter() +void tst_QItemDelegate::testEventFilter() { TestItemDelegate delegate; QWidget widget; diff --git a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp index 02d5c5cdb7..113ec1fd30 100644 --- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp +++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp @@ -505,11 +505,12 @@ class QMoveCursorListView : public QListView public: QMoveCursorListView() : QListView() {} + // enum CursorAction and moveCursor() are protected in QListView. enum CursorAction { MoveUp, MoveDown, MoveLeft, MoveRight, MoveHome, MoveEnd, MovePageUp, MovePageDown, MoveNext, MovePrevious }; - QModelIndex moveCursor(QMoveCursorListView::CursorAction action, Qt::KeyboardModifiers modifiers) + QModelIndex doMoveCursor(QMoveCursorListView::CursorAction action, Qt::KeyboardModifiers modifiers) { return QListView::moveCursor((QListView::CursorAction)action, modifiers); } @@ -540,9 +541,9 @@ void tst_QListView::moveCursor2() vu.selectionModel()->setCurrentIndex(model.index(0,0), QItemSelectionModel::SelectCurrent); QCoreApplication::processEvents(); - QModelIndex idx = vu.moveCursor(QMoveCursorListView::MoveHome, Qt::NoModifier); + QModelIndex idx = vu.doMoveCursor(QMoveCursorListView::MoveHome, Qt::NoModifier); QCOMPARE(idx, model.index(0,0)); - idx = vu.moveCursor(QMoveCursorListView::MoveDown, Qt::NoModifier); + idx = vu.doMoveCursor(QMoveCursorListView::MoveDown, Qt::NoModifier); QCOMPARE(idx, model.index(8,0)); } @@ -1628,7 +1629,7 @@ void tst_QListView::task196118_visualRegionForSelection() class MyListView : public QListView { public: - QRegion visualRegionForSelection() const + QRegion getVisualRegionForSelection() const { return QListView::visualRegionForSelection( selectionModel()->selection()); } } view; @@ -1643,7 +1644,7 @@ void tst_QListView::task196118_visualRegionForSelection() view.selectionModel()->select(top1.index(), QItemSelectionModel::Select); QCOMPARE(view.selectionModel()->selectedIndexes().count(), 1); - QVERIFY(view.visualRegionForSelection().isEmpty()); + QVERIFY(view.getVisualRegionForSelection().isEmpty()); } void tst_QListView::task254449_draggingItemToNegativeCoordinates() @@ -1977,11 +1978,11 @@ void tst_QListView::taskQTBUG_5877_skippingItemInPageDownUp() vu.selectionModel()->setCurrentIndex(model.index(currentItemIndexes[i], 0), QItemSelectionModel::SelectCurrent); - QModelIndex idx = vu.moveCursor(QMoveCursorListView::MovePageDown, Qt::NoModifier); + QModelIndex idx = vu.doMoveCursor(QMoveCursorListView::MovePageDown, Qt::NoModifier); int newCurrent = qMin(currentItemIndexes[i] + scrolledRowCount, 99); QCOMPARE(idx, model.index(newCurrent, 0)); - idx = vu.moveCursor(QMoveCursorListView::MovePageUp, Qt::NoModifier); + idx = vu.doMoveCursor(QMoveCursorListView::MovePageUp, Qt::NoModifier); newCurrent = qMax(currentItemIndexes[i] - scrolledRowCount, 0); QCOMPARE(idx, model.index(newCurrent, 0)); } diff --git a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp index 8a679fd1a0..d1107a687c 100644 --- a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp +++ b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp @@ -437,6 +437,7 @@ public: this, SLOT(itemSelectionChanged(QItemSelection,QItemSelection))); } + // enum CursorAction and moveCursor() are protected in QTableView. enum CursorAction { MoveUp = QAbstractItemView::MoveUp, MoveDown = QAbstractItemView::MoveDown, @@ -450,7 +451,7 @@ public: MovePrevious = QAbstractItemView::MovePrevious }; - QModelIndex moveCursor(QtTestTableView::CursorAction cursorAction, + QModelIndex doMoveCursor(QtTestTableView::CursorAction cursorAction, Qt::KeyboardModifiers modifiers) { return QTableView::moveCursor((QAbstractItemView::CursorAction)cursorAction, modifiers); @@ -1192,7 +1193,7 @@ void tst_QTableView::moveCursor() QModelIndex index = model.index(startRow, startColumn); view.setCurrentIndex(index); - QModelIndex newIndex = view.moveCursor((QtTestTableView::CursorAction)cursorMoveAction, + QModelIndex newIndex = view.doMoveCursor((QtTestTableView::CursorAction)cursorMoveAction, (Qt::KeyboardModifiers)modifier); // expected fails, task 119433 if(newIndex.row() == -1) @@ -1339,7 +1340,7 @@ void tst_QTableView::moveCursorStrikesBack() int newRow = -1; int newColumn = -1; foreach (int cursorMoveAction, cursorMoveActions) { - QModelIndex newIndex = view.moveCursor((QtTestTableView::CursorAction)cursorMoveAction, 0); + QModelIndex newIndex = view.doMoveCursor((QtTestTableView::CursorAction)cursorMoveAction, 0); view.setCurrentIndex(newIndex); newRow = newIndex.row(); newColumn = newIndex.column(); diff --git a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp index d914142e13..ea1f846258 100644 --- a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp @@ -89,7 +89,8 @@ struct PublicView : public QTreeView MovePrevious = QAbstractItemView::MovePrevious }; - inline QModelIndex moveCursor(PublicCursorAction ca, Qt::KeyboardModifiers kbm) + // enum PublicCursorAction and moveCursor() are protected in QTreeView. + inline QModelIndex doMoveCursor(PublicCursorAction ca, Qt::KeyboardModifiers kbm) { return QTreeView::moveCursor((CursorAction)ca, kbm); } inline void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command) @@ -1802,7 +1803,7 @@ void tst_QTreeView::moveCursor() QCOMPARE(view.currentIndex(), expected); //then pressing down should go to the next line - QModelIndex actual = view.moveCursor(PublicView::MoveDown, Qt::NoModifier); + QModelIndex actual = view.doMoveCursor(PublicView::MoveDown, Qt::NoModifier); expected = model.index(2, 1, QModelIndex()); QCOMPARE(actual, expected); @@ -1811,7 +1812,7 @@ void tst_QTreeView::moveCursor() // PageUp was broken with uniform row heights turned on view.setCurrentIndex(model.index(1, 0)); - actual = view.moveCursor(PublicView::MovePageUp, Qt::NoModifier); + actual = view.doMoveCursor(PublicView::MovePageUp, Qt::NoModifier); expected = model.index(0, 0, QModelIndex()); QCOMPARE(actual, expected); @@ -2855,7 +2856,7 @@ void tst_QTreeView::evilModel() view.setSelection(rect, QItemSelectionModel::Select); model.change(); - view.moveCursor(PublicView::MoveDown, Qt::NoModifier); + view.doMoveCursor(PublicView::MoveDown, Qt::NoModifier); model.change(); view.resizeColumnToContents(1); |