summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2023-11-05 21:39:27 +0100
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2023-11-08 11:11:48 +0100
commit5a5c96c65d9c4c4e0eac1888d5f396f352e60444 (patch)
tree1215655265093f5ce812f99d3584f1e86b82a763 /tests/auto/gui
parenta5a925bf2ede609714be931bd20cba29f9c3823f (diff)
Add QPixmapIconEngine::isNull()
Reimplement the virtual function QIconEngine::isNull() for QPixmapIconEngine. This lets QIcon::isNull() return true when no pixmaps are loaded during QIcon::addFile() e.g. due to a wrong filename. Pick-to: 6.6 6.5 Fixes: QTBUG-118667 Change-Id: I29f2c492e55b60638507fa398ef7af76f4e9ff48 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'tests/auto/gui')
-rw-r--r--tests/auto/gui/image/qicon/tst_qicon.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/gui/image/qicon/tst_qicon.cpp b/tests/auto/gui/image/qicon/tst_qicon.cpp
index 71df9f12ca..d7fcd58a03 100644
--- a/tests/auto/gui/image/qicon/tst_qicon.cpp
+++ b/tests/auto/gui/image/qicon/tst_qicon.cpp
@@ -195,17 +195,17 @@ void tst_QIcon::isNull() {
// test string constructor with non-existing file
QIcon iconNoFile = QIcon("imagedoesnotexist");
- QVERIFY(!iconNoFile.isNull());
+ QVERIFY(iconNoFile.isNull());
QVERIFY(!iconNoFile.actualSize(QSize(32, 32)).isValid());
// test string constructor with non-existing file with suffix
QIcon iconNoFileSuffix = QIcon("imagedoesnotexist.png");
- QVERIFY(!iconNoFileSuffix.isNull());
+ QVERIFY(iconNoFileSuffix.isNull());
QVERIFY(!iconNoFileSuffix.actualSize(QSize(32, 32)).isValid());
// test string constructor with existing file but unsupported format
QIcon iconUnsupportedFormat = QIcon(m_sourceFileName);
- QVERIFY(!iconUnsupportedFormat.isNull());
+ QVERIFY(iconUnsupportedFormat.isNull());
QVERIFY(!iconUnsupportedFormat.actualSize(QSize(32, 32)).isValid());
// test string constructor with existing file and supported format