qxcb: output clear error message when running on an 8-bit display

Currently, running a Qt5 widget app in Xvfb (with its default setup, 8 bit color depth)
outputs a stream of error messages, starting with:
QWidget::paintEngine: QWidget::paintEngine: Should no longer be called

Better output clearly the reason why we end up in that method: painting
on a null image, due to the unsupported image format.

Maybe this should even be a qFatal...

Change-Id: Iae8f1b057518c146bf8e034999c1b5e67ce6ef5e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
bb10
David Faure 2013-04-22 16:18:58 +02:00 committed by The Qt Project
parent 3821047e6c
commit 71a1ff39bc
1 changed files with 3 additions and 1 deletions

View File

@ -170,7 +170,9 @@ static inline QImage::Format imageFormatForDepth(int depth)
case 32: return QImage::Format_ARGB32_Premultiplied;
case 24: return QImage::Format_RGB32;
case 16: return QImage::Format_RGB16;
default: return QImage::Format_Invalid;
default:
qWarning("Unsupported screen depth: %d", depth);
return QImage::Format_Invalid;
}
}