Fix warnings about overloaded virtuals in tests (CLANG).
Change-Id: I2f96073c4aaf4b11221b98cc6c7031b253a3b45c Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
This commit is contained in:
parent
cd035286c5
commit
eccef8c936
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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()
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -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));
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user