if (color.alpha() == 255)
return engine->toString(color.name());
QString alphaString = QString::number(color.alphaF(), 'f');
- while (alphaString.endsWith('0'))
+ while (alphaString.endsWith(QLatin1Char('0')))
alphaString.chop(1);
- if (alphaString.endsWith('.'))
- alphaString += '0';
+ if (alphaString.endsWith(QLatin1Char('.')))
+ alphaString += QLatin1Char('0');
return engine->toString(QString::fromLatin1("rgba(%1, %2, %3, %4)").arg(color.red()).arg(color.green()).arg(color.blue()).arg(alphaString));
}
return r->context->m_fillStyle;
QV8Engine *engine = V8ENGINE_ACCESSOR();
- if ((value->IsString() && engine->toString(value) == "WindingFill")
+ if ((value->IsString() && engine->toString(value) == QStringLiteral("WindingFill"))
||(value->IsNumber() && value->NumberValue() == Qt::WindingFill)) {
r->context->state.fillRule = Qt::WindingFill;
- } else if ((value->IsString() && engine->toString(value) == "OddEvenFill")
+ } else if ((value->IsString() && engine->toString(value) == QStringLiteral("OddEvenFill"))
||(value->IsNumber() && value->NumberValue() == Qt::OddEvenFill)) {
r->context->state.fillRule = Qt::OddEvenFill;
} else {
if (color.alpha() == 255)
return engine->toString(color.name());
QString alphaString = QString::number(color.alphaF(), 'f');
- while (alphaString.endsWith('0'))
+ while (alphaString.endsWith(QLatin1Char('0')))
alphaString.chop(1);
- if (alphaString.endsWith('.'))
- alphaString += '0';
+ if (alphaString.endsWith(QLatin1Char('.')))
+ alphaString += QLatin1Char('0');
return engine->toString(QString::fromLatin1("rgba(%1, %2, %3, %4)").arg(color.red()).arg(color.green()).arg(color.blue()).arg(alphaString));
}
return r->context->m_strokeStyle;
styleResouce->brush.setTextureImage(patternTexture);
QString repetition = engine->toString(args[1]);
- if (repetition == "repeat" || repetition.isEmpty()) {
+ if (repetition == QStringLiteral("repeat") || repetition.isEmpty()) {
styleResouce->patternRepeatX = true;
styleResouce->patternRepeatY = true;
- } else if (repetition == "repeat-x") {
+ } else if (repetition == QStringLiteral("repeat-x")) {
styleResouce->patternRepeatX = true;
- } else if (repetition == "repeat-y") {
+ } else if (repetition == QStringLiteral("repeat-y")) {
styleResouce->patternRepeatY = true;
- } else if (repetition == "no-repeat") {
+ } else if (repetition == QStringLiteral("no-repeat")) {
styleResouce->patternRepeatY = false;
styleResouce->patternRepeatY = false;
} else {
newState.textAlign = QSGContext2D::Start;
newState.textBaseline = QSGContext2D::Alphabetic;
- m_fontString = "";
+ m_fontString.clear();
m_stateStack.clear();
m_stateStack.push(newState);
popState();
}
}
-QT_END_NAMESPACE
\ No newline at end of file
+QT_END_NAMESPACE
}
//### could cache properties rather than reconstructing each time
- QDeclarativePropertyPrivate::write(QDeclarativeProperty(target, "x"), currentPos.x(), QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding);
- QDeclarativePropertyPrivate::write(QDeclarativeProperty(target, "y"), currentPos.y(), QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding);
+ QDeclarativePropertyPrivate::write(QDeclarativeProperty(target, QStringLiteral("x")), currentPos.x(), QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding);
+ QDeclarativePropertyPrivate::write(QDeclarativeProperty(target, QStringLiteral("y")), currentPos.y(), QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding);
//adjust angle according to orientation
if (!fixed) {
else if (v > exitStart)
angle = endRotation * (v - exitStart) / exitInterval + angle * (exitInterval - (v - exitStart)) / exitInterval;
}
- QDeclarativePropertyPrivate::write(QDeclarativeProperty(target, "rotation"), angle, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding);
+ QDeclarativePropertyPrivate::write(QDeclarativeProperty(target, QStringLiteral("rotation")), angle, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding);
}
/*
public:
SpriteMaterialData(const char *vertexFile = 0, const char *fragmentFile = 0)
{
- QFile vf(vertexFile ? vertexFile : ":defaultshaders/spriteimagevertex.shader");
+ QFile vf(vertexFile ? QLatin1String(vertexFile) : QLatin1String(":defaultshaders/spriteimagevertex.shader"));
vf.open(QFile::ReadOnly);
m_vertex_code = vf.readAll();
- QFile ff(fragmentFile ? fragmentFile : ":defaultshaders/spriteimagefragment.shader");
+ QFile ff(fragmentFile ? QLatin1String(fragmentFile) : QLatin1String(":defaultshaders/spriteimagefragment.shader"));
ff.open(QFile::ReadOnly);
m_fragment_code = ff.readAll();
qmlRegisterType<QSGTargetAffector>(uri, 2, 0 , "Target");
//Exposed just for completeness
- qmlRegisterUncreatableType<QSGParticleAffector>(uri, 2, 0, "ParticleAffector", "Abstract type. Use one of the inheriting types instead.");
- qmlRegisterUncreatableType<QSGParticlePainter>(uri, 2, 0, "ParticlePainter", "Abstract type. Use one of the inheriting types instead.");
- qmlRegisterUncreatableType<QSGParticleExtruder>(uri, 2, 0, "ParticleExtruder", "Abstract type. Use one of the inheriting types instead.");
- qmlRegisterUncreatableType<QSGDirection>(uri, 2, 0, "NullVector", "Abstract type. Use one of the inheriting types instead.");
+ qmlRegisterUncreatableType<QSGParticleAffector>(uri, 2, 0, "ParticleAffector",
+ QStringLiteral("Abstract type. Use one of the inheriting types instead."));
+ qmlRegisterUncreatableType<QSGParticlePainter>(uri, 2, 0, "ParticlePainter",
+ QStringLiteral("Abstract type. Use one of the inheriting types instead."));
+ qmlRegisterUncreatableType<QSGParticleExtruder>(uri, 2, 0, "ParticleExtruder",
+ QStringLiteral("Abstract type. Use one of the inheriting types instead."));
+ qmlRegisterUncreatableType<QSGDirection>(uri, 2, 0, "NullVector",
+ QStringLiteral("Abstract type. Use one of the inheriting types instead."));
}
QT_END_NAMESPACE
QSGParticleGroupData* gd = new QSGParticleGroupData(0, this);//Default group
groupData.insert(0,gd);
- groupIds.insert("",0);
+ groupIds.insert(QString(), 0);
m_nextGroupId = 1;
}
int particleCount = 0;
if (painter->groups().isEmpty()){//Uses default particle
QStringList def;
- def << "";
+ def << QString();
painter->setGroups(def);
particleCount += groupData[0]->size();
groupData[0]->painters << painter;
if (!m_noiseSource.isEmpty())
image = QImage(m_noiseSource.toLocalFile()).scaled(QSize(m_gridSize, m_gridSize));
if (image.isNull())
- image = QImage(":defaultshaders/noise.png").scaled(QSize(m_gridSize, m_gridSize));
+ image = QImage(QStringLiteral(":defaultshaders/noise.png")).scaled(QSize(m_gridSize, m_gridSize));
for (int i=0; i<m_gridSize; i++)
for (int j=0; j<m_gridSize; j++)