From 376ccedd1a04c196ba3cefb7d4e7d6acbceb66e8 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 21 Nov 2013 19:21:25 +0100 Subject: Avoid incorrect warning when painting onto a QImage Change Ia8ef48f3 introduced a regression: Trying to paint onto a QImage, QPicture or QPrinter from outside the main thread incorrectly shows a warning saying that it is not supported. The patch was incorrect because 'extraCondition' was used in the non-default branches of the switch and thus not passing extraCondition==true caused the message appear even when it shouldn't have. Let's just remove the extraCondition parameter altogether since it is not used in practice anyway. Change-Id: Id2e56c585d1f1013f24942cbcd53305fbb66aeba Reviewed-by: Friedemann Kleint Reviewed-by: Lars Knoll Reviewed-by: Konstantin Ritt --- src/gui/painting/qpainter.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/gui/painting/qpainter.cpp') diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 4c02abdfd5..424ed554a2 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -146,17 +146,16 @@ static inline uint line_emulation(uint emulation) } #ifndef QT_NO_DEBUG -static bool qt_painter_thread_test(int devType, const char *what, bool extraCondition = false) +static bool qt_painter_thread_test(int devType, const char *what) { switch (devType) { case QInternal::Image: case QInternal::Printer: case QInternal::Picture: // can be drawn onto these devices safely from any thread - if (extraCondition) - break; + break; default: - if (!extraCondition && QThread::currentThread() != qApp->thread()) { + if (QThread::currentThread() != qApp->thread()) { qWarning("QPainter: It is not safe to use %s outside the GUI thread", what); return false; } -- cgit v1.2.3