diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/concurrent/qthreadpool.cpp | 1 | ||||
-rw-r--r-- | src/gui/image/qpixmap.cpp | 13 | ||||
-rw-r--r-- | src/gui/kernel/qgesturemanager.cpp | 41 | ||||
-rw-r--r-- | src/gui/painting/qgraphicssystemfactory.cpp | 2 | ||||
-rw-r--r-- | src/gui/text/qstatictext.cpp | 5 |
5 files changed, 38 insertions, 24 deletions
diff --git a/src/corelib/concurrent/qthreadpool.cpp b/src/corelib/concurrent/qthreadpool.cpp index f25a494..265de33 100644 --- a/src/corelib/concurrent/qthreadpool.cpp +++ b/src/corelib/concurrent/qthreadpool.cpp @@ -250,6 +250,7 @@ bool QThreadPoolPrivate::tooManyThreadsActive() const void QThreadPoolPrivate::startThread(QRunnable *runnable) { QScopedPointer <QThreadPoolThread> thread(new QThreadPoolThread(this)); + thread->setObjectName(QLatin1String("Thread (pooled)")); allThreads.insert(thread.data()); ++activeThreads; diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index d5db431..04c53f9 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -1170,15 +1170,24 @@ QPixmap QPixmap::grabWidget(QWidget * widget, const QRect &rect) \warning This function is X11 specific; using it is non-portable. + \warning Since 4.8, pixmaps do not have an X11 handle unless + created with \l {QPixmap::}{fromX11Pixmap()}, or if the native + graphics system is explicitly enabled. + \sa detach() + \sa QApplication::setGraphicsSystem() */ Qt::HANDLE QPixmap::handle() const { #if defined(Q_WS_X11) const QPixmapData *pd = pixmapData(); - if (pd && pd->classId() == QPixmapData::X11Class) - return static_cast<const QX11PixmapData*>(pd)->handle(); + if (pd) { + if (pd->classId() == QPixmapData::X11Class) + return static_cast<const QX11PixmapData*>(pd)->handle(); + else + qWarning("QPixmap::handle(): Pixmap is not an X11 class pixmap"); + } #endif return 0; } diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp index 5c80340..fb1a1d6 100644 --- a/src/gui/kernel/qgesturemanager.cpp +++ b/src/gui/kernel/qgesturemanager.cpp @@ -239,52 +239,53 @@ bool QGestureManager::filterEventThroughContexts(const QMultiMap<QObject *, // TODO: sort contexts by the gesture type and check if one of the contexts // is already active. - bool ret = false; + bool consumeEventHint = false; // filter the event through recognizers typedef QMultiMap<QObject *, Qt::GestureType>::const_iterator ContextIterator; - for (ContextIterator cit = contexts.begin(), ce = contexts.end(); cit != ce; ++cit) { - Qt::GestureType gestureType = cit.value(); + ContextIterator contextEnd = contexts.end(); + for (ContextIterator context = contexts.begin(); context != contextEnd; ++context) { + Qt::GestureType gestureType = context.value(); QMap<Qt::GestureType, QGestureRecognizer *>::const_iterator - rit = m_recognizers.lowerBound(gestureType), - re = m_recognizers.upperBound(gestureType); - for (; rit != re; ++rit) { - QGestureRecognizer *recognizer = rit.value(); - QObject *target = cit.key(); + typeToRecognizerIterator = m_recognizers.lowerBound(gestureType), + typeToRecognizerEnd = m_recognizers.upperBound(gestureType); + for (; typeToRecognizerIterator != typeToRecognizerEnd; ++typeToRecognizerIterator) { + QGestureRecognizer *recognizer = typeToRecognizerIterator.value(); + QObject *target = context.key(); QGesture *state = getState(target, recognizer, gestureType); if (!state) continue; - QGestureRecognizer::Result result = recognizer->recognize(state, target, event); - QGestureRecognizer::Result type = result & QGestureRecognizer::ResultState_Mask; - result &= QGestureRecognizer::ResultHint_Mask; - if (type == QGestureRecognizer::TriggerGesture) { + QGestureRecognizer::Result recognizerResult = recognizer->recognize(state, target, event); + QGestureRecognizer::Result recognizerState = recognizerResult & QGestureRecognizer::ResultState_Mask; + QGestureRecognizer::Result resultHint = recognizerResult & QGestureRecognizer::ResultHint_Mask; + if (recognizerState == QGestureRecognizer::TriggerGesture) { DEBUG() << "QGestureManager:Recognizer: gesture triggered: " << state; triggeredGestures << state; - } else if (type == QGestureRecognizer::FinishGesture) { + } else if (recognizerState == QGestureRecognizer::FinishGesture) { DEBUG() << "QGestureManager:Recognizer: gesture finished: " << state; finishedGestures << state; - } else if (type == QGestureRecognizer::MayBeGesture) { + } else if (recognizerState == QGestureRecognizer::MayBeGesture) { DEBUG() << "QGestureManager:Recognizer: maybe gesture: " << state; newMaybeGestures << state; - } else if (type == QGestureRecognizer::CancelGesture) { + } else if (recognizerState == QGestureRecognizer::CancelGesture) { DEBUG() << "QGestureManager:Recognizer: not gesture: " << state; notGestures << state; - } else if (type == QGestureRecognizer::Ignore) { + } else if (recognizerState == QGestureRecognizer::Ignore) { DEBUG() << "QGestureManager:Recognizer: ignored the event: " << state; } else { DEBUG() << "QGestureManager:Recognizer: hm, lets assume the recognizer" << "ignored the event: " << state; } - if (result & QGestureRecognizer::ConsumeEventHint) { + if (resultHint & QGestureRecognizer::ConsumeEventHint) { DEBUG() << "QGestureManager: we were asked to consume the event: " << state; - ret = true; + consumeEventHint = true; } } } if (triggeredGestures.isEmpty() && finishedGestures.isEmpty() && newMaybeGestures.isEmpty() && notGestures.isEmpty()) - return ret; + return consumeEventHint; QSet<QGesture *> startedGestures = triggeredGestures - m_activeGestures; triggeredGestures &= m_activeGestures; @@ -381,7 +382,7 @@ bool QGestureManager::filterEventThroughContexts(const QMultiMap<QObject *, recycle(gesture); m_gestureTargets.remove(gesture); } - return ret; + return consumeEventHint; } // Cancel all gestures of children of the widget that original is associated with diff --git a/src/gui/painting/qgraphicssystemfactory.cpp b/src/gui/painting/qgraphicssystemfactory.cpp index ee6fbd8..3adeba4 100644 --- a/src/gui/painting/qgraphicssystemfactory.cpp +++ b/src/gui/painting/qgraphicssystemfactory.cpp @@ -73,7 +73,7 @@ QGraphicsSystem *QGraphicsSystemFactory::create(const QString& key) if (system.isEmpty()) { system = QLatin1String("runtime"); } -#elif defined (QT_GRAPHICSSYSTEM_RASTER) && !defined(Q_WS_WIN) && !defined(Q_OS_SYMBIAN) +#elif defined (QT_GRAPHICSSYSTEM_RASTER) && !defined(Q_WS_WIN) && !defined(Q_OS_SYMBIAN) || defined(Q_WS_X11) if (system.isEmpty()) { system = QLatin1String("raster"); } diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp index b950b13..2eeafd2 100644 --- a/src/gui/text/qstatictext.cpp +++ b/src/gui/text/qstatictext.cpp @@ -43,6 +43,7 @@ #include "qstatictext_p.h" #include <private/qtextengine_p.h> #include <private/qfontengine_p.h> +#include <qabstracttextdocumentlayout.h> #include <QtGui/qapplication.h> @@ -655,7 +656,9 @@ void QStaticTextPrivate::paintText(const QPointF &topLeftPosition, QPainter *p) p->save(); p->translate(topLeftPosition); - document.drawContents(p); + QAbstractTextDocumentLayout::PaintContext ctx; + ctx.palette.setColor(QPalette::Text, p->pen().color()); + document.documentLayout()->draw(p, ctx); p->restore(); if (textWidth >= 0.0) |