summaryrefslogtreecommitdiffstats
path: root/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp')
-rw-r--r--tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp40
1 files changed, 38 insertions, 2 deletions
diff --git a/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp
index 04b1e79..efcbc53 100644
--- a/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp
+++ b/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp
@@ -48,6 +48,7 @@
#endif
#include <private/qstylesheetstyle_p.h>
+#include "../platformquirks.h"
//TESTED_CLASS=
//TESTED_FILES=
@@ -103,6 +104,7 @@ private slots:
//at the end because it mess with the style.
void widgetStyle();
void appStyle();
+ void QTBUG11658_cachecrash();
private:
QColor COLOR(const QWidget& w) {
w.ensurePolished();
@@ -822,6 +824,8 @@ void tst_QStyleSheetStyle::focusColors()
void tst_QStyleSheetStyle::hoverColors()
{
+ if (!PlatformQuirks::haveMouseCursor())
+ QSKIP("No mouse Cursor on this platform",SkipAll);
QList<QWidget *> widgets;
widgets << new QPushButton("TESTING");
widgets << new QLineEdit("TESTING");
@@ -979,10 +983,11 @@ void tst_QStyleSheetStyle::background()
void tst_QStyleSheetStyle::tabAlignement()
{
- QTabWidget tabWidget;
+ QWidget topLevel;
+ QTabWidget tabWidget(&topLevel);
tabWidget.addTab(new QLabel("tab1"),"tab1");
tabWidget.resize(QSize(400,400));
- tabWidget.show();
+ topLevel.show();
QTest::qWaitForWindowShown(&tabWidget);
QTest::qWait(50);
QTabBar *bar = qFindChild<QTabBar*>(&tabWidget);
@@ -1622,6 +1627,37 @@ void tst_QStyleSheetStyle::changeStyleInChangeEvent()
wid.ensurePolished();
}
+void tst_QStyleSheetStyle::QTBUG11658_cachecrash()
+{
+ //should not crash
+ class Widget : public QWidget
+ {
+ public:
+ Widget(QWidget *parent = 0)
+ : QWidget(parent)
+ {
+ QVBoxLayout* pLayout = new QVBoxLayout(this);
+ QCheckBox* pCheckBox = new QCheckBox(this);
+ pLayout->addWidget(pCheckBox);
+ setLayout(pLayout);
+
+ QString szStyleSheet = QLatin1String("* { color: red; }");
+ qApp->setStyleSheet(szStyleSheet);
+ qApp->setStyle(QStyleFactory::create(QLatin1String("Windows")));
+ }
+ };
+
+ Widget *w = new Widget();
+ delete w;
+ w = new Widget();
+ w->show();
+
+ QTest::qWaitForWindowShown(w);
+ delete w;
+ qApp->setStyleSheet(QString());
+}
+
+
QTEST_MAIN(tst_QStyleSheetStyle)
#include "tst_qstylesheetstyle.moc"