From 71a1ff39bcf67117e94b669aa0ee059bf1f03b3a Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 22 Apr 2013 16:18:58 +0200 Subject: qxcb: output clear error message when running on an 8-bit display MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Samuel Rødal --- src/plugins/platforms/xcb/qxcbwindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 68ccbfb8c0..f2ec4ce4b0 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -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; } } -- cgit v1.2.3