summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/styles/qstyle
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/styles/qstyle')
-rw-r--r--tests/auto/widgets/styles/qstyle/images/mac/button.pngbin1785 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/images/mac/combobox.pngbin1808 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/images/mac/lineedit.pngbin953 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/images/mac/mdi.pngbin3092 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/images/mac/menu.pngbin1139 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/images/mac/radiobutton.pngbin1498 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/images/mac/slider.pngbin1074 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/images/mac/spinbox.pngbin1299 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/images/vista/button.pngbin722 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/images/vista/combobox.pngbin809 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/images/vista/lineedit.pngbin530 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/images/vista/menu.pngbin646 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/images/vista/radiobutton.pngbin844 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/images/vista/slider.pngbin575 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/images/vista/spinbox.pngbin583 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/qstyle.pro5
-rw-r--r--tests/auto/widgets/styles/qstyle/testdata.qrc19
-rw-r--r--tests/auto/widgets/styles/qstyle/tst_qstyle.cpp127
18 files changed, 0 insertions, 151 deletions
diff --git a/tests/auto/widgets/styles/qstyle/images/mac/button.png b/tests/auto/widgets/styles/qstyle/images/mac/button.png
deleted file mode 100644
index 7b11325e87..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/mac/button.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/images/mac/combobox.png b/tests/auto/widgets/styles/qstyle/images/mac/combobox.png
deleted file mode 100644
index ded0b11f29..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/mac/combobox.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/images/mac/lineedit.png b/tests/auto/widgets/styles/qstyle/images/mac/lineedit.png
deleted file mode 100644
index 8d2861b65b..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/mac/lineedit.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/images/mac/mdi.png b/tests/auto/widgets/styles/qstyle/images/mac/mdi.png
deleted file mode 100644
index 8c09ae4338..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/mac/mdi.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/images/mac/menu.png b/tests/auto/widgets/styles/qstyle/images/mac/menu.png
deleted file mode 100644
index 5dd9111d69..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/mac/menu.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/images/mac/radiobutton.png b/tests/auto/widgets/styles/qstyle/images/mac/radiobutton.png
deleted file mode 100644
index 8828e220a2..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/mac/radiobutton.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/images/mac/slider.png b/tests/auto/widgets/styles/qstyle/images/mac/slider.png
deleted file mode 100644
index fc65035631..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/mac/slider.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/images/mac/spinbox.png b/tests/auto/widgets/styles/qstyle/images/mac/spinbox.png
deleted file mode 100644
index ee88441ecb..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/mac/spinbox.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/images/vista/button.png b/tests/auto/widgets/styles/qstyle/images/vista/button.png
deleted file mode 100644
index a6c45276ca..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/vista/button.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/images/vista/combobox.png b/tests/auto/widgets/styles/qstyle/images/vista/combobox.png
deleted file mode 100644
index 9b82f64d32..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/vista/combobox.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/images/vista/lineedit.png b/tests/auto/widgets/styles/qstyle/images/vista/lineedit.png
deleted file mode 100644
index b2c6ac1ae4..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/vista/lineedit.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/images/vista/menu.png b/tests/auto/widgets/styles/qstyle/images/vista/menu.png
deleted file mode 100644
index b114099cc3..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/vista/menu.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/images/vista/radiobutton.png b/tests/auto/widgets/styles/qstyle/images/vista/radiobutton.png
deleted file mode 100644
index c8aa7864df..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/vista/radiobutton.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/images/vista/slider.png b/tests/auto/widgets/styles/qstyle/images/vista/slider.png
deleted file mode 100644
index 7c156ded9d..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/vista/slider.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/images/vista/spinbox.png b/tests/auto/widgets/styles/qstyle/images/vista/spinbox.png
deleted file mode 100644
index b8d0823ab2..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/vista/spinbox.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/qstyle.pro b/tests/auto/widgets/styles/qstyle/qstyle.pro
index 9ad0940245..4dc0525c49 100644
--- a/tests/auto/widgets/styles/qstyle/qstyle.pro
+++ b/tests/auto/widgets/styles/qstyle/qstyle.pro
@@ -2,8 +2,3 @@ CONFIG += testcase
TARGET = tst_qstyle
QT += widgets testlib testlib-private
SOURCES += tst_qstyle.cpp
-
-android:!android-embedded {
- RESOURCES += \
- testdata.qrc
-}
diff --git a/tests/auto/widgets/styles/qstyle/testdata.qrc b/tests/auto/widgets/styles/qstyle/testdata.qrc
deleted file mode 100644
index 29bb46726e..0000000000
--- a/tests/auto/widgets/styles/qstyle/testdata.qrc
+++ /dev/null
@@ -1,19 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>images/mac/button.png</file>
- <file>images/mac/combobox.png</file>
- <file>images/mac/lineedit.png</file>
- <file>images/mac/mdi.png</file>
- <file>images/mac/menu.png</file>
- <file>images/mac/radiobutton.png</file>
- <file>images/mac/slider.png</file>
- <file>images/mac/spinbox.png</file>
- <file>images/vista/button.png</file>
- <file>images/vista/combobox.png</file>
- <file>images/vista/lineedit.png</file>
- <file>images/vista/menu.png</file>
- <file>images/vista/radiobutton.png</file>
- <file>images/vista/slider.png</file>
- <file>images/vista/spinbox.png</file>
- </qresource>
-</RCC>
diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
index 68e672e16d..ae084310b1 100644
--- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
+++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
@@ -73,7 +73,6 @@ public:
private:
bool testAllFunctions(QStyle *);
bool testScrollBarSubControls();
- void testPainting(QStyle *style, const QString &platform);
private slots:
void drawItemPixmap();
void init();
@@ -333,141 +332,15 @@ void tst_QStyle::testWindowsStyle()
delete wstyle;
}
-void writeImage(const QString &fileName, QImage image)
-{
- QImageWriter imageWriter(fileName);
- imageWriter.setFormat("png");
- qDebug() << "result " << imageWriter.write(image);
-}
-
-QImage readImage(const QString &fileName)
-{
- QImageReader reader(fileName);
- return reader.read();
-}
-
-
#if defined(Q_OS_WIN) && !defined(QT_NO_STYLE_WINDOWSVISTA) && !defined(Q_OS_WINRT)
void tst_QStyle::testWindowsVistaStyle()
{
QStyle *vistastyle = QStyleFactory::create("WindowsVista");
QVERIFY(testAllFunctions(vistastyle));
-
- if (QOperatingSystemVersion::current().majorVersion()
- == QOperatingSystemVersion::WindowsVista.majorVersion()
- && QOperatingSystemVersion::current().minorVersion()
- == QOperatingSystemVersion::WindowsVista.minorVersion())
- testPainting(vistastyle, "vista");
delete vistastyle;
}
#endif
-void comparePixmap(const QString &filename, const QPixmap &pixmap)
-{
- QImage oldFile = readImage(filename);
- QPixmap oldPixmap = QPixmap::fromImage(oldFile);
- if (!oldFile.isNull())
- QCOMPARE(pixmap, oldPixmap);
- else
- writeImage(filename, pixmap.toImage());
-}
-
-void tst_QStyle::testPainting(QStyle *style, const QString &platform)
-{
-qDebug("TEST PAINTING");
- //Test Menu
- QString fileName = "images/" + platform + "/menu.png";
- QMenu menu;
- menu.setStyle(style);
- menu.show();
- menu.addAction(new QAction("Test 1", &menu));
- menu.addAction(new QAction("Test 2", &menu));
- QPixmap pixmap = menu.grab();
- comparePixmap(fileName, pixmap);
-
- //Push button
- fileName = "images/" + platform + "/button.png";
- QPushButton button("OK");
- button.setStyle(style);
- button.show();
- pixmap = button.grab();
- button.hide();
- comparePixmap(fileName, pixmap);
-
- //Push button
- fileName = "images/" + platform + "/radiobutton.png";
- QRadioButton radiobutton("Check");
- radiobutton.setStyle(style);
- radiobutton.show();
- pixmap = radiobutton.grab();
- radiobutton.hide();
- comparePixmap(fileName, pixmap);
-
- //Combo box
- fileName = "images/" + platform + "/combobox.png";
- QComboBox combobox;
- combobox.setStyle(style);
- combobox.addItem("Test 1");
- combobox.addItem("Test 2");
- combobox.show();
- pixmap = combobox.grab();
- combobox.hide();
- comparePixmap(fileName, pixmap);
-
- //Spin box
- fileName = "images/" + platform + "/spinbox.png";
- QDoubleSpinBox spinbox;
- spinbox.setLocale(QLocale(QLocale::English, QLocale::UnitedStates));
- spinbox.setStyle(style);
- spinbox.show();
- pixmap = spinbox.grab();
- spinbox.hide();
- comparePixmap(fileName, pixmap);
- QLocale::setDefault(QLocale::system());
-
- //Slider
- fileName = "images/" + platform + "/slider.png";
- QSlider slider;
- slider.setStyle(style);
- slider.show();
- pixmap = slider.grab();
- slider.hide();
- comparePixmap(fileName, pixmap);
-
- //Line edit
- fileName = "images/" + platform + "/lineedit.png";
- QLineEdit lineedit("Test text");
- lineedit.setStyle(style);
- lineedit.show();
- pixmap = lineedit.grab();
- lineedit.hide();
- comparePixmap(fileName, pixmap);
-
- //MDI
- fileName = "images/" + platform + "/mdi.png";
- QMdiArea mdiArea;
- mdiArea.addSubWindow(new QWidget(&mdiArea));
- mdiArea.resize(200, 200);
- mdiArea.setStyle(style);
- mdiArea.show();
- pixmap = mdiArea.grab();
- mdiArea.hide();
- comparePixmap(fileName, pixmap);
-
- // QToolButton
- fileName = "images/" + platform + "/toolbutton.png";
- QToolButton tb;
- tb.setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
- tb.setText("AaQqPpXx");
- tb.setIcon(style->standardPixmap(QStyle::SP_DirHomeIcon));
- tb.setStyle(style);
- tb.show();
- pixmap = tb.grab();
- tb.hide();
- comparePixmap(fileName, pixmap);
-
-}
-
#ifdef Q_OS_MAC
void tst_QStyle::testMacStyle()
{