summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-09-22 00:24:38 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-09-22 00:24:38 (GMT)
commit9ca64357d6ad9a2a9dd212fc5962169ed2c4bbc1 (patch)
tree1e4213f2b0b33c334f754b7cd964d010aa82cc78
parentb9af296af3d4792d591afd833301ce56bcbc7b55 (diff)
parent30e8b82d74c4c57b60f2f06b61254de6572eaecf (diff)
downloadQt-9ca64357d6ad9a2a9dd212fc5962169ed2c4bbc1.zip
Qt-9ca64357d6ad9a2a9dd212fc5962169ed2c4bbc1.tar.gz
Qt-9ca64357d6ad9a2a9dd212fc5962169ed2c4bbc1.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Rename some variables to improve readability. Make QStaticText honor QPainter::pen() for rich text on X11 w/raster Fixed qdeclarativetext auto-test to work with raster graphicssystem. Fixed QStaticText auto-test to work with raster graphicssystem. Give a warning in QPixmap::handle() if pixmap is not X11 class. QThreadPool: name pooled threads Make raster the default graphics system on X11.
-rw-r--r--src/corelib/concurrent/qthreadpool.cpp1
-rw-r--r--src/gui/image/qpixmap.cpp13
-rw-r--r--src/gui/kernel/qgesturemanager.cpp41
-rw-r--r--src/gui/painting/qgraphicssystemfactory.cpp2
-rw-r--r--src/gui/text/qstatictext.cpp5
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_cb.pngbin496 -> 496 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_cc.pngbin556 -> 556 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_ct.pngbin533 -> 533 bytes
-rw-r--r--tests/auto/qstatictext/tst_qstatictext.cpp2
9 files changed, 39 insertions, 25 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)
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_cb.png b/tests/auto/declarative/qdeclarativetext/data/alignments_cb.png
index 99de219..b5c6bba 100644
--- a/tests/auto/declarative/qdeclarativetext/data/alignments_cb.png
+++ b/tests/auto/declarative/qdeclarativetext/data/alignments_cb.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_cc.png b/tests/auto/declarative/qdeclarativetext/data/alignments_cc.png
index cb85251..c9ffcc1 100644
--- a/tests/auto/declarative/qdeclarativetext/data/alignments_cc.png
+++ b/tests/auto/declarative/qdeclarativetext/data/alignments_cc.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_ct.png b/tests/auto/declarative/qdeclarativetext/data/alignments_ct.png
index ddca549..eda0d25 100644
--- a/tests/auto/declarative/qdeclarativetext/data/alignments_ct.png
+++ b/tests/auto/declarative/qdeclarativetext/data/alignments_ct.png
Binary files differ
diff --git a/tests/auto/qstatictext/tst_qstatictext.cpp b/tests/auto/qstatictext/tst_qstatictext.cpp
index 49d6633..6a78cb8 100644
--- a/tests/auto/qstatictext/tst_qstatictext.cpp
+++ b/tests/auto/qstatictext/tst_qstatictext.cpp
@@ -359,7 +359,7 @@ bool tst_QStaticText::supportsTransformations() const
QPaintEngine::Type type = engine->type();
if (type == QPaintEngine::OpenGL
-#if !defined Q_WS_WIN
+#if !defined(Q_WS_WIN) && !defined(Q_WS_X11)
|| type == QPaintEngine::Raster
#endif
)