summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-03-04 12:30:23 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-03-04 12:30:23 (GMT)
commit30dba6b22f907ba36ed8f71568ab2489536f8f43 (patch)
tree37b73324d4871aa41b53dadd4d270f1c2764d699 /src
parent352f9e629666b6a1743fafc42c16bb51a6ad3df9 (diff)
parentf1e39e7dea8634695263435f0bf912ce19c43195 (diff)
downloadQt-30dba6b22f907ba36ed8f71568ab2489536f8f43.zip
Qt-30dba6b22f907ba36ed8f71568ab2489536f8f43.tar.gz
Qt-30dba6b22f907ba36ed8f71568ab2489536f8f43.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Make tablet detection work with new wacom drivers Fixed an exit crash that could occur in the GL 2 engine under X11. Fix tst_QVariant::operator_eq_eq(UserType) SqlBrowser not respecting casings. Remove vgClearPath() change to OpenVG paint engine QVariant: Fix crash when comparing two variant with the same undefined type. Fix compositing when QWS background is completely transparent. Fixes wrong composition mode for cached backgrounds in Graphics View. Support keypad input with vnc driver
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qvariant.cpp6
-rw-r--r--src/gui/embedded/qscreen_qws.cpp2
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp6
-rw-r--r--src/gui/image/qimagepixmapcleanuphooks.cpp10
-rw-r--r--src/gui/kernel/qapplication_x11.cpp9
-rw-r--r--src/gui/kernel/qt_x11_p.h3
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp1
-rw-r--r--src/openvg/qpaintengine_vg.cpp124
-rw-r--r--src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp34
9 files changed, 118 insertions, 77 deletions
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index e1b5825..9a278bd 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -466,9 +466,13 @@ static bool compare(const QVariant::Private *a, const QVariant::Private *b)
* QMetaType::VoidStar, QMetaType::QObjectStar and so forth, is that it wouldn't include
* user defined pointer types. */
const char *const typeName = QMetaType::typeName(a->type);
- if (typeName[qstrlen(typeName) - 1] == '*')
+ uint typeNameLen = qstrlen(typeName);
+ if (typeNameLen > 0 && typeName[typeNameLen - 1] == '*')
return *static_cast<void *const *>(a_ptr) == *static_cast<void *const *>(b_ptr);
+ if (a->is_null && b->is_null)
+ return true;
+
return a_ptr == b_ptr;
}
diff --git a/src/gui/embedded/qscreen_qws.cpp b/src/gui/embedded/qscreen_qws.cpp
index 8eb8123..9bd73a4 100644
--- a/src/gui/embedded/qscreen_qws.cpp
+++ b/src/gui/embedded/qscreen_qws.cpp
@@ -2739,7 +2739,7 @@ void QScreen::compose(int level, const QRegion &exposed, QRegion &blend,
default:
break;
}
- spanData.setup(qwsServer->backgroundBrush(), 256, QPainter::CompositionMode_SourceOver);
+ spanData.setup(qwsServer->backgroundBrush(), 256, QPainter::CompositionMode_Source);
spanData.dx = off.x();
spanData.dy = off.y();
} else if (!surface->isBuffered()) {
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index 1ced3d7..a767987 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -3360,12 +3360,6 @@ void QGraphicsView::paintEvent(QPaintEvent *event)
backgroundPainter.setClipRegion(d->backgroundPixmapExposed, Qt::ReplaceClip);
if (viewTransformed)
backgroundPainter.setTransform(viewTransform);
-#ifdef Q_WS_X11
-#undef X11
- if (backgroundPainter.paintEngine()->type() != QPaintEngine::X11)
-#define X11 qt_x11Data
-#endif
- backgroundPainter.setCompositionMode(QPainter::CompositionMode_Source);
QRectF backgroundExposedSceneRect = mapToScene(d->backgroundPixmapExposed.boundingRect()).boundingRect();
drawBackground(&backgroundPainter, backgroundExposedSceneRect);
d->backgroundPixmapExposed = QRegion();
diff --git a/src/gui/image/qimagepixmapcleanuphooks.cpp b/src/gui/image/qimagepixmapcleanuphooks.cpp
index 517fcb0..521e348 100644
--- a/src/gui/image/qimagepixmapcleanuphooks.cpp
+++ b/src/gui/image/qimagepixmapcleanuphooks.cpp
@@ -96,6 +96,11 @@ void QImagePixmapCleanupHooks::removeImageHook(_qt_image_cleanup_hook_64 hook)
void QImagePixmapCleanupHooks::executePixmapDataModificationHooks(QPixmapData* pmd)
{
QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks();
+ // the global destructor for the pixmap and image hooks might have
+ // been called already if the app is "leaking" global
+ // pixmaps/images
+ if (!h)
+ return;
for (int i = 0; i < h->pixmapModificationHooks.count(); ++i)
h->pixmapModificationHooks[i](pmd);
@@ -106,6 +111,11 @@ void QImagePixmapCleanupHooks::executePixmapDataModificationHooks(QPixmapData* p
void QImagePixmapCleanupHooks::executePixmapDataDestructionHooks(QPixmapData* pmd)
{
QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks();
+ // the global destructor for the pixmap and image hooks might have
+ // been called already if the app is "leaking" global
+ // pixmaps/images
+ if (!h)
+ return;
for (int i = 0; i < h->pixmapDestructionHooks.count(); ++i)
h->pixmapDestructionHooks[i](pmd);
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index 121e9ec..25a7750 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -320,9 +320,14 @@ static const char * x11_atomnames = {
"_XEMBED\0"
"_XEMBED_INFO\0"
+ // Wacom old. (before version 0.10)
"Wacom Stylus\0"
"Wacom Cursor\0"
"Wacom Eraser\0"
+
+ // Tablet
+ "STYLUS\0"
+ "ERASER\0"
};
Q_GUI_EXPORT QX11Data *qt_x11Data = 0;
@@ -2366,12 +2371,12 @@ void qt_init(QApplicationPrivate *priv, int,
gotStylus = true;
}
#else
- if (devs->type == ATOM(XWacomStylus)) {
+ if (devs->type == ATOM(XWacomStylus) || devs->type == ATOM(XTabletStylus)) {
deviceType = QTabletEvent::Stylus;
if (wacomDeviceName()->isEmpty())
wacomDeviceName()->append(devs->name);
gotStylus = true;
- } else if (devs->type == ATOM(XWacomEraser)) {
+ } else if (devs->type == ATOM(XWacomEraser) || devs->type == ATOM(XTabletEraser)) {
deviceType = QTabletEvent::XFreeEraser;
gotEraser = true;
}
diff --git a/src/gui/kernel/qt_x11_p.h b/src/gui/kernel/qt_x11_p.h
index d110084..14e04bb 100644
--- a/src/gui/kernel/qt_x11_p.h
+++ b/src/gui/kernel/qt_x11_p.h
@@ -675,6 +675,9 @@ struct QX11Data
XWacomCursor,
XWacomEraser,
+ XTabletStylus,
+ XTabletEraser,
+
NPredefinedAtoms,
_QT_SETTINGS_TIMESTAMP = NPredefinedAtoms,
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index c08d04a..2b8e097 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -1597,6 +1597,7 @@ bool QGL2PaintEngineEx::end()
delete d->shaderManager;
d->shaderManager = 0;
+ d->currentBrush = QBrush();
#ifdef QT_OPENGL_CACHE_AS_VBOS
if (!d->unusedVBOSToClean.isEmpty()) {
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp
index 4192dbb..da47f06 100644
--- a/src/openvg/qpaintengine_vg.cpp
+++ b/src/openvg/qpaintengine_vg.cpp
@@ -131,9 +131,8 @@ public:
void draw(VGPath path, const QPen& pen, const QBrush& brush, VGint rule = VG_EVEN_ODD);
void stroke(VGPath path, const QPen& pen);
void fill(VGPath path, const QBrush& brush, VGint rule = VG_EVEN_ODD);
- inline void releasePath(VGPath path);
- VGPath vectorPathToVGPath(const QVectorPath& path, bool forceNewPath = false);
- VGPath painterPathToVGPath(const QPainterPath& path, bool forceNewPath = false);
+ VGPath vectorPathToVGPath(const QVectorPath& path);
+ VGPath painterPathToVGPath(const QPainterPath& path);
VGPath roundedRectPath(const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode);
VGPaintType setBrush
(VGPaint paint, const QBrush& brush, VGMatrixMode mode,
@@ -179,8 +178,6 @@ public:
VGPath roundRectPath; // Cached path for quick drawing of rounded rects.
#endif
- VGPath reusablePath; // Reusable path for vectorPathToVGPath(), etc.
-
QTransform transform; // Currently active transform.
bool simpleTransform; // True if the transform is simple (non-projective).
qreal penScale; // Pen scaling factor from "transform".
@@ -353,8 +350,6 @@ void QVGPaintEnginePrivate::init()
roundRectPath = 0;
#endif
- reusablePath = 0;
-
simpleTransform = true;
pathTransformSet = false;
penScale = 1.0;
@@ -451,15 +446,6 @@ void QVGPaintEnginePrivate::initObjects()
VG_PATH_CAPABILITY_ALL);
vgAppendPathData(linePath, 2, segments, coords);
#endif
-
- // This path can be reused over and over by calling vgClearPath().
- reusablePath = vgCreatePath(VG_PATH_FORMAT_STANDARD,
- VG_PATH_DATATYPE_F,
- 1.0f, // scale
- 0.0f, // bias
- 32 + 1, // segmentCapacityHint
- 32 * 2, // coordCapacityHint
- VG_PATH_CAPABILITY_ALL);
}
void QVGPaintEnginePrivate::destroy()
@@ -479,8 +465,6 @@ void QVGPaintEnginePrivate::destroy()
if (roundRectPath)
vgDestroyPath(roundRectPath);
#endif
- if (reusablePath)
- vgDestroyPath(reusablePath);
#if !defined(QVG_NO_DRAW_GLYPHS)
QVGFontCache::Iterator it;
@@ -557,32 +541,19 @@ void QVGPaintEnginePrivate::updateTransform(QPaintDevice *pdev)
qt_scaleForTransform(transform, &penScale);
}
-inline void QVGPaintEnginePrivate::releasePath(VGPath path)
-{
- if (path == reusablePath)
- vgClearPath(path, VG_PATH_CAPABILITY_ALL);
- else
- vgDestroyPath(path);
-}
-
-VGPath QVGPaintEnginePrivate::vectorPathToVGPath(const QVectorPath& path, bool forceNewPath)
+VGPath QVGPaintEnginePrivate::vectorPathToVGPath(const QVectorPath& path)
{
int count = path.elementCount();
const qreal *points = path.points();
const QPainterPath::ElementType *elements = path.elements();
- VGPath vgpath;
- if (forceNewPath) {
- vgpath = vgCreatePath(VG_PATH_FORMAT_STANDARD,
- VG_PATH_DATATYPE_F,
- 1.0f, // scale
- 0.0f, // bias
- count + 1, // segmentCapacityHint
- count * 2, // coordCapacityHint
- VG_PATH_CAPABILITY_ALL);
- } else {
- vgpath = reusablePath;
- }
+ VGPath vgpath = vgCreatePath(VG_PATH_FORMAT_STANDARD,
+ VG_PATH_DATATYPE_F,
+ 1.0f, // scale
+ 0.0f, // bias
+ count + 1, // segmentCapacityHint
+ count * 2, // coordCapacityHint
+ VG_PATH_CAPABILITY_ALL);
// Size is sufficient segments for drawRoundedRect() paths.
QVarLengthArray<VGubyte, 20> segments;
@@ -754,22 +725,17 @@ VGPath QVGPaintEnginePrivate::vectorPathToVGPath(const QVectorPath& path, bool f
return vgpath;
}
-VGPath QVGPaintEnginePrivate::painterPathToVGPath(const QPainterPath& path, bool forceNewPath)
+VGPath QVGPaintEnginePrivate::painterPathToVGPath(const QPainterPath& path)
{
int count = path.elementCount();
- VGPath vgpath;
- if (forceNewPath) {
- vgpath = vgCreatePath(VG_PATH_FORMAT_STANDARD,
- VG_PATH_DATATYPE_F,
- 1.0f, // scale
- 0.0f, // bias
- count + 1, // segmentCapacityHint
- count * 2, // coordCapacityHint
- VG_PATH_CAPABILITY_ALL);
- } else {
- vgpath = reusablePath;
- }
+ VGPath vgpath = vgCreatePath(VG_PATH_FORMAT_STANDARD,
+ VG_PATH_DATATYPE_F,
+ 1.0f, // scale
+ 0.0f, // bias
+ count + 1, // segmentCapacityHint
+ count * 2, // coordCapacityHint
+ VG_PATH_CAPABILITY_ALL);
if (count == 0)
return vgpath;
@@ -988,7 +954,13 @@ VGPath QVGPaintEnginePrivate::roundedRectPath(const QRectF &rect, qreal xRadius,
vgModifyPathCoords(vgpath, 0, 9, pts);
}
#else
- VGPath vgpath = reusablePath;
+ VGPath vgpath = vgCreatePath(VG_PATH_FORMAT_STANDARD,
+ VG_PATH_DATATYPE_F,
+ 1.0f, // scale
+ 0.0f, // bias
+ 10, // segmentCapacityHint
+ 17 * 2, // coordCapacityHint
+ VG_PATH_CAPABILITY_ALL);
vgAppendPathData(vgpath, 10, roundedrect_types, pts);
#endif
@@ -1544,7 +1516,7 @@ void QVGPaintEngine::draw(const QVectorPath &path)
d->draw(vgpath, s->pen, s->brush, VG_EVEN_ODD);
else
d->draw(vgpath, s->pen, s->brush, VG_NON_ZERO);
- d->releasePath(vgpath);
+ vgDestroyPath(vgpath);
}
void QVGPaintEngine::fill(const QVectorPath &path, const QBrush &brush)
@@ -1555,7 +1527,7 @@ void QVGPaintEngine::fill(const QVectorPath &path, const QBrush &brush)
d->fill(vgpath, brush, VG_EVEN_ODD);
else
d->fill(vgpath, brush, VG_NON_ZERO);
- d->releasePath(vgpath);
+ vgDestroyPath(vgpath);
}
void QVGPaintEngine::stroke(const QVectorPath &path, const QPen &pen)
@@ -1563,7 +1535,7 @@ void QVGPaintEngine::stroke(const QVectorPath &path, const QPen &pen)
Q_D(QVGPaintEngine);
VGPath vgpath = d->vectorPathToVGPath(path);
d->stroke(vgpath, pen);
- d->releasePath(vgpath);
+ vgDestroyPath(vgpath);
}
// Determine if a co-ordinate transform is simple enough to allow
@@ -1759,7 +1731,7 @@ void QVGPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op)
default: break;
}
- d->releasePath(vgpath);
+ vgDestroyPath(vgpath);
vgSeti(VG_MASKING, VG_TRUE);
d->maskValid = true;
@@ -2076,7 +2048,7 @@ void QVGPaintEngine::clip(const QPainterPath &path, Qt::ClipOperation op)
default: break;
}
- d->releasePath(vgpath);
+ vgDestroyPath(vgpath);
vgSeti(VG_MASKING, VG_TRUE);
d->maskValid = true;
@@ -2515,7 +2487,7 @@ void QVGPaintEngine::drawRoundedRect(const QRectF &rect, qreal xrad, qreal yrad,
VGPath vgpath = d->roundedRectPath(rect, xrad, yrad, mode);
d->draw(vgpath, s->pen, s->brush);
#if defined(QVG_NO_MODIFY_PATH)
- d->releasePath(vgpath);
+ vgDestroyPath(vgpath);
#endif
} else {
QPaintEngineEx::drawRoundedRect(rect, xrad, yrad, mode);
@@ -2664,7 +2636,13 @@ void QVGPaintEngine::drawEllipse(const QRectF &r)
Q_D(QVGPaintEngine);
if (d->simpleTransform) {
QVGPainterState *s = state();
- VGPath path = d->reusablePath;
+ VGPath path = vgCreatePath(VG_PATH_FORMAT_STANDARD,
+ VG_PATH_DATATYPE_F,
+ 1.0f, // scale
+ 0.0f, // bias
+ 4, // segmentCapacityHint
+ 12, // coordCapacityHint
+ VG_PATH_CAPABILITY_ALL);
static VGubyte segments[4] = {
VG_MOVE_TO_ABS,
VG_SCCWARC_TO_REL,
@@ -2688,7 +2666,7 @@ void QVGPaintEngine::drawEllipse(const QRectF &r)
coords[11] = 0.0f;
vgAppendPathData(path, 4, segments, coords);
d->draw(path, s->pen, s->brush);
- d->releasePath(path);
+ vgDestroyPath(path);
} else {
// The projective transform version of an ellipse is difficult.
// Generate a QVectorPath containing cubic curves and transform that.
@@ -2712,7 +2690,7 @@ void QVGPaintEngine::drawPath(const QPainterPath &path)
d->draw(vgpath, s->pen, s->brush, VG_EVEN_ODD);
else
d->draw(vgpath, s->pen, s->brush, VG_NON_ZERO);
- d->releasePath(vgpath);
+ vgDestroyPath(vgpath);
}
void QVGPaintEngine::drawPoints(const QPointF *points, int pointCount)
@@ -2787,7 +2765,13 @@ void QVGPaintEngine::drawPolygon(const QPointF *points, int pointCount, PolygonD
{
Q_D(QVGPaintEngine);
QVGPainterState *s = state();
- VGPath path = d->reusablePath;
+ VGPath path = vgCreatePath(VG_PATH_FORMAT_STANDARD,
+ VG_PATH_DATATYPE_F,
+ 1.0f, // scale
+ 0.0f, // bias
+ pointCount + 1, // segmentCapacityHint
+ pointCount * 2, // coordCapacityHint
+ VG_PATH_CAPABILITY_ALL);
QVarLengthArray<VGfloat, 16> coords;
QVarLengthArray<VGubyte, 10> segments;
for (int i = 0; i < pointCount; ++i, ++points) {
@@ -2821,14 +2805,20 @@ void QVGPaintEngine::drawPolygon(const QPointF *points, int pointCount, PolygonD
d->draw(path, s->pen, s->brush, VG_EVEN_ODD);
break;
}
- d->releasePath(path);
+ vgDestroyPath(path);
}
void QVGPaintEngine::drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode)
{
Q_D(QVGPaintEngine);
QVGPainterState *s = state();
- VGPath path = d->reusablePath;
+ VGPath path = vgCreatePath(VG_PATH_FORMAT_STANDARD,
+ VG_PATH_DATATYPE_F,
+ 1.0f, // scale
+ 0.0f, // bias
+ pointCount + 1, // segmentCapacityHint
+ pointCount * 2, // coordCapacityHint
+ VG_PATH_CAPABILITY_ALL);
QVarLengthArray<VGfloat, 16> coords;
QVarLengthArray<VGubyte, 10> segments;
for (int i = 0; i < pointCount; ++i, ++points) {
@@ -2862,7 +2852,7 @@ void QVGPaintEngine::drawPolygon(const QPoint *points, int pointCount, PolygonDr
d->draw(path, s->pen, s->brush, VG_EVEN_ODD);
break;
}
- d->releasePath(path);
+ vgDestroyPath(path);
}
void QVGPaintEnginePrivate::setImageOptions()
@@ -3261,7 +3251,7 @@ void QVGFontGlyphCache::cacheGlyphs
ti.fontEngine->getUnscaledGlyph(glyph, &path, &metrics);
VGPath vgPath;
if (!path.isEmpty()) {
- vgPath = d->painterPathToVGPath(path, true);
+ vgPath = d->painterPathToVGPath(path);
} else {
// Probably a "space" character with no visible outline.
vgPath = VG_INVALID_HANDLE;
diff --git a/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp b/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp
index 7bcb74d..e78fec1 100644
--- a/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp
+++ b/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp
@@ -325,6 +325,36 @@ static const struct {
{ 0xffe8, Qt::Key_Meta },
{ 0xffe9, Qt::Key_Alt },
{ 0xffea, Qt::Key_Alt },
+
+ { 0xffb0, Qt::Key_0 },
+ { 0xffb1, Qt::Key_1 },
+ { 0xffb2, Qt::Key_2 },
+ { 0xffb3, Qt::Key_3 },
+ { 0xffb4, Qt::Key_4 },
+ { 0xffb5, Qt::Key_5 },
+ { 0xffb6, Qt::Key_6 },
+ { 0xffb7, Qt::Key_7 },
+ { 0xffb8, Qt::Key_8 },
+ { 0xffb9, Qt::Key_9 },
+
+ { 0xff8d, Qt::Key_Return },
+ { 0xffaa, Qt::Key_Asterisk },
+ { 0xffab, Qt::Key_Plus },
+ { 0xffad, Qt::Key_Minus },
+ { 0xffae, Qt::Key_Period },
+ { 0xffaf, Qt::Key_Slash },
+
+ { 0xff95, Qt::Key_Home },
+ { 0xff96, Qt::Key_Left },
+ { 0xff97, Qt::Key_Up },
+ { 0xff98, Qt::Key_Right },
+ { 0xff99, Qt::Key_Down },
+ { 0xff9a, Qt::Key_PageUp },
+ { 0xff9b, Qt::Key_PageDown },
+ { 0xff9c, Qt::Key_End },
+ { 0xff9e, Qt::Key_Insert },
+ { 0xff9f, Qt::Key_Delete },
+
{ 0, 0 }
};
@@ -483,6 +513,10 @@ bool QRfbKeyEvent::read(QTcpSocket *s)
keycode = keyMap[i].keycode;
i++;
}
+
+ if (keycode >= ' ' && keycode <= '~')
+ unicode = keycode;
+
if (!keycode) {
if (key <= 0xff) {
unicode = key;