diff options
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/lancelot/lancelot.pro | 1 | ||||
-rw-r--r-- | tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp | 32 |
2 files changed, 33 insertions, 0 deletions
diff --git a/tests/auto/lancelot/lancelot.pro b/tests/auto/lancelot/lancelot.pro index 3859a55..6498f6c 100644 --- a/tests/auto/lancelot/lancelot.pro +++ b/tests/auto/lancelot/lancelot.pro @@ -8,5 +8,6 @@ HEADERS += $$QT_SOURCE_TREE/tests/arthur/common/paintcommands.h RESOURCES += $$QT_SOURCE_TREE/tests/arthur/common/images.qrc include($$QT_SOURCE_TREE/tests/arthur/common/baselineprotocol.pri) +DEFINES += QMAKESPEC=\\\"$$QMAKESPEC\\\" !symbian:!wince*:DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp index 0396408..efcbc53 100644 --- a/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp +++ b/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp @@ -104,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(); @@ -1626,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" |