use QApplication::type() to check the application type in QPixmap::init()

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-02-09 10:13:43 +02:00
parent 6463eab210
commit 2c8823890b

View file

@ -69,11 +69,9 @@ static inline bool qt_pixmap_thread_test()
return true;
}
extern QApplication::Type qt_appType;
void QPixmap::init(int w, int h, int type)
{
if (qt_appType == QApplication::Tty) {
if (Q_UNLIKELY(QApplication::type() == QApplication::Tty)) {
qWarning("QPixmap: Cannot create a QPixmap when no GUI is being used");
data = 0;
return;