summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets')
-rw-r--r--tests/auto/widgets/dialogs/dialogs.pro2
-rw-r--r--tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp8
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog/qfiledialog.pro14
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp3
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog2/qfiledialog2.pro15
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp52
-rw-r--r--tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp42
-rw-r--r--tests/auto/widgets/dialogs/qfontdialog/BLACKLIST1
-rw-r--r--tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp5
-rw-r--r--tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp20
-rw-r--r--tests/auto/widgets/effects/qpixmapfilter/qpixmapfilter.pro7
-rw-r--r--tests/auto/widgets/gestures/qgesturerecognizer/tst_qgesturerecognizer.cpp6
-rw-r--r--tests/auto/widgets/graphicsview/graphicsview.pro2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp11
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp34
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp29
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro13
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp48
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicssceneindex/qgraphicssceneindex.pro2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp55
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.h4
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp1756
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp12
-rw-r--r--tests/auto/widgets/itemviews/itemviews.pro2
-rw-r--r--tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp13
-rw-r--r--tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp3
-rw-r--r--tests/auto/widgets/itemviews/qdirmodel/qdirmodel.pro2
-rw-r--r--tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp23
-rw-r--r--tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro2
-rw-r--r--tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp45
-rw-r--r--tests/auto/widgets/itemviews/qlistview/qlistview.pro2
-rw-r--r--tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp48
-rw-r--r--tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp13
-rw-r--r--tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp9
-rw-r--r--tests/auto/widgets/kernel/qaction/tst_qaction.cpp133
-rw-r--r--tests/auto/widgets/kernel/qapplication/test/test.pro2
-rw-r--r--tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp50
-rw-r--r--tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp275
-rw-r--r--tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp43
-rw-r--r--tests/auto/widgets/kernel/qlayout/qlayout.pro8
-rw-r--r--tests/auto/widgets/kernel/qwidget/BLACKLIST2
-rw-r--r--tests/auto/widgets/kernel/qwidget/qwidget.pro6
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp476
-rw-r--r--tests/auto/widgets/kernel/qwidget_window/qwidget_window.pro5
-rw-r--r--tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp6
-rw-r--r--tests/auto/widgets/styles/qstyle/qstyle.pro6
-rw-r--r--tests/auto/widgets/styles/qstyle/tst_qstyle.cpp54
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/BLACKLIST2
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/qstylesheetstyle.pro2
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp54
-rw-r--r--tests/auto/widgets/styles/styles.pro4
-rw-r--r--tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp10
-rw-r--r--tests/auto/widgets/util/qscroller/tst_qscroller.cpp21
-rw-r--r--tests/auto/widgets/util/qsystemtrayicon/tst_qsystemtrayicon.cpp4
-rw-r--r--tests/auto/widgets/util/qundostack/tst_qundostack.cpp144
-rw-r--r--tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp86
-rw-r--r--tests/auto/widgets/widgets/qdatetimeedit/qdatetimeedit.pro2
-rw-r--r--tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp28
-rw-r--r--tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp6
-rw-r--r--tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp61
-rw-r--r--tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp42
-rw-r--r--tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp30
-rw-r--r--tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp15
-rw-r--r--tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp53
-rw-r--r--tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp22
-rw-r--r--tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp6
-rw-r--r--tests/auto/widgets/widgets/qtabwidget/qtabwidget.pro2
-rw-r--r--tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp6
-rw-r--r--tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp17
-rw-r--r--tests/auto/widgets/widgets/widgets.pro4
73 files changed, 2187 insertions, 1809 deletions
diff --git a/tests/auto/widgets/dialogs/dialogs.pro b/tests/auto/widgets/dialogs/dialogs.pro
index c6667824d9..cf548f2dea 100644
--- a/tests/auto/widgets/dialogs/dialogs.pro
+++ b/tests/auto/widgets/dialogs/dialogs.pro
@@ -13,7 +13,7 @@ SUBDIRS=\
qsidebar \
qwizard \
-!contains(QT_CONFIG, private_tests): SUBDIRS -= \
+!qtConfig(private_tests): SUBDIRS -= \
qsidebar \
mac:qinputdialog.CONFIG += no_check_target # QTBUG-25496
diff --git a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
index e6a0c5e86b..ac7ba02700 100644
--- a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
+++ b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
@@ -69,10 +69,8 @@ private slots:
void showMaximized();
void showMinimized();
void showFullScreen();
-#ifndef Q_OS_WINCE
void showAsTool();
void toolDialogPosition();
-#endif
void deleteMainDefault();
void deleteInExec();
#ifndef QT_NO_SIZEGRIP
@@ -358,8 +356,6 @@ void tst_QDialog::showFullScreen()
QVERIFY(!dialog.isVisible());
}
-// No real support for Qt::Tool on WinCE
-#ifndef Q_OS_WINCE
void tst_QDialog::showAsTool()
{
#if defined(Q_OS_UNIX)
@@ -379,10 +375,7 @@ void tst_QDialog::showAsTool()
QCOMPARE(dialog.wasActive(), false);
}
}
-#endif
-// No real support for Qt::Tool on WinCE
-#ifndef Q_OS_WINCE
// Verify that pos() returns the same before and after show()
// for a dialog with the Tool window type.
void tst_QDialog::toolDialogPosition()
@@ -394,7 +387,6 @@ void tst_QDialog::toolDialogPosition()
const QPoint afterShowPosition = dialog.pos();
QCOMPARE(afterShowPosition, beforeShowPosition);
}
-#endif
class Dialog : public QDialog
{
diff --git a/tests/auto/widgets/dialogs/qfiledialog/qfiledialog.pro b/tests/auto/widgets/dialogs/qfiledialog/qfiledialog.pro
index 2a11a29420..4ea23a896f 100644
--- a/tests/auto/widgets/dialogs/qfiledialog/qfiledialog.pro
+++ b/tests/auto/widgets/dialogs/qfiledialog/qfiledialog.pro
@@ -8,18 +8,6 @@ QT += widgets widgets-private testlib
QT += core-private gui-private
SOURCES += tst_qfiledialog.cpp
-wince* {
- addFiles.files = *.cpp
- addFiles.path = .
- filesInDir.files = *.pro
- filesInDir.path = someDir
- DEPLOYMENT += addFiles filesInDir
-}
-
-wince* {
- DEFINES += SRCDIR=\\\"./\\\"
-} else {
- DEFINES += SRCDIR=\\\"$$PWD/\\\"
-}
+DEFINES += SRCDIR=\\\"$$PWD/\\\"
linux*: CONFIG += insignificant_test # Crashes on different Linux distros
diff --git a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
index d182d2edec..741b5e8aae 100644
--- a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
+++ b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
@@ -186,9 +186,6 @@ void tst_QFiledialog::init()
QFileDialogPrivate::setLastVisitedDirectory(QUrl());
// populate the sidebar with some default settings
QFileDialog fd;
-#if defined(Q_OS_WINCE)
- QTest::qWait(1000);
-#endif
}
void tst_QFiledialog::cleanup()
diff --git a/tests/auto/widgets/dialogs/qfiledialog2/qfiledialog2.pro b/tests/auto/widgets/dialogs/qfiledialog2/qfiledialog2.pro
index fb432a7d21..1b35b2e4ac 100644
--- a/tests/auto/widgets/dialogs/qfiledialog2/qfiledialog2.pro
+++ b/tests/auto/widgets/dialogs/qfiledialog2/qfiledialog2.pro
@@ -6,17 +6,4 @@ QT += core-private gui-private
SOURCES += tst_qfiledialog2.cpp
-wince* {
- addFiles.files = *.cpp
- addFiles.path = .
- filesInDir.files = *.pro
- filesInDir.path = someDir
- DEPLOYMENT += addFiles filesInDir
-}
-
-wince* {
- DEFINES += SRCDIR=\\\"./\\\"
-} else {
- DEFINES += SRCDIR=\\\"$$PWD/\\\"
-}
-
+DEFINES += SRCDIR=\\\"$$PWD/\\\"
diff --git a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
index 82934982c4..a16bd1a787 100644
--- a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
+++ b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
@@ -54,7 +54,7 @@
#include <qpa/qplatformdialoghelper.h>
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN)
#include "../../../network-settings.h"
#endif
@@ -107,7 +107,7 @@ private slots:
#ifndef Q_OS_MAC
void task227930_correctNavigationKeyboardBehavior();
#endif
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN)
void task226366_lowerCaseHardDriveWindows();
#endif
void completionOnLevelAfterRoot();
@@ -138,9 +138,6 @@ tst_QFileDialog2::tst_QFileDialog2()
: tempDir(QDir::tempPath() + "/tst_qfiledialog2.XXXXXX")
{
QCoreApplication::setAttribute(Qt::AA_DontUseNativeDialogs);
-#if defined(Q_OS_WINCE)
- qApp->setAutoMaximizeThreshold(-1);
-#endif
}
void tst_QFileDialog2::cleanupSettingsFile()
@@ -167,9 +164,6 @@ void tst_QFileDialog2::init()
QFileDialogPrivate::setLastVisitedDirectory(QUrl());
// populate the sidebar with some default settings
QFileDialog fd;
-#if defined(Q_OS_WINCE)
- QTest::qWait(1000);
-#endif
}
void tst_QFileDialog2::cleanup()
@@ -189,11 +183,7 @@ void tst_QFileDialog2::listRoot()
fd.show();
QCOMPARE(qt_test_isFetchedRoot(),false);
fd.setDirectory("");
-#ifdef Q_OS_WINCE
- QTest::qWait(1500);
-#else
QTest::qWait(500);
-#endif
QCOMPARE(qt_test_isFetchedRoot(),true);
}
#endif
@@ -286,7 +276,7 @@ void tst_QFileDialog2::showNameFilterDetails()
void tst_QFileDialog2::unc()
{
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
// Only test UNC on Windows./
QString dir("\\\\" + QtNetworkSettings::winServerName() + "\\testsharewritable");
#else
@@ -634,7 +624,7 @@ void tst_QFileDialog2::task227930_correctNavigationKeyboardBehavior()
}
#endif
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN)
void tst_QFileDialog2::task226366_lowerCaseHardDriveWindows()
{
QFileDialog fd;
@@ -664,7 +654,7 @@ void tst_QFileDialog2::task226366_lowerCaseHardDriveWindows()
void tst_QFileDialog2::completionOnLevelAfterRoot()
{
QFileDialog fd;
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN)
fd.setDirectory("C:/");
QDir current = fd.directory();
QStringList entryList = current.entryList(QStringList(), QDir::Dirs);
@@ -708,7 +698,7 @@ void tst_QFileDialog2::completionOnLevelAfterRoot()
fd.show();
QLineEdit *edit = fd.findChild<QLineEdit*>("fileNameEdit");
QTest::qWait(2000);
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN)
//I love testlib :D
for (int i = 0; i < 5; i++)
QTest::keyClick(edit, testDir.at(i).toLower().toLatin1() - 'a' + Qt::Key_A);
@@ -719,7 +709,7 @@ void tst_QFileDialog2::completionOnLevelAfterRoot()
QTest::qWait(200);
QTest::keyClick(edit->completer()->popup(), Qt::Key_Down);
QTest::qWait(200);
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN)
QCOMPARE(edit->text(), testDir);
#else
QTRY_COMPARE(edit->text(), QString("etc"));
@@ -853,33 +843,21 @@ void tst_QFileDialog2::task228844_ensurePreviousSorting()
fd.setDirectory(current.absolutePath());
fd.setViewMode(QFileDialog::Detail);
fd.show();
-#if defined(Q_OS_WINCE)
- QTest::qWait(1500);
-#else
QTest::qWait(500);
-#endif
QTreeView *tree = fd.findChild<QTreeView*>("treeView");
tree->header()->setSortIndicator(3,Qt::DescendingOrder);
QTest::qWait(200);
QDialogButtonBox *buttonBox = fd.findChild<QDialogButtonBox*>("buttonBox");
QPushButton *button = buttonBox->button(QDialogButtonBox::Open);
QTest::mouseClick(button, Qt::LeftButton);
-#if defined(Q_OS_WINCE)
- QTest::qWait(1500);
-#else
QTest::qWait(500);
-#endif
QFileDialog fd2;
fd2.setFileMode(QFileDialog::Directory);
fd2.restoreState(fd.saveState());
current.cd("aaaaaaaaaaaaaaaaaa");
fd2.setDirectory(current.absolutePath());
fd2.show();
-#if defined(Q_OS_WINCE)
- QTest::qWait(1500);
-#else
QTest::qWait(500);
-#endif
QTreeView *tree2 = fd2.findChild<QTreeView*>("treeView");
tree2->setFocus();
@@ -889,22 +867,14 @@ void tst_QFileDialog2::task228844_ensurePreviousSorting()
QPushButton *button2 = buttonBox2->button(QDialogButtonBox::Open);
fd2.selectFile("g");
QTest::mouseClick(button2, Qt::LeftButton);
-#if defined(Q_OS_WINCE)
- QTest::qWait(1500);
-#else
QTest::qWait(500);
-#endif
QCOMPARE(fd2.selectedFiles().first(), current.absolutePath() + QLatin1String("/g"));
QFileDialog fd3(0, "This is a third file dialog", tempFile->fileName());
fd3.restoreState(fd.saveState());
fd3.setFileMode(QFileDialog::Directory);
fd3.show();
-#if defined(Q_OS_WINCE)
- QTest::qWait(1500);
-#else
QTest::qWait(500);
-#endif
QTreeView *tree3 = fd3.findChild<QTreeView*>("treeView");
tree3->setFocus();
@@ -913,11 +883,7 @@ void tst_QFileDialog2::task228844_ensurePreviousSorting()
QDialogButtonBox *buttonBox3 = fd3.findChild<QDialogButtonBox*>("buttonBox");
QPushButton *button3 = buttonBox3->button(QDialogButtonBox::Open);
QTest::mouseClick(button3, Qt::LeftButton);
-#if defined(Q_OS_WINCE)
- QTest::qWait(1500);
-#else
QTest::qWait(500);
-#endif
QCOMPARE(fd3.selectedFiles().first(), tempFile->fileName());
current.cd("aaaaaaaaaaaaaaaaaa");
@@ -999,11 +965,7 @@ void tst_QFileDialog2::task251321_sideBarHiddenEntries()
sidebar->selectUrl(QUrl::fromLocalFile(hiddenSubDir.absolutePath()));
QTest::mouseClick(sidebar->viewport(), Qt::LeftButton, 0, sidebar->visualRect(sidebar->model()->index(0, 0)).center());
// give the background processes more time on windows mobile
-#ifdef Q_OS_WINCE
- QTest::qWait(1000);
-#else
QTest::qWait(250);
-#endif
QFileSystemModel *model = fd.findChild<QFileSystemModel*>("qt_filesystem_model");
QCOMPARE(model->rowCount(model->index(hiddenSubDir.absolutePath())), 2);
diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
index 1acf885285..0bb2c50b9d 100644
--- a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
+++ b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
@@ -40,7 +40,7 @@
#include <QStyle>
#include <QtGlobal>
#include <QTemporaryDir>
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN)
# include <qt_windows.h> // for SetFileAttributes
#endif
@@ -332,7 +332,7 @@ bool tst_QFileSystemModel::createFiles(const QString &test_path, const QStringLi
return false;
}
file.close();
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN)
if (initial_files.at(i)[0] == '.') {
QString hiddenFile = QDir::toNativeSeparators(file.fileName());
wchar_t nativeHiddenFile[MAX_PATH];
@@ -369,14 +369,9 @@ void tst_QFileSystemModel::rowCount()
QSignalSpy spy2(model, SIGNAL(rowsInserted(QModelIndex,int,int)));
QSignalSpy spy3(model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)));
-#if !defined(Q_OS_WINCE)
QStringList files = QStringList() << "b" << "d" << "f" << "h" << "j" << ".a" << ".c" << ".e" << ".g";
QString l = "b,d,f,h,j,.a,.c,.e,.g";
-#else
- // Cannot hide them on CE
- QStringList files = QStringList() << "b" << "d" << "f" << "h" << "j";
- QString l = "b,d,f,h,j";
-#endif
+
QVERIFY(createFiles(tmp, files));
QModelIndex root = model->setRootPath(tmp);
@@ -404,9 +399,6 @@ static inline QString lastEntry(const QModelIndex &root)
void tst_QFileSystemModel::rowsInserted()
{
-#if defined(Q_OS_WINCE)
- QSKIP("Watching directories does not work on CE(see #137910)");
-#endif
QString tmp = flatDirTestPath;
rowCount();
QModelIndex root = model->index(model->rootPath());
@@ -461,9 +453,6 @@ void tst_QFileSystemModel::rowsRemoved_data()
void tst_QFileSystemModel::rowsRemoved()
{
-#if defined(Q_OS_WINCE)
- QSKIP("Watching directories does not work on CE(see #137910)");
-#endif
QString tmp = flatDirTestPath;
rowCount();
QModelIndex root = model->index(model->rootPath());
@@ -552,7 +541,6 @@ void tst_QFileSystemModel::filters_data()
QTest::addColumn<int>("dirFilters");
QTest::addColumn<QStringList>("nameFilters");
QTest::addColumn<int>("rowCount");
-#if !defined(Q_OS_WINCE)
QTest::newRow("no dirs") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs) << QStringList() << 2;
QTest::newRow("no dirs - dot") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs | QDir::NoDot) << QStringList() << 1;
QTest::newRow("no dirs - dotdot") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs | QDir::NoDotDot) << QStringList() << 1;
@@ -574,30 +562,6 @@ void tst_QFileSystemModel::filters_data()
(int)(QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot | QDir::CaseSensitive) << (QStringList() << "a") << 1;
QTest::newRow("dir+files+hid+dot+cas+alldir") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") <<
(int)(QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot | QDir::CaseSensitive | QDir::AllDirs) << (QStringList() << "Z") << 1;
-#else
- QTest::qWait(3000); // We need to calm down a bit...
- QTest::newRow("no dirs") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs) << QStringList() << 0;
- QTest::newRow("no dirs - dot") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs | QDir::NoDot) << QStringList() << 1;
- QTest::newRow("no dirs - dotdot") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs | QDir::NoDotDot) << QStringList() << 1;
- QTest::newRow("no dirs - dotanddotdot") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs | QDir::NoDotAndDotDot) << QStringList() << 0;
- QTest::newRow("one dir - dot") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") << (int)(QDir::Dirs | QDir::NoDot) << QStringList() << 2;
- QTest::newRow("one dir - dotdot") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") << (int)(QDir::Dirs | QDir::NoDotDot) << QStringList() << 2;
- QTest::newRow("one dir - dotanddotdot") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") << (int)(QDir::Dirs | QDir::NoDotAndDotDot) << QStringList() << 1;
- QTest::newRow("one dir") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") << (int)(QDir::Dirs) << QStringList() << 1;
- QTest::newRow("no dir + hidden") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs | QDir::Hidden) << QStringList() << 0;
- QTest::newRow("dir+hid+files") << (QStringList() << "a" << "b" << "c") << QStringList() <<
- (int)(QDir::Dirs | QDir::Files | QDir::Hidden) << QStringList() << 3;
- QTest::newRow("dir+file+hid-dot .A") << (QStringList() << "a" << "b" << "c") << (QStringList() << ".A") <<
- (int)(QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot) << QStringList() << 4;
- QTest::newRow("dir+files+hid+dot A") << (QStringList() << "a" << "b" << "c") << (QStringList() << "AFolder") <<
- (int)(QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot) << (QStringList() << "A*") << 2;
- QTest::newRow("dir+files+hid+dot+cas1") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") <<
- (int)(QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot | QDir::CaseSensitive) << (QStringList() << "Z") << 1;
- QTest::newRow("dir+files+hid+dot+cas2") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") <<
- (int)(QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot | QDir::CaseSensitive) << (QStringList() << "a") << 1;
- QTest::newRow("dir+files+hid+dot+cas+alldir") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") <<
- (int)(QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot | QDir::CaseSensitive | QDir::AllDirs) << (QStringList() << "Z") << 1;
-#endif
QTest::newRow("case sensitive") << (QStringList() << "Antiguagdb" << "Antiguamtd"
<< "Antiguamtp" << "afghanistangdb" << "afghanistanmtd")
diff --git a/tests/auto/widgets/dialogs/qfontdialog/BLACKLIST b/tests/auto/widgets/dialogs/qfontdialog/BLACKLIST
index b62f3e3344..07f3a41df3 100644
--- a/tests/auto/widgets/dialogs/qfontdialog/BLACKLIST
+++ b/tests/auto/widgets/dialogs/qfontdialog/BLACKLIST
@@ -1,4 +1,5 @@
[task256466_wrongStyle]
opensuse-13.1
+opensuse-42.1
rhel-7.1
rhel-7.2
diff --git a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
index d6b3ce07e8..d6c4841b22 100644
--- a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
+++ b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
@@ -395,11 +395,8 @@ void tst_QMessageBox::about()
QVERIFY(closeHelper.done());
#endif
-#if !defined(Q_OS_WINCE)
const int keyToSend = Qt::Key_Enter;
-#else
- const keyToSend = Qt::Key_Escape;
-#endif
+
closeHelper.start(keyToSend);
QMessageBox::aboutQt(0, "Caption");
#ifdef Q_OS_MAC
diff --git a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
index 0f63baa0e6..2a629c3ff0 100644
--- a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
+++ b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
@@ -51,9 +51,6 @@ class tst_QWizard : public QObject
{
Q_OBJECT
-public:
- tst_QWizard();
-
private slots:
void cleanup();
void buttonText();
@@ -128,13 +125,6 @@ private slots:
*/
};
-tst_QWizard::tst_QWizard()
-{
-#ifdef Q_OS_WINCE //disable magic for WindowsCE
- qApp->setAutoMaximizeThreshold(-1);
-#endif
-}
-
void tst_QWizard::cleanup()
{
QVERIFY(QApplication::topLevelWidgets().isEmpty());
@@ -962,9 +952,6 @@ void tst_QWizard::setOption_IndependentPages()
void tst_QWizard::setOption_IgnoreSubTitles()
{
-#if defined(Q_OS_WINCE)
- QSKIP("Skipped because of limited resources and potential crash. (Task: 166824)");
-#endif
const QRect availableGeometry = QGuiApplication::primaryScreen()->availableGeometry();
const int kPixels = (availableGeometry.width() + 500) / 1000;
const int frame = 50 * kPixels;
@@ -1073,9 +1060,6 @@ void tst_QWizard::setOption_IgnoreSubTitles()
void tst_QWizard::setOption_ExtendedWatermarkPixmap()
{
-#if defined(Q_OS_WINCE)
- QSKIP("Skipped because of limited resources and potential crash. (Task: 166824)");
-#endif
QPixmap watermarkPixmap(200, 400);
watermarkPixmap.fill(Qt::black);
@@ -2076,10 +2060,6 @@ void tst_QWizard::combinations_data()
void tst_QWizard::combinations()
{
-#ifdef Q_OS_WINCE
- QSKIP("Too much memory usage for testing on CE emulator");
-#endif
-
QFETCH(bool, ref);
QFETCH(bool, testEquality);
QFETCH(QVector<QSharedPointer<Operation> >, operations);
diff --git a/tests/auto/widgets/effects/qpixmapfilter/qpixmapfilter.pro b/tests/auto/widgets/effects/qpixmapfilter/qpixmapfilter.pro
index bf0f99598b..4fbe13cce7 100644
--- a/tests/auto/widgets/effects/qpixmapfilter/qpixmapfilter.pro
+++ b/tests/auto/widgets/effects/qpixmapfilter/qpixmapfilter.pro
@@ -5,10 +5,3 @@ QT += widgets widgets-private testlib
QT += gui-private
SOURCES += tst_qpixmapfilter.cpp
-
-wince {
- addFiles.files = noise.png
- addFiles.path = .
- DEPLOYMENT += addFiles
-}
-
diff --git a/tests/auto/widgets/gestures/qgesturerecognizer/tst_qgesturerecognizer.cpp b/tests/auto/widgets/gestures/qgesturerecognizer/tst_qgesturerecognizer.cpp
index 6b0c1ecf57..c3ebb838bb 100644
--- a/tests/auto/widgets/gestures/qgesturerecognizer/tst_qgesturerecognizer.cpp
+++ b/tests/auto/widgets/gestures/qgesturerecognizer/tst_qgesturerecognizer.cpp
@@ -38,8 +38,6 @@
#include <QtCore/QHash>
#include <QtCore/QDebug>
-#include <qpa/qwindowsysteminterface.h>
-
class tst_QGestureRecognizer : public QObject
{
Q_OBJECT
@@ -64,15 +62,13 @@ private:
tst_QGestureRecognizer::tst_QGestureRecognizer()
: m_fingerDistance(qRound(QGuiApplication::primaryScreen()->physicalDotsPerInch() / 2.0))
- , m_touchDevice(new QTouchDevice)
+ , m_touchDevice(QTest::createTouchDevice())
{
qputenv("QT_PAN_TOUCHPOINTS", "2"); // Prevent device detection of pan touch point count.
}
void tst_QGestureRecognizer::initTestCase()
{
- m_touchDevice->setType(QTouchDevice::TouchScreen);
- QWindowSystemInterface::registerTouchDevice(m_touchDevice);
}
#ifndef QT_NO_GESTURES
diff --git a/tests/auto/widgets/graphicsview/graphicsview.pro b/tests/auto/widgets/graphicsview/graphicsview.pro
index dce3c6dda9..e99897a4f6 100644
--- a/tests/auto/widgets/graphicsview/graphicsview.pro
+++ b/tests/auto/widgets/graphicsview/graphicsview.pro
@@ -19,7 +19,7 @@ SUBDIRS=\
qgraphicsview \
qgraphicswidget \
-!contains(QT_CONFIG, private_tests): SUBDIRS -= \
+!qtConfig(private_tests): SUBDIRS -= \
qgraphicsanchorlayout \
qgraphicsanchorlayout1 \
qgraphicsitem \
diff --git a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
index 90ea2cb58b..f5b2269297 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
@@ -38,7 +38,6 @@ class tst_QGraphicsGridLayout : public QObject
Q_OBJECT
private slots:
- void initTestCase();
void qgraphicsgridlayout_data();
void qgraphicsgridlayout();
void addItem_data();
@@ -294,16 +293,6 @@ Q_DECLARE_METATYPE(ItemList);
typedef QList<QSizeF> SizeList;
-
-// This will be called before the first test function is executed.
-// It is only called once.
-void tst_QGraphicsGridLayout::initTestCase()
-{
-#ifdef Q_OS_WINCE //disable magic for WindowsCE
- qApp->setAutoMaximizeThreshold(-1);
-#endif
-}
-
void tst_QGraphicsGridLayout::qgraphicsgridlayout_data()
{
}
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro b/tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro
index 5bfa15db16..88526144fc 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro
+++ b/tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro
@@ -5,4 +5,4 @@ QT += core-private gui-private
SOURCES += tst_qgraphicsitem.cpp
DEFINES += QT_NO_CAST_TO_ASCII
-win32:!wince:!winrt: LIBS += -luser32
+win32:!winrt: LIBS += -luser32
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
index 60dc7a7288..96a76d885d 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -57,9 +57,7 @@
Q_DECLARE_METATYPE(QPainterPath)
-#include "../../../qtest-config.h"
-
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
#include <windows.h>
#define Q_CHECK_PAINTEVENTS \
if (::SwitchDesktop(::GetThreadDesktop(::GetCurrentThreadId())) == 0) \
@@ -279,9 +277,6 @@ class tst_QGraphicsItem : public QObject
{
Q_OBJECT
-public slots:
- void init();
-
private slots:
void construction();
void constructionWithParent();
@@ -355,7 +350,7 @@ private slots:
void filtersChildEvents();
void filtersChildEvents2();
void ensureVisible();
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void cursor();
#endif
//void textControlGetterSetter();
@@ -481,13 +476,6 @@ private:
QList<QGraphicsItem *> paintedItems;
};
-void tst_QGraphicsItem::init()
-{
-#ifdef Q_OS_WINCE //disable magic for WindowsCE
- qApp->setAutoMaximizeThreshold(-1);
-#endif
-}
-
void tst_QGraphicsItem::construction()
{
for (int i = 0; i < 7; ++i) {
@@ -4188,7 +4176,7 @@ void tst_QGraphicsItem::ensureVisible()
QTest::qWait(25);
}
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void tst_QGraphicsItem::cursor()
{
QGraphicsScene scene;
@@ -4536,7 +4524,7 @@ protected:
case QGraphicsItem::ItemSceneHasChanged:
break;
case QGraphicsItem::ItemCursorChange:
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
oldValues << cursor();
#endif
break;
@@ -5102,10 +5090,6 @@ public:
void tst_QGraphicsItem::paint()
{
-#ifdef Q_OS_MACX
- if (QSysInfo::MacintoshVersion == QSysInfo::MV_10_7)
- QSKIP("QTBUG-31454 - Unstable auto-test");
-#endif
QGraphicsScene scene;
PaintTester paintTester;
@@ -6590,12 +6574,6 @@ public:
void tst_QGraphicsItem::ensureUpdateOnTextItem()
{
-#ifdef Q_OS_MAC
- if (QSysInfo::MacintoshVersion == QSysInfo::MV_10_7) {
- QSKIP("This test is unstable on 10.7 in CI");
- }
-#endif
-
QGraphicsScene scene;
QGraphicsView view(&scene);
view.show();
@@ -11044,9 +11022,7 @@ void tst_QGraphicsItem::touchEventPropagation()
touchPoints << tp;
sendMousePress(&scene, tp.scenePos());
- QTouchDevice *device = new QTouchDevice;
- device->setType(QTouchDevice::TouchScreen);
- QWindowSystemInterface::registerTouchDevice(device);
+ QTouchDevice *device = QTest::createTouchDevice();
QTouchEvent touchBegin(QEvent::TouchBegin, device, Qt::NoModifier, Qt::TouchPointPressed, touchPoints);
qApp->sendEvent(&scene, &touchBegin);
diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
index 491dda9f9e..d99c056abe 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
@@ -33,8 +33,6 @@
#include <private/qgraphicsproxywidget_p.h>
#include <private/qlayoutengine_p.h> // qSmartMin functions...
-#include "../../../qtest-config.h"
-
static void sendMouseMove(QWidget *widget, const QPoint &point, Qt::MouseButton button = Qt::NoButton)
{
QMouseEvent event(QEvent::MouseMove, point, widget->mapToGlobal(point), button, button, 0);
@@ -97,7 +95,7 @@ private slots:
void focusNextPrevChild();
void focusOutEvent_data();
void focusOutEvent();
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void hoverEnterLeaveEvent_data();
void hoverEnterLeaveEvent();
#endif
@@ -140,7 +138,7 @@ private slots:
void setFocus_complexTwoWidgets();
void popup_basic();
void popup_subwidget();
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void changingCursor_basic();
#endif
void tooltip_basic();
@@ -272,9 +270,6 @@ public:
// It is only called once.
void tst_QGraphicsProxyWidget::initTestCase()
{
-#ifdef Q_OS_WINCE //disable magic for WindowsCE
- qApp->setAutoMaximizeThreshold(-1);
-#endif
// Disable menu animations to prevent the alpha widget from getting in the way
// in actionsContextMenu().
QApplication::setEffectEnabled(Qt::UI_AnimateMenu, false);
@@ -416,7 +411,7 @@ void tst_QGraphicsProxyWidget::setWidget()
}
QWidget *widget = new QWidget;
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
widget->setCursor(Qt::IBeamCursor);
#endif
widget->setPalette(QPalette(Qt::magenta));
@@ -453,7 +448,7 @@ void tst_QGraphicsProxyWidget::setWidget()
QVERIFY(subWidget->testAttribute(Qt::WA_DontShowOnScreen));
QVERIFY(!subWidget->testAttribute(Qt::WA_QuitOnClose));
QCOMPARE(proxy->acceptHoverEvents(), true);
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
QVERIFY(proxy->hasCursor());
// These should match
@@ -936,7 +931,7 @@ protected:
}
};
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void tst_QGraphicsProxyWidget::hoverEnterLeaveEvent_data()
{
QTest::addColumn<bool>("hasWidget");
@@ -1524,7 +1519,7 @@ void tst_QGraphicsProxyWidget::setWidget_simple()
// Properties
// QCOMPARE(proxy.focusPolicy(), lineEdit->focusPolicy());
// QCOMPARE(proxy.palette(), lineEdit->palette());
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
QCOMPARE(proxy.cursor().shape(), lineEdit->cursor().shape());
#endif
QCOMPARE(proxy.layoutDirection(), lineEdit->layoutDirection());
@@ -1573,7 +1568,7 @@ void tst_QGraphicsProxyWidget::resize_simple_data()
QTest::addColumn<QSizeF>("size");
QTest::newRow("200, 200") << QSizeF(200, 200);
-#if !defined(Q_PROCESSOR_ARM) && !defined(Q_OS_WINCE)
+#if !defined(Q_PROCESSOR_ARM)
QTest::newRow("1000, 1000") << QSizeF(1000, 1000);
// Since 4.5, 10000x10000 runs out of memory.
// QTest::newRow("10000, 10000") << QSizeF(10000, 10000);
@@ -2541,7 +2536,7 @@ void tst_QGraphicsProxyWidget::popup_subwidget()
QCOMPARE(popup->size(), child->size().toSize());
}
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void tst_QGraphicsProxyWidget::changingCursor_basic()
{
// Confirm that mouse events are working properly by checking that
@@ -2780,7 +2775,7 @@ void tst_QGraphicsProxyWidget::windowOpacity()
// disabled on platforms without alpha channel support in QPixmap (e.g.,
// X11 without XRender).
int paints = 0;
-#ifdef Q_DEAD_CODE_FROM_QT4_X11
+#if 0 // Used to be included in Qt4 for Q_WS_X11
paints = !X11->use_xrender;
#endif
QTRY_COMPARE(eventSpy.counts[QEvent::UpdateRequest], 0);
@@ -3647,7 +3642,7 @@ public slots:
void tst_QGraphicsProxyWidget::QTBUG_6986_sendMouseEventToAlienWidget()
{
-#if defined(Q_OS_MAC) || defined(Q_OS_WIN) || defined(QTEST_NO_CURSOR)
+#if defined(Q_OS_DARWIN) || defined(Q_OS_WIN) || defined(QT_NO_CURSOR)
QSKIP("Test case unstable on this platform");
#endif
QGraphicsView view;
@@ -3804,9 +3799,7 @@ void tst_QGraphicsProxyWidget::forwardTouchEvent()
EventSpy eventSpy(widget);
- QTouchDevice *device = new QTouchDevice;
- device->setType(QTouchDevice::TouchScreen);
- QWindowSystemInterface::registerTouchDevice(device);
+ QTouchDevice *device = QTest::createTouchDevice();
QCOMPARE(eventSpy.counts[QEvent::TouchBegin], 0);
QCOMPARE(eventSpy.counts[QEvent::TouchUpdate], 0);
diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro b/tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro
index 986ba019b4..351cecd92e 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro
+++ b/tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro
@@ -4,18 +4,9 @@ QT += widgets widgets-private testlib
QT += core-private gui-private
SOURCES += tst_qgraphicsscene.cpp
RESOURCES += images.qrc
-win32:!wince:!winrt: LIBS += -luser32
+win32:!winrt: LIBS += -luser32
-!wince: DEFINES += SRCDIR=\\\"$$PWD\\\"
+DEFINES += SRCDIR=\\\"$$PWD\\\"
DEFINES += QT_NO_CAST_TO_ASCII
-wince* {
- rootFiles.files = Ash_European.jpg graphicsScene_selection.data
- rootFiles.path = .
- renderFiles.files = testData\\render\\*
- renderFiles.path = testData\\render
- DEPLOYMENT += rootFiles renderFiles
- DEFINES += SRCDIR=\\\".\\\"
-}
-
RESOURCES += testdata.qrc
diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
index a346bb9d1f..d95f6e408e 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -28,9 +28,6 @@
#include <QtTest/QtTest>
-#if defined(Q_OS_WINCE)
-#include <ceconfig.h>
-#endif
#include <QtGui>
#include <QtWidgets>
@@ -41,7 +38,7 @@
#include "../../../shared/platforminputcontext.h"
#include <private/qinputmethod_p.h>
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
#include <windows.h>
#define Q_CHECK_PAINTEVENTS \
if (::SwitchDesktop(::GetThreadDesktop(::GetCurrentThreadId())) == 0) \
@@ -170,7 +167,6 @@ class tst_QGraphicsScene : public QObject
{
Q_OBJECT
public slots:
- void initTestCase();
void cleanup();
private slots:
@@ -271,15 +267,9 @@ private slots:
void taskQT_3674_doNotCrash();
void taskQTBUG_15977_renderWithDeviceCoordinateCache();
void taskQTBUG_16401_focusItem();
+ void taskQTBUG_42915_focusNextPrevChild();
};
-void tst_QGraphicsScene::initTestCase()
-{
-#ifdef Q_OS_WINCE //disable magic for WindowsCE
- qApp->setAutoMaximizeThreshold(-1);
-#endif
-}
-
void tst_QGraphicsScene::cleanup()
{
// ensure not even skipped tests with custom input context leave it dangling
@@ -1250,7 +1240,7 @@ void tst_QGraphicsScene::addText()
void tst_QGraphicsScene::removeItem()
{
-#if (defined(Q_OS_WINCE) && !defined(GWES_ICONCURS)) || defined(Q_OS_ANDROID)
+#if defined(Q_OS_ANDROID)
QSKIP("No mouse cursor support");
#endif
QGraphicsScene scene;
@@ -1587,11 +1577,7 @@ void tst_QGraphicsScene::hoverEvents_siblings()
QGraphicsView view(&scene);
view.setRenderHint(QPainter::Antialiasing, true);
-#if defined(Q_OS_WINCE)
- view.setMinimumSize(230, 200);
-#else
view.setMinimumSize(400, 300);
-#endif
view.rotate(10);
view.scale(1.7, 1.7);
view.show();
@@ -1660,11 +1646,7 @@ void tst_QGraphicsScene::hoverEvents_parentChild()
QGraphicsView view(&scene);
view.setRenderHint(QPainter::Antialiasing, true);
-#if defined(Q_OS_WINCE)
- view.setMinimumSize(230, 200);
-#else
view.setMinimumSize(400, 300);
-#endif
view.rotate(10);
view.scale(1.7, 1.7);
view.show();
@@ -4834,5 +4816,29 @@ void tst_QGraphicsScene::taskQTBUG_16401_focusItem()
QVERIFY(!scene.focusItem());
}
+void tst_QGraphicsScene::taskQTBUG_42915_focusNextPrevChild()
+{
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ scene.setSceneRect(1, 1, 198, 198);
+ view.setFocus();
+
+ QGraphicsWidget *widget1 = new QGraphicsWidget();
+ QGraphicsRectItem *rect1 = new QGraphicsRectItem(-50, -50, 100, 100, widget1);
+ rect1->setBrush(Qt::blue);
+ scene.addItem(widget1);
+ widget1->setPos(100, 100);
+ widget1->setFlags(QGraphicsItem::ItemIsPanel);
+
+ QGraphicsWidget *widget2 = new QGraphicsWidget(widget1);
+ widget2->setFocusPolicy(Qt::NoFocus);
+
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowActive(&view));
+
+ QTest::keyEvent(QTest::Click, &view, Qt::Key_Tab);
+}
+
QTEST_MAIN(tst_QGraphicsScene)
#include "tst_qgraphicsscene.moc"
diff --git a/tests/auto/widgets/graphicsview/qgraphicssceneindex/qgraphicssceneindex.pro b/tests/auto/widgets/graphicsview/qgraphicssceneindex/qgraphicssceneindex.pro
index 3b74ab0c75..42c260d480 100644
--- a/tests/auto/widgets/graphicsview/qgraphicssceneindex/qgraphicssceneindex.pro
+++ b/tests/auto/widgets/graphicsview/qgraphicssceneindex/qgraphicssceneindex.pro
@@ -1,6 +1,6 @@
CONFIG += testcase
TARGET = tst_qgraphicssceneindex
-requires(contains(QT_CONFIG,private_tests))
+requires(qtConfig(private_tests))
QT += widgets widgets-private testlib
QT += core-private gui-private
SOURCES += tst_qgraphicssceneindex.cpp
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
index 5b6f219d11..2e76ea3bb3 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
@@ -57,7 +57,6 @@
#include "../../../shared/platforminputcontext.h"
#include <private/qinputmethod_p.h>
-#include "../../../qtest-config.h"
#include "tst_qgraphicsview.h"
Q_DECLARE_METATYPE(ExpectedValueDescription)
@@ -146,7 +145,6 @@ public:
: platformName(QGuiApplication::platformName().toLower())
{ }
private slots:
- void initTestCase();
void cleanup();
void construction();
void renderHints();
@@ -202,7 +200,7 @@ private slots:
#ifndef QT_NO_WHEELEVENT
void wheelEvent();
#endif
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void cursor();
void cursor2();
#endif
@@ -266,7 +264,7 @@ private slots:
void QTBUG_4151_clipAndIgnore_data();
void QTBUG_4151_clipAndIgnore();
void QTBUG_5859_exposedRect();
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void QTBUG_7438_cursor();
#endif
void hoverLeave();
@@ -279,13 +277,6 @@ private:
QString platformName;
};
-void tst_QGraphicsView::initTestCase()
-{
-#ifdef Q_OS_WINCE_WM
- qApp->setAutoMaximizeThreshold(-1);
-#endif
-}
-
void tst_QGraphicsView::cleanup()
{
// ensure not even skipped tests with custom input context leave it dangling
@@ -739,7 +730,7 @@ void tst_QGraphicsView::dragMode_scrollHand()
for (int i = 0; i < 2; ++i) {
// ScrollHandDrag
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
Qt::CursorShape cursorShape = view.viewport()->cursor().shape();
#endif
int horizontalScrollBarValue = view.horizontalScrollBar()->value();
@@ -758,7 +749,7 @@ void tst_QGraphicsView::dragMode_scrollHand()
QTRY_VERIFY(item->isSelected());
for (int k = 0; k < 4; ++k) {
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
QCOMPARE(view.viewport()->cursor().shape(), Qt::ClosedHandCursor);
#endif
{
@@ -801,7 +792,7 @@ void tst_QGraphicsView::dragMode_scrollHand()
QTRY_VERIFY(item->isSelected());
QCOMPARE(view.horizontalScrollBar()->value(), horizontalScrollBarValue - 10);
QCOMPARE(view.verticalScrollBar()->value(), verticalScrollBarValue - 10);
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
QCOMPARE(view.viewport()->cursor().shape(), cursorShape);
#endif
@@ -861,7 +852,7 @@ void tst_QGraphicsView::dragMode_rubberBand()
for (int i = 0; i < 2; ++i) {
// RubberBandDrag
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
Qt::CursorShape cursorShape = view.viewport()->cursor().shape();
#endif
int horizontalScrollBarValue = view.horizontalScrollBar()->value();
@@ -875,7 +866,7 @@ void tst_QGraphicsView::dragMode_rubberBand()
QApplication::sendEvent(view.viewport(), &event);
QVERIFY(event.isAccepted());
}
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
QCOMPARE(view.viewport()->cursor().shape(), cursorShape);
#endif
@@ -923,7 +914,7 @@ void tst_QGraphicsView::dragMode_rubberBand()
}
QCOMPARE(view.horizontalScrollBar()->value(), horizontalScrollBarValue);
QCOMPARE(view.verticalScrollBar()->value(), verticalScrollBarValue);
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
QCOMPARE(view.viewport()->cursor().shape(), cursorShape);
#endif
@@ -1428,20 +1419,9 @@ void tst_QGraphicsView::fitInView()
items[0]->setTransform(QTransform().rotate(30), true);
items[1]->setTransform(QTransform().rotate(-30), true);
-#if defined(Q_OS_WINCE)
- //Is the standard scrollbar size
- int scrollbarSize = qApp->style()->pixelMetric(QStyle::PM_ScrollBarExtent) - 13;
-#endif
-
QGraphicsView view(&scene);
view.setSceneRect(-400, -400, 800, 800);
-
-#if defined(Q_OS_WINCE)
- //We need to take in account the scrollbar size for the WindowsMobilStyle
- view.setFixedSize(400 + scrollbarSize, 200 + scrollbarSize);
-#else
view.setFixedSize(400, 200);
-#endif
view.showNormal();
view.fitInView(scene.itemsBoundingRect(), Qt::IgnoreAspectRatio);
@@ -1855,11 +1835,7 @@ void tst_QGraphicsView::mapToScene()
QGraphicsView view(&topLevel);
view.setScene(&scene);
view.setSceneRect(-500, -500, 1000, 1000);
-#if defined(Q_OS_WINCE)
- QSize viewSize(200,200);
-#else
QSize viewSize(300,300);
-#endif
view.setFixedSize(viewSize);
topLevel.show();
@@ -2266,7 +2242,7 @@ void tst_QGraphicsView::wheelEvent()
}
#endif // !QT_NO_WHEELEVENT
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void tst_QGraphicsView::cursor()
{
QGraphicsScene scene;
@@ -2290,7 +2266,7 @@ void tst_QGraphicsView::cursor()
}
#endif
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void tst_QGraphicsView::cursor2()
{
QGraphicsScene scene;
@@ -3789,7 +3765,7 @@ void tst_QGraphicsView::mouseTracking()
QGraphicsView view(&scene);
QGraphicsRectItem *item = new QGraphicsRectItem(10, 10, 10, 10);
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
item->setCursor(Qt::CrossCursor);
#endif
scene.addItem(item);
@@ -3799,7 +3775,7 @@ void tst_QGraphicsView::mouseTracking()
// Adding an item to the scene before the scene is set on the view.
QGraphicsScene scene(-10000, -10000, 20000, 20000);
QGraphicsRectItem *item = new QGraphicsRectItem(10, 10, 10, 10);
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
item->setCursor(Qt::CrossCursor);
#endif
scene.addItem(item);
@@ -3816,7 +3792,7 @@ void tst_QGraphicsView::mouseTracking()
QGraphicsView view3(&scene);
QGraphicsRectItem *item = new QGraphicsRectItem(10, 10, 10, 10);
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
item->setCursor(Qt::CrossCursor);
#endif
scene.addItem(item);
@@ -4577,9 +4553,6 @@ void tst_QGraphicsView::task253415_reconnectUpdateSceneOnSceneChanged()
void tst_QGraphicsView::task255529_transformationAnchorMouseAndViewportMargins()
{
-#if defined(Q_OS_WINCE)
- QSKIP("Qt/CE does not implement mouse tracking at this point");
-#endif
QGraphicsScene scene(-100, -100, 200, 200);
scene.addRect(QRectF(-50, -50, 100, 100), QPen(Qt::black), QBrush(Qt::blue));
@@ -4771,7 +4744,7 @@ void tst_QGraphicsView::QTBUG_5859_exposedRect()
QCOMPARE(item.lastExposedRect, scene.lastBackgroundExposedRect);
}
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void tst_QGraphicsView::QTBUG_7438_cursor()
{
QGraphicsScene scene;
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.h b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.h
index 8a83ee3272..ed16878ecb 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.h
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.h
@@ -34,7 +34,7 @@
// value to add/remove has to be obtained in test run using the actual style.
struct ExpectedValueDescription {
- ExpectedValueDescription(int v = 0, int sbeta = 0, int sta = 0)
+ Q_DECL_CONSTEXPR ExpectedValueDescription(int v = 0, int sbeta = 0, int sta = 0)
: value(v)
, scrollBarExtentsToAdd(sbeta)
, spacingsToAdd(sta)
@@ -55,7 +55,7 @@ struct ExpectedValueDescription {
// Describes how often the scroll bar width/height has to be added to/removed
// from the according side of the sceneRect.
struct ScrollBarCount {
- ScrollBarCount(int l = 0, int t = 0, int r = 0, int b = 0 )
+ Q_DECL_CONSTEXPR ScrollBarCount(int l = 0, int t = 0, int r = 0, int b = 0 )
: left(l)
, top(t)
, right(r)
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp
index ff621b94c5..875f671e76 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp
@@ -47,584 +47,1184 @@ Q_DECLARE_METATYPE(ScrollBarCount)
static void _scrollBarRanges_addTestData(const QString &style, bool styled)
{
const QString styleString = styled ? style + ", Styled" : style;
- int viewWidth = 250;
- int viewHeight = 100;
- QTest::newRow(qPrintable(styleString + ", 1"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded
- << ExpectedValueDescription() << ExpectedValueDescription()
- << ExpectedValueDescription() << ExpectedValueDescription() << styled;
- QTest::newRow(qPrintable(styleString + ", 2"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 50, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded
- << ExpectedValueDescription() << ExpectedValueDescription(50, 1, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(0, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 3"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 50, viewHeight + 100) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded
- << ExpectedValueDescription() << ExpectedValueDescription(50, 1, 1)
- << ExpectedValueDescription(0, 0) << ExpectedValueDescription(100, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 4"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded
- << ExpectedValueDescription() << ExpectedValueDescription()
- << ExpectedValueDescription() << ExpectedValueDescription() << styled;
- QTest::newRow(qPrintable(styleString + ", 5"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth + 50, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded
- << ExpectedValueDescription(-100) << ExpectedValueDescription(-50, 1, 1)
- << ExpectedValueDescription(-100) << ExpectedValueDescription(-100, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 6"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth + 50, viewHeight + 100) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded
- << ExpectedValueDescription(-100) << ExpectedValueDescription(-50, 1, 1)
- << ExpectedValueDescription(-100) << ExpectedValueDescription(0, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 7"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 1, viewHeight + 1) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded
- << ExpectedValueDescription() << ExpectedValueDescription(1, 1, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(1, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 8"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 51, viewHeight + 1) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded
- << ExpectedValueDescription() << ExpectedValueDescription(51, 1, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(1, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 9"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 51, viewHeight + 101) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded
- << ExpectedValueDescription() << ExpectedValueDescription(51, 1, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(101, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 10"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-101, -101, viewWidth + 1, viewHeight + 1) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded
- << ExpectedValueDescription(-101) << ExpectedValueDescription(-100, 1, 1)
- << ExpectedValueDescription(-101) << ExpectedValueDescription(-100, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 11"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-101, -101, viewWidth + 51, viewHeight + 1) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded
- << ExpectedValueDescription(-101) << ExpectedValueDescription(-50, 1, 1)
- << ExpectedValueDescription(-101) << ExpectedValueDescription(-100, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 12"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-101, -101, viewWidth + 51, viewHeight + 101) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded
- << ExpectedValueDescription(-101) << ExpectedValueDescription(-50, 1, 1)
- << ExpectedValueDescription(-101) << ExpectedValueDescription(0, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 13"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth, viewHeight) << ScrollBarCount(0, 0, 1, 1)
- << QTransform() << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded
- << ExpectedValueDescription() << ExpectedValueDescription(0, 2, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(0, 2, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 14"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 50, viewHeight) << ScrollBarCount(0, 0, 1, 1)
- << QTransform() << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded
- << ExpectedValueDescription() << ExpectedValueDescription(50, 2, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(0, 2, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 15"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 50, viewHeight + 100) << ScrollBarCount(0, 0, 1, 1)
- << QTransform() << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded
- << ExpectedValueDescription() << ExpectedValueDescription(50, 2, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(100, 2, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 16"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth, viewHeight) << ScrollBarCount(-1, -1, 1, 1)
- << QTransform() << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded
- << ExpectedValueDescription(-100, -1) << ExpectedValueDescription(-100, 1, 1)
- << ExpectedValueDescription(-100, -1) << ExpectedValueDescription(-100, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 17"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth + 50, viewHeight) << ScrollBarCount(-1, -1, 1, 1)
- << QTransform() << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded
- << ExpectedValueDescription(-100, -1) << ExpectedValueDescription(-50, 1, 1)
- << ExpectedValueDescription(-100, -1) << ExpectedValueDescription(-100, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 18"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth + 50, viewHeight + 100) << ScrollBarCount(-1, -1, 1, 1)
- << QTransform() << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded
- << ExpectedValueDescription(-100, -1) << ExpectedValueDescription(-50, 1, 1)
- << ExpectedValueDescription(-100, -1) << ExpectedValueDescription(0, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 1 x2"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform().scale(2, 2) << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded
- << ExpectedValueDescription() << ExpectedValueDescription(viewWidth, 1, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(viewHeight, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 2 x2"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 50, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform().scale(2, 2) << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded
- << ExpectedValueDescription() << ExpectedValueDescription(viewWidth + 100, 1, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(viewHeight, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 3 x2"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 50, viewHeight + 100) << ScrollBarCount(0, 0, 0, 0)
- << QTransform().scale(2, 2) << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded
- << ExpectedValueDescription() << ExpectedValueDescription(viewWidth + 100, 1, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(viewHeight + 200, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 4 x2"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform().scale(2, 2) << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded
- << ExpectedValueDescription(-200) << ExpectedValueDescription(viewWidth - 200, 1, 1)
- << ExpectedValueDescription(-200) << ExpectedValueDescription(viewHeight - 200, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 5 x2"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth + 50, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform().scale(2, 2) << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded
- << ExpectedValueDescription(-200) << ExpectedValueDescription(viewWidth - 100, 1, 1)
- << ExpectedValueDescription(-200) << ExpectedValueDescription(viewHeight - 200, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 6 x2"))
- << style << QSize(viewWidth, viewHeight) <<
- QRectF(-100, -100, viewWidth + 50, viewHeight + 100) << ScrollBarCount(0, 0, 0, 0)
- << QTransform().scale(2, 2) << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded
- << ExpectedValueDescription(-200) << ExpectedValueDescription(viewWidth - 100, 1, 1)
- << ExpectedValueDescription(-200) << ExpectedValueDescription(viewHeight, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 1 No ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff
- << ExpectedValueDescription() << ExpectedValueDescription()
- << ExpectedValueDescription() << ExpectedValueDescription() << styled;
- QTest::newRow(qPrintable(styleString + ", 2 No ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 50, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff
- << ExpectedValueDescription() << ExpectedValueDescription(50)
- << ExpectedValueDescription() << ExpectedValueDescription() << styled;
- QTest::newRow(qPrintable(styleString + ", 3 No ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 50, viewHeight + 100) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff
- << ExpectedValueDescription() << ExpectedValueDescription(50)
- << ExpectedValueDescription() << ExpectedValueDescription(100) << styled;
- QTest::newRow(qPrintable(styleString + ", 4 No ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff
- << ExpectedValueDescription() << ExpectedValueDescription()
- << ExpectedValueDescription() << ExpectedValueDescription() << styled;
- QTest::newRow(qPrintable(styleString + ", 5 No ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth + 50, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff
- << ExpectedValueDescription(-100) << ExpectedValueDescription(-50)
- << ExpectedValueDescription() << ExpectedValueDescription() << styled;
- QTest::newRow(qPrintable(styleString + ", 6 No ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth + 50, viewHeight + 100) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff
- << ExpectedValueDescription(-100) << ExpectedValueDescription(-50)
- << ExpectedValueDescription(-100) << ExpectedValueDescription() << styled;
- QTest::newRow(qPrintable(styleString + ", 7 No ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 1, viewHeight + 1) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff
- << ExpectedValueDescription() << ExpectedValueDescription(1)
- << ExpectedValueDescription() << ExpectedValueDescription(1) << styled;
- QTest::newRow(qPrintable(styleString + ", 8 No ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 51, viewHeight + 1) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff
- << ExpectedValueDescription() << ExpectedValueDescription(51)
- << ExpectedValueDescription() << ExpectedValueDescription(1) << styled;
- QTest::newRow(qPrintable(styleString + ", 9 No ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 51, viewHeight + 101) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff
- << ExpectedValueDescription() << ExpectedValueDescription(51)
- << ExpectedValueDescription() << ExpectedValueDescription(101) << styled;
- QTest::newRow(qPrintable(styleString + ", 10 No ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-101, -101, viewWidth + 1, viewHeight + 1) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff
- << ExpectedValueDescription(-101) << ExpectedValueDescription(-100)
- << ExpectedValueDescription(-101) << ExpectedValueDescription(-100) << styled;
- QTest::newRow(qPrintable(styleString + ", 11 No ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-101, -101, viewWidth + 51, viewHeight + 1) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff
- << ExpectedValueDescription(-101) << ExpectedValueDescription(-50)
- << ExpectedValueDescription(-101) << ExpectedValueDescription(-100) << styled;
- QTest::newRow(qPrintable(styleString + ", 12 No ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-101, -101, viewWidth + 51, viewHeight + 101) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff
- << ExpectedValueDescription(-101) << ExpectedValueDescription(-50)
- << ExpectedValueDescription(-101) << ExpectedValueDescription() << styled;
- QTest::newRow(qPrintable(styleString + ", 13 No ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth, viewHeight) << ScrollBarCount(0, 0, 1, 1)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff
- << ExpectedValueDescription() << ExpectedValueDescription(0, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(0, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 14 No ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 50, viewHeight) << ScrollBarCount(0, 0, 1, 1)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff
- << ExpectedValueDescription() << ExpectedValueDescription(50, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(0, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 15 No ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 50, viewHeight + 100) << ScrollBarCount(0, 0, 1, 1)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff
- << ExpectedValueDescription() << ExpectedValueDescription(50, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(100, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 16 No ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth, viewHeight) << ScrollBarCount(-1, -1, 1, 1)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff
- << ExpectedValueDescription(-100, -1) << ExpectedValueDescription(-100)
- << ExpectedValueDescription(-100, -1) << ExpectedValueDescription(-100) << styled;
- QTest::newRow(qPrintable(styleString + ", 17 No ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth + 50, viewHeight) << ScrollBarCount(-1, -1, 1, 1)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff
- << ExpectedValueDescription(-100, -1) << ExpectedValueDescription(-50)
- << ExpectedValueDescription(-100, -1) << ExpectedValueDescription(-100) << styled;
- QTest::newRow(qPrintable(styleString + ", 18 No ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth + 50, viewHeight + 100) << ScrollBarCount(-1, -1, 1, 1)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff
- << ExpectedValueDescription(-100, -1) << ExpectedValueDescription(-50)
- << ExpectedValueDescription(-100, -1) << ExpectedValueDescription() << styled;
- QTest::newRow(qPrintable(styleString + ", 1 x2 No ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform().scale(2, 2) << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff
- << ExpectedValueDescription() << ExpectedValueDescription(viewWidth)
- << ExpectedValueDescription() << ExpectedValueDescription(viewHeight) << styled;
- QTest::newRow(qPrintable(styleString + ", 2 x2 No ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 50, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform().scale(2, 2) << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff
- << ExpectedValueDescription() << ExpectedValueDescription(viewWidth + 100)
- << ExpectedValueDescription() << ExpectedValueDescription(viewHeight) << styled;
- QTest::newRow(qPrintable(styleString + ", 3 x2 No ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 50, viewHeight + 100) << ScrollBarCount(0, 0, 0, 0)
- << QTransform().scale(2, 2) << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff
- << ExpectedValueDescription() << ExpectedValueDescription(viewWidth + 100)
- << ExpectedValueDescription() << ExpectedValueDescription(viewHeight + 200) << styled;
- QTest::newRow(qPrintable(styleString + ", 4 x2 No ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform().scale(2, 2) << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff
- << ExpectedValueDescription(-200) << ExpectedValueDescription(viewWidth - 200)
- << ExpectedValueDescription(-200) << ExpectedValueDescription(viewHeight - 200) << styled;
- QTest::newRow(qPrintable(styleString + ", 5 x2 No ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth + 50, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform().scale(2, 2) << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff
- << ExpectedValueDescription(-200) << ExpectedValueDescription(viewWidth - 100)
- << ExpectedValueDescription(-200) << ExpectedValueDescription(viewHeight - 200) << styled;
- QTest::newRow(qPrintable(styleString + ", 6 x2 No ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth + 50, viewHeight + 100) << ScrollBarCount(0, 0, 0, 0)
- << QTransform().scale(2, 2) << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff
- << ExpectedValueDescription(-200) << ExpectedValueDescription(viewWidth - 100)
- << ExpectedValueDescription(-200) << ExpectedValueDescription(viewHeight) << styled;
- QTest::newRow(qPrintable(styleString + ", 1 Always ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription() << ExpectedValueDescription(0, 1, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(0, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 2 Always ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 50, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription() << ExpectedValueDescription(50, 1, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(0, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 3 Always ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 50, viewHeight + 100) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription() << ExpectedValueDescription(50, 1, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(100, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 4 Always ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription(-100) << ExpectedValueDescription(-100, 1, 1)
- << ExpectedValueDescription(-100) << ExpectedValueDescription(-100, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 5 Always ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth + 50, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription(-100) << ExpectedValueDescription(-50, 1, 1)
- << ExpectedValueDescription(-100) << ExpectedValueDescription(-100, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 6 Always ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth + 50, viewHeight + 100) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription(-100) << ExpectedValueDescription(-50, 1, 1)
- << ExpectedValueDescription(-100) << ExpectedValueDescription(0, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 7 Always ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 1, viewHeight + 1) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription() << ExpectedValueDescription(1, 1, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(1, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 8 Always ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 51, viewHeight + 1) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription() << ExpectedValueDescription(51, 1, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(1, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 9 Always ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 51, viewHeight + 101) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription() << ExpectedValueDescription(51, 1, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(101, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 10 Always ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-101, -101, viewWidth + 1, viewHeight + 1) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription(-101) << ExpectedValueDescription(-100, 1, 1)
- << ExpectedValueDescription(-101) << ExpectedValueDescription(-100, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 11 Always ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-101, -101, viewWidth + 51, viewHeight + 1) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription(-101) << ExpectedValueDescription(-50, 1, 1)
- << ExpectedValueDescription(-101) << ExpectedValueDescription(-100, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 12 Always ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-101, -101, viewWidth + 51, viewHeight + 101) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription(-101) << ExpectedValueDescription(-50, 1, 1)
- << ExpectedValueDescription(-101) << ExpectedValueDescription(0, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 13 Always ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth, viewHeight) << ScrollBarCount(0, 0, 1, 1)
- << QTransform() << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription() << ExpectedValueDescription(0, 2, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(0, 2, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 14 Always ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 50, viewHeight) << ScrollBarCount(0, 0, 1, 1)
- << QTransform() << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription() << ExpectedValueDescription(50, 2, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(0, 2, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 15 Always ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 50, viewHeight + 100) << ScrollBarCount(0, 0, 1, 1)
- << QTransform() << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription() << ExpectedValueDescription(50, 2, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(100, 2, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 16 Always ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth, viewHeight) << ScrollBarCount(-1, -1, 1, 1)
- << QTransform() << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription(-100, -1) << ExpectedValueDescription(-100, 1, 1)
- << ExpectedValueDescription(-100, -1) << ExpectedValueDescription(-100, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 17 Always ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth + 50, viewHeight) << ScrollBarCount(-1, -1, 1, 1)
- << QTransform() << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription(-100, -1) << ExpectedValueDescription(-50, 1, 1)
- << ExpectedValueDescription(-100, -1) << ExpectedValueDescription(-100, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 18 Always ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth + 50, viewHeight + 100) << ScrollBarCount(-1, -1, 1, 1)
- << QTransform() << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription(-100, -1) << ExpectedValueDescription(-50, 1, 1)
- << ExpectedValueDescription(-100, -1) << ExpectedValueDescription(0, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 1 x2 Always ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform().scale(2, 2) << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription() << ExpectedValueDescription(viewWidth, 1, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(viewHeight, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 2 x2 Always ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 50, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform().scale(2, 2) << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription() << ExpectedValueDescription(viewWidth + 100, 1, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(viewHeight, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 3 x2 Always ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 50, viewHeight + 100) << ScrollBarCount(0, 0, 0, 0)
- << QTransform().scale(2, 2) << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription() << ExpectedValueDescription(viewWidth + 100, 1, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(viewHeight + 200, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 4 x2 Always ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform().scale(2, 2) << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription(-200) << ExpectedValueDescription(viewWidth - 200, 1, 1)
- << ExpectedValueDescription(-200) << ExpectedValueDescription(viewHeight - 200, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 5 x2 Always ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth + 50, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform().scale(2, 2) << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription(-200) << ExpectedValueDescription(viewWidth - 100, 1, 1)
- << ExpectedValueDescription(-200) << ExpectedValueDescription(viewHeight - 200, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 6 x2 Always ScrollBars"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth + 50, viewHeight + 100) << ScrollBarCount(0, 0, 0, 0)
- << QTransform().scale(2, 2) << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription(-200) << ExpectedValueDescription(viewWidth - 100, 1, 1)
- << ExpectedValueDescription(-200) << ExpectedValueDescription(viewHeight, 1, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 1 Vertical Only"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription() << ExpectedValueDescription(0, 1, 1)
- << ExpectedValueDescription() << ExpectedValueDescription() << styled;
- QTest::newRow(qPrintable(styleString + ", 2 Vertical Only"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 50, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription() << ExpectedValueDescription(50, 1, 1)
- << ExpectedValueDescription() << ExpectedValueDescription() << styled;
- QTest::newRow(qPrintable(styleString + ", 3 Vertical Only"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 50, viewHeight + 100) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription() << ExpectedValueDescription(50, 1, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(100) << styled;
- QTest::newRow(qPrintable(styleString + ", 4 Vertical Only"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription(-100) << ExpectedValueDescription(-100, 1, 1)
- << ExpectedValueDescription() << ExpectedValueDescription() << styled;
- QTest::newRow(qPrintable(styleString + ", 5 Vertical Only"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth + 50, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription(-100) << ExpectedValueDescription(-50, 1, 1)
- << ExpectedValueDescription() << ExpectedValueDescription() << styled;
- QTest::newRow(qPrintable(styleString + ", 6 Vertical Only"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth + 50, viewHeight + 100) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription(-100) << ExpectedValueDescription(-50, 1, 1)
- << ExpectedValueDescription(-100) << ExpectedValueDescription() << styled;
- QTest::newRow(qPrintable(styleString + ", 7 Vertical Only"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 1, viewHeight + 1) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription() << ExpectedValueDescription(1, 1, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(1) << styled;
- QTest::newRow(qPrintable(styleString + ", 8 Vertical Only"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 51, viewHeight + 1) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription() << ExpectedValueDescription(51, 1, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(1) << styled;
- QTest::newRow(qPrintable(styleString + ", 9 Vertical Only"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 51, viewHeight + 101) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription() << ExpectedValueDescription(51, 1, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(101) << styled;
- QTest::newRow(qPrintable(styleString + ", 10 Vertical Only"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-101, -101, viewWidth + 1, viewHeight +1) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription(-101) << ExpectedValueDescription(-100, 1, 1)
- << ExpectedValueDescription(-101) << ExpectedValueDescription(-100) << styled;
- QTest::newRow(qPrintable(styleString + ", 11 Vertical Only"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-101, -101, viewWidth + 51, viewHeight + 1) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription(-101) << ExpectedValueDescription(-50, 1, 1)
- << ExpectedValueDescription(-101) << ExpectedValueDescription(-100) << styled;
- QTest::newRow(qPrintable(styleString + ", 12 Vertical Only"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-101, -101, viewWidth + 51, viewHeight + 101) << ScrollBarCount(0, 0, 0, 0)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription(-101) << ExpectedValueDescription(-50, 1, 1)
- << ExpectedValueDescription(-101) << ExpectedValueDescription() << styled;
- QTest::newRow(qPrintable(styleString + ", 13 Vertical Only"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth, viewHeight) << ScrollBarCount(0, 0, 1, 1)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription() << ExpectedValueDescription(0, 2, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(0, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 14 Vertical Only"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 50, viewHeight) << ScrollBarCount(0, 0, 1, 1)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription() << ExpectedValueDescription(50, 2, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(0, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 15 Vertical Only"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 50, viewHeight + 100) << ScrollBarCount(0, 0, 1, 1)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription() << ExpectedValueDescription(50, 2, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(100, 1) << styled;
- QTest::newRow(qPrintable(styleString + ", 16 Vertical Only"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth, viewHeight) << ScrollBarCount(-1, -1, 1, 1)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription(-100, -1) << ExpectedValueDescription(-100, 1, 1)
- << ExpectedValueDescription(-100, -1) << ExpectedValueDescription(-100) << styled;
- QTest::newRow(qPrintable(styleString + ", 17 Vertical Only"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth + 50, viewHeight) << ScrollBarCount(-1, -1, 1, 1)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription(-100, -1) << ExpectedValueDescription(-50, 1, 1)
- << ExpectedValueDescription(-100, -1) << ExpectedValueDescription(-100) << styled;
- QTest::newRow(qPrintable(styleString + ", 18 Vertical Only"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth + 50, viewHeight + 100) << ScrollBarCount(-1, -1, 1, 1)
- << QTransform() << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription(-100, -1) << ExpectedValueDescription(-50, 1, 1)
- << ExpectedValueDescription(-100, -1) << ExpectedValueDescription() << styled;
- QTest::newRow(qPrintable(styleString + ", 1 x2 Vertical Only"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform().scale(2, 2) << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription() << ExpectedValueDescription(viewWidth, 1, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(viewHeight) << styled;
- QTest::newRow(qPrintable(styleString + ", 2 x2 Vertical Only"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 50, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform().scale(2, 2) << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription() << ExpectedValueDescription(viewWidth + 100, 1, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(viewHeight) << styled;
- QTest::newRow(qPrintable(styleString + ", 3 x2 Vertical Only"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(0, 0, viewWidth + 50, viewHeight + 100) << ScrollBarCount(0, 0, 0, 0)
- << QTransform().scale(2, 2) << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription() << ExpectedValueDescription(viewWidth + 100, 1, 1)
- << ExpectedValueDescription() << ExpectedValueDescription(viewHeight + 200) << styled;
- QTest::newRow(qPrintable(styleString + ", 4 x2 Vertical Only"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform().scale(2, 2) << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription(-200) << ExpectedValueDescription(viewWidth - 200, 1, 1)
- << ExpectedValueDescription(-200) << ExpectedValueDescription(viewHeight - 200) << styled;
- QTest::newRow(qPrintable(styleString + ", 5 x2 Vertical Only"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth + 50, viewHeight) << ScrollBarCount(0, 0, 0, 0)
- << QTransform().scale(2, 2) << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription(-200) << ExpectedValueDescription(viewWidth - 100, 1, 1)
- << ExpectedValueDescription(-200) << ExpectedValueDescription(viewHeight - 200) << styled;
- QTest::newRow(qPrintable(styleString + ", 6 x2 Vertical Only"))
- << style << QSize(viewWidth, viewHeight)
- << QRectF(-100, -100, viewWidth + 50, viewHeight + 100) << ScrollBarCount(0, 0, 0, 0)
- << QTransform().scale(2, 2) << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOn
- << ExpectedValueDescription(-200) << ExpectedValueDescription(viewWidth - 100, 1, 1)
- << ExpectedValueDescription(-200) << ExpectedValueDescription(viewHeight) << styled;
+ const int viewWidth = 250;
+ const int viewHeight = 100;
+
+ static Q_CONSTEXPR struct Data {
+ const char *name;
+ QRectF sceneRect;
+ ScrollBarCount sceneRectOffsetFactors;
+ int scale;
+ Qt::ScrollBarPolicy hbarpolicy, vbarpolicy;
+ ExpectedValueDescription hmin, hmax, vmin, vmax;
+ } data [] = {
+ {
+ ", 1",
+ QRectF(0, 0, viewWidth, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAsNeeded,
+ Qt::ScrollBarAsNeeded,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(),
+ },
+ {
+ ", 2",
+ QRectF(0, 0, viewWidth + 50, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAsNeeded,
+ Qt::ScrollBarAsNeeded,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(50, 1, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(0, 1, 1),
+ },
+ {
+ ", 3",
+ QRectF(0, 0, viewWidth + 50, viewHeight + 100),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAsNeeded,
+ Qt::ScrollBarAsNeeded,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(50, 1, 1),
+ ExpectedValueDescription(0, 0),
+ ExpectedValueDescription(100, 1, 1),
+ },
+ {
+ ", 4",
+ QRectF(-100, -100, viewWidth, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAsNeeded,
+ Qt::ScrollBarAsNeeded,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(),
+ },
+ {
+ ", 5",
+ QRectF(-100, -100, viewWidth + 50, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAsNeeded,
+ Qt::ScrollBarAsNeeded,
+ ExpectedValueDescription(-100),
+ ExpectedValueDescription(-50, 1, 1),
+ ExpectedValueDescription(-100),
+ ExpectedValueDescription(-100, 1, 1),
+ },
+ {
+ ", 6",
+ QRectF(-100, -100, viewWidth + 50, viewHeight + 100),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAsNeeded,
+ Qt::ScrollBarAsNeeded,
+ ExpectedValueDescription(-100),
+ ExpectedValueDescription(-50, 1, 1),
+ ExpectedValueDescription(-100),
+ ExpectedValueDescription(0, 1, 1),
+ },
+ {
+ ", 7",
+ QRectF(0, 0, viewWidth + 1, viewHeight + 1),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAsNeeded,
+ Qt::ScrollBarAsNeeded,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(1, 1, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(1, 1, 1),
+ },
+ {
+ ", 8",
+ QRectF(0, 0, viewWidth + 51, viewHeight + 1),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAsNeeded,
+ Qt::ScrollBarAsNeeded,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(51, 1, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(1, 1, 1),
+ },
+ {
+ ", 9",
+ QRectF(0, 0, viewWidth + 51, viewHeight + 101),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAsNeeded,
+ Qt::ScrollBarAsNeeded,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(51, 1, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(101, 1, 1),
+ },
+ {
+ ", 10",
+ QRectF(-101, -101, viewWidth + 1, viewHeight + 1),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAsNeeded,
+ Qt::ScrollBarAsNeeded,
+ ExpectedValueDescription(-101),
+ ExpectedValueDescription(-100, 1, 1),
+ ExpectedValueDescription(-101),
+ ExpectedValueDescription(-100, 1, 1),
+ },
+ {
+ ", 11",
+ QRectF(-101, -101, viewWidth + 51, viewHeight + 1),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAsNeeded,
+ Qt::ScrollBarAsNeeded,
+ ExpectedValueDescription(-101),
+ ExpectedValueDescription(-50, 1, 1),
+ ExpectedValueDescription(-101),
+ ExpectedValueDescription(-100, 1, 1),
+ },
+ {
+ ", 12",
+ QRectF(-101, -101, viewWidth + 51, viewHeight + 101),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAsNeeded,
+ Qt::ScrollBarAsNeeded,
+ ExpectedValueDescription(-101),
+ ExpectedValueDescription(-50, 1, 1),
+ ExpectedValueDescription(-101),
+ ExpectedValueDescription(0, 1, 1),
+ },
+ {
+ ", 13",
+ QRectF(0, 0, viewWidth, viewHeight),
+ ScrollBarCount(0, 0, 1, 1),
+ 1,
+ Qt::ScrollBarAsNeeded,
+ Qt::ScrollBarAsNeeded,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(0, 2, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(0, 2, 1),
+ },
+ {
+ ", 14",
+ QRectF(0, 0, viewWidth + 50, viewHeight),
+ ScrollBarCount(0, 0, 1, 1),
+ 1,
+ Qt::ScrollBarAsNeeded,
+ Qt::ScrollBarAsNeeded,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(50, 2, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(0, 2, 1),
+ },
+ {
+ ", 15",
+ QRectF(0, 0, viewWidth + 50, viewHeight + 100),
+ ScrollBarCount(0, 0, 1, 1),
+ 1,
+ Qt::ScrollBarAsNeeded,
+ Qt::ScrollBarAsNeeded,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(50, 2, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(100, 2, 1),
+ },
+ {
+ ", 16",
+ QRectF(-100, -100, viewWidth, viewHeight),
+ ScrollBarCount(-1, -1, 1, 1),
+ 1,
+ Qt::ScrollBarAsNeeded,
+ Qt::ScrollBarAsNeeded,
+ ExpectedValueDescription(-100, -1),
+ ExpectedValueDescription(-100, 1, 1),
+ ExpectedValueDescription(-100, -1),
+ ExpectedValueDescription(-100, 1, 1),
+ },
+ {
+ ", 17",
+ QRectF(-100, -100, viewWidth + 50, viewHeight),
+ ScrollBarCount(-1, -1, 1, 1),
+ 1,
+ Qt::ScrollBarAsNeeded,
+ Qt::ScrollBarAsNeeded,
+ ExpectedValueDescription(-100, -1),
+ ExpectedValueDescription(-50, 1, 1),
+ ExpectedValueDescription(-100, -1),
+ ExpectedValueDescription(-100, 1, 1),
+ },
+ {
+ ", 18",
+ QRectF(-100, -100, viewWidth + 50, viewHeight + 100),
+ ScrollBarCount(-1, -1, 1, 1),
+ 1,
+ Qt::ScrollBarAsNeeded,
+ Qt::ScrollBarAsNeeded,
+ ExpectedValueDescription(-100, -1),
+ ExpectedValueDescription(-50, 1, 1),
+ ExpectedValueDescription(-100, -1),
+ ExpectedValueDescription(0, 1, 1),
+ },
+ {
+ ", 1 x2",
+ QRectF(0, 0, viewWidth, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 2,
+ Qt::ScrollBarAsNeeded,
+ Qt::ScrollBarAsNeeded,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(viewWidth, 1, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(viewHeight, 1, 1),
+ },
+ {
+ ", 2 x2",
+ QRectF(0, 0, viewWidth + 50, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 2,
+ Qt::ScrollBarAsNeeded,
+ Qt::ScrollBarAsNeeded,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(viewWidth + 100, 1, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(viewHeight, 1, 1),
+ },
+ {
+ ", 3 x2",
+ QRectF(0, 0, viewWidth + 50, viewHeight + 100),
+ ScrollBarCount(0, 0, 0, 0),
+ 2,
+ Qt::ScrollBarAsNeeded,
+ Qt::ScrollBarAsNeeded,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(viewWidth + 100, 1, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(viewHeight + 200, 1, 1),
+ },
+ {
+ ", 4 x2",
+ QRectF(-100, -100, viewWidth, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 2,
+ Qt::ScrollBarAsNeeded,
+ Qt::ScrollBarAsNeeded,
+ ExpectedValueDescription(-200),
+ ExpectedValueDescription(viewWidth - 200, 1, 1),
+ ExpectedValueDescription(-200),
+ ExpectedValueDescription(viewHeight - 200, 1, 1),
+ },
+ {
+ ", 5 x2",
+ QRectF(-100, -100, viewWidth + 50, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 2,
+ Qt::ScrollBarAsNeeded,
+ Qt::ScrollBarAsNeeded,
+ ExpectedValueDescription(-200),
+ ExpectedValueDescription(viewWidth - 100, 1, 1),
+ ExpectedValueDescription(-200),
+ ExpectedValueDescription(viewHeight - 200, 1, 1),
+ },
+ {
+ ", 6 x2",
+ QRectF(-100, -100, viewWidth + 50, viewHeight + 100),
+ ScrollBarCount(0, 0, 0, 0),
+ 2,
+ Qt::ScrollBarAsNeeded,
+ Qt::ScrollBarAsNeeded,
+ ExpectedValueDescription(-200),
+ ExpectedValueDescription(viewWidth - 100, 1, 1),
+ ExpectedValueDescription(-200),
+ ExpectedValueDescription(viewHeight, 1, 1),
+ },
+ {
+ ", 1 No ScrollBars",
+ QRectF(0, 0, viewWidth, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOff,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(),
+ },
+ {
+ ", 2 No ScrollBars",
+ QRectF(0, 0, viewWidth + 50, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOff,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(50),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(),
+ },
+ {
+ ", 3 No ScrollBars",
+ QRectF(0, 0, viewWidth + 50, viewHeight + 100),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOff,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(50),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(100),
+ },
+ {
+ ", 4 No ScrollBars",
+ QRectF(-100, -100, viewWidth, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOff,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(),
+ },
+ {
+ ", 5 No ScrollBars",
+ QRectF(-100, -100, viewWidth + 50, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOff,
+ ExpectedValueDescription(-100),
+ ExpectedValueDescription(-50),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(),
+ },
+ {
+ ", 6 No ScrollBars",
+ QRectF(-100, -100, viewWidth + 50, viewHeight + 100),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOff,
+ ExpectedValueDescription(-100),
+ ExpectedValueDescription(-50),
+ ExpectedValueDescription(-100),
+ ExpectedValueDescription(),
+ },
+ {
+ ", 7 No ScrollBars",
+ QRectF(0, 0, viewWidth + 1, viewHeight + 1),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOff,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(1),
+ },
+ {
+ ", 8 No ScrollBars",
+ QRectF(0, 0, viewWidth + 51, viewHeight + 1),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOff,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(51),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(1),
+ },
+ {
+ ", 9 No ScrollBars",
+ QRectF(0, 0, viewWidth + 51, viewHeight + 101),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOff,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(51),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(101),
+ },
+ {
+ ", 10 No ScrollBars",
+ QRectF(-101, -101, viewWidth + 1, viewHeight + 1),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOff,
+ ExpectedValueDescription(-101),
+ ExpectedValueDescription(-100),
+ ExpectedValueDescription(-101),
+ ExpectedValueDescription(-100),
+ },
+ {
+ ", 11 No ScrollBars",
+ QRectF(-101, -101, viewWidth + 51, viewHeight + 1),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOff,
+ ExpectedValueDescription(-101),
+ ExpectedValueDescription(-50),
+ ExpectedValueDescription(-101),
+ ExpectedValueDescription(-100),
+ },
+ {
+ ", 12 No ScrollBars",
+ QRectF(-101, -101, viewWidth + 51, viewHeight + 101),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOff,
+ ExpectedValueDescription(-101),
+ ExpectedValueDescription(-50),
+ ExpectedValueDescription(-101),
+ ExpectedValueDescription(),
+ },
+ {
+ ", 13 No ScrollBars",
+ QRectF(0, 0, viewWidth, viewHeight),
+ ScrollBarCount(0, 0, 1, 1),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOff,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(0, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(0, 1),
+ },
+ {
+ ", 14 No ScrollBars",
+ QRectF(0, 0, viewWidth + 50, viewHeight),
+ ScrollBarCount(0, 0, 1, 1),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOff,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(50, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(0, 1),
+ },
+ {
+ ", 15 No ScrollBars",
+ QRectF(0, 0, viewWidth + 50, viewHeight + 100),
+ ScrollBarCount(0, 0, 1, 1),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOff,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(50, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(100, 1),
+ },
+ {
+ ", 16 No ScrollBars",
+ QRectF(-100, -100, viewWidth, viewHeight),
+ ScrollBarCount(-1, -1, 1, 1),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOff,
+ ExpectedValueDescription(-100, -1),
+ ExpectedValueDescription(-100),
+ ExpectedValueDescription(-100, -1),
+ ExpectedValueDescription(-100),
+ },
+ {
+ ", 17 No ScrollBars",
+ QRectF(-100, -100, viewWidth + 50, viewHeight),
+ ScrollBarCount(-1, -1, 1, 1),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOff,
+ ExpectedValueDescription(-100, -1),
+ ExpectedValueDescription(-50),
+ ExpectedValueDescription(-100, -1),
+ ExpectedValueDescription(-100),
+ },
+ {
+ ", 18 No ScrollBars",
+ QRectF(-100, -100, viewWidth + 50, viewHeight + 100),
+ ScrollBarCount(-1, -1, 1, 1),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOff,
+ ExpectedValueDescription(-100, -1),
+ ExpectedValueDescription(-50),
+ ExpectedValueDescription(-100, -1),
+ ExpectedValueDescription(),
+ },
+ {
+ ", 1 x2 No ScrollBars",
+ QRectF(0, 0, viewWidth, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 2,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOff,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(viewWidth),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(viewHeight),
+ },
+ {
+ ", 2 x2 No ScrollBars",
+ QRectF(0, 0, viewWidth + 50, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 2,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOff,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(viewWidth + 100),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(viewHeight),
+ },
+ {
+ ", 3 x2 No ScrollBars",
+ QRectF(0, 0, viewWidth + 50, viewHeight + 100),
+ ScrollBarCount(0, 0, 0, 0),
+ 2,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOff,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(viewWidth + 100),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(viewHeight + 200),
+ },
+ {
+ ", 4 x2 No ScrollBars",
+ QRectF(-100, -100, viewWidth, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 2,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOff,
+ ExpectedValueDescription(-200),
+ ExpectedValueDescription(viewWidth - 200),
+ ExpectedValueDescription(-200),
+ ExpectedValueDescription(viewHeight - 200),
+ },
+ {
+ ", 5 x2 No ScrollBars",
+ QRectF(-100, -100, viewWidth + 50, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 2,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOff,
+ ExpectedValueDescription(-200),
+ ExpectedValueDescription(viewWidth - 100),
+ ExpectedValueDescription(-200),
+ ExpectedValueDescription(viewHeight - 200),
+ },
+ {
+ ", 6 x2 No ScrollBars",
+ QRectF(-100, -100, viewWidth + 50, viewHeight + 100),
+ ScrollBarCount(0, 0, 0, 0),
+ 2,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOff,
+ ExpectedValueDescription(-200),
+ ExpectedValueDescription(viewWidth - 100),
+ ExpectedValueDescription(-200),
+ ExpectedValueDescription(viewHeight),
+ },
+ {
+ ", 1 Always ScrollBars",
+ QRectF(0, 0, viewWidth, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOn,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(0, 1, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(0, 1, 1),
+ },
+ {
+ ", 2 Always ScrollBars",
+ QRectF(0, 0, viewWidth + 50, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOn,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(50, 1, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(0, 1, 1),
+ },
+ {
+ ", 3 Always ScrollBars",
+ QRectF(0, 0, viewWidth + 50, viewHeight + 100),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOn,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(50, 1, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(100, 1, 1),
+ },
+ {
+ ", 4 Always ScrollBars",
+ QRectF(-100, -100, viewWidth, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOn,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(-100),
+ ExpectedValueDescription(-100, 1, 1),
+ ExpectedValueDescription(-100),
+ ExpectedValueDescription(-100, 1, 1),
+ },
+ {
+ ", 5 Always ScrollBars",
+ QRectF(-100, -100, viewWidth + 50, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOn,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(-100),
+ ExpectedValueDescription(-50, 1, 1),
+ ExpectedValueDescription(-100),
+ ExpectedValueDescription(-100, 1, 1),
+ },
+ {
+ ", 6 Always ScrollBars",
+ QRectF(-100, -100, viewWidth + 50, viewHeight + 100),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOn,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(-100),
+ ExpectedValueDescription(-50, 1, 1),
+ ExpectedValueDescription(-100),
+ ExpectedValueDescription(0, 1, 1),
+ },
+ {
+ ", 7 Always ScrollBars",
+ QRectF(0, 0, viewWidth + 1, viewHeight + 1),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOn,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(1, 1, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(1, 1, 1),
+ },
+ {
+ ", 8 Always ScrollBars",
+ QRectF(0, 0, viewWidth + 51, viewHeight + 1),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOn,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(51, 1, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(1, 1, 1),
+ },
+ {
+ ", 9 Always ScrollBars",
+ QRectF(0, 0, viewWidth + 51, viewHeight + 101),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOn,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(51, 1, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(101, 1, 1),
+ },
+ {
+ ", 10 Always ScrollBars",
+ QRectF(-101, -101, viewWidth + 1, viewHeight + 1),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOn,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(-101),
+ ExpectedValueDescription(-100, 1, 1),
+ ExpectedValueDescription(-101),
+ ExpectedValueDescription(-100, 1, 1),
+ },
+ {
+ ", 11 Always ScrollBars",
+ QRectF(-101, -101, viewWidth + 51, viewHeight + 1),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOn,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(-101),
+ ExpectedValueDescription(-50, 1, 1),
+ ExpectedValueDescription(-101),
+ ExpectedValueDescription(-100, 1, 1),
+ },
+ {
+ ", 12 Always ScrollBars",
+ QRectF(-101, -101, viewWidth + 51, viewHeight + 101),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOn,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(-101),
+ ExpectedValueDescription(-50, 1, 1),
+ ExpectedValueDescription(-101),
+ ExpectedValueDescription(0, 1, 1),
+ },
+ {
+ ", 13 Always ScrollBars",
+ QRectF(0, 0, viewWidth, viewHeight),
+ ScrollBarCount(0, 0, 1, 1),
+ 1,
+ Qt::ScrollBarAlwaysOn,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(0, 2, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(0, 2, 1),
+ },
+ {
+ ", 14 Always ScrollBars",
+ QRectF(0, 0, viewWidth + 50, viewHeight),
+ ScrollBarCount(0, 0, 1, 1),
+ 1,
+ Qt::ScrollBarAlwaysOn,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(50, 2, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(0, 2, 1),
+ },
+ {
+ ", 15 Always ScrollBars",
+ QRectF(0, 0, viewWidth + 50, viewHeight + 100),
+ ScrollBarCount(0, 0, 1, 1),
+ 1,
+ Qt::ScrollBarAlwaysOn,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(50, 2, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(100, 2, 1),
+ },
+ {
+ ", 16 Always ScrollBars",
+ QRectF(-100, -100, viewWidth, viewHeight),
+ ScrollBarCount(-1, -1, 1, 1),
+ 1,
+ Qt::ScrollBarAlwaysOn,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(-100, -1),
+ ExpectedValueDescription(-100, 1, 1),
+ ExpectedValueDescription(-100, -1),
+ ExpectedValueDescription(-100, 1, 1),
+ },
+ {
+ ", 17 Always ScrollBars",
+ QRectF(-100, -100, viewWidth + 50, viewHeight),
+ ScrollBarCount(-1, -1, 1, 1),
+ 1,
+ Qt::ScrollBarAlwaysOn,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(-100, -1),
+ ExpectedValueDescription(-50, 1, 1),
+ ExpectedValueDescription(-100, -1),
+ ExpectedValueDescription(-100, 1, 1),
+ },
+ {
+ ", 18 Always ScrollBars",
+ QRectF(-100, -100, viewWidth + 50, viewHeight + 100),
+ ScrollBarCount(-1, -1, 1, 1),
+ 1,
+ Qt::ScrollBarAlwaysOn,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(-100, -1),
+ ExpectedValueDescription(-50, 1, 1),
+ ExpectedValueDescription(-100, -1),
+ ExpectedValueDescription(0, 1, 1),
+ },
+ {
+ ", 1 x2 Always ScrollBars",
+ QRectF(0, 0, viewWidth, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 2,
+ Qt::ScrollBarAlwaysOn,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(viewWidth, 1, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(viewHeight, 1, 1),
+ },
+ {
+ ", 2 x2 Always ScrollBars",
+ QRectF(0, 0, viewWidth + 50, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 2,
+ Qt::ScrollBarAlwaysOn,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(viewWidth + 100, 1, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(viewHeight, 1, 1),
+ },
+ {
+ ", 3 x2 Always ScrollBars",
+ QRectF(0, 0, viewWidth + 50, viewHeight + 100),
+ ScrollBarCount(0, 0, 0, 0),
+ 2,
+ Qt::ScrollBarAlwaysOn,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(viewWidth + 100, 1, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(viewHeight + 200, 1, 1),
+ },
+ {
+ ", 4 x2 Always ScrollBars",
+ QRectF(-100, -100, viewWidth, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 2,
+ Qt::ScrollBarAlwaysOn,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(-200),
+ ExpectedValueDescription(viewWidth - 200, 1, 1),
+ ExpectedValueDescription(-200),
+ ExpectedValueDescription(viewHeight - 200, 1, 1),
+ },
+ {
+ ", 5 x2 Always ScrollBars",
+ QRectF(-100, -100, viewWidth + 50, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 2,
+ Qt::ScrollBarAlwaysOn,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(-200),
+ ExpectedValueDescription(viewWidth - 100, 1, 1),
+ ExpectedValueDescription(-200),
+ ExpectedValueDescription(viewHeight - 200, 1, 1),
+ },
+ {
+ ", 6 x2 Always ScrollBars",
+ QRectF(-100, -100, viewWidth + 50, viewHeight + 100),
+ ScrollBarCount(0, 0, 0, 0),
+ 2,
+ Qt::ScrollBarAlwaysOn,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(-200),
+ ExpectedValueDescription(viewWidth - 100, 1, 1),
+ ExpectedValueDescription(-200),
+ ExpectedValueDescription(viewHeight, 1, 1),
+ },
+ {
+ ", 1 Vertical Only",
+ QRectF(0, 0, viewWidth, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(0, 1, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(),
+ },
+ {
+ ", 2 Vertical Only",
+ QRectF(0, 0, viewWidth + 50, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(50, 1, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(),
+ },
+ {
+ ", 3 Vertical Only",
+ QRectF(0, 0, viewWidth + 50, viewHeight + 100),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(50, 1, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(100),
+ },
+ {
+ ", 4 Vertical Only",
+ QRectF(-100, -100, viewWidth, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(-100),
+ ExpectedValueDescription(-100, 1, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(),
+ },
+ {
+ ", 5 Vertical Only",
+ QRectF(-100, -100, viewWidth + 50, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(-100),
+ ExpectedValueDescription(-50, 1, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(),
+ },
+ {
+ ", 6 Vertical Only",
+ QRectF(-100, -100, viewWidth + 50, viewHeight + 100),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(-100),
+ ExpectedValueDescription(-50, 1, 1),
+ ExpectedValueDescription(-100),
+ ExpectedValueDescription(),
+ },
+ {
+ ", 7 Vertical Only",
+ QRectF(0, 0, viewWidth + 1, viewHeight + 1),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(1, 1, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(1),
+ },
+ {
+ ", 8 Vertical Only",
+ QRectF(0, 0, viewWidth + 51, viewHeight + 1),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(51, 1, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(1),
+ },
+ {
+ ", 9 Vertical Only",
+ QRectF(0, 0, viewWidth + 51, viewHeight + 101),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(51, 1, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(101),
+ },
+ {
+ ", 10 Vertical Only",
+ QRectF(-101, -101, viewWidth + 1, viewHeight +1),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(-101),
+ ExpectedValueDescription(-100, 1, 1),
+ ExpectedValueDescription(-101),
+ ExpectedValueDescription(-100),
+ },
+ {
+ ", 11 Vertical Only",
+ QRectF(-101, -101, viewWidth + 51, viewHeight + 1),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(-101),
+ ExpectedValueDescription(-50, 1, 1),
+ ExpectedValueDescription(-101),
+ ExpectedValueDescription(-100),
+ },
+ {
+ ", 12 Vertical Only",
+ QRectF(-101, -101, viewWidth + 51, viewHeight + 101),
+ ScrollBarCount(0, 0, 0, 0),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(-101),
+ ExpectedValueDescription(-50, 1, 1),
+ ExpectedValueDescription(-101),
+ ExpectedValueDescription(),
+ },
+ {
+ ", 13 Vertical Only",
+ QRectF(0, 0, viewWidth, viewHeight),
+ ScrollBarCount(0, 0, 1, 1),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(0, 2, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(0, 1),
+ },
+ {
+ ", 14 Vertical Only",
+ QRectF(0, 0, viewWidth + 50, viewHeight),
+ ScrollBarCount(0, 0, 1, 1),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(50, 2, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(0, 1),
+ },
+ {
+ ", 15 Vertical Only",
+ QRectF(0, 0, viewWidth + 50, viewHeight + 100),
+ ScrollBarCount(0, 0, 1, 1),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(50, 2, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(100, 1),
+ },
+ {
+ ", 16 Vertical Only",
+ QRectF(-100, -100, viewWidth, viewHeight),
+ ScrollBarCount(-1, -1, 1, 1),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(-100, -1),
+ ExpectedValueDescription(-100, 1, 1),
+ ExpectedValueDescription(-100, -1),
+ ExpectedValueDescription(-100),
+ },
+ {
+ ", 17 Vertical Only",
+ QRectF(-100, -100, viewWidth + 50, viewHeight),
+ ScrollBarCount(-1, -1, 1, 1),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(-100, -1),
+ ExpectedValueDescription(-50, 1, 1),
+ ExpectedValueDescription(-100, -1),
+ ExpectedValueDescription(-100),
+ },
+ {
+ ", 18 Vertical Only",
+ QRectF(-100, -100, viewWidth + 50, viewHeight + 100),
+ ScrollBarCount(-1, -1, 1, 1),
+ 1,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(-100, -1),
+ ExpectedValueDescription(-50, 1, 1),
+ ExpectedValueDescription(-100, -1),
+ ExpectedValueDescription(),
+ },
+ {
+ ", 1 x2 Vertical Only",
+ QRectF(0, 0, viewWidth, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 2,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(viewWidth, 1, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(viewHeight),
+ },
+ {
+ ", 2 x2 Vertical Only",
+ QRectF(0, 0, viewWidth + 50, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 2,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(viewWidth + 100, 1, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(viewHeight),
+ },
+ {
+ ", 3 x2 Vertical Only",
+ QRectF(0, 0, viewWidth + 50, viewHeight + 100),
+ ScrollBarCount(0, 0, 0, 0),
+ 2,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(),
+ ExpectedValueDescription(viewWidth + 100, 1, 1),
+ ExpectedValueDescription(),
+ ExpectedValueDescription(viewHeight + 200),
+ },
+ {
+ ", 4 x2 Vertical Only",
+ QRectF(-100, -100, viewWidth, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 2,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(-200),
+ ExpectedValueDescription(viewWidth - 200, 1, 1),
+ ExpectedValueDescription(-200),
+ ExpectedValueDescription(viewHeight - 200),
+ },
+ {
+ ", 5 x2 Vertical Only",
+ QRectF(-100, -100, viewWidth + 50, viewHeight),
+ ScrollBarCount(0, 0, 0, 0),
+ 2,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(-200),
+ ExpectedValueDescription(viewWidth - 100, 1, 1),
+ ExpectedValueDescription(-200),
+ ExpectedValueDescription(viewHeight - 200),
+ },
+ {
+ ", 6 x2 Vertical Only",
+ QRectF(-100, -100, viewWidth + 50, viewHeight + 100),
+ ScrollBarCount(0, 0, 0, 0),
+ 2,
+ Qt::ScrollBarAlwaysOff,
+ Qt::ScrollBarAlwaysOn,
+ ExpectedValueDescription(-200),
+ ExpectedValueDescription(viewWidth - 100, 1, 1),
+ ExpectedValueDescription(-200),
+ ExpectedValueDescription(viewHeight),
+ },
+ };
+
+ const QSize viewSize(viewWidth, viewHeight);
+
+ for (const Data &e : data) {
+ QTest::newRow(qPrintable(styleString + QLatin1String(e.name)))
+ << style << viewSize
+ << e.sceneRect
+ << e.sceneRectOffsetFactors
+ << QTransform().scale(e.scale, e.scale)
+ << e.hbarpolicy
+ << e.vbarpolicy
+ << e.hmin << e.hmax << e.vmin << e.vmax
+ << styled;
+ }
}
void _scrollBarRanges_data()
diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
index ca9f866e81..9e390e45a6 100644
--- a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
@@ -42,8 +42,6 @@
#include <qstylefactory.h>
#include <qscreen.h>
-#include "../../../qtest-config.h"
-
typedef QList<QGraphicsItem *> QGraphicsItemList;
class EventSpy : public QObject
@@ -1112,9 +1110,7 @@ void tst_QGraphicsWidget::initStyleOption()
bool hasFocus = option.state & QStyle::State_HasFocus;
QCOMPARE(hasFocus, focus);
bool isUnderMouse = option.state & QStyle::State_MouseOver;
-#ifndef Q_OS_WINCE
QCOMPARE(isUnderMouse, underMouse);
-#endif
// if (layoutDirection != Qt::LeftToRight)
//QEXPECT_FAIL("", "QApplicaiton::layoutDirection doesn't propagate to QGraphicsWidget", Continue);
//QCOMPARE(option.direction, layoutDirection);
@@ -2938,8 +2934,8 @@ protected:
void tst_QGraphicsWidget::respectHFW()
{
-#if defined(Q_OS_WINCE) || defined(Q_OS_MAC)
- QSKIP("This test is platform dependent, it fails on wince and mac. Please fix.");
+#if defined(Q_OS_DARWIN)
+ QSKIP("This test is platform dependent, it fails on Apple platforms. Please fix.");
#else
QGraphicsScene scene;
HFWWidget *window = new HFWWidget;
@@ -3184,7 +3180,7 @@ void tst_QGraphicsWidget::itemChangeEvents()
valueDuringEvents.insert(QEvent::ParentChange, QVariant::fromValue(parentItem()));
break;
}
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
case QEvent::CursorChange: {
valueDuringEvents.insert(QEvent::CursorChange, int(cursor().shape()));
break;
@@ -3235,7 +3231,7 @@ void tst_QGraphicsWidget::itemChangeEvents()
QVERIFY(!item->isVisible());
QTRY_VERIFY(!item->valueDuringEvents.value(QEvent::Hide).toBool());
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
// CursorChange should be triggered after the cursor has changed
item->setCursor(Qt::PointingHandCursor);
QTRY_COMPARE(item->valueDuringEvents.value(QEvent::CursorChange).toInt(), int(item->cursor().shape()));
diff --git a/tests/auto/widgets/itemviews/itemviews.pro b/tests/auto/widgets/itemviews/itemviews.pro
index 2bd8ec43d3..af0b6aeef0 100644
--- a/tests/auto/widgets/itemviews/itemviews.pro
+++ b/tests/auto/widgets/itemviews/itemviews.pro
@@ -17,7 +17,7 @@ SUBDIRS=\
qtreewidget \
qtreewidgetitemiterator \
-!contains(QT_CONFIG, private_tests): SUBDIRS -= \
+!qtConfig(private_tests): SUBDIRS -= \
qcolumnview \
qlistwidget \
diff --git a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
index 6fd95c8266..5567641dde 100644
--- a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
+++ b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
@@ -95,7 +95,6 @@ public:
void basic_tests(QAbstractItemView *view);
private slots:
- void initTestCase();
void cleanup();
void getSetCheck();
void emptyModels_data();
@@ -255,13 +254,6 @@ void tst_QAbstractItemView::getSetCheck()
QCOMPARE(16, obj1->autoScrollMargin());
}
-void tst_QAbstractItemView::initTestCase()
-{
-#ifdef Q_OS_WINCE_WM
- qApp->setAutoMaximizeThreshold(-1);
-#endif
-}
-
void tst_QAbstractItemView::cleanup()
{
QVERIFY(QApplication::topLevelWidgets().isEmpty());
@@ -1008,7 +1000,7 @@ void tst_QAbstractItemView::setItemDelegate()
centerOnScreen(&v);
moveCursorAway(&v);
v.show();
-#ifdef Q_DEAD_CODE_FROM_QT4_X11
+#if 0 // Used to be included in Qt4 for Q_WS_X11
QCursor::setPos(v.geometry().center());
#endif
QApplication::setActiveWindow(&v);
@@ -1206,9 +1198,6 @@ void tst_QAbstractItemView::task250754_fontChange()
void tst_QAbstractItemView::task200665_itemEntered()
{
-#ifdef Q_OS_WINCE_WM
- QSKIP("On Windows Mobile the mouse tracking is unavailable at the moment");
-#endif
//we test that view will emit entered
//when the scrollbar move but not the mouse itself
QStandardItemModel model(1000,1);
diff --git a/tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp b/tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp
index d717278be9..e6c4ab44f8 100644
--- a/tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp
+++ b/tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp
@@ -183,9 +183,6 @@ void tst_QColumnView::initTestCase()
void tst_QColumnView::init()
{
qApp->setLayoutDirection(Qt::LeftToRight);
-#ifdef Q_OS_WINCE //disable magic for WindowsCE
- qApp->setAutoMaximizeThreshold(-1);
-#endif
}
void tst_QColumnView::rootIndex()
diff --git a/tests/auto/widgets/itemviews/qdirmodel/qdirmodel.pro b/tests/auto/widgets/itemviews/qdirmodel/qdirmodel.pro
index 5190598701..ea4e9d4620 100644
--- a/tests/auto/widgets/itemviews/qdirmodel/qdirmodel.pro
+++ b/tests/auto/widgets/itemviews/qdirmodel/qdirmodel.pro
@@ -13,7 +13,7 @@ wince* {
DEPLOYMENT += addit tests sourceFile
}
-android|wince {
+android {
DEFINES += SRCDIR=\\\"./\\\"
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
diff --git a/tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp b/tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp
index 06019d4555..30109952c7 100644
--- a/tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp
+++ b/tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp
@@ -575,7 +575,7 @@ void tst_QDirModel::filePath()
model.setResolveSymlinks(false);
QModelIndex index = model.index(SRCDIR "test.lnk");
QVERIFY(index.isValid());
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_ANDROID)
+#if !defined(Q_OS_ANDROID)
QString path = SRCDIR;
#else
QString path = QFileInfo(SRCDIR).absoluteFilePath();
diff --git a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
index ea065a4db4..32a324b888 100644
--- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
+++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
@@ -381,9 +381,6 @@ tst_QHeaderView::tst_QHeaderView()
void tst_QHeaderView::initTestCase()
{
-#ifdef Q_OS_WINCE //disable magic for WindowsCE
- qApp->setAutoMaximizeThreshold(-1);
-#endif
m_tableview = new QTableView();
}
@@ -554,11 +551,7 @@ void tst_QHeaderView::hidden()
void tst_QHeaderView::stretch()
{
// Show before resize and setStretchLastSection
-#if defined(Q_OS_WINCE)
- QSize viewSize(200,300);
-#else
QSize viewSize(500, 500);
-#endif
view->resize(viewSize);
view->setStretchLastSection(true);
QCOMPARE(view->stretchLastSection(), true);
@@ -618,12 +611,6 @@ void tst_QHeaderView::sectionSize()
QFETCH(int, lastVisibleSectionSize);
QFETCH(int, persistentSectionSize);
-#ifdef Q_OS_WINCE
- // We test on a device with doubled pixels. Therefore we need to specify
- // different boundaries.
- initialDefaultSize = qMax(view->minimumSectionSize(), 30);
-#endif
-
// bounds check
foreach (int val, boundsCheck)
view->sectionSize(val);
@@ -693,13 +680,7 @@ void tst_QHeaderView::visualIndexAt_data()
QTest::addColumn<QList<int> >("visual");
QList<int> coordinateList;
-#ifndef Q_OS_WINCE
coordinateList << -1 << 0 << 31 << 91 << 99999;
-#else
- // We test on a device with doubled pixels. Therefore we need to specify
- // different boundaries.
- coordinateList << -1 << 0 << 33 << 97 << 99999;
-#endif
QTest::newRow("no hidden, no moved sections")
<< QList<int>()
@@ -752,10 +733,6 @@ void tst_QHeaderView::visualIndexAt()
void tst_QHeaderView::length()
{
-#if defined(Q_OS_WINCE)
- QFont font(QLatin1String("Tahoma"), 7);
- view->setFont(font);
-#endif
view->setStretchLastSection(true);
topLevel->show();
QVERIFY(QTest::qWaitForWindowExposed(topLevel));
diff --git a/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro b/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro
index 02a71f8101..10cd1dcc54 100644
--- a/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro
+++ b/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro
@@ -3,4 +3,4 @@ TARGET = tst_qitemdelegate
QT += widgets widgets-private testlib
SOURCES += tst_qitemdelegate.cpp
-win32:!wince:!winrt: LIBS += -luser32
+win32:!winrt: LIBS += -luser32
diff --git a/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp b/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
index 972dabdcb8..0720a4f766 100644
--- a/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
+++ b/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
@@ -55,7 +55,7 @@
Q_DECLARE_METATYPE(QAbstractItemDelegate::EndEditHint)
-#if defined (Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
+#if defined (Q_OS_WIN) && !defined(Q_OS_WINRT)
#include <windows.h>
#define Q_CHECK_PAINTEVENTS \
if (::SwitchDesktop(::GetThreadDesktop(::GetCurrentThreadId())) == 0) \
diff --git a/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp b/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp
index d3211eada8..1fd7b31e22 100644
--- a/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp
+++ b/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp
@@ -32,42 +32,13 @@
#include "viewstotest.cpp"
#include <stdlib.h>
-#if defined(Q_OS_UNIX)
+#if defined(Q_OS_UNIX) || defined(Q_OS_WIN)
#include <time.h>
#endif
-#if defined(Q_OS_WIN)
-#include <time.h>
-#if defined(Q_OS_WINCE)
-#include <aygshell.h>
-#endif
-#define random rand
-#define srandom srand
-
-#if defined(Q_OS_WINCE)
-#ifndef SPI_GETPLATFORMTYPE
-#define SPI_GETPLATFORMTYPE 257
-#endif
-
-bool qt_wince_is_platform(const QString &platformString) {
- wchar_t tszPlatform[64];
- if (SystemParametersInfo(SPI_GETPLATFORMTYPE,
- sizeof(tszPlatform)/sizeof(*tszPlatform),tszPlatform,0))
- if (0 == _tcsicmp(reinterpret_cast<const wchar_t *> (platformString.utf16()), tszPlatform))
- return true;
- return false;
-}
-
-bool qt_wince_is_pocket_pc() {
- return qt_wince_is_platform(QString::fromLatin1("PocketPC"));
-}
-bool qt_wince_is_smartphone() {
- return qt_wince_is_platform(QString::fromLatin1("Smartphone"));
-}
-bool qt_wince_is_mobile() {
- return (qt_wince_is_smartphone() || qt_wince_is_pocket_pc());
-}
-#endif
+#if defined(Q_OS_WIN)
+# define random rand
+# define srandom srand
#endif
/*!
@@ -305,10 +276,6 @@ void tst_QItemView::nonDestructiveBasicTest_data()
*/
void tst_QItemView::nonDestructiveBasicTest()
{
-#ifdef Q_OS_WINCE
- QTest::qWait(400);
-#endif
-
QFETCH(QString, viewType);
QFETCH(int, vscroll);
QFETCH(int, hscroll);
@@ -476,11 +443,7 @@ void tst_QItemView::spider()
view->setModel(treeModel);
view->show();
QVERIFY(QTest::qWaitForWindowActive(view));
-#if defined(Q_OS_WINCE)
- srandom(0);
-#else
srandom(time(0));
-#endif
touch(view->viewport(), Qt::NoModifier, Qt::Key_Left);
touch(view->viewport(), Qt::ShiftModifier, Qt::Key_Enter);
touch(view->viewport(), Qt::ControlModifier, Qt::Key_Backspace);
diff --git a/tests/auto/widgets/itemviews/qlistview/qlistview.pro b/tests/auto/widgets/itemviews/qlistview/qlistview.pro
index 509303b62e..44e25ded66 100644
--- a/tests/auto/widgets/itemviews/qlistview/qlistview.pro
+++ b/tests/auto/widgets/itemviews/qlistview/qlistview.pro
@@ -2,5 +2,5 @@ CONFIG += testcase
TARGET = tst_qlistview
QT += widgets gui-private widgets-private core-private testlib
SOURCES += tst_qlistview.cpp
-win32:!wince:!winrt: LIBS += -luser32
+win32:!winrt: LIBS += -luser32
linux*: CONFIG += insignificant_test # Crashes
diff --git a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
index 98cc9b29ed..0f1c5723d5 100644
--- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
+++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
@@ -46,13 +46,13 @@
#include <QtWidgets/QStyleFactory>
#include <QtWidgets/QVBoxLayout>
-#if defined(Q_OS_WIN) || defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN)
# include <windows.h>
# include <QtGui/QGuiApplication>
#include <qpa/qplatformnativeinterface.h>
#endif // Q_OS_WIN
-#if defined(Q_OS_WIN) || defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN)
static inline HWND getHWNDForWidget(const QWidget *widget)
{
QWindow *window = widget->windowHandle();
@@ -84,7 +84,6 @@ class tst_QListView : public QObject
Q_OBJECT
private slots:
- void initTestCase();
void cleanup();
void getSetCheck();
void noDelegate();
@@ -112,7 +111,7 @@ private slots:
void scrollBarAsNeeded();
void moveItems();
void wordWrap();
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
void setCurrentIndexAfterAppendRowCrash();
#endif
void emptyItemSize();
@@ -293,13 +292,6 @@ public:
}
};
-void tst_QListView::initTestCase()
-{
-#ifdef Q_OS_WINCE //disable magic for WindowsCE
- qApp->setAutoMaximizeThreshold(-1);
-#endif
-}
-
void tst_QListView::cleanup()
{
QVERIFY(QApplication::topLevelWidgets().isEmpty());
@@ -984,25 +976,6 @@ void tst_QListView::selection_data()
<< QRect(300, 0, 1, 300) // selection rectangle
<< IntList(); // expected items
-#if defined(Q_OS_WINCE)
- // depending on whether the display is double-pixeld, we need
- // to click at a different position
- bool doubledSize = false;
- int dpi = GetDeviceCaps(GetDC(0), LOGPIXELSX);
- if ((dpi < 1000) && (dpi > 0)) {
- doubledSize = true;
- }
- QTest::newRow("select inside contents, (on viewport)")
- << 35 // itemCount
- << int(QListView::ListMode)
- << int(QListView::TopToBottom)
- << true // wrapping
- << 0 // spacing
- << QSize() // gridSize
- << IntList() // hiddenRows
- << QRect(doubledSize?350:175,doubledSize?550:275, 1, 1)// selection rectangle
- << IntList(); // expected items
-#else
QTest::newRow("select inside contents, (on viewport)")
<< 35 // itemCount
<< int(QListView::ListMode)
@@ -1013,7 +986,6 @@ void tst_QListView::selection_data()
<< IntList() // hiddenRows
<< QRect(175, 275, 1, 1) // selection rectangle
<< IntList(); // expected items
-#endif
QTest::newRow("select a tall rect in LeftToRight flow, wrap items")
<< 70 // itemCount
@@ -1138,17 +1110,7 @@ void tst_QListView::selection()
v.setRowHidden(hiddenRows.at(j), true);
}
-#if defined(Q_OS_WINCE)
- // If the device is double-pixeled then the scrollbars become
- // 10 pixels wider than normal (Windows Style: 16, Windows Mobile Style: 26).
- // So we have to make the window slightly bigger to have the same count of
- // items in each row of the list view like in the other styles.
- static const int dpi = ::GetDeviceCaps(GetDC(0), LOGPIXELSX);
- if ((dpi < 1000) && (dpi > 0))
- v.resize(535,535);
-#else
v.resize(525,525);
-#endif
topLevel.show();
QVERIFY(QTest::qWaitForWindowExposed(&topLevel));
@@ -1450,7 +1412,7 @@ void tst_QListView::wordWrap()
QTRY_COMPARE(lv.verticalScrollBar()->isVisible(), true);
}
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
class SetCurrentIndexAfterAppendRowCrashDialog : public QDialog
{
Q_OBJECT
@@ -1501,7 +1463,7 @@ void tst_QListView::setCurrentIndexAfterAppendRowCrash()
SetCurrentIndexAfterAppendRowCrashDialog w;
w.exec();
}
-#endif // Q_OS_WIN && !Q_OS_WINCE && !Q_OS_WINRT
+#endif // Q_OS_WIN && !Q_OS_WINRT
void tst_QListView::emptyItemSize()
{
diff --git a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
index 7258044804..cf8ee310d3 100644
--- a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
+++ b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
@@ -61,8 +61,6 @@ class tst_QTableView : public QObject
Q_OBJECT
private slots:
- void initTestCase();
-
void getSetCheck();
void noDelegate();
@@ -520,13 +518,6 @@ public:
QSize hint;
};
-void tst_QTableView::initTestCase()
-{
-#ifdef Q_OS_WINCE //disable magic for WindowsCE
- qApp->setAutoMaximizeThreshold(-1);
-#endif
-}
-
void tst_QTableView::noDelegate()
{
QtTestTableModel model(3, 3);
@@ -3996,10 +3987,6 @@ void tst_QTableView::mouseWheel_data()
void tst_QTableView::mouseWheel()
{
-#ifdef Q_OS_WINCE
- QSKIP("Since different Windows CE versions sport different taskbars, we skip this test");
-#endif
-
QFETCH(int, scrollMode);
QFETCH(int, delta);
QFETCH(int, horizontalPositon);
diff --git a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
index 611aaa92e6..c7b7ffaf95 100644
--- a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
@@ -75,8 +75,6 @@ public slots:
void selectionOrderTest();
private slots:
- void initTestCase();
-
void getSetCheck();
// one test per QTreeView property
@@ -347,13 +345,6 @@ public:
mutable QMap<QModelIndex,QModelIndex> parentHash;
};
-void tst_QTreeView::initTestCase()
-{
-#ifdef Q_OS_WINCE //disable magic for WindowsCE
- qApp->setAutoMaximizeThreshold(-1);
-#endif
-}
-
// Testing get/set functions
void tst_QTreeView::getSetCheck()
{
diff --git a/tests/auto/widgets/kernel/qaction/tst_qaction.cpp b/tests/auto/widgets/kernel/qaction/tst_qaction.cpp
index e6a615d4f5..83e1850524 100644
--- a/tests/auto/widgets/kernel/qaction/tst_qaction.cpp
+++ b/tests/auto/widgets/kernel/qaction/tst_qaction.cpp
@@ -42,15 +42,12 @@ class tst_QAction : public QObject
public:
tst_QAction();
- virtual ~tst_QAction();
-
void updateState(QActionEvent *e);
-public slots:
- void initTestCase();
- void cleanupTestCase();
private slots:
+ void init();
+ void cleanup();
void getSetCheck();
void setText_data();
void setText();
@@ -68,11 +65,26 @@ private slots:
private:
int m_lastEventType;
- int m_keyboardScheme;
+ const int m_keyboardScheme;
QAction *m_lastAction;
- QWidget *m_tstWidget;
};
+tst_QAction::tst_QAction()
+ : m_keyboardScheme(QGuiApplicationPrivate::platformTheme()->themeHint(QPlatformTheme::KeyboardScheme).toInt())
+{
+}
+
+void tst_QAction::init()
+{
+ m_lastEventType = 0;
+ m_lastAction = nullptr;
+}
+
+void tst_QAction::cleanup()
+{
+ QVERIFY(QApplication::topLevelWidgets().isEmpty());
+}
+
// Testing get/set functions
void tst_QAction::getSetCheck()
{
@@ -104,46 +116,16 @@ class MyWidget : public QWidget
{
Q_OBJECT
public:
- MyWidget(tst_QAction *tst, QWidget *parent = 0) : QWidget(parent) { this->tst = tst; }
+ explicit MyWidget(tst_QAction *tst, QWidget *parent = nullptr) : QWidget(parent), m_test(tst)
+ { setWindowTitle(QTest::currentTestFunction()); }
protected:
- virtual void actionEvent(QActionEvent *e) { tst->updateState(e); }
+ void actionEvent(QActionEvent *e) override { m_test->updateState(e); }
private:
- tst_QAction *tst;
+ tst_QAction *m_test;
};
-tst_QAction::tst_QAction() : m_keyboardScheme(QPlatformTheme::WindowsKeyboardScheme)
-{
- if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme())
- m_keyboardScheme = theme->themeHint(QPlatformTheme::KeyboardScheme).toInt();
-}
-
-tst_QAction::~tst_QAction()
-{
-
-}
-
-void tst_QAction::initTestCase()
-{
- m_lastEventType = 0;
- m_lastAction = 0;
-
- MyWidget *mw = new MyWidget(this);
- m_tstWidget = mw;
- mw->show();
- qApp->setActiveWindow(mw);
-}
-
-void tst_QAction::cleanupTestCase()
-{
- QWidget *testWidget = m_tstWidget;
- if (testWidget) {
- testWidget->hide();
- delete testWidget;
- }
-}
-
void tst_QAction::setText_data()
{
QTest::addColumn<QString>("text");
@@ -208,7 +190,10 @@ void tst_QAction::actionEvent()
a.setText("action text");
// add action
- m_tstWidget->addAction(&a);
+ MyWidget testWidget(this);
+ testWidget.show();
+ QApplication::setActiveWindow(&testWidget);
+ testWidget.addAction(&a);
qApp->processEvents();
QCOMPARE(m_lastEventType, (int)QEvent::ActionAdded);
@@ -222,7 +207,7 @@ void tst_QAction::actionEvent()
QCOMPARE(m_lastAction, &a);
// remove action
- m_tstWidget->removeAction(&a);
+ testWidget.removeAction(&a);
qApp->processEvents();
QCOMPARE(m_lastEventType, (int)QEvent::ActionRemoved);
@@ -262,22 +247,24 @@ void tst_QAction::alternateShortcuts()
{
//test the alternate shortcuts (by adding more than 1 shortcut)
- QWidget *wid = m_tstWidget;
+ MyWidget testWidget(this);
+ testWidget.show();
+ QApplication::setActiveWindow(&testWidget);
{
- QAction act(wid);
- wid->addAction(&act);
+ QAction act(&testWidget);
+ testWidget.addAction(&act);
QList<QKeySequence> shlist = QList<QKeySequence>() << QKeySequence("CTRL+P") << QKeySequence("CTRL+A");
act.setShortcuts(shlist);
QSignalSpy spy(&act, SIGNAL(triggered()));
act.setAutoRepeat(true);
- QTest::keyClick(wid, Qt::Key_A, Qt::ControlModifier);
+ QTest::keyClick(&testWidget, Qt::Key_A, Qt::ControlModifier);
QCOMPARE(spy.count(), 1); //act should have been triggered
act.setAutoRepeat(false);
- QTest::keyClick(wid, Qt::Key_A, Qt::ControlModifier);
+ QTest::keyClick(&testWidget, Qt::Key_A, Qt::ControlModifier);
QCOMPARE(spy.count(), 2); //act should have been triggered a 2nd time
//end of the scope of the action, it will be destroyed and removed from wid
@@ -286,11 +273,15 @@ void tst_QAction::alternateShortcuts()
//this tests a crash (if the action did not unregister its alternate shortcuts)
- QTest::keyClick(wid, Qt::Key_A, Qt::ControlModifier);
+ QTest::keyClick(&testWidget, Qt::Key_A, Qt::ControlModifier);
}
void tst_QAction::enabledVisibleInteraction()
{
+ MyWidget testWidget(this);
+ testWidget.show();
+ QApplication::setActiveWindow(&testWidget);
+
QAction act(0);
// check defaults
QVERIFY(act.isEnabled());
@@ -305,20 +296,20 @@ void tst_QAction::enabledVisibleInteraction()
QVERIFY(act.isVisible());
// check if shortcut is disabled if not visible
- m_tstWidget->addAction(&act);
+ testWidget.addAction(&act);
act.setShortcut(QKeySequence("Ctrl+T"));
QSignalSpy spy(&act, SIGNAL(triggered()));
act.setEnabled(true);
act.setVisible(false);
- QTest::keyClick(m_tstWidget, Qt::Key_T, Qt::ControlModifier);
+ QTest::keyClick(&testWidget, Qt::Key_T, Qt::ControlModifier);
QCOMPARE(spy.count(), 0); //act is not visible, so don't trigger
act.setVisible(false);
act.setEnabled(true);
- QTest::keyClick(m_tstWidget, Qt::Key_T, Qt::ControlModifier);
+ QTest::keyClick(&testWidget, Qt::Key_T, Qt::ControlModifier);
QCOMPARE(spy.count(), 0); //act is not visible, so don't trigger
act.setVisible(true);
act.setEnabled(true);
- QTest::keyClick(m_tstWidget, Qt::Key_T, Qt::ControlModifier);
+ QTest::keyClick(&testWidget, Qt::Key_T, Qt::ControlModifier);
QCOMPARE(spy.count(), 1); //act is visible and enabled, so trigger
}
@@ -378,38 +369,42 @@ void tst_QAction::task229128TriggeredSignalWhenInActiongroup()
void tst_QAction::repeat()
{
- QWidget *wid = m_tstWidget;
- QAction act(wid);
- wid->addAction(&act);
+ MyWidget testWidget(this);
+ testWidget.show();
+ QApplication::setActiveWindow(&testWidget);
+ QVERIFY(QTest::qWaitForWindowActive(&testWidget));
+
+ QAction act(&testWidget);
+ testWidget.addAction(&act);
act.setShortcut(QKeySequence(Qt::Key_F));
QSignalSpy spy(&act, SIGNAL(triggered()));
act.setAutoRepeat(true);
- QTest::keyPress(wid, Qt::Key_F);
- QTest::keyRelease(wid, Qt::Key_F);
+ QTest::keyPress(&testWidget, Qt::Key_F);
+ QTest::keyRelease(&testWidget, Qt::Key_F);
QCOMPARE(spy.count(), 1);
spy.clear();
- QTest::keyPress(wid, Qt::Key_F);
+ QTest::keyPress(&testWidget, Qt::Key_F);
// repeat event
- QTest::simulateEvent(wid, true, Qt::Key_F, Qt::NoModifier, QString("f"), true);
- QTest::simulateEvent(wid, true, Qt::Key_F, Qt::NoModifier, QString("f"), true);
- QTest::keyRelease(wid, Qt::Key_F);
+ QTest::simulateEvent(&testWidget, true, Qt::Key_F, Qt::NoModifier, QString("f"), true);
+ QTest::simulateEvent(&testWidget, true, Qt::Key_F, Qt::NoModifier, QString("f"), true);
+ QTest::keyRelease(&testWidget, Qt::Key_F);
QCOMPARE(spy.count(), 3);
spy.clear();
act.setAutoRepeat(false);
- QTest::keyPress(wid, Qt::Key_F);
- QTest::simulateEvent(wid, true, Qt::Key_F, Qt::NoModifier, QString("f"), true);
- QTest::simulateEvent(wid, true, Qt::Key_F, Qt::NoModifier, QString("f"), true);
- QTest::keyRelease(wid, Qt::Key_F);
+ QTest::keyPress(&testWidget, Qt::Key_F);
+ QTest::simulateEvent(&testWidget, true, Qt::Key_F, Qt::NoModifier, QString("f"), true);
+ QTest::simulateEvent(&testWidget, true, Qt::Key_F, Qt::NoModifier, QString("f"), true);
+ QTest::keyRelease(&testWidget, Qt::Key_F);
QCOMPARE(spy.count(), 1);
spy.clear();
act.setAutoRepeat(true);
- QTest::keyPress(wid, Qt::Key_F);
- QTest::simulateEvent(wid, true, Qt::Key_F, Qt::NoModifier, QString("f"), true);
- QTest::keyRelease(wid, Qt::Key_F);
+ QTest::keyPress(&testWidget, Qt::Key_F);
+ QTest::simulateEvent(&testWidget, true, Qt::Key_F, Qt::NoModifier, QString("f"), true);
+ QTest::keyRelease(&testWidget, Qt::Key_F);
QCOMPARE(spy.count(), 2);
}
diff --git a/tests/auto/widgets/kernel/qapplication/test/test.pro b/tests/auto/widgets/kernel/qapplication/test/test.pro
index 908aa846c0..92409e4bfe 100644
--- a/tests/auto/widgets/kernel/qapplication/test/test.pro
+++ b/tests/auto/widgets/kernel/qapplication/test/test.pro
@@ -11,7 +11,7 @@ TESTDATA = ../test/test.pro ../tmp/README
!winrt {
SUBPROGRAMS = desktopsettingsaware modal
- win32:!wince: SUBPROGRAMS += wincmdline
+ win32:SUBPROGRAMS += wincmdline
for(file, SUBPROGRAMS): TEST_HELPER_INSTALLS += "../$${file}/$${file}"
}
diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
index 779773eff0..d6f3728663 100644
--- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
+++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
@@ -52,15 +52,9 @@
#include <QtWidgets/private/qapplication_p.h>
#include <QtWidgets/QStyle>
-#ifdef Q_OS_WINCE
-#include <windows.h>
-#endif
-
#include <qpa/qwindowsysteminterface.h>
#include <private/qhighdpiscaling_p.h>
-#include "../../../qtest-config.h"
-
QT_BEGIN_NAMESPACE
static QWindowSystemInterface::TouchPoint touchPoint(const QTouchEvent::TouchPoint& pt)
{
@@ -235,10 +229,6 @@ static char *argv0;
tst_QApplication::tst_QApplication()
: quitApplicationTriggered(false)
{
-#ifdef Q_OS_WINCE
- // Clean up environment previously to launching test
- qputenv("QT_PLUGIN_PATH", QByteArray());
-#endif
}
void tst_QApplication::cleanup()
@@ -897,19 +887,8 @@ bool isPathListIncluded(const QStringList &l, const QStringList &r)
#define QT_TST_QAPP_DEBUG
void tst_QApplication::libraryPaths()
{
-#ifndef Q_OS_WINCE
const QString testDir = QFileInfo(QFINDTESTDATA("test/test.pro")).absolutePath();
QVERIFY(!testDir.isEmpty());
-#else // !Q_OS_WINCE
- // On Windows CE we need QApplication object to have valid
- // current Path. Therefore we need to identify it ourselves
- // here for the test.
- QFileInfo filePath;
- wchar_t module_name[MAX_PATH];
- GetModuleFileName(0, module_name, MAX_PATH);
- filePath = QString::fromWCharArray(module_name);
- const QString testDir = filePath.path() + "/test";
-#endif // Q_OS_WINCE
{
QApplication::setLibraryPaths(QStringList() << testDir);
QCOMPARE(QApplication::libraryPaths(), (QStringList() << testDir));
@@ -1000,11 +979,7 @@ void tst_QApplication::libraryPaths()
QString appDirPath = app.applicationDirPath();
app.addLibraryPath(appDirPath);
-#ifdef Q_OS_WINCE
- app.addLibraryPath(appDirPath + "/../..");
-#else
app.addLibraryPath(appDirPath + "/..");
-#endif
#ifdef QT_TST_QAPP_DEBUG
qDebug() << "appDirPath" << appDirPath;
qDebug() << "After adding appDirPath && appDirPath + /..:" << app.libraryPaths();
@@ -1044,15 +1019,9 @@ void tst_QApplication::libraryPaths_qt_plugin_path_2()
QByteArray nonExistentPath = "/nonexistent";
QByteArray pluginPath = validPath + ':' + nonExistentPath;
#elif defined(Q_OS_WIN)
-# ifdef Q_OS_WINCE
- QByteArray validPath = "/Temp";
- QByteArray nonExistentPath = "/nonexistent";
- QByteArray pluginPath = validPath + ';' + nonExistentPath;
-# else
QByteArray validPath = "C:\\windows";
QByteArray nonExistentPath = "Z:\\nonexistent";
QByteArray pluginPath = validPath + ';' + nonExistentPath;
-# endif
#endif
{
@@ -1069,9 +1038,7 @@ void tst_QApplication::libraryPaths_qt_plugin_path_2()
<< QLibraryInfo::location(QLibraryInfo::PluginsPath)
<< QDir(app.applicationDirPath()).canonicalPath()
<< QDir(QDir::fromNativeSeparators(QString::fromLatin1(validPath))).canonicalPath();
-# ifdef Q_OS_WINCE
- expected = QSet<QString>::fromList(expected).toList();
-# endif
+
QVERIFY2(isPathListIncluded(app.libraryPaths(), expected),
qPrintable("actual:\n - " + app.libraryPaths().join("\n - ") +
"\nexpected:\n - " + expected.join("\n - ")));
@@ -1091,9 +1058,6 @@ void tst_QApplication::libraryPaths_qt_plugin_path_2()
QStringList()
<< QLibraryInfo::location(QLibraryInfo::PluginsPath)
<< app.applicationDirPath();
-# ifdef Q_OS_WINCE
- expected = QSet<QString>::fromList(expected).toList();
-# endif
QVERIFY(isPathListIncluded(app.libraryPaths(), expected));
qputenv("QT_PLUGIN_PATH", QByteArray());
@@ -1479,10 +1443,6 @@ void tst_QApplication::desktopSettingsAware()
}
QVERIFY2(!path.isEmpty(), "Cannot locate desktopsettingsaware helper application");
path += "desktopsettingsaware";
-#ifdef Q_OS_WINCE
- int argc = 0;
- QApplication tmpApp(argc, 0);
-#endif
QProcess testProcess;
testProcess.start(path);
QVERIFY2(testProcess.waitForStarted(),
@@ -1955,9 +1915,7 @@ void tst_QApplication::touchEventPropagation()
release.setState(Qt::TouchPointReleased);
releasedTouchPoints << release;
- QTouchDevice *device = new QTouchDevice;
- device->setType(QTouchDevice::TouchScreen);
- QWindowSystemInterface::registerTouchDevice(device);
+ QTouchDevice *device = QTest::createTouchDevice();
{
// touch event behavior on a window
@@ -2312,7 +2270,7 @@ Q_GLOBAL_STATIC(QPixmap, tst_qapp_pixmap);
Q_GLOBAL_STATIC(QFont, tst_qapp_font);
Q_GLOBAL_STATIC(QRegion, tst_qapp_region);
Q_GLOBAL_STATIC(QFontDatabase, tst_qapp_fontDatabase);
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
Q_GLOBAL_STATIC(QCursor, tst_qapp_cursor);
#endif
@@ -2337,7 +2295,7 @@ void tst_QApplication::globalStaticObjectDestruction()
QVERIFY(tst_qapp_font());
QVERIFY(tst_qapp_region());
QVERIFY(tst_qapp_fontDatabase());
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
QVERIFY(tst_qapp_cursor());
#endif
}
diff --git a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
index 6c7197b85e..01e3d7bac0 100644
--- a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
+++ b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
@@ -51,6 +51,44 @@ static inline void setFrameless(QWidget *w)
w->setWindowFlags(flags);
}
+struct QFormLayoutTakeRowResultHolder {
+ QFormLayoutTakeRowResultHolder(QFormLayout::TakeRowResult result) Q_DECL_NOTHROW
+ : labelItem(result.labelItem),
+ fieldItem(result.fieldItem)
+ {
+ }
+ ~QFormLayoutTakeRowResultHolder()
+ {
+ // re-use a QFormLayout to recursively reap the QLayoutItems:
+ QFormLayout disposer;
+ if (labelItem)
+ disposer.setItem(0, QFormLayout::LabelRole, labelItem);
+ if (fieldItem)
+ disposer.setItem(0, QFormLayout::FieldRole, fieldItem);
+ }
+ QFormLayoutTakeRowResultHolder(QFormLayoutTakeRowResultHolder &&other) Q_DECL_NOTHROW
+ : labelItem(other.labelItem),
+ fieldItem(other.fieldItem)
+ {
+ other.labelItem = nullptr;
+ other.fieldItem = nullptr;
+ }
+ QFormLayoutTakeRowResultHolder &operator=(QFormLayoutTakeRowResultHolder &&other) Q_DECL_NOTHROW
+ {
+ swap(other);
+ return *this;
+ }
+
+ void swap(QFormLayoutTakeRowResultHolder &other) Q_DECL_NOTHROW
+ {
+ qSwap(labelItem, other.labelItem);
+ qSwap(fieldItem, other.fieldItem);
+ }
+
+ QLayoutItem *labelItem;
+ QLayoutItem *fieldItem;
+};
+
class tst_QFormLayout : public QObject
{
Q_OBJECT
@@ -84,6 +122,12 @@ private slots:
void insertRow_QString_QLayout();
void insertRow_QWidget();
void insertRow_QLayout();
+ void removeRow();
+ void removeRow_QWidget();
+ void removeRow_QLayout();
+ void takeRow();
+ void takeRow_QWidget();
+ void takeRow_QLayout();
void setWidget();
void setLayout();
@@ -690,6 +734,237 @@ void tst_QFormLayout::insertRow_QLayout()
// ### come back to this later
}
+void tst_QFormLayout::removeRow()
+{
+ QWidget topLevel;
+ QFormLayout *layout = new QFormLayout(&topLevel);
+
+ QCOMPARE(layout->count(), 0);
+ QCOMPARE(layout->rowCount(), 0);
+
+ QPointer<QWidget> w1 = new QWidget;
+ QPointer<QWidget> w2 = new QWidget;
+
+ layout->addRow("test1", w1);
+ layout->addRow(w2);
+
+ QCOMPARE(layout->count(), 3);
+ QCOMPARE(layout->rowCount(), 2);
+
+ layout->removeRow(1);
+
+ QVERIFY(!w1);
+ QCOMPARE(layout->count(), 1);
+ QCOMPARE(layout->rowCount(), 1);
+
+ layout->removeRow(0);
+
+ QVERIFY(!w2);
+ QCOMPARE(layout->count(), 0);
+ QCOMPARE(layout->rowCount(), 0);
+}
+
+void tst_QFormLayout::removeRow_QWidget()
+{
+ QWidget topLevel;
+ QFormLayout *layout = new QFormLayout(&topLevel);
+
+ QCOMPARE(layout->count(), 0);
+ QCOMPARE(layout->rowCount(), 0);
+
+ QPointer<QWidget> w1 = new QWidget;
+ QPointer<QWidget> w2 = new QWidget;
+
+ layout->addRow("test1", w1);
+ layout->addRow(w2);
+
+ QCOMPARE(layout->count(), 3);
+ QCOMPARE(layout->rowCount(), 2);
+
+ layout->removeRow(w1);
+
+ QVERIFY(!w1);
+ QCOMPARE(layout->count(), 1);
+ QCOMPARE(layout->rowCount(), 1);
+
+ layout->removeRow(w2);
+
+ QVERIFY(!w2);
+ QCOMPARE(layout->count(), 0);
+ QCOMPARE(layout->rowCount(), 0);
+
+ QWidget *w3 = new QWidget;
+ layout->removeRow(w3);
+ delete w3;
+}
+
+void tst_QFormLayout::removeRow_QLayout()
+{
+ QWidget topLevel;
+ QFormLayout *layout = new QFormLayout(&topLevel);
+
+ QCOMPARE(layout->count(), 0);
+ QCOMPARE(layout->rowCount(), 0);
+
+ QPointer<QHBoxLayout> l1 = new QHBoxLayout;
+ QPointer<QWidget> w1 = new QWidget;
+ l1->addWidget(w1);
+ QPointer<QHBoxLayout> l2 = new QHBoxLayout;
+ QPointer<QWidget> w2 = new QWidget;
+ l2->addWidget(w2);
+
+ layout->addRow("test1", l1);
+ layout->addRow(l2);
+
+ QCOMPARE(layout->count(), 3);
+ QCOMPARE(layout->rowCount(), 2);
+
+ layout->removeRow(l1);
+
+ QVERIFY(!l1);
+ QVERIFY(!w1);
+ QCOMPARE(layout->count(), 1);
+ QCOMPARE(layout->rowCount(), 1);
+
+ layout->removeRow(l2);
+
+ QVERIFY(!l2);
+ QVERIFY(!w2);
+ QCOMPARE(layout->count(), 0);
+ QCOMPARE(layout->rowCount(), 0);
+
+ QHBoxLayout *l3 = new QHBoxLayout;
+ layout->removeRow(l3);
+ delete l3;
+}
+
+void tst_QFormLayout::takeRow()
+{
+ QWidget topLevel;
+ QFormLayout *layout = new QFormLayout(&topLevel);
+
+ QCOMPARE(layout->count(), 0);
+ QCOMPARE(layout->rowCount(), 0);
+
+ QPointer<QWidget> w1 = new QWidget;
+ QPointer<QWidget> w2 = new QWidget;
+
+ layout->addRow("test1", w1);
+ layout->addRow(w2);
+
+ QCOMPARE(layout->count(), 3);
+ QCOMPARE(layout->rowCount(), 2);
+
+ QFormLayoutTakeRowResultHolder result = layout->takeRow(1);
+
+ QVERIFY(w2);
+ QVERIFY(result.fieldItem);
+ QVERIFY(result.labelItem);
+ QCOMPARE(layout->count(), 1);
+ QCOMPARE(layout->rowCount(), 1);
+
+ result = layout->takeRow(0);
+
+ QVERIFY(w1);
+ QVERIFY(result.fieldItem);
+ QVERIFY(!result.labelItem);
+ QCOMPARE(layout->count(), 0);
+ QCOMPARE(layout->rowCount(), 0);
+
+ result = layout->takeRow(0);
+
+ QVERIFY(!result.fieldItem);
+ QVERIFY(!result.labelItem);
+}
+
+void tst_QFormLayout::takeRow_QWidget()
+{
+ QWidget topLevel;
+ QFormLayout *layout = new QFormLayout(&topLevel);
+
+ QCOMPARE(layout->count(), 0);
+ QCOMPARE(layout->rowCount(), 0);
+
+ QPointer<QWidget> w1 = new QWidget;
+ QPointer<QWidget> w2 = new QWidget;
+
+ layout->addRow("test1", w1);
+ layout->addRow(w2);
+
+ QCOMPARE(layout->count(), 3);
+ QCOMPARE(layout->rowCount(), 2);
+
+ QFormLayoutTakeRowResultHolder result = layout->takeRow(w1);
+
+ QVERIFY(w1);
+ QVERIFY(result.fieldItem);
+ QVERIFY(result.labelItem);
+ QCOMPARE(layout->count(), 1);
+ QCOMPARE(layout->rowCount(), 1);
+
+ result = layout->takeRow(w2);
+
+ QVERIFY(w2);
+ QVERIFY(result.fieldItem);
+ QVERIFY(!result.labelItem);
+ QCOMPARE(layout->count(), 0);
+ QCOMPARE(layout->rowCount(), 0);
+
+ QWidget *w3 = new QWidget;
+ result = layout->takeRow(w3);
+ delete w3;
+
+ QVERIFY(!result.fieldItem);
+ QVERIFY(!result.labelItem);
+}
+
+void tst_QFormLayout::takeRow_QLayout()
+{
+ QWidget topLevel;
+ QFormLayout *layout = new QFormLayout(&topLevel);
+
+ QCOMPARE(layout->count(), 0);
+ QCOMPARE(layout->rowCount(), 0);
+
+ QPointer<QHBoxLayout> l1 = new QHBoxLayout;
+ QPointer<QWidget> w1 = new QWidget;
+ l1->addWidget(w1);
+ QPointer<QHBoxLayout> l2 = new QHBoxLayout;
+ QPointer<QWidget> w2 = new QWidget;
+ l2->addWidget(w2);
+
+ layout->addRow("test1", l1);
+ layout->addRow(l2);
+
+ QCOMPARE(layout->count(), 3);
+ QCOMPARE(layout->rowCount(), 2);
+
+ QFormLayoutTakeRowResultHolder result = layout->takeRow(l1);
+
+ QVERIFY(l1);
+ QVERIFY(w1);
+ QVERIFY(result.fieldItem);
+ QVERIFY(result.labelItem);
+ QCOMPARE(layout->count(), 1);
+ QCOMPARE(layout->rowCount(), 1);
+
+ result = layout->takeRow(l2);
+
+ QVERIFY(l2);
+ QVERIFY(w2);
+ QVERIFY(result.fieldItem);
+ QVERIFY(!result.labelItem);
+ QCOMPARE(layout->count(), 0);
+ QCOMPARE(layout->rowCount(), 0);
+
+ QHBoxLayout *l3 = new QHBoxLayout;
+ result = layout->takeRow(l3);
+ delete l3;
+
+ QVERIFY(!result.fieldItem);
+ QVERIFY(!result.labelItem);
+}
+
void tst_QFormLayout::setWidget()
{
QFormLayout layout;
diff --git a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
index e5da83ed37..c1ab5f51be 100644
--- a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
+++ b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
@@ -56,7 +56,6 @@ class tst_QGridLayout : public QObject
Q_OBJECT
private slots:
- void initTestCase();
void cleanup();
void getItemPosition();
void itemAtPosition();
@@ -81,17 +80,11 @@ private slots:
void taskQTBUG_27420_takeAtShouldUnparentLayout();
void taskQTBUG_40609_addingWidgetToItsOwnLayout();
void taskQTBUG_40609_addingLayoutToItself();
+ void taskQTBUG_52357_spacingWhenItemIsHidden();
void replaceWidget();
void dontCrashWhenExtendsToEnd();
};
-void tst_QGridLayout::initTestCase()
-{
-#ifdef Q_OS_WINCE //disable magic for WindowsCE
- qApp->setAutoMaximizeThreshold(-1);
-#endif
-}
-
static inline int visibleTopLevelWidgetCount()
{
int result= 0;
@@ -605,19 +598,6 @@ void tst_QGridLayout::spacingsAndMargins_data()
<< QPoint( 20, child_offset_y)
<< QPoint( 20, child_offset_y + 100 + 6)
);
-#if defined (Q_OS_WINCE) //There is not enough screenspace to run the test in original size on Windows CE. We use smaller widgets.
- child_offset_y = 11 + 9 + 50 + 6 + 50 + 6 + 50 + 6;
- QTest::newRow("1x3 grid") << 1 << 3 << QSize(50, 50)
- << (PointList() // toplevel
- << QPoint( 11, 11)
- << QPoint( 11, 11 + 50 + 6)
- << QPoint( 11, 11 + 50 + 6 + 50 + 6)
- // children
- << QPoint( 20, child_offset_y)
- << QPoint( 20, child_offset_y + 50 + 6)
- << QPoint( 20, child_offset_y + 50 + 6 + 50 + 6)
- );
-#else
child_offset_y = 11 + 9 + 100 + 6 + 100 + 6 + 100 + 6;
QTest::newRow("1x3 grid") << 1 << 3 << QSize(100, 100)
<< (PointList() // toplevel
@@ -629,7 +609,6 @@ void tst_QGridLayout::spacingsAndMargins_data()
<< QPoint( 20, child_offset_y + 100 + 6)
<< QPoint( 20, child_offset_y + 100 + 6 + 100 + 6)
);
-#endif
child_offset_y = 11 + 9 + 100 + 6 + 100 + 6;
QTest::newRow("2x2 grid") << 2 << 2 << QSize(100, 100)
@@ -1674,6 +1653,26 @@ void tst_QGridLayout::taskQTBUG_40609_addingLayoutToItself(){
QCOMPARE(layout.count(), 0);
}
+void tst_QGridLayout::taskQTBUG_52357_spacingWhenItemIsHidden()
+{
+ QWidget widget;
+ setFrameless(&widget);
+ QGridLayout layout(&widget);
+ layout.setMargin(0);
+ layout.setSpacing(5);
+ QPushButton button1;
+ layout.addWidget(&button1, 0, 0);
+ QPushButton button2;
+ layout.addWidget(&button2, 0, 1);
+ QPushButton button3;
+ layout.addWidget(&button3, 0, 2);
+ widget.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&widget));
+ int tempWidth = button1.width() + button2.width() + button3.width() + 2 * layout.spacing();
+ button2.hide();
+ QTRY_COMPARE_WITH_TIMEOUT(tempWidth, button1.width() + button3.width() + layout.spacing(), 1000);
+}
+
void tst_QGridLayout::replaceWidget()
{
QWidget wdg;
diff --git a/tests/auto/widgets/kernel/qlayout/qlayout.pro b/tests/auto/widgets/kernel/qlayout/qlayout.pro
index 2213767950..d460785158 100644
--- a/tests/auto/widgets/kernel/qlayout/qlayout.pro
+++ b/tests/auto/widgets/kernel/qlayout/qlayout.pro
@@ -4,13 +4,7 @@ TARGET = tst_qlayout
QT += widgets widgets-private testlib
SOURCES += tst_qlayout.cpp
-wince* {
- addFiles.files = baseline
- addFiles.path = .
- DEPLOYMENT += addFiles
-} else {
- TESTDATA += baseline/*
-}
+TESTDATA += baseline/*
android {
RESOURCES += \
diff --git a/tests/auto/widgets/kernel/qwidget/BLACKLIST b/tests/auto/widgets/kernel/qwidget/BLACKLIST
index 98a4caf49e..6fe6bd2f67 100644
--- a/tests/auto/widgets/kernel/qwidget/BLACKLIST
+++ b/tests/auto/widgets/kernel/qwidget/BLACKLIST
@@ -3,6 +3,7 @@
ubuntu-14.04
[saveRestoreGeometry]
ubuntu-14.04
+ubuntu-16.04
[restoreVersion1Geometry]
ubuntu-14.04
osx
@@ -53,6 +54,7 @@ osx
osx
[maskedUpdate]
osx
+opensuse-42.1
[hideWhenFocusWidgetIsChild]
osx-10.10
[hideOpaqueChildWhileHidden]
diff --git a/tests/auto/widgets/kernel/qwidget/qwidget.pro b/tests/auto/widgets/kernel/qwidget/qwidget.pro
index a3fd622896..499ca65516 100644
--- a/tests/auto/widgets/kernel/qwidget/qwidget.pro
+++ b/tests/auto/widgets/kernel/qwidget/qwidget.pro
@@ -16,8 +16,4 @@ mac {
OBJECTIVE_SOURCES += tst_qwidget_mac_helpers.mm
}
-x11 {
- LIBS += $$QMAKE_LIBS_X11
-}
-
-win32:!wince:!winrt: LIBS += -luser32 -lgdi32
+win32:!winrt: LIBS += -luser32 -lgdi32
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index 5a00b0dad9..0c25a01ba0 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -67,15 +67,13 @@
#include <QtGui/qwindow.h>
#include <qtimer.h>
-#include "../../../qtest-config.h"
-
#if defined(Q_OS_OSX)
#include "tst_qwidget_mac_helpers.h" // Abstract the ObjC stuff out so not everyone must run an ObjC++ compile.
#endif
#include <QtTest/QTest>
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
# include <QtCore/qt_windows.h>
# include <QtGui/private/qguiapplication_p.h>
#include <qpa/qplatformnativeinterface.h>
@@ -91,49 +89,12 @@ static HWND winHandleOf(const QWidget *w)
return 0;
}
-# ifdef Q_OS_WINCE
-# define Q_CHECK_PAINTEVENTS
-# ifdef Q_OS_WINCE_WM
-# include <qguifunctions_wince.h>
-// taken from qguifunctions_wce.cpp
-# define SPI_GETPLATFORMTYPE 257
-static bool qt_wince_is_platform(const QString &platformString) {
- wchar_t tszPlatform[64];
- if (SystemParametersInfo(SPI_GETPLATFORMTYPE,
- sizeof(tszPlatform)/sizeof(*tszPlatform),tszPlatform,0))
- if (0 == _tcsicmp(reinterpret_cast<const wchar_t *> (platformString.utf16()), tszPlatform))
- return true;
- return false;
-}
-static inline bool qt_wince_is_smartphone() { return qt_wince_is_platform(QString::fromLatin1("Smartphone")); }
-# endif // Q_OS_WINCE_WM
-# elif !defined(Q_OS_WINRT) // Q_OS_WINCE
-# define Q_CHECK_PAINTEVENTS \
+# define Q_CHECK_PAINTEVENTS \
if (::SwitchDesktop(::GetThreadDesktop(::GetCurrentThreadId())) == 0) \
QSKIP("desktop is not visible, this test would fail");
-# else // !Q_OS_WINCE && !Q_OS_WINRT
-# define Q_CHECK_PAINTEVENTS
-# endif // Q_OS_WINRT
-#else // Q_OS_WIN
+
+#else // Q_OS_WIN && !Q_OS_WINRT
# define Q_CHECK_PAINTEVENTS
-#endif // else Q_OS_WIN
-
-
-#if defined(Q_OS_WINCE_WM)
-#include <qguifunctions_wince.h>
-// taken from qguifunctions_wce.cpp
-#define SPI_GETPLATFORMTYPE 257
-bool qt_wince_is_platform(const QString &platformString) {
- wchar_t tszPlatform[64];
- if (SystemParametersInfo(SPI_GETPLATFORMTYPE,
- sizeof(tszPlatform)/sizeof(*tszPlatform),tszPlatform,0))
- if (0 == _tcsicmp(reinterpret_cast<const wchar_t *> (platformString.utf16()), tszPlatform))
- return true;
- return false;
-}
-bool qt_wince_is_smartphone() {
- return qt_wince_is_platform(QString::fromLatin1("Smartphone"));
-}
#endif
#ifdef Q_OS_OSX
@@ -163,7 +124,7 @@ static inline void centerOnScreen(QWidget *w)
w->move(QGuiApplication::primaryScreen()->availableGeometry().center() - offset);
}
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
static inline void setWindowsAnimationsEnabled(bool enabled)
{
ANIMATIONINFO animation = { sizeof(ANIMATIONINFO), enabled };
@@ -176,10 +137,10 @@ static inline bool windowsAnimationsEnabled()
SystemParametersInfo(SPI_GETANIMATION, 0, &animation, 0);
return animation.iMinAnimate;
}
-#else // Q_OS_WIN && !Q_OS_WINCE && !Q_OS_WINRT
+#else // Q_OS_WIN && !Q_OS_WINRT
inline void setWindowsAnimationsEnabled(bool) {}
static inline bool windowsAnimationsEnabled() { return false; }
-#endif // !Q_OS_WIN || Q_OS_WINCE || Q_OS_WINRT
+#endif // !Q_OS_WIN || Q_OS_WINRT
template <class T>
static QByteArray msgComparisonFailed(T v1, const char *op, T v2)
@@ -212,8 +173,6 @@ public:
public slots:
void initTestCase();
- void cleanupTestCase();
- void init();
void cleanup();
private slots:
void getSetCheck();
@@ -251,9 +210,7 @@ private slots:
void hideWhenFocusWidgetIsChild();
void normalGeometry();
void setGeometry();
-#ifndef Q_OS_WINCE
void windowOpacity();
-#endif
void raise();
void lower();
void stackUnder();
@@ -315,7 +272,7 @@ private slots:
void subtractOpaqueSiblings();
-#if defined (Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
+#if defined (Q_OS_WIN) && !defined(Q_OS_WINRT)
void setGeometry_win();
#endif
@@ -323,7 +280,7 @@ private slots:
void deleteStyle();
void multipleToplevelFocusCheck();
void setFocus();
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void setCursor();
#endif
void setToolTip();
@@ -340,9 +297,7 @@ private slots:
void render_task188133();
void render_task211796();
void render_task217815();
-#ifndef Q_OS_WINCE
void render_windowOpacity();
-#endif
void render_systemClip();
void render_systemClip2_data();
void render_systemClip2();
@@ -358,9 +313,7 @@ private slots:
void repaintWhenChildDeleted();
void hideOpaqueChildWhileHidden();
-#if !defined(Q_OS_WINCE)
void updateWhileMinimized();
-#endif
void alienWidgets();
void adjustSize();
void adjustSize_data();
@@ -395,7 +348,7 @@ private slots:
void setClearAndResizeMask();
void maskedUpdate();
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void syntheticEnterLeave();
void taskQTBUG_4055_sendSyntheticEnterLeave();
void underMouse();
@@ -407,9 +360,7 @@ private slots:
void toplevelLineEditFocus();
void focusWidget_task254563();
-#ifndef Q_OS_WINCE_WM
void rectOutsideCoordinatesLimit_task144779();
-#endif
void setGraphicsEffect();
#ifdef QT_BUILD_INTERNAL
@@ -458,13 +409,13 @@ private slots:
private:
bool ensureScreenSize(int width, int height);
- QWidget *testWidget;
const QString m_platform;
QSize m_testWidgetSize;
QPoint m_availableTopLeft;
QPoint m_safeCursorPos;
const bool m_windowsAnimationsEnabled;
+ QTouchDevice *m_touchScreen;
};
bool tst_QWidget::ensureScreenSize(int width, int height)
@@ -612,7 +563,7 @@ void tst_QWidget::getSetCheck()
QCOMPARE(true, obj1.autoFillBackground());
var1.reset();
-#if defined (Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
+#if defined (Q_OS_WIN) && !defined(Q_OS_WINRT)
obj1.setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint);
const HWND handle = reinterpret_cast<HWND>(obj1.winId()); // explicitly create window handle
QVERIFY(GetWindowLong(handle, GWL_STYLE) & WS_POPUP);
@@ -623,6 +574,7 @@ tst_QWidget::tst_QWidget()
: m_platform(QGuiApplication::platformName().toLower())
, m_safeCursorPos(0, 0)
, m_windowsAnimationsEnabled(windowsAnimationsEnabled())
+ , m_touchScreen(QTest::createTouchDevice())
{
if (m_windowsAnimationsEnabled) // Disable animations which can interfere with screen grabbing in moveChild(), showAndMoveChild()
setWindowsAnimationsEnabled(false);
@@ -635,8 +587,6 @@ tst_QWidget::tst_QWidget()
palette.setColor(QPalette::ToolTipBase, QColor(12, 13, 14));
palette.setColor(QPalette::Text, QColor(21, 22, 23));
qApp->setPalette(palette, "QPropagationTestWidget");
-
- testWidget = 0;
}
tst_QWidget::~tst_QWidget()
@@ -657,9 +607,6 @@ private:
void tst_QWidget::initTestCase()
{
-#ifdef Q_OS_WINCE //disable magic for WindowsCE
- qApp->setAutoMaximizeThreshold(-1);
-#endif
// Size of reference widget, 200 for < 2000, scale up for larger screens
// to avoid Windows warnings about minimum size for decorated windows.
int width = 200;
@@ -675,122 +622,23 @@ void tst_QWidget::initTestCase()
if (screenWidth > 2000)
width = 100 * ((screenWidth + 500) / 1000);
m_testWidgetSize = QSize(width, width);
- // Create the test class
- testWidget = new BezierViewer;
- testWidget->setWindowTitle(QStringLiteral("BezierViewer"));
- testWidget->move(m_availableTopLeft + QPoint(screenWidth / 3, 50));
- testWidget->resize(m_testWidgetSize);
- testWidget->show();
- QVERIFY(QTest::qWaitForWindowExposed(testWidget));
-}
-
-void tst_QWidget::cleanupTestCase()
-{
- delete testWidget;
- testWidget = 0;
-}
-
-void tst_QWidget::init()
-{
-// TODO: Add initialization code here.
-// This will be executed immediately before each test is run.
- testWidget->setFont(QFont());
- testWidget->setPalette(QPalette());
}
void tst_QWidget::cleanup()
{
- // Only 'testwidget', do not leak any other widgets.
- QCOMPARE(QApplication::topLevelWidgets().size(), 1);
-}
-
-// Helper class...
-
-BezierViewer::BezierViewer( QWidget* parent)
- : QWidget(parent)
-{
- setObjectName(QLatin1String("TestWidget"));
- setWindowTitle(objectName());
- QPalette pal;
- pal.setColor(backgroundRole(), Qt::white);
- setPalette(pal);
-}
-
-
-void BezierViewer::setPoints( const QPolygonF& a )
-{
- points = a;
-}
-
-#include "private/qbezier_p.h"
-void BezierViewer::paintEvent( QPaintEvent* )
-{
- if ( points.size() != 4 ) {
-#if defined(QT_CHECK_RANGE)
- qWarning( "QPolygon::bezier: The array must have 4 control points" );
-#endif
- return;
- }
-
- /* Calculate Bezier curve */
- QPolygonF bezier = QBezier::fromPoints(points.at(0),points.at(1),points.at(2),points.at(3)).toPolygon();
-
- QPainter painter( this );
-
- /* Calculate scale to fit in window */
- QRectF br = bezier.boundingRect() | points.boundingRect();
- QRectF pr = rect();
- int scl = qMax( qMin(pr.width()/br.width(), pr.height()/br.height()), qreal(1.) );
- int border = scl-1;
-
- /* Scale Bezier curve vertices */
- for ( QPolygonF::Iterator it = bezier.begin(); it != bezier.end(); ++it ) {
- it->setX( (it->x()-br.x()) * scl + border );
- it->setY( (it->y()-br.y()) * scl + border );
- }
-
- /* Draw grid */
- painter.setPen( Qt::lightGray );
- int i;
- for ( i = border; i <= pr.width(); i += scl ) {
- painter.drawLine( i, 0, i, pr.height() );
- }
- for ( int j = border; j <= pr.height(); j += scl ) {
- painter.drawLine( 0, j, pr.width(), j );
- }
-
- /* Write number of vertices */
- painter.setPen( Qt::red );
- painter.setFont( QFont("Helvetica", 14, QFont::DemiBold, true ) );
- QString caption;
- caption.setNum( bezier.size() );
- caption += QString::fromLatin1( " vertices" );
- painter.drawText( 10, pr.height()-10, caption );
-
- /* Draw Bezier curve */
- painter.setPen( Qt::black );
- painter.drawPolyline( bezier );
-
- /* Scale and draw control points */
- painter.setPen( Qt::darkGreen );
- for ( QPolygonF::Iterator p1 = points.begin(); p1 != points.end(); ++p1 ) {
- int x = (p1->x()-br.x()) * scl + border;
- int y = (p1->y()-br.y()) * scl + border;
- painter.drawLine( x-4, y-4, x+4, y+4 );
- painter.drawLine( x+4, y-4, x-4, y+4 );
- }
-
- /* Draw vertices */
- painter.setPen( Qt::red );
- painter.setBrush( Qt::red );
- for ( QPolygonF::Iterator p2 = bezier.begin(); p2 != bezier.end(); ++p2 )
- painter.drawEllipse( p2->x()-1, p2->y()-1, 3, 3 );
+ QVERIFY(QApplication::topLevelWidgets().isEmpty());
}
void tst_QWidget::fontPropagation()
{
+ QScopedPointer<QWidget> testWidget(new QWidget);
+ testWidget->resize(m_testWidgetSize);
+ testWidget->setWindowTitle(__FUNCTION__);
+ centerOnScreen(testWidget.data());
+ testWidget->show();
+ QVERIFY(QTest::qWaitForWindowExposed(testWidget.data()));
QFont font = testWidget->font();
- QWidget* childWidget = new QWidget( testWidget );
+ QWidget* childWidget = new QWidget( testWidget.data() );
childWidget->show();
QCOMPARE( font, childWidget->font() );
@@ -821,7 +669,7 @@ void tst_QWidget::fontPropagation()
font.setPointSize(font.pointSize() + 2);
testWidget->setFont(font);
- QWidget *one = new QWidget(testWidget);
+ QWidget *one = new QWidget(testWidget.data());
QWidget *two = new QWidget(one);
QWidget *three = new QWidget(two);
QWidget *four = new QWidget(two);
@@ -977,8 +825,15 @@ void tst_QWidget::fontPropagation2()
void tst_QWidget::palettePropagation()
{
+ QScopedPointer<QWidget> testWidget(new QWidget);
+ testWidget->resize(m_testWidgetSize);
+ testWidget->setWindowTitle(__FUNCTION__);
+ centerOnScreen(testWidget.data());
+ testWidget->show();
+ QVERIFY(QTest::qWaitForWindowExposed(testWidget.data()));
+
QPalette palette = testWidget->palette();
- QWidget* childWidget = new QWidget( testWidget );
+ QWidget* childWidget = new QWidget( testWidget.data() );
childWidget->show();
QCOMPARE( palette, childWidget->palette() );
@@ -1111,7 +966,13 @@ void tst_QWidget::palettePropagation2()
void tst_QWidget::enabledPropagation()
{
- QWidget* childWidget = new QWidget( testWidget );
+ QScopedPointer<QWidget> testWidget(new QWidget);
+ testWidget->resize(m_testWidgetSize);
+ testWidget->setWindowTitle(__FUNCTION__);
+ centerOnScreen(testWidget.data());
+ testWidget->show();
+ QVERIFY(QTest::qWaitForWindowExposed(testWidget.data()));
+ QWidget* childWidget = new QWidget( testWidget.data() );
childWidget->show();
QVERIFY( testWidget->isEnabled() );
QVERIFY( childWidget->isEnabled() );
@@ -1194,7 +1055,13 @@ void tst_QWidget::properTabHandlingWhenDisabled_QTBUG27417()
#ifndef QT_NO_DRAGANDDROP
void tst_QWidget::acceptDropsPropagation()
{
- QWidget *childWidget = new QWidget(testWidget);
+ QScopedPointer<QWidget> testWidget(new QWidget);
+ testWidget->resize(m_testWidgetSize);
+ testWidget->setWindowTitle(__FUNCTION__);
+ centerOnScreen(testWidget.data());
+ testWidget->show();
+ QVERIFY(QTest::qWaitForWindowExposed(testWidget.data()));
+ QWidget *childWidget = new QWidget(testWidget.data());
childWidget->show();
QVERIFY(!testWidget->acceptDrops());
QVERIFY(!childWidget->acceptDrops());
@@ -1241,32 +1108,38 @@ void tst_QWidget::acceptDropsPropagation()
void tst_QWidget::isEnabledTo()
{
- QWidget* childWidget = new QWidget( testWidget );
+ QWidget testWidget;
+ testWidget.resize(m_testWidgetSize);
+ testWidget.setWindowTitle(__FUNCTION__);
+ centerOnScreen(&testWidget);
+ testWidget.show();
+ QWidget* childWidget = new QWidget( &testWidget );
QWidget* grandChildWidget = new QWidget( childWidget );
- QVERIFY( childWidget->isEnabledTo( testWidget ) );
- QVERIFY( grandChildWidget->isEnabledTo( testWidget ) );
+ QVERIFY( childWidget->isEnabledTo( &testWidget ) );
+ QVERIFY( grandChildWidget->isEnabledTo( &testWidget ) );
childWidget->setEnabled( false );
- QVERIFY( !childWidget->isEnabledTo( testWidget ) );
+ QVERIFY( !childWidget->isEnabledTo( &testWidget ) );
QVERIFY( grandChildWidget->isEnabledTo( childWidget ) );
- QVERIFY( !grandChildWidget->isEnabledTo( testWidget ) );
+ QVERIFY( !grandChildWidget->isEnabledTo( &testWidget ) );
- QScopedPointer<QMainWindow> childDialog(new QMainWindow(testWidget));
- testWidget->setEnabled(false);
+ QScopedPointer<QMainWindow> childDialog(new QMainWindow(&testWidget));
+ testWidget.setEnabled(false);
QVERIFY(!childDialog->isEnabled());
QVERIFY(childDialog->isEnabledTo(0));
- testWidget->setEnabled(true);
}
void tst_QWidget::visible()
{
// Ensure that the testWidget is hidden for this test at the
// start
-
- testWidget->hide();
+ QScopedPointer<QWidget> testWidget(new QWidget);
+ testWidget->resize(m_testWidgetSize);
+ testWidget->setWindowTitle(__FUNCTION__);
+ centerOnScreen(testWidget.data());
QVERIFY( !testWidget->isVisible() );
- QWidget* childWidget = new QWidget( testWidget );
+ QWidget* childWidget = new QWidget( testWidget.data() );
QVERIFY( !childWidget->isVisible() );
testWidget->show();
@@ -1332,11 +1205,16 @@ void tst_QWidget::setLocale()
void tst_QWidget::visible_setWindowOpacity()
{
- testWidget->hide();
+ QScopedPointer<QWidget> testWidget(new QWidget);
+ testWidget->resize(m_testWidgetSize);
+ testWidget->setWindowTitle(__FUNCTION__);
+ centerOnScreen(testWidget.data());
+ testWidget->winId();
+
QVERIFY( !testWidget->isVisible() );
testWidget->setWindowOpacity(0.5);
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
- QVERIFY(!::IsWindowVisible(winHandleOf(testWidget)));
+ QVERIFY(!::IsWindowVisible(winHandleOf(testWidget.data())));
#endif
testWidget->setWindowOpacity(1.0);
}
@@ -1345,35 +1223,40 @@ void tst_QWidget::isVisibleTo()
{
// Ensure that the testWidget is hidden for this test at the
// start
+ QWidget testWidget;
+ testWidget.resize(m_testWidgetSize);
+ testWidget.setWindowTitle(__FUNCTION__);
+ centerOnScreen(&testWidget);
- testWidget->hide();
- QWidget* childWidget = new QWidget( testWidget );
- QVERIFY( childWidget->isVisibleTo( testWidget ) );
+ QWidget* childWidget = new QWidget( &testWidget );
+ QVERIFY( childWidget->isVisibleTo( &testWidget ) );
childWidget->hide();
- QVERIFY( !childWidget->isVisibleTo( testWidget ) );
+ QVERIFY( !childWidget->isVisibleTo( &testWidget ) );
QWidget* grandChildWidget = new QWidget( childWidget );
- QVERIFY( !grandChildWidget->isVisibleTo( testWidget ) );
+ QVERIFY( !grandChildWidget->isVisibleTo( &testWidget ) );
QVERIFY( grandChildWidget->isVisibleTo( childWidget ) );
- testWidget->show();
+ testWidget.show();
childWidget->show();
- QVERIFY( childWidget->isVisibleTo( testWidget ) );
+ QVERIFY( childWidget->isVisibleTo( &testWidget ) );
grandChildWidget->hide();
QVERIFY( !grandChildWidget->isVisibleTo( childWidget ) );
- QVERIFY( !grandChildWidget->isVisibleTo( testWidget ) );
-
+ QVERIFY( !grandChildWidget->isVisibleTo( &testWidget ) );
}
void tst_QWidget::isHidden()
{
// Ensure that the testWidget is hidden for this test at the
// start
+ QScopedPointer<QWidget> testWidget(new QWidget);
+ testWidget->resize(m_testWidgetSize);
+ testWidget->setWindowTitle(__FUNCTION__);
+ centerOnScreen(testWidget.data());
- testWidget->hide();
QVERIFY( testWidget->isHidden() );
- QWidget* childWidget = new QWidget( testWidget );
+ QWidget* childWidget = new QWidget( testWidget.data() );
QVERIFY( !childWidget->isHidden() );
testWidget->show();
@@ -1406,8 +1289,15 @@ void tst_QWidget::isHidden()
void tst_QWidget::fonts()
{
+ QWidget testWidget;
+ testWidget.resize(m_testWidgetSize);
+ testWidget.setWindowTitle(__FUNCTION__);
+ centerOnScreen(&testWidget);
+ testWidget.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&testWidget));
+
// Tests setFont(), ownFont() and unsetFont()
- QWidget* cleanTestWidget = new QWidget( testWidget );
+ QWidget* cleanTestWidget = new QWidget( &testWidget );
QFont originalFont = cleanTestWidget->font();
QVERIFY( !cleanTestWidget->testAttribute(Qt::WA_SetFont) );
@@ -1416,7 +1306,7 @@ void tst_QWidget::fonts()
QFont newFont( "times", 18 );
cleanTestWidget->setFont( newFont );
- newFont = newFont.resolve( testWidget->font() );
+ newFont = newFont.resolve( testWidget.font() );
QVERIFY( cleanTestWidget->testAttribute(Qt::WA_SetFont) );
QVERIFY2( cleanTestWidget->font() == newFont,
@@ -1513,7 +1403,7 @@ void tst_QWidget::mapFromAndTo()
subWindow2->setGeometry(75, 75, 100, 100);
subSubWindow->setGeometry(10, 10, 10, 10);
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_QNX)
+#if !defined(Q_OS_QNX)
//update visibility
if (windowMinimized) {
if (!windowHidden) {
@@ -1693,7 +1583,6 @@ void tst_QWidget::focusChainOnReparent()
void tst_QWidget::focusChainOnHide()
{
- testWidget->hide(); // We do not want to get disturbed by other widgets
// focus should move to the next widget in the focus chain when we hide it.
QScopedPointer<QWidget> parent(new QWidget());
parent->setObjectName(QLatin1String("focusChainOnHide"));
@@ -1717,8 +1606,6 @@ void tst_QWidget::focusChainOnHide()
QTRY_COMPARE(parent->hasFocus(), true);
QCOMPARE(parent.data(), qApp->focusWidget());
-
- testWidget->show(); //don't disturb later tests
}
class Container : public QWidget
@@ -1826,15 +1713,8 @@ void tst_QWidget::activation()
{
Q_CHECK_PAINTEVENTS
-#if defined(Q_OS_WINCE)
- int waitTime = 1000;
-#else
int waitTime = 100;
-#endif
-#ifdef Q_OS_WINCE
- qApp->processEvents();
-#endif
QWidget widget1;
widget1.setObjectName("activation-Widget1");
widget1.setWindowTitle(widget1.objectName());
@@ -1886,10 +1766,6 @@ void tst_QWidget::windowState()
size = QGuiApplication::primaryScreen()->size();
} else {
pos = QPoint(10, 10);
-#ifdef Q_OS_WINCE_WM
- if (qt_wince_is_smartphone()) { //small screen
- size = QSize(100,100);
-#endif
}
QWidget widget1;
@@ -2421,11 +2297,7 @@ void tst_QWidget::reparent()
childTLW.show();
QVERIFY(QTest::qWaitForWindowExposed(&parent));
-#ifdef Q_OS_WINCE
- parent.move(50, 50);
-#else
parent.move(parentPosition);
-#endif
QPoint childPos = parent.mapToGlobal(child.pos());
QPoint tlwPos = childTLW.pos();
@@ -2454,6 +2326,12 @@ void tst_QWidget::icon()
QPixmap p(20,20);
p.fill(Qt::red);
+ QScopedPointer<QWidget> testWidget(new QWidget);
+ testWidget->resize(m_testWidgetSize);
+ testWidget->setWindowTitle(__FUNCTION__);
+ centerOnScreen(testWidget.data());
+ testWidget->show();
+ QVERIFY(QTest::qWaitForWindowExposed(testWidget.data()));
testWidget->setWindowIcon(p);
QVERIFY(!testWidget->windowIcon().isNull());
@@ -2469,22 +2347,27 @@ void tst_QWidget::hideWhenFocusWidgetIsChild()
{
if (m_platform == QStringLiteral("wayland"))
QSKIP("Wayland: This fails. Figure out why.");
- testWidget->activateWindow();
- QScopedPointer<QWidget> parentWidget(new QWidget(testWidget));
+
+ QScopedPointer<QWidget> testWidget(new QWidget);
+ testWidget->setWindowTitle(__FUNCTION__);
+ testWidget->resize(m_testWidgetSize);
+ centerOnScreen(testWidget.data());
+ QWidget *parentWidget(new QWidget(testWidget.data()));
parentWidget->setObjectName("parentWidget");
parentWidget->setGeometry(0, 0, 100, 100);
- QLineEdit *edit = new QLineEdit(parentWidget.data());
+ QLineEdit *edit = new QLineEdit(parentWidget);
edit->setObjectName("edit1");
- QLineEdit *edit3 = new QLineEdit(parentWidget.data());
+ QLineEdit *edit3 = new QLineEdit(parentWidget);
edit3->setObjectName("edit3");
edit3->move(0,50);
- parentWidget->show();
- QLineEdit *edit2 = new QLineEdit(testWidget);
+ QLineEdit *edit2 = new QLineEdit(testWidget.data());
edit2->setObjectName("edit2");
- edit2->show();
edit2->move(110, 100);
edit->setFocus();
- qApp->processEvents();
+ testWidget->show();
+ testWidget->activateWindow();
+ QVERIFY(QTest::qWaitForWindowActive(testWidget.data()));
+
QString actualFocusWidget, expectedFocusWidget;
if (!qApp->focusWidget() && m_platform == QStringLiteral("xcb"))
QSKIP("X11: Your window manager is too broken for this test");
@@ -2640,8 +2523,6 @@ void tst_QWidget::setGeometry()
QCOMPARE(tlw.geometry(), tr);
}
-// Windows CE does not support windowOpacity.
-#ifndef Q_OS_WINCE
void tst_QWidget::windowOpacity()
{
QWidget widget;
@@ -2672,7 +2553,6 @@ void tst_QWidget::windowOpacity()
child.setWindowOpacity(-1.0);
QCOMPARE(child.windowOpacity(), 1.0);
}
-#endif
class UpdateWidget : public QWidget
{
@@ -2991,9 +2871,6 @@ void tst_QWidget::stackUnder()
foreach (UpdateWidget *child, allChildren) {
int expectedZOrderChangeEvents = child == child1 ? 1 : 0;
if (child == child3) {
-#ifdef Q_OS_WINCE
- qApp->processEvents();
-#endif
#ifndef Q_OS_OSX
QEXPECT_FAIL(0, "See QTBUG-493", Continue);
#endif
@@ -3385,9 +3262,6 @@ void tst_QWidget::widgetAt()
w2->setMask(rgn);
qApp->processEvents();
QTest::qWait(10);
-#if defined(Q_OS_WINCE)
- QEXPECT_FAIL("", "Windows CE does only support rectangular regions", Continue); //See also task 147191
-#endif
QTRY_VERIFY((wr = QApplication::widgetAt(testPos)));
QTRY_COMPARE(wr->objectName(), w1->objectName());
@@ -3403,9 +3277,6 @@ void tst_QWidget::widgetAt()
w2->setMask(bitmap);
qApp->processEvents();
QTest::qWait(10);
-#if defined(Q_OS_WINCE)
- QEXPECT_FAIL("", "Windows CE does only support rectangular regions", Continue); //See also task 147191
-#endif
QTRY_COMPARE(QApplication::widgetAt(testPos), w1.data());
QTRY_VERIFY(QApplication::widgetAt(testPos + QPoint(1, 1)) == w2.data());
}
@@ -3573,8 +3444,6 @@ bool verifyWidgetMask(QWidget *widget, QRect mask)
void tst_QWidget::setMask()
{
- testWidget->hide(); // get this out of the way.
-
{
MaskedPainter w;
w.resize(200, 200);
@@ -3730,7 +3599,7 @@ void tst_QWidget::optimizedResize_topLevel()
topLevel.partial = false;
topLevel.paintedRegion = QRegion();
-#if !defined(Q_OS_WIN32) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_WIN32)
topLevel.resize(topLevel.size() + QSize(10, 10));
#else
// Static contents does not work when programmatically resizing
@@ -3801,7 +3670,6 @@ void tst_QWidget::setMinimumSize()
// Setting a minimum size larger than the desktop does not work on WinCE,
// so skip this part of the test.
-#ifndef Q_OS_WINCE
QSize nonDefaultSize = defaultSize + QSize(5,5);
w.setMinimumSize(nonDefaultSize);
w.showNormal();
@@ -3810,7 +3678,6 @@ void tst_QWidget::setMinimumSize()
msgComparisonFailed(w.height(), ">=", nonDefaultSize.height()));
QVERIFY2(w.width() >= nonDefaultSize.width(),
msgComparisonFailed(w.width(), ">=", nonDefaultSize.width()));
-#endif
}
void tst_QWidget::setMaximumSize()
@@ -4787,7 +4654,7 @@ void tst_QWidget::setWindowGeometry()
}
}
-#if defined (Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
+#if defined (Q_OS_WIN) && !defined(Q_OS_WINRT)
void tst_QWidget::setGeometry_win()
{
QWidget widget;
@@ -4808,7 +4675,7 @@ void tst_QWidget::setGeometry_win()
QVERIFY2(rt.top <= m_availableTopLeft.y(),
msgComparisonFailed(int(rt.top), "<=", m_availableTopLeft.y()));
}
-#endif // defined (Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
+#endif // defined (Q_OS_WIN) && !defined(Q_OS_WINRT)
// Since X11 WindowManager operation are all async, and we have no way to know if the window
// manager has finished playing with the window geometry, this test can't be reliable on X11.
@@ -5134,12 +5001,8 @@ void tst_QWidget::moveChild()
parent.setStyle(style.data());
ColorWidget child(&parent, Qt::Widget, Qt::blue);
-#ifndef Q_OS_WINCE
parent.setGeometry(QRect(QPoint(QApplication::desktop()->availableGeometry(&parent).topLeft()) + QPoint(50, 50),
QSize(200, 200)));
-#else
- parent.setGeometry(60, 60, 150, 150);
-#endif
child.setGeometry(25, 25, 50, 50);
#ifndef QT_NO_CURSOR // Try to make sure the cursor is not in a taskbar area to prevent tooltips or window highlighting
QCursor::setPos(parent.geometry().topRight() + QPoint(50 , 50));
@@ -5365,11 +5228,18 @@ public:
void tst_QWidget::setFocus()
{
+ QScopedPointer<QWidget> testWidget(new QWidget);
+ testWidget->resize(m_testWidgetSize);
+ testWidget->setWindowTitle(__FUNCTION__);
+ centerOnScreen(testWidget.data());
+ testWidget->show();
+ QVERIFY(QTest::qWaitForWindowExposed(testWidget.data()));
+
const QPoint windowPos = testWidget->geometry().topRight() + QPoint(50, 0);
{
// move focus to another window
testWidget->activateWindow();
- QApplication::setActiveWindow(testWidget);
+ QApplication::setActiveWindow(testWidget.data());
if (testWidget->focusWidget())
testWidget->focusWidget()->clearFocus();
else
@@ -5415,7 +5285,7 @@ void tst_QWidget::setFocus()
// note: window may be active, but we don't want it to be
testWidget->activateWindow();
- QApplication::setActiveWindow(testWidget);
+ QApplication::setActiveWindow(testWidget.data());
if (testWidget->focusWidget())
testWidget->focusWidget()->clearFocus();
else
@@ -5584,7 +5454,7 @@ private:
int m_count;
};
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void tst_QWidget::setCursor()
{
{
@@ -5727,8 +5597,6 @@ void tst_QWidget::setToolTip()
QCOMPARE(widget.toolTip(), QString());
QCOMPARE(spy.count(), 2);
- // Mouse over doesn't work on Windows mobile, so skip the rest of the test for that platform.
-#ifndef Q_OS_WINCE_WM
for (int pass = 0; pass < 2; ++pass) {
QCursor::setPos(m_safeCursorPos);
QScopedPointer<QWidget> popup(new QWidget(0, Qt::Popup));
@@ -5756,7 +5624,6 @@ void tst_QWidget::setToolTip()
QTest::qWait(2200); // delay is 2000
QTest::mouseMove(popupWindow);
}
-#endif
}
void tst_QWidget::testWindowIconChangeEventPropagation()
@@ -6837,7 +6704,6 @@ void tst_QWidget::render_task217815()
}
// Window Opacity is not supported on Windows CE.
-#ifndef Q_OS_WINCE
void tst_QWidget::render_windowOpacity()
{
const qreal opacity = 0.5;
@@ -6910,7 +6776,6 @@ void tst_QWidget::render_windowOpacity()
QCOMPARE(result, expected);
}
}
-#endif
void tst_QWidget::render_systemClip()
{
@@ -7368,14 +7233,10 @@ void tst_QWidget::repaintWhenChildDeleted()
}
#endif
ColorWidget w(0, Qt::FramelessWindowHint, Qt::red);
-#if !defined(Q_OS_WINCE)
QPoint startPoint = QApplication::desktop()->availableGeometry(&w).topLeft();
startPoint.rx() += 50;
startPoint.ry() += 50;
w.setGeometry(QRect(startPoint, QSize(100, 100)));
-#else
- w.setGeometry(60, 60, 110, 110);
-#endif
w.show();
QVERIFY(QTest::qWaitForWindowExposed(&w));
QTest::qWait(10);
@@ -7399,14 +7260,10 @@ void tst_QWidget::repaintWhenChildDeleted()
void tst_QWidget::hideOpaqueChildWhileHidden()
{
ColorWidget w(0, Qt::FramelessWindowHint, Qt::red);
-#if !defined(Q_OS_WINCE)
QPoint startPoint = QApplication::desktop()->availableGeometry(&w).topLeft();
startPoint.rx() += 50;
startPoint.ry() += 50;
w.setGeometry(QRect(startPoint, QSize(100, 100)));
-#else
- w.setGeometry(60, 60, 110, 110);
-#endif
ColorWidget child(&w, Qt::Widget, Qt::blue);
child.setGeometry(10, 10, 80, 80);
@@ -7435,7 +7292,6 @@ void tst_QWidget::hideOpaqueChildWhileHidden()
}
// This test doesn't make sense without support for showMinimized().
-#if !defined(Q_OS_WINCE)
void tst_QWidget::updateWhileMinimized()
{
if (m_platform == QStringLiteral("wayland"))
@@ -7473,7 +7329,6 @@ void tst_QWidget::updateWhileMinimized()
QTRY_COMPARE(widget.numPaintEvents, 1);
QCOMPARE(widget.paintedRegion, QRegion(0, 0, 50, 50));
}
-#endif
class PaintOnScreenWidget: public QWidget
{
@@ -7840,13 +7695,6 @@ void tst_QWidget::adjustSize()
QVERIFY2(child->size().height() < sizeHint.height(),
msgComparisonFailed(child->size().height(), "<", sizeHint.height()));
} else {
-#if defined (Q_OS_WINCE)
- if (!haveParent) {
- const QRect& desktopRect = qApp->desktop()->availableGeometry();
- expectedSize.setWidth(qMin(expectedSize.width(), desktopRect.width()));
- expectedSize.setHeight(qMin(expectedSize.height(), desktopRect.height()));
- }
-#endif
QCOMPARE(child->size(), expectedSize);
}
if (!haveParent)
@@ -8916,7 +8764,7 @@ void tst_QWidget::maskedUpdate()
QTRY_COMPARE(grandChild.paintedRegion, QRegion(grandChild.rect())); // Full update.
}
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void tst_QWidget::syntheticEnterLeave()
{
if (m_platform == QStringLiteral("wayland"))
@@ -9022,7 +8870,7 @@ void tst_QWidget::syntheticEnterLeave()
}
#endif
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void tst_QWidget::taskQTBUG_4055_sendSyntheticEnterLeave()
{
if (m_platform == QStringLiteral("wayland"))
@@ -9170,8 +9018,6 @@ void tst_QWidget::updateOnDestroyedSignal()
void tst_QWidget::toplevelLineEditFocus()
{
- testWidget->hide();
-
QLineEdit w;
w.setMinimumWidth(m_testWidgetSize.width());
w.show();
@@ -9237,10 +9083,9 @@ QWidgetBackingStore* backingStore(QWidget &widget)
}
// Tables of 5000 elements do not make sense on Windows Mobile.
-#ifndef Q_OS_WINCE_WM
void tst_QWidget::rectOutsideCoordinatesLimit_task144779()
{
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
QApplication::setOverrideCursor(Qt::BlankCursor); //keep the cursor out of screen grabs
#endif
QWidget main(0,Qt::FramelessWindowHint); //don't get confused by the size of the window frame
@@ -9275,11 +9120,10 @@ void tst_QWidget::rectOutsideCoordinatesLimit_task144779()
QTRY_COMPARE(mainPixmap.toImage().convertToFormat(QImage::Format_RGB32),
correct.toImage().convertToFormat(QImage::Format_RGB32));
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
QApplication::restoreOverrideCursor();
#endif
}
-#endif
void tst_QWidget::setGraphicsEffect()
{
@@ -9892,25 +9736,21 @@ void tst_QWidget::touchEventSynthesizedMouseEvent()
{
// Simple case, we ignore the touch events, we get mouse events instead
- QTouchDevice *device = new QTouchDevice;
- device->setType(QTouchDevice::TouchScreen);
- QWindowSystemInterface::registerTouchDevice(device);
-
TouchMouseWidget widget;
widget.show();
QVERIFY(QTest::qWaitForWindowExposed(widget.windowHandle()));
QCOMPARE(widget.m_touchEventCount, 0);
QCOMPARE(widget.m_mouseEventCount, 0);
- QTest::touchEvent(&widget, device).press(0, QPoint(10, 10), &widget);
+ QTest::touchEvent(&widget, m_touchScreen).press(0, QPoint(10, 10), &widget);
QCOMPARE(widget.m_touchEventCount, 0);
QCOMPARE(widget.m_mouseEventCount, 1);
QCOMPARE(widget.m_lastMouseEventPos, QPointF(10, 10));
- QTest::touchEvent(&widget, device).move(0, QPoint(15, 15), &widget);
+ QTest::touchEvent(&widget, m_touchScreen).move(0, QPoint(15, 15), &widget);
QCOMPARE(widget.m_touchEventCount, 0);
QCOMPARE(widget.m_mouseEventCount, 2);
QCOMPARE(widget.m_lastMouseEventPos, QPointF(15, 15));
- QTest::touchEvent(&widget, device).release(0, QPoint(20, 20), &widget);
+ QTest::touchEvent(&widget, m_touchScreen).release(0, QPoint(20, 20), &widget);
QCOMPARE(widget.m_touchEventCount, 0);
QCOMPARE(widget.m_mouseEventCount, 4); // we receive extra mouse move event
QCOMPARE(widget.m_lastMouseEventPos, QPointF(20, 20));
@@ -9918,10 +9758,6 @@ void tst_QWidget::touchEventSynthesizedMouseEvent()
{
// We accept the touch events, no mouse event is generated
- QTouchDevice *device = new QTouchDevice;
- device->setType(QTouchDevice::TouchScreen);
- QWindowSystemInterface::registerTouchDevice(device);
-
TouchMouseWidget widget;
widget.setAcceptTouch(true);
widget.show();
@@ -9929,13 +9765,13 @@ void tst_QWidget::touchEventSynthesizedMouseEvent()
QCOMPARE(widget.m_touchEventCount, 0);
QCOMPARE(widget.m_mouseEventCount, 0);
- QTest::touchEvent(&widget, device).press(0, QPoint(10, 10), &widget);
+ QTest::touchEvent(&widget, m_touchScreen).press(0, QPoint(10, 10), &widget);
QCOMPARE(widget.m_touchEventCount, 1);
QCOMPARE(widget.m_mouseEventCount, 0);
- QTest::touchEvent(&widget, device).move(0, QPoint(15, 15), &widget);
+ QTest::touchEvent(&widget, m_touchScreen).move(0, QPoint(15, 15), &widget);
QCOMPARE(widget.m_touchEventCount, 2);
QCOMPARE(widget.m_mouseEventCount, 0);
- QTest::touchEvent(&widget, device).release(0, QPoint(20, 20), &widget);
+ QTest::touchEvent(&widget, m_touchScreen).release(0, QPoint(20, 20), &widget);
QCOMPARE(widget.m_touchEventCount, 3);
QCOMPARE(widget.m_mouseEventCount, 0);
}
@@ -9943,10 +9779,6 @@ void tst_QWidget::touchEventSynthesizedMouseEvent()
{
// Parent accepts touch events, child ignore both mouse and touch
// We should see propagation of the TouchBegin
- QTouchDevice *device = new QTouchDevice;
- device->setType(QTouchDevice::TouchScreen);
- QWindowSystemInterface::registerTouchDevice(device);
-
TouchMouseWidget parent;
parent.setAcceptTouch(true);
TouchMouseWidget child(&parent);
@@ -9959,7 +9791,7 @@ void tst_QWidget::touchEventSynthesizedMouseEvent()
QCOMPARE(child.m_touchEventCount, 0);
QCOMPARE(child.m_mouseEventCount, 0);
- QTest::touchEvent(parent.window(), device).press(0, QPoint(10, 10), &child);
+ QTest::touchEvent(parent.window(), m_touchScreen).press(0, QPoint(10, 10), &child);
QCOMPARE(parent.m_touchEventCount, 1);
QCOMPARE(parent.m_mouseEventCount, 0);
QCOMPARE(child.m_touchEventCount, 0);
@@ -9969,10 +9801,6 @@ void tst_QWidget::touchEventSynthesizedMouseEvent()
{
// Parent accepts mouse events, child ignore both mouse and touch
// We should see propagation of the TouchBegin into a MouseButtonPress
- QTouchDevice *device = new QTouchDevice;
- device->setType(QTouchDevice::TouchScreen);
- QWindowSystemInterface::registerTouchDevice(device);
-
TouchMouseWidget parent;
TouchMouseWidget child(&parent);
child.move(5, 5);
@@ -9984,7 +9812,7 @@ void tst_QWidget::touchEventSynthesizedMouseEvent()
QCOMPARE(child.m_touchEventCount, 0);
QCOMPARE(child.m_mouseEventCount, 0);
- QTest::touchEvent(parent.window(), device).press(0, QPoint(10, 10), &child);
+ QTest::touchEvent(parent.window(), m_touchScreen).press(0, QPoint(10, 10), &child);
QCOMPARE(parent.m_touchEventCount, 0);
QCOMPARE(parent.m_mouseEventCount, 1);
QCOMPARE(parent.m_lastMouseEventPos, QPointF(15, 15));
@@ -9996,10 +9824,6 @@ void tst_QWidget::touchEventSynthesizedMouseEvent()
void tst_QWidget::touchUpdateOnNewTouch()
{
- QTouchDevice *device = new QTouchDevice;
- device->setType(QTouchDevice::TouchScreen);
- QWindowSystemInterface::registerTouchDevice(device);
-
TouchMouseWidget widget;
widget.setAcceptTouch(true);
QVBoxLayout *layout = new QVBoxLayout;
@@ -10012,23 +9836,23 @@ void tst_QWidget::touchUpdateOnNewTouch()
QCOMPARE(widget.m_touchBeginCount, 0);
QCOMPARE(widget.m_touchUpdateCount, 0);
QCOMPARE(widget.m_touchEndCount, 0);
- QTest::touchEvent(window, device).press(0, QPoint(20, 20), window);
+ QTest::touchEvent(window, m_touchScreen).press(0, QPoint(20, 20), window);
QCOMPARE(widget.m_touchBeginCount, 1);
QCOMPARE(widget.m_touchUpdateCount, 0);
QCOMPARE(widget.m_touchEndCount, 0);
- QTest::touchEvent(window, device).move(0, QPoint(25, 25), window);
+ QTest::touchEvent(window, m_touchScreen).move(0, QPoint(25, 25), window);
QCOMPARE(widget.m_touchBeginCount, 1);
QCOMPARE(widget.m_touchUpdateCount, 1);
QCOMPARE(widget.m_touchEndCount, 0);
- QTest::touchEvent(window, device).stationary(0).press(1, QPoint(40, 40), window);
+ QTest::touchEvent(window, m_touchScreen).stationary(0).press(1, QPoint(40, 40), window);
QCOMPARE(widget.m_touchBeginCount, 1);
QCOMPARE(widget.m_touchUpdateCount, 2);
QCOMPARE(widget.m_touchEndCount, 0);
- QTest::touchEvent(window, device).stationary(1).release(0, QPoint(25, 25), window);
+ QTest::touchEvent(window, m_touchScreen).stationary(1).release(0, QPoint(25, 25), window);
QCOMPARE(widget.m_touchBeginCount, 1);
QCOMPARE(widget.m_touchUpdateCount, 3);
QCOMPARE(widget.m_touchEndCount, 0);
- QTest::touchEvent(window, device).release(1, QPoint(40, 40), window);
+ QTest::touchEvent(window, m_touchScreen).release(1, QPoint(40, 40), window);
QCOMPARE(widget.m_touchBeginCount, 1);
QCOMPARE(widget.m_touchUpdateCount, 3);
QCOMPARE(widget.m_touchEndCount, 1);
@@ -10036,10 +9860,6 @@ void tst_QWidget::touchUpdateOnNewTouch()
void tst_QWidget::touchEventsForGesturePendingWidgets()
{
- QTouchDevice *device = new QTouchDevice;
- device->setType(QTouchDevice::TouchScreen);
- QWindowSystemInterface::registerTouchDevice(device);
-
TouchMouseWidget parent;
TouchMouseWidget child(&parent);
parent.grabGesture(Qt::TapAndHoldGesture);
@@ -10052,14 +9872,14 @@ void tst_QWidget::touchEventsForGesturePendingWidgets()
QCOMPARE(child.m_gestureEventCount, 0);
QCOMPARE(parent.m_touchEventCount, 0);
QCOMPARE(parent.m_gestureEventCount, 0);
- QTest::touchEvent(window, device).press(0, QPoint(20, 20), window);
+ QTest::touchEvent(window, m_touchScreen).press(0, QPoint(20, 20), window);
QCOMPARE(child.m_touchEventCount, 0);
QCOMPARE(child.m_gestureEventCount, 0);
QCOMPARE(parent.m_touchBeginCount, 1); // QTapAndHoldGestureRecognizer::create() sets Qt::WA_AcceptTouchEvents
QCOMPARE(parent.m_touchUpdateCount, 0);
QCOMPARE(parent.m_touchEndCount, 0);
QCOMPARE(parent.m_gestureEventCount, 0);
- QTest::touchEvent(window, device).move(0, QPoint(25, 25), window);
+ QTest::touchEvent(window, m_touchScreen).move(0, QPoint(25, 25), window);
QCOMPARE(child.m_touchEventCount, 0);
QCOMPARE(child.m_gestureEventCount, 0);
QCOMPARE(parent.m_touchBeginCount, 1);
@@ -10067,7 +9887,7 @@ void tst_QWidget::touchEventsForGesturePendingWidgets()
QCOMPARE(parent.m_touchEndCount, 0);
QCOMPARE(parent.m_gestureEventCount, 0);
QTest::qWait(1000);
- QTest::touchEvent(window, device).release(0, QPoint(25, 25), window);
+ QTest::touchEvent(window, m_touchScreen).release(0, QPoint(25, 25), window);
QCOMPARE(child.m_touchEventCount, 0);
QCOMPARE(child.m_gestureEventCount, 0);
QCOMPARE(parent.m_touchBeginCount, 1);
@@ -10184,7 +10004,7 @@ void tst_QWidget::destroyedSignal()
}
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void tst_QWidget::underMouse()
{
// Move the mouse cursor to a safe location
@@ -10473,7 +10293,7 @@ void tst_QWidget::taskQTBUG_27643_enterEvents()
// Must only register only single enter on modal dialog's button after all said and done
QCOMPARE(dialog.enters, 1);
}
-#endif // QTEST_NO_CURSOR
+#endif // QT_NO_CURSOR
class KeyboardWidget : public QWidget
{
diff --git a/tests/auto/widgets/kernel/qwidget_window/qwidget_window.pro b/tests/auto/widgets/kernel/qwidget_window/qwidget_window.pro
index 8672c363a2..a6248dfd16 100644
--- a/tests/auto/widgets/kernel/qwidget_window/qwidget_window.pro
+++ b/tests/auto/widgets/kernel/qwidget_window/qwidget_window.pro
@@ -2,8 +2,3 @@ CONFIG += testcase
TARGET = tst_qwidget_window
QT += widgets testlib core-private gui-private
SOURCES += tst_qwidget_window.cpp
-
-x11 {
- LIBS += $$QMAKE_LIBS_X11
-}
-
diff --git a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
index 35b1596003..6aaac6d135 100644
--- a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
+++ b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
@@ -331,8 +331,10 @@ void tst_QWidget_window::tst_showWithoutActivating()
QSKIP("Cocoa: This fails. Figure out why.");
else if (platformName != QStringLiteral("xcb")
&& platformName != QStringLiteral("windows")
- && platformName != QStringLiteral("ios"))
- QSKIP("Qt::WA_ShowWithoutActivating is currently supported only on xcb, windows, and ios platforms.");
+ && platformName != QStringLiteral("ios")
+ && platformName != QStringLiteral("tvos")
+ && platformName != QStringLiteral("watchos"))
+ QSKIP("Qt::WA_ShowWithoutActivating is currently supported only on xcb, windows, and ios/tvos/watchos platforms.");
QWidget w1;
w1.setAttribute(Qt::WA_ShowWithoutActivating);
diff --git a/tests/auto/widgets/styles/qstyle/qstyle.pro b/tests/auto/widgets/styles/qstyle/qstyle.pro
index 50445b9a45..a1e5a70a08 100644
--- a/tests/auto/widgets/styles/qstyle/qstyle.pro
+++ b/tests/auto/widgets/styles/qstyle/qstyle.pro
@@ -3,12 +3,6 @@ TARGET = tst_qstyle
QT += widgets testlib
SOURCES += tst_qstyle.cpp
-wince* {
- addPixmap.files = task_25863.png
- addPixmap.path = .
- DEPLOYMENT += addPixmap
-}
-
android {
RESOURCES += \
testdata.qrc
diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
index 5c213fea04..5925b764dd 100644
--- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
+++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
@@ -56,20 +56,6 @@
#include <qlineedit.h>
#include <qmdiarea.h>
#include <qscrollarea.h>
-
-#ifdef Q_OS_WINCE_WM
-#include <windows.h>
-
-static bool qt_wince_is_smartphone() {
- wchar_t tszPlatform[64];
- if (SystemParametersInfo(SPI_GETPLATFORMTYPE,
- sizeof(tszPlatform)/sizeof(*tszPlatform),tszPlatform,0))
- if (0 == _tcsicmp(reinterpret_cast<const wchar_t *> (QString::fromLatin1("Smartphone").utf16()), tszPlatform))
- return true;
- return false;
-}
-#endif
-
#include <qwidget.h>
// Make a widget frameless to prevent size constraints of title bars
@@ -90,7 +76,7 @@ public:
private:
bool testAllFunctions(QStyle *);
- bool testScrollBarSubControls(QStyle *);
+ bool testScrollBarSubControls();
void testPainting(QStyle *style, const QString &platform);
private slots:
void drawItemPixmap();
@@ -109,12 +95,6 @@ private slots:
#ifdef Q_OS_MAC
void testMacStyle();
#endif
-#ifdef Q_OS_WINCE
- void testWindowsCEStyle();
-#endif
-#ifdef Q_OS_WINCE_WM
- void testWindowsMobileStyle();
-#endif
void testStyleFactory();
void testProxyStyle();
void pixelMetric();
@@ -315,19 +295,11 @@ bool tst_QStyle::testAllFunctions(QStyle *style)
style->itemPixmapRect(QRect(0, 0, 100, 100), Qt::AlignHCenter, QPixmap(200, 200));
style->itemTextRect(QFontMetrics(qApp->font()), QRect(0, 0, 100, 100), Qt::AlignHCenter, true, QString("Test"));
- return testScrollBarSubControls(style);
+ return testScrollBarSubControls();
}
-bool tst_QStyle::testScrollBarSubControls(QStyle* style)
+bool tst_QStyle::testScrollBarSubControls()
{
- // WinCE SmartPhone doesn't have scrollbar subcontrols, so skip the rest of the test.
-#ifdef Q_OS_WINCE_WM
- if (style->inherits("QWindowsMobileStyle") && qt_wince_is_smartphone())
- return true;
-#else
- Q_UNUSED(style);
-#endif
-
QScrollBar scrollBar;
setFrameless(&scrollBar);
scrollBar.show();
@@ -522,26 +494,6 @@ void tst_QStyle::testMacStyle()
}
#endif
-#ifdef Q_OS_WINCE
-// WindowsCEStyle style
-void tst_QStyle::testWindowsCEStyle()
-{
- QStyle *cstyle = QStyleFactory::create("WindowsCE");
- QVERIFY(testAllFunctions(cstyle));
- delete cstyle;
-}
-#endif
-
-#ifdef Q_OS_WINCE_WM
-// WindowsMobileStyle style
-void tst_QStyle::testWindowsMobileStyle()
-{
- QStyle *cstyle = QStyleFactory::create("WindowsMobile");
- QVERIFY(testAllFunctions(cstyle));
- delete cstyle;
-}
-#endif
-
// Helper class...
MyWidget::MyWidget( QWidget* parent, const char* name )
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/BLACKLIST b/tests/auto/widgets/styles/qstylesheetstyle/BLACKLIST
index cf78fb47c2..61966e684f 100644
--- a/tests/auto/widgets/styles/qstylesheetstyle/BLACKLIST
+++ b/tests/auto/widgets/styles/qstylesheetstyle/BLACKLIST
@@ -1,2 +1,4 @@
[hoverColors]
ubuntu-14.04
+opensuse-13.1
+opensuse-42.1
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/qstylesheetstyle.pro b/tests/auto/widgets/styles/qstylesheetstyle/qstylesheetstyle.pro
index c96004bd5d..7d9a8576d3 100644
--- a/tests/auto/widgets/styles/qstylesheetstyle/qstylesheetstyle.pro
+++ b/tests/auto/widgets/styles/qstylesheetstyle/qstylesheetstyle.pro
@@ -5,4 +5,4 @@ QT += widgets widgets-private gui-private testlib
SOURCES += tst_qstylesheetstyle.cpp
RESOURCES += resources.qrc
-requires(contains(QT_CONFIG,private_tests))
+requires(qtConfig(private_tests))
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
index a506bbb114..d8c70a0cc1 100644
--- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
+++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
@@ -34,8 +34,6 @@
#include <private/qstylesheetstyle_p.h>
-#include "../../../qtest-config.h"
-
static inline void centerOnScreen(QWidget *w)
{
const QPoint offset = QPoint(w->width() / 2, w->height() / 2);
@@ -76,7 +74,7 @@ private slots:
void onWidgetDestroyed();
void fontPrecedence();
void focusColors();
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void hoverColors();
#endif
void background();
@@ -819,6 +817,24 @@ static bool testForColors(const QImage& image, const QColor& color, bool ensureP
return false;
}
+static const QList<QWidget*> sample_widgets() // returning const to avoid detaching when passing to range-for
+{
+ QList<QWidget *> widgets;
+ widgets << new QPushButton("TESTING TESTING");
+ widgets << new QLineEdit("TESTING TESTING");
+ widgets << new QLabel("TESTING TESTING");
+ QSpinBox *spinbox = new QSpinBox;
+ spinbox->setMaximum(1000000000);
+ spinbox->setValue(123456789);
+ widgets << spinbox;
+ QComboBox *combobox = new QComboBox;
+ combobox->setEditable(true);
+ combobox->addItems(QStringList() << "TESTING TESTING");
+ widgets << combobox;
+ widgets << new QLabel("<b>TESTING TESTING</b>");
+ return widgets;
+}
+
void tst_QStyleSheetStyle::focusColors()
{
// Tests if colors can be changed by altering the focus of the widget.
@@ -835,22 +851,9 @@ void tst_QStyleSheetStyle::focusColors()
" (for example, QTBUG-33959)."
"That doesn't mean that the feature doesn't work in practice.");
#endif
- QList<QWidget *> widgets;
- widgets << new QPushButton("TESTING TESTING");
- widgets << new QLineEdit("TESTING TESTING");
- widgets << new QLabel("TESTING TESTING");
- QSpinBox *spinbox = new QSpinBox;
- spinbox->setMaximum(1000000000);
- spinbox->setValue(123456789);
- widgets << spinbox;
- QComboBox *combobox = new QComboBox;
- combobox->setEditable(true);
- combobox->addItems(QStringList() << "TESTING TESTING");
- widgets << combobox;
- widgets << new QLabel("TESTING TESTING");
- foreach (QWidget *widget, widgets) {
+ for (QWidget *widget : sample_widgets()) {
QDialog frame;
QLayout* layout = new QGridLayout;
@@ -887,27 +890,14 @@ void tst_QStyleSheetStyle::focusColors()
}
}
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void tst_QStyleSheetStyle::hoverColors()
{
#ifdef Q_OS_OSX
QSKIP("This test is fragile on Mac, most likely due to QTBUG-33959.");
#endif
- QList<QWidget *> widgets;
- widgets << new QPushButton("TESTING TESTING");
- widgets << new QLineEdit("TESTING TESTING");
- widgets << new QLabel("TESTING TESTING");
- QSpinBox *spinbox = new QSpinBox;
- spinbox->setMaximum(1000000000);
- spinbox->setValue(123456789);
- widgets << spinbox;
- QComboBox *combobox = new QComboBox;
- combobox->setEditable(true);
- combobox->addItems(QStringList() << "TESTING TESTING");
- widgets << combobox;
- widgets << new QLabel("<b>TESTING TESTING</b>");
- foreach (QWidget *widget, widgets) {
+ for (QWidget *widget : sample_widgets()) {
//without Qt::X11BypassWindowManagerHint the window manager may move the window after we moved the cursor
QDialog frame(0, Qt::X11BypassWindowManagerHint);
QLayout* layout = new QGridLayout;
diff --git a/tests/auto/widgets/styles/styles.pro b/tests/auto/widgets/styles/styles.pro
index 0de9dfcdab..9d7464cb5b 100644
--- a/tests/auto/widgets/styles/styles.pro
+++ b/tests/auto/widgets/styles/styles.pro
@@ -5,12 +5,12 @@ SUBDIRS=\
qstyleoption \
qstylesheetstyle \
-!contains(QT_CONFIG, private_tests): SUBDIRS -= \
+!qtConfig(private_tests): SUBDIRS -= \
qstylesheetstyle \
# This test can only be run on Mac OS:
!mac:SUBDIRS -= \
qmacstyle \
-ios|android|qnx|wince: SUBDIRS -= \
+uikit|android|qnx: SUBDIRS -= \
qstylesheetstyle \
diff --git a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
index 50e11611f2..92a8dff218 100644
--- a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
+++ b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
@@ -600,10 +600,7 @@ void tst_QCompleter::directoryModel_data()
if (i == 1)
QTest::newRow("FILTERING_OFF") << "FILTERING_OFF" << "" << "" << "";
-#if defined(Q_OS_WINCE)
- QTest::newRow("()") << "" << "" << "/" << "/";
- QTest::newRow("()") << "\\Program" << "" << "Program Files" << "\\Program Files";
-#elif defined(Q_OS_WIN)
+#if defined(Q_OS_WIN)
QTest::newRow("()") << "C" << "" << "C:" << "C:";
QTest::newRow("()") << "C:\\Program" << "" << "Program Files" << "C:\\Program Files";
#elif defined (Q_OS_MAC)
@@ -649,10 +646,7 @@ void tst_QCompleter::fileSystemModel_data()
if (i == 1)
QTest::newRow("FILTERING_OFF") << "FILTERING_OFF" << "" << "" << "";
-#if defined(Q_OS_WINCE)
- QTest::newRow("()") << "" << "" << "/" << "/";
- QTest::newRow("()") << "\\Program" << "" << "Program Files" << "\\Program Files";
-#elif defined(Q_OS_WIN)
+#if defined(Q_OS_WIN)
QTest::newRow("()") << "C" << "" << "C:" << "C:";
QTest::newRow("()") << "C:\\Program" << "" << "Program Files" << "C:\\Program Files";
#elif defined (Q_OS_MAC)
diff --git a/tests/auto/widgets/util/qscroller/tst_qscroller.cpp b/tests/auto/widgets/util/qscroller/tst_qscroller.cpp
index 2c398e1b2f..67bae43c9d 100644
--- a/tests/auto/widgets/util/qscroller/tst_qscroller.cpp
+++ b/tests/auto/widgets/util/qscroller/tst_qscroller.cpp
@@ -125,6 +125,9 @@ private slots:
void scrollTo();
void scroll();
void overshoot();
+
+private:
+ QTouchDevice *m_touchScreen = QTest::createTouchDevice();
};
/*! \internal
@@ -150,11 +153,8 @@ void tst_QScroller::kineticScroll( tst_QScrollerWidget *sw, QPointF from, QPoint
touchPoint.setPos(touchStart);
touchPoint.setScenePos(touchStart);
touchPoint.setScreenPos(touchStart);
- QTouchDevice *device = new QTouchDevice;
- device->setType(QTouchDevice::TouchScreen);
- QWindowSystemInterface::registerTouchDevice(device);
QTouchEvent touchEvent1(QEvent::TouchBegin,
- device,
+ m_touchScreen,
Qt::NoModifier,
Qt::TouchPointPressed,
(QList<QTouchEvent::TouchPoint>() << touchPoint));
@@ -168,7 +168,7 @@ void tst_QScroller::kineticScroll( tst_QScrollerWidget *sw, QPointF from, QPoint
touchPoint.setScenePos(touchUpdate);
touchPoint.setScreenPos(touchUpdate);
QTouchEvent touchEvent2(QEvent::TouchUpdate,
- device,
+ m_touchScreen,
Qt::NoModifier,
Qt::TouchPointMoved,
(QList<QTouchEvent::TouchPoint>() << touchPoint));
@@ -192,7 +192,7 @@ void tst_QScroller::kineticScroll( tst_QScrollerWidget *sw, QPointF from, QPoint
touchPoint.setScenePos(touchEnd);
touchPoint.setScreenPos(touchEnd);
QTouchEvent touchEvent5(QEvent::TouchEnd,
- device,
+ m_touchScreen,
Qt::NoModifier,
Qt::TouchPointReleased,
(QList<QTouchEvent::TouchPoint>() << touchPoint));
@@ -223,11 +223,8 @@ void tst_QScroller::kineticScrollNoTest( tst_QScrollerWidget *sw, QPointF from,
touchPoint.setPos(touchStart);
touchPoint.setScenePos(touchStart);
touchPoint.setScreenPos(touchStart);
- QTouchDevice *device = new QTouchDevice;
- device->setType(QTouchDevice::TouchScreen);
- QWindowSystemInterface::registerTouchDevice(device);
QTouchEvent touchEvent1(QEvent::TouchBegin,
- device,
+ m_touchScreen,
Qt::NoModifier,
Qt::TouchPointPressed,
(QList<QTouchEvent::TouchPoint>() << touchPoint));
@@ -239,7 +236,7 @@ void tst_QScroller::kineticScrollNoTest( tst_QScrollerWidget *sw, QPointF from,
touchPoint.setScenePos(touchUpdate);
touchPoint.setScreenPos(touchUpdate);
QTouchEvent touchEvent2(QEvent::TouchUpdate,
- device,
+ m_touchScreen,
Qt::NoModifier,
Qt::TouchPointMoved,
(QList<QTouchEvent::TouchPoint>() << touchPoint));
@@ -252,7 +249,7 @@ void tst_QScroller::kineticScrollNoTest( tst_QScrollerWidget *sw, QPointF from,
touchPoint.setScenePos(touchEnd);
touchPoint.setScreenPos(touchEnd);
QTouchEvent touchEvent5(QEvent::TouchEnd,
- device,
+ m_touchScreen,
Qt::NoModifier,
Qt::TouchPointReleased,
(QList<QTouchEvent::TouchPoint>() << touchPoint));
diff --git a/tests/auto/widgets/util/qsystemtrayicon/tst_qsystemtrayicon.cpp b/tests/auto/widgets/util/qsystemtrayicon/tst_qsystemtrayicon.cpp
index a932cf5984..616898c4c5 100644
--- a/tests/auto/widgets/util/qsystemtrayicon/tst_qsystemtrayicon.cpp
+++ b/tests/auto/widgets/util/qsystemtrayicon/tst_qsystemtrayicon.cpp
@@ -107,9 +107,6 @@ void tst_QSystemTrayIcon::getSetCheck()
void tst_QSystemTrayIcon::supportsMessages()
{
// ### fixme: Check platforms.
-#if defined(Q_OS_WINCE)
- QCOMPARE(QSystemTrayIcon::supportsMessages(), false);
-#else
const QString platform = QGuiApplication::platformName();
if (platform.compare(QStringLiteral("xcb"), Qt::CaseInsensitive)
&& platform.compare(QStringLiteral("windows"), Qt::CaseInsensitive)
@@ -117,7 +114,6 @@ void tst_QSystemTrayIcon::supportsMessages()
QEXPECT_FAIL("", "QTBUG-20978 QSystemTrayIcon is unimplemented for this platform", Abort);
}
QCOMPARE(QSystemTrayIcon::supportsMessages(), true);
-#endif
}
void tst_QSystemTrayIcon::lastWindowClosed()
diff --git a/tests/auto/widgets/util/qundostack/tst_qundostack.cpp b/tests/auto/widgets/util/qundostack/tst_qundostack.cpp
index 8573cea35f..a3e7219892 100644
--- a/tests/auto/widgets/util/qundostack/tst_qundostack.cpp
+++ b/tests/auto/widgets/util/qundostack/tst_qundostack.cpp
@@ -1200,6 +1200,150 @@ void tst_QUndoStack::setClean()
true, // undoChanged
true); // redoChanged
QCOMPARE(stack.cleanIndex(), -1);
+
+ stack.setClean();
+ QCOMPARE(str, QString());
+ checkState(redoTextChangedSpy,
+ canRedoChangedSpy,
+ undoTextChangedSpy,
+ redoAction,
+ undoAction,
+ canUndoChangedSpy,
+ cleanChangedSpy,
+ indexChangedSpy,
+ stack,
+ true, // clean
+ 1, // count
+ 0, // index
+ false, // canUndo
+ "", // undoText
+ true, // canRedo
+ "insert", // redoText
+ true, // cleanChanged
+ false, // indexChanged
+ false, // undoChanged
+ false); // redoChanged
+ QCOMPARE(stack.cleanIndex(), 0);
+
+ stack.resetClean();
+ QCOMPARE(str, QString());
+ checkState(redoTextChangedSpy,
+ canRedoChangedSpy,
+ undoTextChangedSpy,
+ redoAction,
+ undoAction,
+ canUndoChangedSpy,
+ cleanChangedSpy,
+ indexChangedSpy,
+ stack,
+ false, // clean
+ 1, // count
+ 0, // index
+ false, // canUndo
+ "", // undoText
+ true, // canRedo
+ "insert", // redoText
+ true, // cleanChanged
+ false, // indexChanged
+ false, // undoChanged
+ false); // redoChanged
+ QCOMPARE(stack.cleanIndex(), -1);
+
+ stack.redo();
+ QCOMPARE(str, QString("foo"));
+ checkState(redoTextChangedSpy,
+ canRedoChangedSpy,
+ undoTextChangedSpy,
+ redoAction,
+ undoAction,
+ canUndoChangedSpy,
+ cleanChangedSpy,
+ indexChangedSpy,
+ stack,
+ false, // clean
+ 1, // count
+ 1, // index
+ true, // canUndo
+ "insert", // undoText
+ false, // canRedo
+ "", // redoText
+ false, // cleanChanged
+ true, // indexChanged
+ true, // undoChanged
+ true); // redoChanged
+ QCOMPARE(stack.cleanIndex(), -1);
+
+ stack.setClean();
+ QCOMPARE(str, QString("foo"));
+ checkState(redoTextChangedSpy,
+ canRedoChangedSpy,
+ undoTextChangedSpy,
+ redoAction,
+ undoAction,
+ canUndoChangedSpy,
+ cleanChangedSpy,
+ indexChangedSpy,
+ stack,
+ true, // clean
+ 1, // count
+ 1, // index
+ true, // canUndo
+ "insert", // undoText
+ false, // canRedo
+ "", // redoText
+ true, // cleanChanged
+ false, // indexChanged
+ false, // undoChanged
+ false); // redoChanged
+ QCOMPARE(stack.cleanIndex(), 1);
+
+ stack.undo();
+ QCOMPARE(str, QString());
+ checkState(redoTextChangedSpy,
+ canRedoChangedSpy,
+ undoTextChangedSpy,
+ redoAction,
+ undoAction,
+ canUndoChangedSpy,
+ cleanChangedSpy,
+ indexChangedSpy,
+ stack,
+ false, // clean
+ 1, // count
+ 0, // index
+ false, // canUndo
+ "", // undoText
+ true, // canRedo
+ "insert", // redoText
+ true, // cleanChanged
+ true, // indexChanged
+ true, // undoChanged
+ true); // redoChanged
+ QCOMPARE(stack.cleanIndex(), 1);
+
+ stack.resetClean();
+ QCOMPARE(str, QString());
+ checkState(redoTextChangedSpy,
+ canRedoChangedSpy,
+ undoTextChangedSpy,
+ redoAction,
+ undoAction,
+ canUndoChangedSpy,
+ cleanChangedSpy,
+ indexChangedSpy,
+ stack,
+ false, // clean
+ 1, // count
+ 0, // index
+ false, // canUndo
+ "", // undoText
+ true, // canRedo
+ "insert", // redoText
+ false, // cleanChanged
+ false, // indexChanged
+ false, // undoChanged
+ false); // redoChanged
+ QCOMPARE(stack.cleanIndex(), -1);
}
void tst_QUndoStack::clear()
diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
index 50024460fc..edaf033678 100644
--- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
@@ -62,6 +62,7 @@
#include <qstyleditemdelegate.h>
#include <qstandarditemmodel.h>
#include <qproxystyle.h>
+#include <qfont.h>
static inline void setFrameless(QWidget *w)
{
@@ -78,9 +79,6 @@ class tst_QComboBox : public QObject
public:
tst_QComboBox() {}
-public slots:
- void init();
-
private slots:
void getSetCheck();
void ensureReturnIsIgnored();
@@ -163,6 +161,7 @@ private slots:
void respectChangedOwnershipOfItemView();
void task_QTBUG_39088_inputMethodHints();
void task_QTBUG_49831_scrollerNotActivated();
+ void task_QTBUG_56693_itemFontFromModel();
};
class MyAbstractItemDelegate : public QAbstractItemDelegate
@@ -396,13 +395,6 @@ private:
};
-void tst_QComboBox::init()
-{
-#ifdef Q_OS_WINCE //disable magic for WindowsCE
- qApp->setAutoMaximizeThreshold(-1);
-#endif
-}
-
void tst_QComboBox::setEditable()
{
TestWidget topLevel;
@@ -2753,7 +2745,7 @@ void tst_QComboBox::keyBoardNavigationWithMouse()
QCOMPARE(combo.currentText(), QLatin1String("0"));
// When calling cursor function, Windows CE responds with: This function is not supported on this system.
-#if !defined Q_OS_WINCE && !defined Q_OS_QNX
+#if !defined Q_OS_QNX
// Force cursor movement to prevent QCursor::setPos() from returning prematurely on QPA:
centerCursor(combo.view());
QTest::qWait(200);
@@ -3260,5 +3252,77 @@ void tst_QComboBox::task_QTBUG_49831_scrollerNotActivated()
}
}
+class QTBUG_56693_Model : public QStandardItemModel
+{
+public:
+ QTBUG_56693_Model(QObject *parent = Q_NULLPTR)
+ : QStandardItemModel(parent)
+ { }
+
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override
+ {
+ if (role == Qt::FontRole) {
+ if (index.row() < 5) {
+ QFont font = QApplication::font();
+ font.setItalic(true);
+ return font;
+ } else {
+ return QApplication::font();
+ }
+ }
+ return QStandardItemModel::data(index, role);
+ }
+};
+
+class QTBUG_56693_ProxyStyle : public QProxyStyle
+{
+public:
+ QTBUG_56693_ProxyStyle(QStyle *style)
+ : QProxyStyle(style), italicItemsNo(0)
+ {
+
+ }
+
+ void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w = Q_NULLPTR) const override
+ {
+ if (element == CE_MenuItem)
+ if (const QStyleOptionMenuItem *menuItem = qstyleoption_cast<const QStyleOptionMenuItem *>(opt))
+ if (menuItem->font.italic())
+ italicItemsNo++;
+
+ baseStyle()->drawControl(element, opt, p, w);
+ }
+
+ mutable int italicItemsNo;
+};
+
+void tst_QComboBox::task_QTBUG_56693_itemFontFromModel()
+{
+ QComboBox box;
+ if (!qobject_cast<QComboMenuDelegate *>(box.itemDelegate()))
+ QSKIP("Only for combo boxes using QComboMenuDelegate");
+
+ QTBUG_56693_Model model;
+ box.setModel(&model);
+
+ QTBUG_56693_ProxyStyle *proxyStyle = new QTBUG_56693_ProxyStyle(box.style());
+ box.setStyle(proxyStyle);
+ box.setFont(QApplication::font());
+
+ for (int i = 0; i < 10; i++)
+ box.addItem(QLatin1String("Item ") + QString::number(i));
+
+ box.show();
+ QTest::qWaitForWindowExposed(&box);
+ box.showPopup();
+ QFrame *container = box.findChild<QComboBoxPrivateContainer *>();
+ QVERIFY(container);
+ QTest::qWaitForWindowExposed(container);
+
+ QCOMPARE(proxyStyle->italicItemsNo, 5);
+
+ box.hidePopup();
+}
+
QTEST_MAIN(tst_QComboBox)
#include "tst_qcombobox.moc"
diff --git a/tests/auto/widgets/widgets/qdatetimeedit/qdatetimeedit.pro b/tests/auto/widgets/widgets/qdatetimeedit/qdatetimeedit.pro
index 411185ae2a..c4bc1cab21 100644
--- a/tests/auto/widgets/widgets/qdatetimeedit/qdatetimeedit.pro
+++ b/tests/auto/widgets/widgets/qdatetimeedit/qdatetimeedit.pro
@@ -2,5 +2,3 @@ CONFIG += testcase
TARGET = tst_qdatetimeedit
QT += widgets testlib core-private widgets-private
SOURCES += tst_qdatetimeedit.cpp
-
-wincewm50smart-msvc2005: DEFINES += WINCE_NO_MODIFIER_KEYS
diff --git a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
index 31eb05a957..09ab20f7ca 100644
--- a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
+++ b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
@@ -84,30 +84,6 @@ Q_DECLARE_METATYPE(Qt::Key);
Q_DECLARE_METATYPE(Qt::KeyboardModifiers);
Q_DECLARE_METATYPE(Qt::KeyboardModifier);
-#if defined(Q_OS_WINCE)
-#ifndef SPI_GETPLATFORMTYPE
-#define SPI_GETPLATFORMTYPE 257
-#endif
-
-bool qt_wince_is_platform(const QString &platformString) {
- wchar_t tszPlatform[64];
- if (SystemParametersInfo(SPI_GETPLATFORMTYPE,
- sizeof(tszPlatform)/sizeof(*tszPlatform),tszPlatform,0))
- if (0 == _tcsicmp(reinterpret_cast<const wchar_t *> (platformString.utf16()), tszPlatform))
- return true;
- return false;
-}
-bool qt_wince_is_pocket_pc() {
- return qt_wince_is_platform(QString::fromLatin1("PocketPC"));
-}
-bool qt_wince_is_smartphone() {
- return qt_wince_is_platform(QString::fromLatin1("Smartphone"));
-}
-bool qt_wince_is_mobile() {
- return (qt_wince_is_smartphone() || qt_wince_is_pocket_pc());
-}
-#endif
-
class EditorDateEdit : public QDateTimeEdit
{
Q_OBJECT
@@ -332,7 +308,7 @@ void tst_QDateTimeEdit::cleanupTestCase()
void tst_QDateTimeEdit::init()
{
QLocale::setDefault(QLocale(QLocale::C));
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
SetThreadLocale(MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT));
#endif
testWidget->setDisplayFormat("dd/MM/yyyy"); // Nice default to have
@@ -3108,7 +3084,7 @@ void tst_QDateTimeEdit::nextPrevSection_data()
// 1. mac doesn't do these,
// 2. some WinCE devices do not have modifiers
-#if !defined(Q_OS_MAC) && !defined(WINCE_NO_MODIFIER_KEYS)
+#if !defined(Q_OS_DARWIN)
QTest::newRow("ctrl-right") << Qt::Key_Right << (Qt::KeyboardModifiers)Qt::ControlModifier << QString("56");
QTest::newRow("ctrl-left") << Qt::Key_Left << (Qt::KeyboardModifiers)Qt::ControlModifier << QString("12");
#endif
diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
index 598b518810..a4614d0a9d 100644
--- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
+++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
@@ -70,8 +70,6 @@
#include "../../../shared/platforminputcontext.h"
#include <private/qinputmethod_p.h>
-#include "../../../qtest-config.h"
-
QT_BEGIN_NAMESPACE
class QPainter;
QT_END_NAMESPACE
@@ -252,7 +250,7 @@ private slots:
void noTextEditedOnClear();
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void cursor();
#endif
@@ -3484,7 +3482,7 @@ void tst_QLineEdit::textMargin()
QTRY_COMPARE(testWidget.cursorPosition(), cursorPosition);
}
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void tst_QLineEdit::cursor()
{
QLineEdit *testWidget = ensureTestWidget();
diff --git a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
index 6ee5f76c6a..680fea27dd 100644
--- a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
+++ b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
@@ -45,7 +45,9 @@
#include <private/qmainwindowlayout_p.h>
#include <private/qdockarealayout_p.h>
-#include "../../../qtest-config.h"
+#ifndef QT_NO_TABBAR
+#include <qtabbar.h>
+#endif
static uchar restoreData41[] = { 0x0, 0x0, 0x0, 0xff, 0x0, 0x0, 0x0, 0x0, 0xfc, 0x0, 0x0, 0x0, 0x0, 0xfd, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x64, 0x0, 0x0, 0x1, 0x19, 0xfc, 0x2, 0x0, 0x0, 0x0, 0x4, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x30, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x45, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x34, 0x1, 0x0, 0x0, 0x0, 0x49, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x38, 0x1, 0x0, 0x0, 0x0, 0x8d, 0x0, 0x0, 0x0, 0x43, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x32, 0x1, 0x0, 0x0, 0x0, 0xd4, 0x0, 0x0, 0x0, 0x45, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x64, 0x0, 0x0, 0x1, 0x19, 0xfc, 0x2, 0x0, 0x0, 0x0, 0x4, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x45, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x35, 0x1, 0x0, 0x0, 0x0, 0x49, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x39, 0x1, 0x0, 0x0, 0x0, 0x8d, 0x0, 0x0, 0x0, 0x43, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x33, 0x1, 0x0, 0x0, 0x0, 0xd4, 0x0, 0x0, 0x0, 0x45, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x1, 0x89, 0x0, 0x0, 0x0, 0xe, 0xfc, 0x1, 0x0, 0x0, 0x0, 0x4, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x32, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5f, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x36, 0x1, 0x0, 0x0, 0x0, 0x63, 0x0, 0x0, 0x0, 0x61, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x30, 0x1, 0x0, 0x0, 0x0, 0xc8, 0x0, 0x0, 0x0, 0x5e, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x34, 0x1, 0x0, 0x0, 0x1, 0x2a, 0x0, 0x0, 0x0, 0x5f, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x3, 0x0, 0x0, 0x1, 0x89, 0x0, 0x0, 0x0, 0xe, 0xfc, 0x1, 0x0, 0x0, 0x0, 0x4, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x33, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5f, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x37, 0x1, 0x0, 0x0, 0x0, 0x63, 0x0, 0x0, 0x0, 0x61, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x31, 0x1, 0x0, 0x0, 0x0, 0xc8, 0x0, 0x0, 0x0, 0x5e, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x35, 0x1, 0x0, 0x0, 0x1, 0x2a, 0x0, 0x0, 0x0, 0x5f, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0xc1, 0x0, 0x0, 0x1, 0x19};
static uchar restoreData42[] = { 0x0, 0x0, 0x0, 0xff, 0x0, 0x0, 0x0, 0x0, 0xfc, 0x0, 0x0, 0x0, 0x0, 0xfd, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x24, 0x0, 0x0, 0x2, 0x2b, 0xfc, 0x2, 0x0, 0x0, 0x0, 0x4, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x30, 0x1, 0x0, 0x0, 0x0, 0x2a, 0x0, 0x0, 0x0, 0x88, 0x0, 0x0, 0x0, 0x21, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x34, 0x1, 0x0, 0x0, 0x0, 0xb6, 0x0, 0x0, 0x0, 0x88, 0x0, 0x0, 0x0, 0x21, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x38, 0x1, 0x0, 0x0, 0x1, 0x42, 0x0, 0x0, 0x0, 0x87, 0x0, 0x0, 0x0, 0x21, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x32, 0x1, 0x0, 0x0, 0x1, 0xcd, 0x0, 0x0, 0x0, 0x88, 0x0, 0x0, 0x0, 0x21, 0x0, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x98, 0x0, 0x0, 0x2, 0x2b, 0xfc, 0x2, 0x0, 0x0, 0x0, 0x4, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x1, 0x0, 0x0, 0x0, 0x2a, 0x0, 0x0, 0x0, 0x88, 0x0, 0x0, 0x0, 0x21, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x35, 0x1, 0x0, 0x0, 0x0, 0xb6, 0x0, 0x0, 0x0, 0x88, 0x0, 0x0, 0x0, 0x21, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x39, 0x1, 0x0, 0x0, 0x1, 0x42, 0x0, 0x0, 0x0, 0x87, 0x0, 0x0, 0x0, 0x21, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x33, 0x1, 0x0, 0x0, 0x1, 0xcd, 0x0, 0x0, 0x0, 0x88, 0x0, 0x0, 0x0, 0x21, 0x0, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x4, 0x4e, 0x0, 0x0, 0x0, 0x26, 0xfc, 0x1, 0x0, 0x0, 0x0, 0x4, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x32, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x12, 0x0, 0x0, 0x0, 0xa, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x36, 0x1, 0x0, 0x0, 0x1, 0x16, 0x0, 0x0, 0x1, 0xe, 0x0, 0x0, 0x0, 0xa, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x30, 0x1, 0x0, 0x0, 0x2, 0x28, 0x0, 0x0, 0x1, 0x14, 0x0, 0x0, 0x0, 0xa, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x34, 0x1, 0x0, 0x0, 0x3, 0x40, 0x0, 0x0, 0x1, 0xe, 0x0, 0x0, 0x0, 0xa, 0x0, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x3, 0x0, 0x0, 0x4, 0x4e, 0x0, 0x0, 0x0, 0x26, 0xfc, 0x1, 0x0, 0x0, 0x0, 0x4, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x33, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x12, 0x0, 0x0, 0x0, 0xa, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x37, 0x1, 0x0, 0x0, 0x1, 0x16, 0x0, 0x0, 0x1, 0xe, 0x0, 0x0, 0x0, 0xa, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x31, 0x1, 0x0, 0x0, 0x2, 0x28, 0x0, 0x0, 0x1, 0x14, 0x0, 0x0, 0x0, 0xa, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x35, 0x1, 0x0, 0x0, 0x3, 0x40, 0x0, 0x0, 0x1, 0xe, 0x0, 0x0, 0x0, 0xa, 0x0, 0xff, 0xff, 0xff, 0x0, 0x0, 0x3, 0x8a, 0x0, 0x0, 0x2, 0x2b, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x8};
@@ -131,7 +133,7 @@ private slots:
void contentsMargins_data();
void contentsMargins();
void isSeparator();
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void setCursor();
#endif
void addToolbarAfterShow();
@@ -146,6 +148,9 @@ private slots:
void QTBUG21378_animationFinished();
void resizeDocks();
void resizeDocks_data();
+#if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_TABBAR)
+ void QTBUG52175_tabifiedDockWidgetActivated();
+#endif
};
@@ -595,9 +600,6 @@ void tst_QMainWindow::menuBar()
mw.setMenuBar(mb1);
QVERIFY(mw.menuBar() != 0);
QCOMPARE(mw.menuBar(), (QMenuBar *)mb1);
-#ifdef Q_OS_WINCE_WM
- QSKIP("With native menubar integration the menubar is not a child");
-#endif
QCOMPARE(mb1->parentWidget(), (QWidget *)&mw);
mw.setMenuBar(0);
@@ -1732,7 +1734,7 @@ class MainWindow : public QMainWindow {
using QMainWindow::event;
};
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void tst_QMainWindow::setCursor()
{
MainWindow mw;
@@ -2042,5 +2044,52 @@ void tst_QMainWindow::resizeDocks()
}
}
+#if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_TABBAR)
+void tst_QMainWindow::QTBUG52175_tabifiedDockWidgetActivated()
+{
+ QMainWindow w;
+
+ QDockWidget *dwFirst = new QDockWidget(&w);
+ dwFirst->setWidget(new QWidget(dwFirst));
+ w.addDockWidget(Qt::LeftDockWidgetArea, dwFirst);
+
+ QDockWidget *dwSecond = new QDockWidget(&w);
+ dwSecond->setWidget(new QWidget(dwSecond));
+ w.addDockWidget(Qt::LeftDockWidgetArea, dwSecond);
+
+ w.tabifyDockWidget(dwFirst, dwSecond);
+ w.show();
+ QVERIFY(QTest::qWaitForWindowActive(&w));
+
+ QTabBar *tabBar = w.findChild<QTabBar *>();
+ QVERIFY(tabBar);
+
+ QDockWidget *activated = nullptr;
+ connect(&w, &QMainWindow::tabifiedDockWidgetActivated, [&activated](QDockWidget *dockWidget)
+ {
+ activated = dockWidget;
+ });
+
+ w.hide();
+ QCoreApplication::processEvents();
+ QCOMPARE(activated, nullptr);
+
+ w.show();
+ QCoreApplication::processEvents();
+ QCOMPARE(activated, nullptr);
+
+ tabBar->setCurrentIndex(1);
+ QCoreApplication::processEvents();
+ QCOMPARE(activated, nullptr);
+
+ tabBar->setCurrentIndex(0);
+ QTRY_COMPARE(activated, dwFirst);
+ activated = nullptr;
+
+ tabBar->setCurrentIndex(1);
+ QTRY_COMPARE(activated, dwSecond);
+}
+#endif
+
QTEST_MAIN(tst_QMainWindow)
#include "tst_qmainwindow.moc"
diff --git a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
index 809fa56a61..52d7a39406 100644
--- a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
+++ b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
@@ -228,7 +228,6 @@ class tst_QMdiArea : public QObject
public:
tst_QMdiArea();
public slots:
- void initTestCase();
void cleanup();
protected slots:
@@ -293,13 +292,6 @@ tst_QMdiArea::tst_QMdiArea()
qRegisterMetaType<QMdiSubWindow *>();
}
-void tst_QMdiArea::initTestCase()
-{
-#ifdef Q_OS_WINCE //disable magic for WindowsCE
- qApp->setAutoMaximizeThreshold(-1);
-#endif
-}
-
void tst_QMdiArea::cleanup()
{
QVERIFY(QApplication::topLevelWidgets().isEmpty());
@@ -482,7 +474,7 @@ void tst_QMdiArea::subWindowActivated2()
// Check that we only emit _one_ signal and the active window
// is unchanged after hide/show.
mdiArea.hide();
-#ifdef Q_DEAD_CODE_FROM_QT4_X11
+#if 0 // Used to be included in Qt4 for Q_WS_X11
qt_x11_wait_for_window_manager(&mdiArea);
#endif
QTest::qWait(100);
@@ -509,9 +501,6 @@ void tst_QMdiArea::subWindowActivated2()
if (!macHasAccessToWindowsServer())
QEXPECT_FAIL("", "showMinimized doesn't really minimize if you don't have access to the server", Abort);
#endif
-#ifdef Q_OS_WINCE
- QSKIP("Not fixed yet. See Task 197453");
-#endif
#ifdef Q_OS_MAC
QSKIP("QTBUG-25298: This test is unstable on Mac.");
#endif
@@ -649,7 +638,7 @@ void tst_QMdiArea::changeWindowTitle()
#else
widget->setWindowState(Qt::WindowMaximized);
#endif
-#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_DARWIN)
QTRY_COMPARE( mw->windowTitle(), windowTitle(mwc, wc) );
#endif
@@ -658,7 +647,7 @@ void tst_QMdiArea::changeWindowTitle()
mw->show();
QVERIFY(QTest::qWaitForWindowExposed(mw));
-#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_DARWIN)
QTRY_COMPARE( mw->windowTitle(), windowTitle(mwc, wc) );
#endif
@@ -676,7 +665,7 @@ void tst_QMdiArea::changeWindowTitle()
widget->setWindowState(Qt::WindowMaximized);
#endif
qApp->processEvents();
-#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_DARWIN)
QTRY_COMPARE( mw->windowTitle(), windowTitle(mwc, wc) );
widget->setWindowTitle( wc2 );
QCOMPARE( mw->windowTitle(), windowTitle(mwc, wc2) );
@@ -694,7 +683,7 @@ void tst_QMdiArea::changeWindowTitle()
#endif
qApp->processEvents();
-#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_DARWIN)
QCOMPARE( mw->windowTitle(), windowTitle(mwc2, wc2) );
#endif
#ifdef USE_SHOW
@@ -703,7 +692,7 @@ void tst_QMdiArea::changeWindowTitle()
widget->setWindowState(Qt::WindowNoState);
#endif
qApp->processEvents();
-#if defined(Q_OS_MAC) || defined(Q_OS_WINCE)
+#if defined(Q_OS_DARWIN)
QCOMPARE(mw->windowTitle(), mwc);
#else
QCOMPARE( mw->windowTitle(), mwc2 );
@@ -715,7 +704,7 @@ void tst_QMdiArea::changeWindowTitle()
widget->setWindowState(Qt::WindowMaximized);
#endif
qApp->processEvents();
-#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_DARWIN)
QCOMPARE( mw->windowTitle(), windowTitle(mwc2, wc2) );
#endif
@@ -764,7 +753,7 @@ void tst_QMdiArea::changeModified()
QCOMPARE( mw->isWindowModified(), false);
QCOMPARE( widget->isWindowModified(), true);
widget->setWindowState(Qt::WindowMaximized);
-#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_DARWIN)
QCOMPARE( mw->isWindowModified(), true);
#endif
QCOMPARE( widget->isWindowModified(), true);
@@ -774,7 +763,7 @@ void tst_QMdiArea::changeModified()
QCOMPARE( widget->isWindowModified(), true);
widget->setWindowState(Qt::WindowMaximized);
-#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_DARWIN)
QCOMPARE( mw->isWindowModified(), true);
#endif
QCOMPARE( widget->isWindowModified(), true);
@@ -784,7 +773,7 @@ void tst_QMdiArea::changeModified()
QCOMPARE( widget->isWindowModified(), false);
widget->setWindowModified(true);
-#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_DARWIN)
QCOMPARE( mw->isWindowModified(), true);
#endif
QCOMPARE( widget->isWindowModified(), true);
@@ -1598,9 +1587,7 @@ void tst_QMdiArea::tileSubWindows()
qApp->processEvents();
}
workspace.setActiveSubWindow(0);
-#ifndef Q_OS_WINCE //See Task 197453 ToDo
QCOMPARE(workspace.viewport()->childrenRect(), workspace.viewport()->rect());
-#endif
QMdiSubWindow *window = windows.at(0);
@@ -1724,9 +1711,6 @@ void tst_QMdiArea::tileSubWindows()
frameWidth = workspace.style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
const int spacing = 2 * frameWidth + 2;
const QSize expectedViewportSize(3 * minSize.width() + spacing, 3 * minSize.height() + spacing);
-#ifdef Q_OS_WINCE
- QSKIP("Not fixed yet! See task 197453");
-#endif
QTRY_COMPARE(workspace.viewport()->rect().size(), expectedViewportSize);
// Restore original scrollbar behavior for test below
@@ -2005,7 +1989,7 @@ void tst_QMdiArea::delayedPlacement()
void tst_QMdiArea::iconGeometryInMenuBar()
{
-#if !defined (Q_OS_MAC) && !defined(Q_OS_WINCE)
+#if !defined (Q_OS_DARWIN)
QMainWindow mainWindow;
QMenuBar *menuBar = mainWindow.menuBar();
menuBar->setNativeMenuBar(false);
@@ -2063,11 +2047,7 @@ void tst_QMdiArea::resizeTimer()
mdiArea.show();
QVERIFY(QTest::qWaitForWindowActive(&mdiArea));
-#ifndef Q_OS_WINCE
int time = 250;
-#else
- int time = 1000;
-#endif
EventSpy timerEventSpy(subWindow, QEvent::Timer);
QCOMPARE(timerEventSpy.count(), 0);
diff --git a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
index 3fbb9a3f3f..a9d8c48d63 100644
--- a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
+++ b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
@@ -48,10 +48,8 @@
#include <QScreen>
#include <QSizeGrip>
-#include "../../../qtest-config.h"
-
QT_BEGIN_NAMESPACE
-#if !defined(Q_DEAD_CODE_FROM_QT4_WIN)
+#if 1 // Used to be excluded in Qt4 for Q_WS_WIN
extern bool qt_tab_all_widgets();
#endif
QT_END_NAMESPACE
@@ -161,7 +159,7 @@ private slots:
void showShaded();
void showNormal_data();
void showNormal();
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void setOpaqueResizeAndMove_data();
void setOpaqueResizeAndMove();
#endif
@@ -184,7 +182,7 @@ private slots:
void explicitlyHiddenWidget();
void resizeTimer();
void fixedMinMaxSize();
-#if !defined (Q_OS_MAC) && !defined (Q_OS_WINCE)
+#if !defined (Q_OS_DARWIN)
void replaceMenuBarWhileMaximized();
void closeOnDoubleClick_data();
void closeOnDoubleClick();
@@ -575,10 +573,6 @@ void tst_QMdiSubWindow::showShaded()
window->showNormal();
QTest::qWait(250);
-#ifdef Q_OS_WINCE
- QSKIP("Until we have a QEvent::WindowFlagsChange event, this will skip");
-#endif
-
const QSize minimumSizeHint = window->minimumSizeHint();
QVERIFY(minimumSizeHint.height() < 300);
const int maxHeightDiff = 300 - minimumSizeHint.height();
@@ -669,7 +663,7 @@ private:
int _count;
};
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void tst_QMdiSubWindow::setOpaqueResizeAndMove_data()
{
QTest::addColumn<bool>("opaqueMode");
@@ -1010,7 +1004,7 @@ void tst_QMdiSubWindow::setSystemMenu()
systemMenu->hide();
QVERIFY(!qApp->activePopupWidget());
-#if !defined (Q_OS_MAC) && !defined (Q_OS_WINCE)
+#if !defined (Q_OS_DARWIN)
// System menu in menu bar.
subWindow->showMaximized();
QVERIFY(subWindow->isMaximized());
@@ -1043,7 +1037,7 @@ void tst_QMdiSubWindow::setSystemMenu()
systemMenu->hide();
QVERIFY(!qApp->activePopupWidget());
-#if !defined (Q_OS_MAC) && !defined (Q_OS_WINCE)
+#if !defined (Q_OS_DARWIN)
// System menu in menu bar in reverse mode.
subWindow->showMaximized();
QVERIFY(subWindow->isMaximized());
@@ -1474,7 +1468,7 @@ void tst_QMdiSubWindow::hideAndShow()
QVERIFY(!menuBar->cornerWidget(Qt::TopRightCorner));
QMdiSubWindow *subWindow = mdiArea->addSubWindow(new QTextEdit);
subWindow->showMaximized();
-#if !defined (Q_OS_MAC) && !defined (Q_OS_WINCE)
+#if !defined (Q_OS_DARWIN)
QVERIFY(menuBar->cornerWidget(Qt::TopRightCorner));
QCOMPARE(menuBar->cornerWidget(Qt::TopRightCorner), subWindow->maximizedButtonsWidget());
#endif
@@ -1489,7 +1483,7 @@ void tst_QMdiSubWindow::hideAndShow()
// Show QMdiArea.
tabWidget->setCurrentIndex(0);
-#if !defined (Q_OS_MAC) && !defined (Q_OS_WINCE)
+#if !defined (Q_OS_DARWIN)
QVERIFY(menuBar->cornerWidget(Qt::TopRightCorner));
QVERIFY(subWindow->maximizedButtonsWidget());
QVERIFY(subWindow->maximizedSystemMenuIconWidget());
@@ -1511,7 +1505,7 @@ void tst_QMdiSubWindow::hideAndShow()
QVERIFY(subWindow);
QCOMPARE(mdiArea->activeSubWindow(), subWindow);
-#if !defined (Q_OS_MAC) && !defined (Q_OS_WINCE)
+#if !defined (Q_OS_DARWIN)
QVERIFY(menuBar->cornerWidget(Qt::TopRightCorner));
#if defined Q_OS_QNX
QEXPECT_FAIL("", "QTBUG-38231", Abort);
@@ -1539,7 +1533,7 @@ void tst_QMdiSubWindow::hideAndShow()
QVERIFY(!menuBar->cornerWidget(Qt::TopRightCorner));
subWindow->show();
-#if !defined (Q_OS_MAC) && !defined (Q_OS_WINCE)
+#if !defined (Q_OS_DARWIN)
QVERIFY(subWindow->maximizedButtonsWidget());
QVERIFY(subWindow->maximizedSystemMenuIconWidget());
QCOMPARE(menuBar->cornerWidget(Qt::TopRightCorner), subWindow->maximizedButtonsWidget());
@@ -1553,7 +1547,7 @@ void tst_QMdiSubWindow::hideAndShow()
// Show QMainWindow.
mainWindow.show();
-#if !defined (Q_OS_MAC) && !defined (Q_OS_WINCE)
+#if !defined (Q_OS_DARWIN)
QVERIFY(subWindow->maximizedButtonsWidget());
QVERIFY(subWindow->maximizedSystemMenuIconWidget());
QCOMPARE(menuBar->cornerWidget(Qt::TopRightCorner), subWindow->maximizedButtonsWidget());
@@ -1723,7 +1717,7 @@ void tst_QMdiSubWindow::fixedMinMaxSize()
QCOMPARE(subWindow->size(), minimumSize);
}
-#if !defined( Q_OS_MAC) && !defined( Q_OS_WINCE)
+#if !defined( Q_OS_DARWIN)
void tst_QMdiSubWindow::replaceMenuBarWhileMaximized()
{
diff --git a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
index 741d6839db..cb7643d1ac 100644
--- a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
+++ b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
@@ -81,9 +81,7 @@ private slots:
void overrideMenuAction();
void statusTip();
void widgetActionFocus();
-#ifndef Q_OS_WINCE
void mouseActivation();
-#endif
void tearOff();
void submenuTearOffDontClose();
void layoutDirection();
@@ -96,9 +94,7 @@ private slots:
void task250673_activeMultiColumnSubMenuPosition();
void task256918_setFont();
void menuSizeHint();
-#ifndef Q_OS_WINCE
void task258920_mouseBorder();
-#endif
void setFixedWidth();
void deleteActionInTriggered();
void pushButtonPopulateOnAboutToShow();
@@ -293,8 +289,6 @@ void tst_QMenu::addActionsConnect()
#endif // !QT_NO_SHORTCUT
}
-// We have a separate mouseActivation test for Windows mobile
-#ifndef Q_OS_WINCE
void tst_QMenu::mouseActivation()
{
QWidget topLevel;
@@ -334,7 +328,6 @@ void tst_QMenu::mouseActivation()
QVERIFY(submenu.isVisible());
#endif
}
-#endif
void tst_QMenu::keyboardNavigation_data()
{
@@ -465,7 +458,7 @@ void tst_QMenu::overrideMenuAction()
// On Mac and Windows CE, we need to create native key events to test menu
// action activation, so skip this part of the test.
-#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_DARWIN)
QAction *aQuit = new QAction("Quit", &w);
aQuit->setShortcut(QKeySequence("Ctrl+X"));
m->addAction(aQuit);
@@ -762,10 +755,8 @@ void tst_QMenu::activeSubMenuPosition()
QVERIFY(sub->pos() != QPoint(0,0));
// well, it's enough to check the pos is not (0,0) but it's more safe
// to check that submenu is to the right of the main menu too.
-#ifndef Q_OS_WINCE_WM
QVERIFY(sub->pos().x() > main->pos().x());
QCOMPARE(sub->activeAction(), subAction);
-#endif
}
// QTBUG-49588, QTBUG-48396: activeSubMenuPositionExec() is the same as
@@ -817,10 +808,8 @@ private:
void tst_QMenu::activeSubMenuPositionExec()
{
-#ifndef Q_OS_WINCE
SubMenuPositionExecMenu menu;
menu.exec(QGuiApplication::primaryScreen()->availableGeometry().center());
-#endif // !Q_OS_WINCE
}
void tst_QMenu::task242454_sizeHint()
@@ -954,7 +943,6 @@ public:
};
// Mouse move related signals for Windows Mobile unavailable
-#ifndef Q_OS_WINCE
void tst_QMenu::task258920_mouseBorder()
{
Menu258920 menu;
@@ -983,7 +971,6 @@ void tst_QMenu::task258920_mouseBorder()
QTRY_COMPARE(static_cast<QAction*>(0), menu.activeAction());
QTRY_VERIFY(menu.painted);
}
-#endif
void tst_QMenu::setFixedWidth()
{
diff --git a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
index 9a68655fb6..3a4c4545df 100644
--- a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
+++ b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
@@ -90,7 +90,7 @@ private slots:
void count();
void insertItem_QString_QObject();
-#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_DARWIN)
void accel();
void activatedCount();
@@ -115,7 +115,7 @@ private slots:
void check_altPress();
void check_altClosePress();
-#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_DARWIN)
void check_shortcutPress();
void check_menuPosition();
#endif
@@ -134,6 +134,8 @@ private slots:
void taskQTBUG56275_reinsertMenuInParentlessQMenuBar();
#endif
+ void platformMenu();
+
protected slots:
void onSimpleActivated( QAction*);
void onComplexActionTriggered();
@@ -314,7 +316,7 @@ inline TestMenu tst_QMenuBar::initWindowWithComplexMenuBar(QMainWindow &w)
}
// On Mac/WinCE, native key events are needed to test menu action activation
-#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_DARWIN)
void tst_QMenuBar::accel()
{
// create a popup menu with menu items set the accelerators later...
@@ -332,7 +334,7 @@ void tst_QMenuBar::accel()
#endif
// On Mac/WinCE, native key events are needed to test menu action activation
-#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_DARWIN)
void tst_QMenuBar::activatedCount()
{
// create a popup menu with menu items set the accelerators later...
@@ -523,7 +525,7 @@ void tst_QMenuBar::insertItem_QString_QObject()
}
// On Mac/WinCE, native key events are needed to test menu action activation
-#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_DARWIN)
void tst_QMenuBar::check_accelKeys()
{
QMainWindow w;
@@ -596,7 +598,7 @@ void tst_QMenuBar::check_accelKeys()
#endif
// On Mac/WinCE, native key events are needed to test menu action activation
-#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_DARWIN)
void tst_QMenuBar::check_cursorKeys1()
{
QMainWindow w;
@@ -630,7 +632,7 @@ void tst_QMenuBar::check_cursorKeys1()
#endif
// Qt/Mac,WinCE does not use the native popups/menubar
-#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_DARWIN)
void tst_QMenuBar::check_cursorKeys2()
{
QMainWindow w;
@@ -663,7 +665,7 @@ void tst_QMenuBar::check_cursorKeys2()
If a popupmenu is active you can use Left to move to the menu to the left of it.
*/
// Qt/Mac,WinCE does not use the native popups/menubar
-#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_DARWIN)
void tst_QMenuBar::check_cursorKeys3()
{
QMainWindow w;
@@ -778,7 +780,7 @@ void tst_QMenuBar::check_endKey()
*/
// Qt/Mac,WinCE does not use the native popups/menubar
-#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_DARWIN)
void tst_QMenuBar::check_escKey()
{
QMainWindow w;
@@ -923,7 +925,6 @@ void tst_QMenuBar::check_escKey()
// QCOMPARE(m_complexActionTriggerCount['h'], (uint)itemH_count);
// }
-#ifndef Q_OS_WINCE
void tst_QMenuBar::allowActiveAndDisabled()
{
QMenuBar menuBar;
@@ -963,7 +964,6 @@ void tst_QMenuBar::allowActiveAndDisabled()
else
QCOMPARE(menuBar.activeAction()->text(), fileMenu.title());
}
-#endif
void tst_QMenuBar::check_altPress()
{
@@ -1014,7 +1014,7 @@ void tst_QMenuBar::check_altClosePress()
}
// Qt/Mac,WinCE does not use the native popups/menubar
-#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_DARWIN)
void tst_QMenuBar::check_shortcutPress()
{
QMainWindow w;
@@ -1057,7 +1057,7 @@ private:
};
// Qt/Mac,WinCE does not use the native popups/menubar
-#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_DARWIN)
void tst_QMenuBar::check_menuPosition()
{
QMainWindow w;
@@ -1126,7 +1126,7 @@ void tst_QMenuBar::check_menuPosition()
menu.close();
}
-# ifndef QTEST_NO_CURSOR
+# ifndef QT_NO_CURSOR
// QTBUG-28031: Click at bottom-right corner.
{
w.move(400, 200);
@@ -1140,7 +1140,7 @@ void tst_QMenuBar::check_menuPosition()
QCOMPARE(menu.geometry().right() - 1, globalPos.x());
menu.close();
}
-# endif // QTEST_NO_CURSOR
+# endif // QT_NO_CURSOR
}
#endif
@@ -1213,7 +1213,7 @@ void tst_QMenuBar::task256322_highlight()
QTRY_VERIFY(!menu2.isVisible());
QVERIFY(!menu.isVisible());
#ifdef Q_OS_MAC
- if ((QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) && (win.menuBar()->activeAction() != nothing))
+ if (win.menuBar()->activeAction() != nothing)
QEXPECT_FAIL("", "QTBUG-30565: Unstable test", Continue);
#endif
QTRY_COMPARE(win.menuBar()->activeAction(), nothing);
@@ -1396,7 +1396,7 @@ void tst_QMenuBar::cornerWidgets()
QFETCH(Qt::Corner, corner);
-#if defined(Q_OS_OSX) || defined(Q_OS_WINCE)
+#if defined(Q_OS_OSX)
QSKIP("Test interferes with native menu bars on this platform");
#endif
@@ -1492,6 +1492,25 @@ void tst_QMenuBar::taskQTBUG53205_crashReparentNested()
testMenus.actions[0]->trigger();
}
+// QTBUG-56526
+void tst_QMenuBar::platformMenu()
+{
+ QMenuBar menuBar;
+ QPlatformMenuBar *platformMenuBar = menuBar.platformMenuBar();
+ if (!platformMenuBar)
+ QSKIP("No platform menubar implementation available on this platform.");
+
+ // QMenu must not create a platform menu instance at creation time, because
+ // on Unity the type of the platform menu instance must be different (QGtk3Menu
+ // vs. QDbusPlatformMenu) depending on whether the menu is in the global menubar
+ // or a standalone context menu.
+ QMenu *menu = new QMenu(&menuBar);
+ QVERIFY(!menu->platformMenu());
+
+ menuBar.addMenu(menu);
+ QVERIFY(menu->platformMenu());
+}
+
void tst_QMenuBar::slotForTaskQTBUG53205()
{
QWidget *parent = taskQTBUG53205MenuBar->parentWidget();
diff --git a/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp b/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp
index b58d236a91..31bbcf9c7f 100644
--- a/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp
+++ b/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp
@@ -48,8 +48,6 @@
#include "qplaintextedit.h"
#include "../../../shared/platformclipboard.h"
-#include "../../../qtest-config.h"
-
//Used in copyAvailable
typedef QPair<Qt::Key, Qt::KeyboardModifier> keyPairType;
typedef QList<keyPairType> pairListType;
@@ -64,7 +62,6 @@ public:
tst_QPlainTextEdit();
public slots:
- void initTestCase();
void init();
void cleanup();
private slots:
@@ -104,7 +101,7 @@ private slots:
void shiftDownInLineLastShouldSelectToEnd();
void undoRedoShouldRepositionTextEditCursor();
void lineWrapModes();
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void mouseCursorShape();
#endif
void implicitClear();
@@ -208,16 +205,8 @@ void tst_QPlainTextEdit::getSetCheck()
QCOMPARE(0, obj1.tabStopWidth());
obj1.setTabStopWidth(INT_MIN);
QCOMPARE(0, obj1.tabStopWidth()); // Makes no sense to set a negative tabstop value
-#if defined(Q_OS_WINCE)
- // due to rounding error in qRound when qreal==float
- // we cannot use INT_MAX for this check
- obj1.setTabStopWidth(SHRT_MAX*2);
- QCOMPARE(SHRT_MAX*2, obj1.tabStopWidth());
-#else
obj1.setTabStopWidth(INT_MAX);
QCOMPARE(INT_MAX, obj1.tabStopWidth());
-#endif
-
}
class QtTestDocumentLayout : public QAbstractTextDocumentLayout
@@ -251,13 +240,6 @@ public:
tst_QPlainTextEdit::tst_QPlainTextEdit()
{}
-void tst_QPlainTextEdit::initTestCase()
-{
-#ifdef Q_OS_WINCE //disable magic for WindowsCE
- qApp->setAutoMaximizeThreshold(-1);
-#endif
-}
-
void tst_QPlainTextEdit::init()
{
ed = new QPlainTextEdit(0);
@@ -896,7 +878,7 @@ void tst_QPlainTextEdit::lineWrapModes()
delete window;
}
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void tst_QPlainTextEdit::mouseCursorShape()
{
// always show an IBeamCursor, see change 170146
diff --git a/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp b/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp
index 302d290c72..7bbbc46b5a 100644
--- a/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp
+++ b/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp
@@ -526,12 +526,6 @@ void tst_QPushButton::sizeHint_data()
#if defined(Q_OS_WIN) && !defined(QT_NO_STYLE_WINDOWSVISTA)
QTest::newRow("windowsvista") << QString::fromLatin1("windowsvista");
#endif
-#if defined(Q_OS_WINCE) && !defined(QT_NO_STYLE_WINDOWSCE)
- QTest::newRow("windowsce") << QString::fromLatin1("windowsce");
-#endif
-#if defined(Q_OS_WINCE_WM) && !defined(QT_NO_STYLE_WINDOWSCE)
- QTest::newRow("windowsmobile") << QString::fromLatin1("windowsmobile");
-#endif
}
void tst_QPushButton::sizeHint()
diff --git a/tests/auto/widgets/widgets/qtabwidget/qtabwidget.pro b/tests/auto/widgets/widgets/qtabwidget/qtabwidget.pro
index 92c2f6cb7e..6523209c32 100644
--- a/tests/auto/widgets/widgets/qtabwidget/qtabwidget.pro
+++ b/tests/auto/widgets/widgets/qtabwidget/qtabwidget.pro
@@ -8,4 +8,4 @@ INCLUDEPATH += ../
HEADERS +=
SOURCES += tst_qtabwidget.cpp
-win32:!wince:!winrt: LIBS += -luser32
+win32:!winrt: LIBS += -luser32
diff --git a/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp b/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp
index f8125bf749..2a2331c3bf 100644
--- a/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp
+++ b/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp
@@ -35,7 +35,7 @@
#include <qlabel.h>
#include <QtWidgets/qboxlayout.h>
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
# include <qt_windows.h>
#define Q_CHECK_PAINTEVENTS \
if (::SwitchDesktop(::GetThreadDesktop(::GetCurrentThreadId())) == 0) \
@@ -553,9 +553,7 @@ void tst_QTabWidget::paintEventCount()
// Mac, Windows and Windows CE get multiple repaints on the first show, so use those as a starting point.
static const int MaxInitialPaintCount =
-#if defined(Q_OS_WINCE)
- 4;
-#elif defined(Q_OS_WIN)
+#if defined(Q_OS_WIN)
2;
#elif defined(Q_OS_MAC)
5;
diff --git a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
index 69f0ff0f7e..cecec48113 100644
--- a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
+++ b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
@@ -55,8 +55,6 @@
#include "../../../shared/platforminputcontext.h"
#include <private/qinputmethod_p.h>
-#include "../../../qtest-config.h"
-
//Used in copyAvailable
typedef QPair<Qt::Key, Qt::KeyboardModifier> keyPairType;
typedef QList<keyPairType> pairListType;
@@ -125,7 +123,7 @@ private slots:
void shiftDownInLineLastShouldSelectToEnd();
void undoRedoShouldRepositionTextEditCursor();
void lineWrapModes();
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void mouseCursorShape();
#endif
void implicitClear();
@@ -276,15 +274,8 @@ void tst_QTextEdit::getSetCheck()
QCOMPARE(0, obj1.tabStopWidth());
obj1.setTabStopWidth(INT_MIN);
QCOMPARE(0, obj1.tabStopWidth()); // Makes no sense to set a negative tabstop value
-#if defined(Q_OS_WINCE)
- // due to rounding error in qRound when qreal==float
- // we cannot use INT_MAX for this check
- obj1.setTabStopWidth(SHRT_MAX*2);
- QCOMPARE(SHRT_MAX*2, obj1.tabStopWidth());
-#else
obj1.setTabStopWidth(INT_MAX);
QCOMPARE(INT_MAX, obj1.tabStopWidth());
-#endif
// bool QTextEdit::acceptRichText()
// void QTextEdit::setAcceptRichText(bool)
@@ -378,10 +369,6 @@ void tst_QTextEdit::cleanupTestCase()
void tst_QTextEdit::init()
{
-#ifdef Q_OS_WINCE //disable magic for WindowsCE
- qApp->setAutoMaximizeThreshold(-1);
-#endif
-
ed = new QTextEdit(0);
rootFrameMargin = ed->document()->documentMargin();
}
@@ -1230,7 +1217,7 @@ void tst_QTextEdit::lineWrapModes()
QCOMPARE(ed->document()->pageSize().width(), qreal(1000));
}
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
void tst_QTextEdit::mouseCursorShape()
{
// always show an IBeamCursor, see change 170146
diff --git a/tests/auto/widgets/widgets/widgets.pro b/tests/auto/widgets/widgets/widgets.pro
index 0651583867..a8e8f6d865 100644
--- a/tests/auto/widgets/widgets/widgets.pro
+++ b/tests/auto/widgets/widgets/widgets.pro
@@ -48,10 +48,10 @@ SUBDIRS=\
qtoolbutton \
# The following tests depend on private API:
-!contains(QT_CONFIG, private_tests): SUBDIRS -= \
+!qtConfig(private_tests): SUBDIRS -= \
qcombobox \
qmainwindow \
qtextedit \
qtoolbar \
-contains(QT_CONFIG, opengl): SUBDIRS += qopenglwidget
+qtConfig(opengl): SUBDIRS += qopenglwidget