summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2013-11-21 19:21:25 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-23 15:44:55 +0100
commit376ccedd1a04c196ba3cefb7d4e7d6acbceb66e8 (patch)
tree402b38198cf8774159d40c07180ae23d9ecffb31 /src
parent28c5c74c9b37fdf650810cebcd93944e0078cbd1 (diff)
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 <Friedemann.Kleint@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/painting/qpainter.cpp7
1 files changed, 3 insertions, 4 deletions
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;
}