summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp
diff options
context:
space:
mode:
authorTarja Sundqvist <tarja.sundqvist@qt.io>2022-04-07 15:21:56 +0300
committerTarja Sundqvist <tarja.sundqvist@qt.io>2022-04-07 15:21:56 +0300
commite89a6f03c4d24f18db36a906a7320035388504ba (patch)
tree47f7edb9faa26f6f4e2d3f2eea12133933d86e45 /tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp
parentc8989ca20fa5798f7853f07df6e150cc407c64a4 (diff)
parent69b8ab23c93785dc69ae43ea04d5620656a4af44 (diff)
Merge remote-tracking branch 'origin/tqtc/lts-5.15.4' into tqtc/lts-5.15-opensource
Diffstat (limited to 'tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp')
-rw-r--r--tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp b/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp
index 94cb42cc00..e818514a79 100644
--- a/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp
+++ b/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp
@@ -68,6 +68,7 @@ private slots:
void taskQTBUG_20191_shortcutWithKeypadModifer();
void emitReleasedAfterChange();
void hitButton();
+ void iconOnlyStyleSheet();
protected slots:
void resetCounters();
@@ -695,5 +696,22 @@ void tst_QPushButton::hitButton()
QVERIFY(!button2->hitButton(QPoint(2, 2)));
}
+/*
+ Test that a style sheet with only icon doesn't crash.
+ QTBUG-91735
+*/
+void tst_QPushButton::iconOnlyStyleSheet()
+{
+ QIcon icon(":/qt-project.org/styles/commonstyle/images/dvd-32.png");
+ QVERIFY(!icon.isNull());
+ QPushButton pb;
+ pb.setStyleSheet("QPushButton {"
+ "icon: url(:/qt-project.org/styles/commonstyle/images/dvd-32.png);"
+ "border: red;"
+ "}");
+ pb.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&pb));
+}
+
QTEST_MAIN(tst_QPushButton)
#include "tst_qpushbutton.moc"