diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2015-09-07 15:09:21 +0200 |
---|---|---|
committer | Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> | 2015-09-11 12:42:15 +0000 |
commit | 1464118b67a030d290eb14e7c6612202273e1366 (patch) | |
tree | e0efb3c98e4e2da3a363db0f1bf4b6c9b35d56df /src/gui/image/qiconengine.h | |
parent | 4b224816aa2902e10835a560d14e305cfdc32bac (diff) |
QIcon: add a hook in the engine so a non null QIconEngine can still be a null icon
Implement it in the QIconLoader
We have to change detach() because some code does:
icon = QIcon::fromTheme("foobar"); if (icon.isNull()) icon.addPixmap(...);
so addPixmap and addFile have to work on a null QIcon by resetting
the iconEngine.
Change-Id: I07719bef93930cf4692384a8c64e21a97dcce25c
Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/gui/image/qiconengine.h')
-rw-r--r-- | src/gui/image/qiconengine.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/image/qiconengine.h b/src/gui/image/qiconengine.h index 735da863fd..f0ff143b36 100644 --- a/src/gui/image/qiconengine.h +++ b/src/gui/image/qiconengine.h @@ -57,7 +57,7 @@ public: virtual bool read(QDataStream &in); virtual bool write(QDataStream &out) const; - enum IconEngineHook { AvailableSizesHook = 1, IconNameHook }; + enum IconEngineHook { AvailableSizesHook = 1, IconNameHook, IsNullHook }; struct AvailableSizesArgument { @@ -70,6 +70,7 @@ public: QIcon::State state = QIcon::Off) const; virtual QString iconName() const; + bool isNull() const; // ### Qt6 make virtual virtual void virtual_hook(int id, void *data); }; |