[Development] Should null QPixmaps be allowed in a QCoreApplication?
Sze Howe Koh
szehowe.koh at gmail.com
Tue Jul 27 18:41:01 CEST 2021
Current Qt behaviours:
A) If you create any QPixmap after creating QGuiApplication, the result is
probably the pixmap that you asked for. All is well.
B) If you create any QPixmap after creating QCoreApplication, the result is
a null QPixmap. No warnings are produced.
C) If you create any QPixmap _in a secondary thread_ after creating
QCoreApplication, the result is a segfault due to a nullptr dereference .
D) If you create any QPixmap without creating Q(Core|Gui|)Application, the
result is a qFatal() telling you that you must have a QGuiApplication.
I think that results of (B) and (C) should be changed to match (D) .
However, there are some complications:
* There is a unit test that relies on the current behaviour of (B) .
* Making this change will break existing user code that relies on the
current behaviour of (B).
How should we proceed?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Development