From 2ccd293d722a235bf0fe04fcef187d9073422ebe Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 28 Sep 2011 16:43:20 +0200 Subject: Declarative: Compile on Windows. - Remove UTF8 special characters from comments in qsgcontext2d.cpp. Change-Id: I7ba71f7db72d6d31dec115483ff785a0ce79d0e2 Reviewed-on: http://codereview.qt-project.org/5738 Reviewed-by: Qt Sanity Bot Reviewed-by: Charles Yin Reviewed-by: Aaron Kennedy Reviewed-by: Roberto Raggi Reviewed-by: Gunnar Sletta --- src/declarative/items/context2d/qsgcontext2d.cpp | 20 +++++++++----------- .../items/context2d/qsgcontext2dtexture.cpp | 2 ++ .../items/context2d/qsgcontext2dtexture_p.h | 2 +- src/declarative/particles/qsgparticlegroup_p.h | 1 + src/declarative/particles/qsgparticlepainter.cpp | 2 +- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/declarative/items/context2d/qsgcontext2d.cpp b/src/declarative/items/context2d/qsgcontext2d.cpp index e98c614754..205809861b 100644 --- a/src/declarative/items/context2d/qsgcontext2d.cpp +++ b/src/declarative/items/context2d/qsgcontext2d.cpp @@ -332,9 +332,8 @@ public: v8::Persistent constructorPixelArray; v8::Persistent constructorImageData; }; -V8_DEFINE_EXTENSION(QSGContext2DEngineData, engineData); - +V8_DEFINE_EXTENSION(QSGContext2DEngineData, engineData) class QV8Context2DResource : public QV8ObjectResource { @@ -2639,7 +2638,6 @@ v8::Handle ctx2d_pixelArray_indexed_set(uint32_t index, v8::LocalUint32Value(); if (r && index > 0 && index < r->image.width() * r->image.height() * 4 && v > 0 && v <= 255) { const int w = r->image.width(); - const int h = r->image.height(); const int row = (index / 4) / w; const int col = (index / 4) % w; @@ -3082,14 +3080,14 @@ int baseLineOffset(QSGContext2D::TextBaseLineType value, const QFontMetrics &met { int offset = 0; switch (value) { - case QSGContext2D::QSGContext2D::Top: + case QSGContext2D::Top: break; - case QSGContext2D::QSGContext2D::Alphabetic: - case QSGContext2D::QSGContext2D::Middle: - case QSGContext2D::QSGContext2D::Hanging: + case QSGContext2D::Alphabetic: + case QSGContext2D::Middle: + case QSGContext2D::Hanging: offset = metrics.ascent(); break; - case QSGContext2D::QSGContext2D::Bottom: + case QSGContext2D::Bottom: offset = metrics.height(); break; } @@ -3104,12 +3102,12 @@ static int textAlignOffset(QSGContext2D::TextAlignType value, const QFontMetrics else if (value == QSGContext2D::End) value = QGuiApplication::layoutDirection() == Qt::LeftToRight ? QSGContext2D::Right: QSGContext2D::Left; switch (value) { - case QSGContext2D::QSGContext2D::Center: + case QSGContext2D::Center: offset = metrics.width(text)/2; break; - case QSGContext2D::QSGContext2D::Right: + case QSGContext2D::Right: offset = metrics.width(text); - case QSGContext2D::QSGContext2D::Left: + case QSGContext2D::Left: default: break; } diff --git a/src/declarative/items/context2d/qsgcontext2dtexture.cpp b/src/declarative/items/context2d/qsgcontext2dtexture.cpp index 4833c1301c..3f7692c0ba 100644 --- a/src/declarative/items/context2d/qsgcontext2dtexture.cpp +++ b/src/declarative/items/context2d/qsgcontext2dtexture.cpp @@ -155,7 +155,9 @@ bool QSGContext2DTexture::setCanvasWindow(const QRect& r) { if (m_canvasWindow != r) { m_canvasWindow = r; + return true; } + return false; } bool QSGContext2DTexture::setDirtyRect(const QRect &r) diff --git a/src/declarative/items/context2d/qsgcontext2dtexture_p.h b/src/declarative/items/context2d/qsgcontext2dtexture_p.h index 0fb315497a..c91d3fb2ba 100644 --- a/src/declarative/items/context2d/qsgcontext2dtexture_p.h +++ b/src/declarative/items/context2d/qsgcontext2dtexture_p.h @@ -100,7 +100,7 @@ public Q_SLOTS: protected: void paintWithoutTiles(); - virtual QPaintDevice* beginPainting() {m_painting = true;} + virtual QPaintDevice* beginPainting() {m_painting = true; return 0; } virtual void endPainting() {m_painting = false;} virtual QSGContext2DTile* createTile() const = 0; virtual void compositeTile(QSGContext2DTile* tile) = 0; diff --git a/src/declarative/particles/qsgparticlegroup_p.h b/src/declarative/particles/qsgparticlegroup_p.h index d0ac41ca79..a809b63e8a 100644 --- a/src/declarative/particles/qsgparticlegroup_p.h +++ b/src/declarative/particles/qsgparticlegroup_p.h @@ -57,6 +57,7 @@ class QSGParticleGroup : public QSGStochasticState, public QDeclarativeParserSta //Intercept children requests and assign to the group & system Q_PROPERTY(QDeclarativeListProperty particleChildren READ particleChildren DESIGNABLE false)//### Hidden property for in-state system definitions - ought not to be used in actual "Sprite" states Q_CLASSINFO("DefaultProperty", "particleChildren") + Q_INTERFACES(QDeclarativeParserStatus) public: explicit QSGParticleGroup(QObject* parent = 0); diff --git a/src/declarative/particles/qsgparticlepainter.cpp b/src/declarative/particles/qsgparticlepainter.cpp index 53f2421b9c..fe689ee4f7 100644 --- a/src/declarative/particles/qsgparticlepainter.cpp +++ b/src/declarative/particles/qsgparticlepainter.cpp @@ -65,7 +65,7 @@ QT_BEGIN_NAMESPACE */ QSGParticlePainter::QSGParticlePainter(QSGItem *parent) : QSGItem(parent), - m_system(0), m_count(0), m_sentinel(new QSGParticleData(0)), m_pleaseReset(true) + m_system(0), m_count(0), m_pleaseReset(true), m_sentinel(new QSGParticleData(0)) { } -- cgit v1.2.3