summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets')
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp26
-rw-r--r--tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp4
-rw-r--r--tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp5
-rw-r--r--tests/auto/widgets/styles/qstyle/tst_qstyle.cpp33
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp3
-rw-r--r--tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp6
6 files changed, 24 insertions, 53 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
index 43064dd540..96aba11d52 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
@@ -52,9 +52,6 @@
#include <math.h>
#include <QtWidgets/QLabel>
-#if !defined(QT_NO_STYLE_MOTIF)
-#include <QtWidgets/QMotifStyle>
-#endif
#if !defined(QT_NO_STYLE_WINDOWS)
#include <QtWidgets/QWindowsStyle>
#endif
@@ -2736,6 +2733,23 @@ void tst_QGraphicsView::scrollBarRanges_data()
_scrollBarRanges_data();
}
+// Simulates motif scrollbar for range tests
+class FauxMotifStyle : public QCommonStyle {
+public:
+ int styleHint(StyleHint hint, const QStyleOption *option,
+ const QWidget *widget, QStyleHintReturn *returnData) const {
+ if (hint == QStyle::SH_ScrollView_FrameOnlyAroundContents)
+ return true;
+ return QCommonStyle::styleHint(hint, option, widget, returnData);
+ }
+
+ int pixelMetric(PixelMetric m, const QStyleOption *opt, const QWidget *widget) const {
+ if (m == QStyle::PM_ScrollView_ScrollBarSpacing)
+ return 4;
+ return QCommonStyle::pixelMetric(m, opt, widget);
+ }
+};
+
void tst_QGraphicsView::scrollBarRanges()
{
QFETCH(QSize, viewportSize);
@@ -2758,10 +2772,10 @@ void tst_QGraphicsView::scrollBarRanges()
view.setFrameStyle(useStyledPanel ? QFrame::StyledPanel : QFrame::NoFrame);
if (useMotif) {
-#if !defined(QT_NO_STYLE_MOTIF)
- view.setStyle(new QMotifStyle);
+#if !defined(QT_NO_STYLE_WINDOWS)
+ view.setStyle(new FauxMotifStyle);
#else
- QSKIP("No Motif style compiled.");
+ QSKIP("No Windows style compiled.");
#endif
} else {
#if defined(Q_OS_WINCE)
diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
index b9a9301daa..2250fe390f 100644
--- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
+++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
@@ -447,8 +447,8 @@ void tst_QApplication::args_data()
QTest::newRow( "App name" ) << 1 << "/usr/bin/appname" << 1 << "/usr/bin/appname";
QTest::newRow( "No arguments" ) << 0 << QString() << 0 << QString();
- QTest::newRow( "App name, style" ) << 3 << "/usr/bin/appname -style motif" << 1 << "/usr/bin/appname";
- QTest::newRow( "App name, style, arbitrary, reverse" ) << 5 << "/usr/bin/appname -style motif -arbitrary -reverse"
+ QTest::newRow( "App name, style" ) << 3 << "/usr/bin/appname -style windows" << 1 << "/usr/bin/appname";
+ QTest::newRow( "App name, style, arbitrary, reverse" ) << 5 << "/usr/bin/appname -style windows -arbitrary -reverse"
<< 2 << "/usr/bin/appname -arbitrary";
}
diff --git a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
index 7787f79620..e09a3e75e7 100644
--- a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
+++ b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
@@ -793,11 +793,6 @@ void tst_QGridLayout::minMaxSize_data()
<< SizeInfo(QPoint(10, 10), QSize( 90, 90), QSize(100,100))
<< SizeInfo(QPoint(10 + 100 + 1, 10), QSize( 90, 90))
);
- QTest::newRow("2x1 grid, extend to minimumSize, motif") << QString::fromLatin1("motif") << 2 << 1
- << int(QSizePolicy::Preferred) << QSize() << (SizeInfoList()
- << SizeInfo(QPoint(11, 11), QSize( 90, 90), QSize(100,100))
- << SizeInfo(QPoint(11 + 100 + 6, 11), QSize( 90, 90))
- );
QTest::newRow("2x1 grid, extend to minimumSize, windows") << QString::fromLatin1("windows") << 2 << 1
<< int(QSizePolicy::Preferred) << QSize() << (SizeInfoList()
<< SizeInfo(QPoint(11, 11), QSize( 90, 90), QSize(100,100))
diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
index e20891adc4..6bbcc4d1c1 100644
--- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
+++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
@@ -57,8 +57,6 @@
#include <qplastiquestyle.h>
#include <qwindowsstyle.h>
-#include <qcdestyle.h>
-#include <qmotifstyle.h>
#include <qcommonstyle.h>
#include <qproxystyle.h>
#include <qstylefactory.h>
@@ -121,16 +119,10 @@ private slots:
void cleanupTestCase();
void init();
void cleanup();
-#ifndef QT_NO_STYLE_MOTIF
- void testMotifStyle();
-#endif
#ifndef QT_NO_STYLE_PLASTIQUE
void testPlastiqueStyle();
#endif
void testWindowsStyle();
-#ifndef QT_NO_STYLE_CDE
- void testCDEStyle();
-#endif
#ifndef QT_NO_STYLE_WINDOWSXP
void testWindowsXPStyle();
#endif
@@ -195,24 +187,15 @@ void tst_QStyle::cleanupTestCase()
void tst_QStyle::testStyleFactory()
{
QStringList keys = QStyleFactory::keys();
-#ifndef QT_NO_STYLE_MOTIF
- QVERIFY(keys.contains("Motif"));
-#endif
#ifndef QT_NO_STYLE_CLEANLOOKS
QVERIFY(keys.contains("Cleanlooks"));
#endif
#ifndef QT_NO_STYLE_PLASTIQUE
QVERIFY(keys.contains("Plastique"));
#endif
-#ifndef QT_NO_STYLE_CDE
- QVERIFY(keys.contains("CDE"));
-#endif
#ifndef QT_NO_STYLE_WINDOWS
QVERIFY(keys.contains("Windows"));
#endif
-#ifndef QT_NO_STYLE_MOTIF
- QVERIFY(keys.contains("Motif"));
-#endif
#ifdef Q_OS_WIN
if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP &&
(QSysInfo::WindowsVersion & QSysInfo::WV_NT_based))
@@ -569,22 +552,6 @@ void tst_QStyle::testMacStyle()
#endif
}
-#ifndef QT_NO_STYLE_MOTIF
-void tst_QStyle::testMotifStyle()
-{
- QMotifStyle mstyle;
- QVERIFY(testAllFunctions(&mstyle));
-}
-#endif
-
-#ifndef QT_NO_STYLE_CDE
-void tst_QStyle::testCDEStyle()
-{
- QCDEStyle cstyle;
- QVERIFY(testAllFunctions(&cstyle));
-}
-#endif
-
void tst_QStyle::testWindowsCEStyle()
{
#if defined(Q_OS_WINCE)
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
index 796b40573d..310e43cd53 100644
--- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
+++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
@@ -44,6 +44,7 @@
#include <QtTest/QtTest>
#include <QtDebug>
#include <QMetaObject>
+#include <QPlastiqueStyle>
#include <private/qstylesheetstyle_p.h>
#include "../../../platformquirks.h"
@@ -1590,7 +1591,7 @@ class ChangeEventWidget : public QWidget
static bool recurse = false;
if (!recurse) {
recurse = true;
- QStyle *style = new QMotifStyle;
+ QStyle *style = new QPlastiqueStyle;
style->setParent(this);
setStyle(style);
recurse = false;
diff --git a/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp b/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp
index 03c880a68c..30cc6a4294 100644
--- a/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp
+++ b/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp
@@ -561,12 +561,6 @@ void tst_QPushButton::defaultAndAutoDefault()
void tst_QPushButton::sizeHint_data()
{
QTest::addColumn<QString>("stylename");
-#if !defined(QT_NO_STYLE_MOTIF)
- QTest::newRow("motif") << QString::fromLatin1("motif");
-#endif
-#if !defined(QT_NO_STYLE_CDE)
- QTest::newRow("cde") << QString::fromLatin1("cde");
-#endif
#if !defined(QT_NO_STYLE_WINDOWS)
QTest::newRow("windows") << QString::fromLatin1("windows");
#endif