summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtableview/tst_qtableview.cpp
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2009-09-09 04:48:46 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2009-09-09 04:48:46 (GMT)
commit1e6a4aab859ab1a41e9bcedb6e8f8f9dc8296d54 (patch)
treee2f9bc8a8ca67f1bf0543605bab8ba7348539b1b /tests/auto/qtableview/tst_qtableview.cpp
parent01f48343efd58df74a14e89eb5ead6be5d532c64 (diff)
parentb2daad6cce4298ba438aba4b0e8bb3ea80680c6e (diff)
downloadQt-1e6a4aab859ab1a41e9bcedb6e8f8f9dc8296d54.zip
Qt-1e6a4aab859ab1a41e9bcedb6e8f8f9dc8296d54.tar.gz
Qt-1e6a4aab859ab1a41e9bcedb6e8f8f9dc8296d54.tar.bz2
Merge branch '4.6'
Conflicts: examples/assistant/simpletextviewer/findfiledialog.cpp examples/assistant/simpletextviewer/findfiledialog.h examples/assistant/simpletextviewer/main.cpp examples/assistant/simpletextviewer/mainwindow.cpp examples/assistant/simpletextviewer/mainwindow.h tools/assistant/compat/config.cpp tools/assistant/compat/config.h tools/assistant/compat/docuparser.cpp tools/assistant/compat/docuparser.h tools/assistant/compat/fontsettingsdialog.cpp tools/assistant/compat/fontsettingsdialog.h tools/assistant/compat/helpdialog.cpp tools/assistant/compat/helpdialog.h tools/assistant/compat/helpdialog.ui tools/assistant/compat/helpwindow.cpp tools/assistant/compat/helpwindow.h tools/assistant/compat/index.cpp tools/assistant/compat/index.h tools/assistant/compat/lib/qassistantclient.cpp tools/assistant/compat/lib/qassistantclient.h tools/assistant/compat/lib/qassistantclient_global.h tools/assistant/compat/main.cpp tools/assistant/compat/mainwindow.cpp tools/assistant/compat/mainwindow.h tools/assistant/compat/mainwindow.ui tools/assistant/compat/profile.cpp tools/assistant/compat/profile.h tools/assistant/compat/tabbedbrowser.cpp tools/assistant/compat/tabbedbrowser.h tools/assistant/compat/tabbedbrowser.ui tools/assistant/compat/topicchooser.cpp tools/assistant/compat/topicchooser.h tools/assistant/compat/topicchooser.ui
Diffstat (limited to 'tests/auto/qtableview/tst_qtableview.cpp')
-rw-r--r--tests/auto/qtableview/tst_qtableview.cpp33
1 files changed, 18 insertions, 15 deletions
diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp
index 6fe2963..5d21955 100644
--- a/tests/auto/qtableview/tst_qtableview.cpp
+++ b/tests/auto/qtableview/tst_qtableview.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the test suite of the Qt Toolkit.
@@ -20,10 +21,9 @@
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this
-** package.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
@@ -2334,8 +2334,10 @@ void tst_QTableView::scrollTo()
QtTestTableView view;
view.show();
- view.resize(columnWidth * 2, rowHeight * 2);
+ QSize forcedSize(columnWidth * 2, rowHeight * 2);
+ view.resize(forcedSize);
QTest::qWait(0);
+ QTRY_COMPARE(view.size(), forcedSize);
view.setModel(&model);
view.setSpan(row, column, rowSpan, columnSpan);
@@ -2910,6 +2912,7 @@ void tst_QTableView::tabFocus()
window.setFocus();
QTest::qWait(100);
window.activateWindow();
+ QApplication::setActiveWindow(&window);
QTest::qWait(100);
qApp->processEvents();
@@ -2926,43 +2929,43 @@ void tst_QTableView::tabFocus()
for (int i = 0; i < 2; ++i) {
// tab to view
QTest::keyPress(qApp->focusWidget(), Qt::Key_Tab);
- QVERIFY(!window.hasFocus());
+ QTRY_VERIFY(!window.hasFocus());
QVERIFY(view->hasFocus());
QVERIFY(!edit->hasFocus());
// tab to edit
QTest::keyPress(qApp->focusWidget(), Qt::Key_Tab);
+ QTRY_VERIFY(edit->hasFocus());
QVERIFY(!window.hasFocus());
QVERIFY(!view->hasFocus());
- QVERIFY(edit->hasFocus());
}
// backtab to view
QTest::keyPress(qApp->focusWidget(), Qt::Key_Backtab);
+ QTRY_VERIFY(view->hasFocus());
QVERIFY(!window.hasFocus());
- QVERIFY(view->hasFocus());
QVERIFY(!edit->hasFocus());
// backtab to edit
QTest::keyPress(qApp->focusWidget(), Qt::Key_Backtab);
+ QTRY_VERIFY(edit->hasFocus());
QVERIFY(!window.hasFocus());
QVERIFY(!view->hasFocus());
- QVERIFY(edit->hasFocus());
QStandardItemModel *model = new QStandardItemModel;
view->setModel(model);
// backtab to view
QTest::keyPress(qApp->focusWidget(), Qt::Key_Backtab);
+ QTRY_VERIFY(view->hasFocus());
QVERIFY(!window.hasFocus());
- QVERIFY(view->hasFocus());
QVERIFY(!edit->hasFocus());
// backtab to edit
QTest::keyPress(qApp->focusWidget(), Qt::Key_Backtab);
+ QTRY_VERIFY(edit->hasFocus());
QVERIFY(!window.hasFocus());
QVERIFY(!view->hasFocus());
- QVERIFY(edit->hasFocus());
model->insertRow(0, new QStandardItem("Hei"));
model->insertRow(0, new QStandardItem("Hei"));
@@ -2970,8 +2973,8 @@ void tst_QTableView::tabFocus()
// backtab to view
QTest::keyPress(qApp->focusWidget(), Qt::Key_Backtab);
+ QTRY_VERIFY(view->hasFocus());
QVERIFY(!window.hasFocus());
- QVERIFY(view->hasFocus());
QVERIFY(!edit->hasFocus());
// backtab to edit doesn't work
@@ -2984,14 +2987,14 @@ void tst_QTableView::tabFocus()
// backtab to edit
QTest::keyPress(qApp->focusWidget(), Qt::Key_Backtab);
+ QTRY_VERIFY(edit->hasFocus());
QVERIFY(!window.hasFocus());
QVERIFY(!view->hasFocus());
- QVERIFY(edit->hasFocus());
QTest::keyPress(qApp->focusWidget(), Qt::Key_Tab);
- QVERIFY(view->hasFocus());
+ QTRY_VERIFY(view->hasFocus());
QTest::keyPress(qApp->focusWidget(), Qt::Key_Tab);
- QVERIFY(edit->hasFocus());
+ QTRY_VERIFY(edit->hasFocus());
delete model;
}