summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/dialogs/qfilesystemmodel.cpp10
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp103
-rw-r--r--src/gui/graphicsview/qgraphicsitem.h7
-rw-r--r--src/gui/graphicsview/qgraphicsitem_p.h67
-rw-r--r--src/gui/graphicsview/qgraphicswidget.cpp14
-rw-r--r--src/gui/graphicsview/qgraphicswidget.h8
-rw-r--r--src/gui/graphicsview/qgraphicswidget_p.cpp51
-rw-r--r--src/gui/graphicsview/qgraphicswidget_p.h9
-rw-r--r--src/gui/painting/qbrush.cpp3
-rw-r--r--src/gui/text/qfontengine_win.cpp2
-rw-r--r--src/gui/text/qfontengine_win_p.h2
-rw-r--r--src/network/access/qnetworkdiskcache.cpp3
-rw-r--r--src/network/access/qnetworkdiskcache_p.h4
-rw-r--r--src/opengl/qglshaderprogram.cpp19
-rw-r--r--src/openvg/qpaintengine_vg.cpp41
-rw-r--r--src/xmlpatterns/api/qxmlresultitems.cpp4
16 files changed, 65 insertions, 282 deletions
diff --git a/src/gui/dialogs/qfilesystemmodel.cpp b/src/gui/dialogs/qfilesystemmodel.cpp
index 6fd947ce3b..24faa59d55 100644
--- a/src/gui/dialogs/qfilesystemmodel.cpp
+++ b/src/gui/dialogs/qfilesystemmodel.cpp
@@ -1361,6 +1361,16 @@ QModelIndex QFileSystemModel::setRootPath(const QString &newPath)
if (!showDrives && !newPathDir.exists())
return d->index(rootPath());
+ //We remove the watcher on the previous path
+ if (!rootPath().isEmpty() && rootPath() != QLatin1String(".")) {
+ //This remove the watcher for the old rootPath
+ d->fileInfoGatherer.removePath(rootPath());
+ //This line "marks" the node as dirty, so the next fetchMore
+ //call on the path will ask the gatherer to install a watcher again
+ //But it doesn't re-fetch everything
+ d->node(rootPath())->populatedChildren = false;
+ }
+
// We have a new valid root path
d->rootDir = newPathDir;
QModelIndex newRootIndex;
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 1b707b02d4..42abe59f85 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -5225,8 +5225,6 @@ void QGraphicsItemPrivate::addChild(QGraphicsItem *child)
needSortChildren = 1; // ### maybe 0
child->d_ptr->siblingIndex = children.size();
children.append(child);
- if (isObject)
- emit static_cast<QGraphicsObject *>(q_ptr)->childrenChanged();
}
/*!
@@ -5249,8 +5247,6 @@ void QGraphicsItemPrivate::removeChild(QGraphicsItem *child)
// the child is not guaranteed to be at the index after the list is sorted.
// (see ensureSortedChildren()).
child->d_ptr->siblingIndex = -1;
- if (isObject)
- emit static_cast<QGraphicsObject *>(q_ptr)->childrenChanged();
}
/*!
@@ -7458,88 +7454,6 @@ void QGraphicsObject::ungrabGesture(Qt::GestureType gesture)
}
}
-void QGraphicsItemPrivate::append(QDeclarativeListProperty<QGraphicsObject> *list, QGraphicsObject *item)
-{
- QGraphicsItemPrivate::get(item)->setParentItemHelper(static_cast<QGraphicsObject *>(list->object), /*newParentVariant=*/0, /*thisPointerVariant=*/0);
-}
-
-/*!
- Returns a list of this item's children.
-
- The items are sorted by stacking order. This takes into account both the
- items' insertion order and their Z-values.
-
-*/
-QDeclarativeListProperty<QGraphicsObject> QGraphicsItemPrivate::childrenList()
-{
- Q_Q(QGraphicsItem);
- if (isObject) {
- QGraphicsObject *that = static_cast<QGraphicsObject *>(q);
- return QDeclarativeListProperty<QGraphicsObject>(that, &children, QGraphicsItemPrivate::append);
- } else {
- //QGraphicsItem is not supported for this property
- return QDeclarativeListProperty<QGraphicsObject>();
- }
-}
-
-/*!
- \internal
- Returns the width of the item
- Reimplemented by QGraphicsWidget
-*/
-qreal QGraphicsItemPrivate::width() const
-{
- return 0;
-}
-
-/*!
- \internal
- Set the width of the item
- Reimplemented by QGraphicsWidget
-*/
-void QGraphicsItemPrivate::setWidth(qreal w)
-{
- Q_UNUSED(w);
-}
-
-/*!
- \internal
- Reset the width of the item
- Reimplemented by QGraphicsWidget
-*/
-void QGraphicsItemPrivate::resetWidth()
-{
-}
-
-/*!
- \internal
- Returns the height of the item
- Reimplemented by QGraphicsWidget
-*/
-qreal QGraphicsItemPrivate::height() const
-{
- return 0;
-}
-
-/*!
- \internal
- Set the height of the item
- Reimplemented by QGraphicsWidget
-*/
-void QGraphicsItemPrivate::setHeight(qreal h)
-{
- Q_UNUSED(h);
-}
-
-/*!
- \internal
- Reset the height of the item
- Reimplemented by QGraphicsWidget
-*/
-void QGraphicsItemPrivate::resetHeight()
-{
-}
-
/*!
\property QGraphicsObject::parent
\brief the parent of the item
@@ -7726,23 +7640,6 @@ void QGraphicsItemPrivate::resetHeight()
\sa scale, rotation, QGraphicsItem::transformOriginPoint()
*/
-/*!
- \fn void QGraphicsObject::widthChanged()
- \internal
-*/
-
-/*!
- \fn void QGraphicsObject::heightChanged()
- \internal
-*/
-
-/*!
-
- \fn QGraphicsObject::childrenChanged()
-
- This signal gets emitted whenever the children list changes
- \internal
-*/
/*!
\class QAbstractGraphicsShapeItem
diff --git a/src/gui/graphicsview/qgraphicsitem.h b/src/gui/graphicsview/qgraphicsitem.h
index 5023f60427..d72833bc6e 100644
--- a/src/gui/graphicsview/qgraphicsitem.h
+++ b/src/gui/graphicsview/qgraphicsitem.h
@@ -547,10 +547,6 @@ class Q_GUI_EXPORT QGraphicsObject : public QObject, public QGraphicsItem
Q_PROPERTY(qreal rotation READ rotation WRITE setRotation NOTIFY rotationChanged)
Q_PROPERTY(qreal scale READ scale WRITE setScale NOTIFY scaleChanged)
Q_PROPERTY(QPointF transformOriginPoint READ transformOriginPoint WRITE setTransformOriginPoint)
- Q_PRIVATE_PROPERTY(QGraphicsItem::d_func(), QDeclarativeListProperty<QGraphicsObject> children READ childrenList DESIGNABLE false NOTIFY childrenChanged)
- Q_PRIVATE_PROPERTY(QGraphicsItem::d_func(), qreal width READ width WRITE setWidth NOTIFY widthChanged RESET resetWidth FINAL)
- Q_PRIVATE_PROPERTY(QGraphicsItem::d_func(), qreal height READ height WRITE setHeight NOTIFY heightChanged RESET resetHeight FINAL)
- Q_CLASSINFO("DefaultProperty", "children")
Q_INTERFACES(QGraphicsItem)
public:
QGraphicsObject(QGraphicsItem *parent = 0);
@@ -575,9 +571,6 @@ Q_SIGNALS:
void zChanged();
void rotationChanged();
void scaleChanged();
- void childrenChanged();
- void widthChanged();
- void heightChanged();
protected:
QGraphicsObject(QGraphicsItemPrivate &dd, QGraphicsItem *parent, QGraphicsScene *scene);
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h
index 669ae1b06c..ea04e0be4d 100644
--- a/src/gui/graphicsview/qgraphicsitem_p.h
+++ b/src/gui/graphicsview/qgraphicsitem_p.h
@@ -71,62 +71,6 @@ QT_BEGIN_NAMESPACE
class QGraphicsItemPrivate;
-#ifndef QDECLARATIVELISTPROPERTY
-#define QDECLARATIVELISTPROPERTY
-template<typename T>
-struct QDeclarativeListProperty {
- typedef void (*AppendFunction)(QDeclarativeListProperty<T> *, T*);
- typedef int (*CountFunction)(QDeclarativeListProperty<T> *);
- typedef T *(*AtFunction)(QDeclarativeListProperty<T> *, int);
- typedef void (*ClearFunction)(QDeclarativeListProperty<T> *);
-
- QDeclarativeListProperty()
- : object(0), data(0), append(0), count(0), at(0), clear(0), dummy1(0), dummy2(0) {}
- QDeclarativeListProperty(QObject *o, QList<T *> &list)
- : object(o), data(&list), append(qlist_append), count(qlist_count), at(qlist_at),
- clear(qlist_clear), dummy1(0), dummy2(0) {}
- QDeclarativeListProperty(QObject *o, void *d, AppendFunction a, CountFunction c = 0, AtFunction t = 0,
- ClearFunction r = 0)
- : object(o), data(d), append(a), count(c), at(t), clear(r), dummy1(0), dummy2(0) {}
-
- bool operator==(const QDeclarativeListProperty &o) const {
- return object == o.object &&
- data == o.data &&
- append == o.append &&
- count == o.count &&
- at == o.at &&
- clear == o.clear;
- }
-
- QObject *object;
- void *data;
-
- AppendFunction append;
-
- CountFunction count;
- AtFunction at;
-
- ClearFunction clear;
-
- void *dummy1;
- void *dummy2;
-
-private:
- static void qlist_append(QDeclarativeListProperty *p, T *v) {
- ((QList<T *> *)p->data)->append(v);
- }
- static int qlist_count(QDeclarativeListProperty *p) {
- return ((QList<T *> *)p->data)->count();
- }
- static T *qlist_at(QDeclarativeListProperty *p, int idx) {
- return ((QList<T *> *)p->data)->at(idx);
- }
- static void qlist_clear(QDeclarativeListProperty *p) {
- return ((QList<T *> *)p->data)->clear();
- }
-};
-#endif
-
class QGraphicsItemCache
{
public:
@@ -293,7 +237,6 @@ public:
void resolveDepth();
void addChild(QGraphicsItem *child);
void removeChild(QGraphicsItem *child);
- QDeclarativeListProperty<QGraphicsObject> childrenList();
void setParentItemHelper(QGraphicsItem *parent, const QVariant *newParentVariant,
const QVariant *thisPointerVariant);
void childrenBoundingRectHelper(QTransform *x, QRectF *rect);
@@ -480,21 +423,11 @@ public:
inline QTransform transformToParent() const;
inline void ensureSortedChildren();
- static void append(QDeclarativeListProperty<QGraphicsObject> *list, QGraphicsObject *item);
static inline bool insertionOrder(QGraphicsItem *a, QGraphicsItem *b);
void ensureSequentialSiblingIndex();
inline void sendScenePosChange();
virtual void siblingOrderChange();
- // Private Properties
- virtual qreal width() const;
- virtual void setWidth(qreal);
- virtual void resetWidth();
-
- virtual qreal height() const;
- virtual void setHeight(qreal);
- virtual void resetHeight();
-
QRectF childrenBoundingRect;
QRectF needsRepaint;
QMap<QWidget *, QRect> paintedViewBoundingRects;
diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp
index 131ee879c4..4c5cffad3d 100644
--- a/src/gui/graphicsview/qgraphicswidget.cpp
+++ b/src/gui/graphicsview/qgraphicswidget.cpp
@@ -324,14 +324,6 @@ void QGraphicsWidget::resize(const QSizeF &size)
*/
/*!
-
- \fn QGraphicsWidget::geometryChanged()
-
- This signal gets emitted whenever the geometry of the item changes
- \internal
-*/
-
-/*!
\property QGraphicsWidget::geometry
\brief the geometry of the widget
@@ -392,17 +384,13 @@ void QGraphicsWidget::setGeometry(const QRectF &rect)
}
QSizeF oldSize = size();
QGraphicsLayoutItem::setGeometry(newGeom);
- emit geometryChanged();
+
// Send resize event
bool resized = newGeom.size() != oldSize;
if (resized) {
QGraphicsSceneResizeEvent re;
re.setOldSize(oldSize);
re.setNewSize(newGeom.size());
- if (oldSize.width() != newGeom.size().width())
- emit widthChanged();
- if (oldSize.height() != newGeom.size().height())
- emit heightChanged();
QApplication::sendEvent(this, &re);
}
}
diff --git a/src/gui/graphicsview/qgraphicswidget.h b/src/gui/graphicsview/qgraphicswidget.h
index 468a134418..f1d382bb44 100644
--- a/src/gui/graphicsview/qgraphicswidget.h
+++ b/src/gui/graphicsview/qgraphicswidget.h
@@ -73,7 +73,7 @@ class Q_GUI_EXPORT QGraphicsWidget : public QGraphicsObject, public QGraphicsLay
Q_PROPERTY(QPalette palette READ palette WRITE setPalette)
Q_PROPERTY(QFont font READ font WRITE setFont)
Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection RESET unsetLayoutDirection)
- Q_PROPERTY(QSizeF size READ size WRITE resize NOTIFY geometryChanged)
+ Q_PROPERTY(QSizeF size READ size WRITE resize)
Q_PROPERTY(QSizeF minimumSize READ minimumSize WRITE setMinimumSize)
Q_PROPERTY(QSizeF preferredSize READ preferredSize WRITE setPreferredSize)
Q_PROPERTY(QSizeF maximumSize READ maximumSize WRITE setMaximumSize)
@@ -81,10 +81,11 @@ class Q_GUI_EXPORT QGraphicsWidget : public QGraphicsObject, public QGraphicsLay
Q_PROPERTY(Qt::FocusPolicy focusPolicy READ focusPolicy WRITE setFocusPolicy)
Q_PROPERTY(Qt::WindowFlags windowFlags READ windowFlags WRITE setWindowFlags)
Q_PROPERTY(QString windowTitle READ windowTitle WRITE setWindowTitle)
- Q_PROPERTY(QRectF geometry READ geometry WRITE setGeometry NOTIFY geometryChanged)
+ Q_PROPERTY(QRectF geometry READ geometry WRITE setGeometry)
public:
QGraphicsWidget(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0);
~QGraphicsWidget();
+
QGraphicsLayout *layout() const;
void setLayout(QGraphicsLayout *layout);
void adjustSize();
@@ -174,9 +175,6 @@ public:
using QObject::children;
#endif
-Q_SIGNALS:
- void geometryChanged();
-
public Q_SLOTS:
bool close();
diff --git a/src/gui/graphicsview/qgraphicswidget_p.cpp b/src/gui/graphicsview/qgraphicswidget_p.cpp
index 6e397b67ef..1835c74f17 100644
--- a/src/gui/graphicsview/qgraphicswidget_p.cpp
+++ b/src/gui/graphicsview/qgraphicswidget_p.cpp
@@ -44,7 +44,6 @@
#ifndef QT_NO_GRAPHICSVIEW
#include <QtCore/qdebug.h>
-#include <QtCore/qnumeric.h>
#include "qgraphicswidget_p.h"
#include "qgraphicslayout.h"
#include "qgraphicsscene_p.h"
@@ -826,56 +825,6 @@ void QGraphicsWidgetPrivate::setLayout_helper(QGraphicsLayout *l)
}
}
-qreal QGraphicsWidgetPrivate::width() const
-{
- Q_Q(const QGraphicsWidget);
- return q->geometry().width();
-}
-
-void QGraphicsWidgetPrivate::setWidth(qreal w)
-{
- if (qIsNaN(w))
- return;
- Q_Q(QGraphicsWidget);
- if (q->geometry().width() == w)
- return;
-
- QRectF oldGeom = q->geometry();
-
- q->setGeometry(QRectF(q->x(), q->y(), w, height()));
-}
-
-void QGraphicsWidgetPrivate::resetWidth()
-{
- Q_Q(QGraphicsWidget);
- q->setGeometry(QRectF(q->x(), q->y(), 0, height()));
-}
-
-qreal QGraphicsWidgetPrivate::height() const
-{
- Q_Q(const QGraphicsWidget);
- return q->geometry().height();
-}
-
-void QGraphicsWidgetPrivate::setHeight(qreal h)
-{
- if (qIsNaN(h))
- return;
- Q_Q(QGraphicsWidget);
- if (q->geometry().height() == h)
- return;
-
- QRectF oldGeom = q->geometry();
-
- q->setGeometry(QRectF(q->x(), q->y(), width(), h));
-}
-
-void QGraphicsWidgetPrivate::resetHeight()
-{
- Q_Q(QGraphicsWidget);
- q->setGeometry(QRectF(q->x(), q->y(), width(), 0));
-}
-
QT_END_NAMESPACE
#endif //QT_NO_GRAPHICSVIEW
diff --git a/src/gui/graphicsview/qgraphicswidget_p.h b/src/gui/graphicsview/qgraphicswidget_p.h
index f34a755caa..2c5b3bfedd 100644
--- a/src/gui/graphicsview/qgraphicswidget_p.h
+++ b/src/gui/graphicsview/qgraphicswidget_p.h
@@ -130,15 +130,6 @@ public:
void windowFrameHoverLeaveEvent(QGraphicsSceneHoverEvent *event);
bool hasDecoration() const;
- // Private Properties
- qreal width() const;
- void setWidth(qreal);
- void resetWidth();
-
- qreal height() const;
- void setHeight(qreal);
- void resetHeight();
-
// State
inline int attributeToBitIndex(Qt::WidgetAttribute att) const
{
diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp
index 1a83b1d1cd..fcfc44d1ac 100644
--- a/src/gui/painting/qbrush.cpp
+++ b/src/gui/painting/qbrush.cpp
@@ -989,7 +989,8 @@ QDebug operator<<(QDebug dbg, const QBrush &b)
"LinearGradientPattern",
"RadialGradientPattern",
"ConicalGradientPattern",
- "TexturePattern"
+ 0, 0, 0, 0, 0, 0,
+ "TexturePattern" // 24
};
dbg.nospace() << "QBrush(" << b.color() << ',' << BRUSH_STYLES[b.style()] << ')';
diff --git a/src/gui/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp
index d126a2e0ad..eea196eb4c 100644
--- a/src/gui/text/qfontengine_win.cpp
+++ b/src/gui/text/qfontengine_win.cpp
@@ -654,6 +654,7 @@ static const ushort char_table[] = {
static const int char_table_entries = sizeof(char_table)/sizeof(ushort);
+#ifndef Q_CC_MINGW
void QFontEngineWin::getGlyphBearings(glyph_t glyph, qreal *leftBearing, qreal *rightBearing)
{
HDC hdc = shared_dc();
@@ -678,6 +679,7 @@ void QFontEngineWin::getGlyphBearings(glyph_t glyph, qreal *leftBearing, qreal *
}
#endif
}
+#endif // Q_CC_MINGW
qreal QFontEngineWin::minLeftBearing() const
{
diff --git a/src/gui/text/qfontengine_win_p.h b/src/gui/text/qfontengine_win_p.h
index f19e48eb5e..68b53b5235 100644
--- a/src/gui/text/qfontengine_win_p.h
+++ b/src/gui/text/qfontengine_win_p.h
@@ -106,7 +106,9 @@ public:
virtual QImage alphaMapForGlyph(glyph_t, const QTransform &xform);
virtual QImage alphaRGBMapForGlyph(glyph_t t, int margin, const QTransform &xform);
+#ifndef Q_CC_MINGW
virtual void getGlyphBearings(glyph_t glyph, qreal *leftBearing = 0, qreal *rightBearing = 0);
+#endif
int getGlyphIndexes(const QChar *ch, int numChars, QGlyphLayout *glyphs, bool mirrored) const;
void getCMap();
diff --git a/src/network/access/qnetworkdiskcache.cpp b/src/network/access/qnetworkdiskcache.cpp
index ec6817a604..cce6bd91f4 100644
--- a/src/network/access/qnetworkdiskcache.cpp
+++ b/src/network/access/qnetworkdiskcache.cpp
@@ -41,7 +41,6 @@
//#define QNETWORKDISKCACHE_DEBUG
-#ifndef QT_NO_NETWORKDISKCACHE
#include "qnetworkdiskcache.h"
#include "qnetworkdiskcache_p.h"
@@ -60,6 +59,8 @@
#define CACHE_POSTFIX QLatin1String(".cache")
#define MAX_COMPRESSION_SIZE (1024 * 1024 * 3)
+#ifndef QT_NO_NETWORKDISKCACHE
+
QT_BEGIN_NAMESPACE
/*!
diff --git a/src/network/access/qnetworkdiskcache_p.h b/src/network/access/qnetworkdiskcache_p.h
index ad46602bf7..b6df1793dc 100644
--- a/src/network/access/qnetworkdiskcache_p.h
+++ b/src/network/access/qnetworkdiskcache_p.h
@@ -59,6 +59,8 @@
#include <qhash.h>
#include <qtemporaryfile.h>
+#ifndef QT_NO_NETWORKDISKCACHE
+
QT_BEGIN_NAMESPACE
class QFile;
@@ -119,4 +121,6 @@ public:
QT_END_NAMESPACE
+#endif // QT_NO_NETWORKDISKCACHE
+
#endif // QNETWORKDISKCACHE_P_H
diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp
index 79484fa094..bbfc2d50da 100644
--- a/src/opengl/qglshaderprogram.cpp
+++ b/src/opengl/qglshaderprogram.cpp
@@ -969,17 +969,18 @@ GLuint QGLShaderProgram::programId() const
Any attributes that have not been explicitly bound when the program
is linked will be assigned locations automatically.
+ When this function is called after the program has been linked,
+ the program will need to be relinked for the change to take effect.
+
\sa attributeLocation()
*/
void QGLShaderProgram::bindAttributeLocation(const char *name, int location)
{
Q_D(QGLShaderProgram);
- if (!d->linked) {
- glBindAttribLocation(d->programGuard.id(), location, name);
- } else {
- qWarning() << "QGLShaderProgram::bindAttributeLocation(" << name
- << "): cannot bind after shader program is linked";
- }
+ if (!init())
+ return;
+ glBindAttribLocation(d->programGuard.id(), location, name);
+ d->linked = false; // Program needs to be relinked.
}
/*!
@@ -990,6 +991,9 @@ void QGLShaderProgram::bindAttributeLocation(const char *name, int location)
Any attributes that have not been explicitly bound when the program
is linked will be assigned locations automatically.
+ When this function is called after the program has been linked,
+ the program will need to be relinked for the change to take effect.
+
\sa attributeLocation()
*/
void QGLShaderProgram::bindAttributeLocation(const QByteArray& name, int location)
@@ -1005,6 +1009,9 @@ void QGLShaderProgram::bindAttributeLocation(const QByteArray& name, int locatio
Any attributes that have not been explicitly bound when the program
is linked will be assigned locations automatically.
+ When this function is called after the program has been linked,
+ the program will need to be relinked for the change to take effect.
+
\sa attributeLocation()
*/
void QGLShaderProgram::bindAttributeLocation(const QString& name, int location)
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp
index ce6e21ba69..ebf34f5a06 100644
--- a/src/openvg/qpaintengine_vg.cpp
+++ b/src/openvg/qpaintengine_vg.cpp
@@ -183,6 +183,7 @@ public:
qreal penScale; // Pen scaling factor from "transform".
QTransform pathTransform; // Calculated VG path transformation.
+ QTransform glyphTransform; // Calculated VG glyph transformation.
QTransform imageTransform; // Calculated VG image transformation.
bool pathTransformSet; // True if path transform set in the VG context.
@@ -500,24 +501,31 @@ extern bool qt_scaleForTransform(const QTransform &transform, qreal *scale);
void QVGPaintEnginePrivate::updateTransform(QPaintDevice *pdev)
{
- VGfloat devh = pdev->height() - 1;
+ VGfloat devh = pdev->height();
// Construct the VG transform by combining the Qt transform with
// the following viewport transformation:
- // | 1 0 0 | | 1 0 0.5 | | 1 0 0.5 |
- // | 0 -1 devh | * | 0 1 -0.5 | = | 0 -1 (0.5 + devh) |
- // | 0 0 1 | | 0 0 1 | | 0 0 1 |
+ // | 1 0 0 |
+ // | 0 -1 devh |
+ // | 0 0 1 |
+ // The glyph transform uses a slightly different transformation:
+ // | 1 0 0 | | 1 0 0.5 | | 1 0 0.5 |
+ // | 0 -1 devh - 1 | * | 0 1 -0.5 | = | 0 -1 (devh - 0.5) |
+ // | 0 0 1 | | 0 0 1 | | 0 0 1 |
// The full VG transform is effectively:
// 1. Apply the user's transformation matrix.
- // 2. Translate by (0.5, -0.5) to correct for Qt and VG putting
- // the centre of the pixel at different positions.
+ // 2. Translate glyphs by an extra (0.5, -0.5).
// 3. Flip the co-ordinate system upside down.
QTransform viewport(1.0f, 0.0f, 0.0f,
0.0f, -1.0f, 0.0f,
- 0.5f, devh + 0.5f, 1.0f);
+ 0.0f, devh, 1.0f);
+ QTransform gviewport(1.0f, 0.0f, 0.0f,
+ 0.0f, -1.0f, 0.0f,
+ 0.5f, devh - 0.5f, 1.0f);
// Compute the path transform and determine if it is projective.
pathTransform = transform * viewport;
+ glyphTransform = transform * gviewport;
bool projective = (pathTransform.m13() != 0.0f ||
pathTransform.m23() != 0.0f ||
pathTransform.m33() != 1.0f);
@@ -526,6 +534,7 @@ void QVGPaintEnginePrivate::updateTransform(QPaintDevice *pdev)
// so we will have to convert the co-ordinates ourselves.
// Change the matrix to just the viewport transformation.
pathTransform = viewport;
+ glyphTransform = gviewport;
simpleTransform = false;
} else {
simpleTransform = true;
@@ -533,13 +542,7 @@ void QVGPaintEnginePrivate::updateTransform(QPaintDevice *pdev)
pathTransformSet = false;
// The image transform is always the full transformation,
- // because it can be projective. It also does not need the
- // (0.5, -0.5) translation because vgDrawImage() implicitly
- // adds 0.5 to each co-ordinate.
- QTransform viewport2(1.0f, 0.0f, 0.0f,
- 0.0f, -1.0f, 0.0f,
- 0.0f, devh + 1, 1.0f);
- imageTransform = transform * viewport2;
+ imageTransform = transform * viewport;
// Calculate the scaling factor to use for turning cosmetic pens
// into ordinary non-cosmetic pens.
@@ -3317,7 +3320,7 @@ void QVGPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem)
}
// Set the transformation to use for drawing the current glyphs.
- QTransform glyphTransform(d->pathTransform);
+ QTransform glyphTransform(d->glyphTransform);
glyphTransform.translate(p.x(), p.y());
#if defined(QVG_NO_IMAGE_GLYPHS)
glyphTransform.scale(glyphCache->scaleX, glyphCache->scaleY);
@@ -3650,10 +3653,10 @@ void QVGCompositionHelper::fillBackground
} else {
// Set the path transform to the default viewport transformation.
- VGfloat devh = screenSize.height() - 1;
+ VGfloat devh = screenSize.height();
QTransform viewport(1.0f, 0.0f, 0.0f,
0.0f, -1.0f, 0.0f,
- -0.5f, devh + 0.5f, 1.0f);
+ 0.0f, devh, 1.0f);
d->setTransform(VG_MATRIX_PATH_USER_TO_SURFACE, viewport);
// Set the brush to use to fill the background.
@@ -3689,10 +3692,10 @@ void QVGCompositionHelper::drawCursorPixmap
}
// Set the image transformation and modes.
- VGfloat devh = screenSize.height() - 1;
+ VGfloat devh = screenSize.height();
QTransform transform(1.0f, 0.0f, 0.0f,
0.0f, -1.0f, 0.0f,
- -0.5f, devh + 0.5f, 1.0f);
+ 0.0f, devh, 1.0f);
transform.translate(offset.x(), offset.y());
d->setTransform(VG_MATRIX_IMAGE_USER_TO_SURFACE, transform);
d->setImageMode(VG_DRAW_IMAGE_NORMAL);
diff --git a/src/xmlpatterns/api/qxmlresultitems.cpp b/src/xmlpatterns/api/qxmlresultitems.cpp
index c474082eb1..98c5bdc813 100644
--- a/src/xmlpatterns/api/qxmlresultitems.cpp
+++ b/src/xmlpatterns/api/qxmlresultitems.cpp
@@ -70,6 +70,10 @@ QT_BEGIN_NAMESPACE
sequence and returns it, and current() always returns the QXmlItem
that next() returned the last time it was called.
+ \note When using the QXmlResultItems overload of QXmlQuery::evaluateTo()
+ to execute a query, it is advisable to create a new instance of this
+ class for each new set of results rather than reusing an old instance.
+
\sa QXmlItem::isNode(), QXmlItem::isAtomicValue(), QXmlNodeModelIndex
*/