forked from qt-creator/qt-creator
Use QString::*Ref method
Change-Id: I63a10f274dd17e08b5b8a2577762cc9f7960b5af Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
committed by
Laurent Montel
parent
384d141aac
commit
158ab3316e
@@ -83,8 +83,7 @@ QColor QmlJS::toQColor(const QString &qmlColorString)
|
||||
bool ok;
|
||||
const int alpha = qmlColorString.midRef(1, 2).toInt(&ok, 16);
|
||||
if (ok) {
|
||||
QString name(qmlColorString.at(0));
|
||||
name.append(qmlColorString.right(6));
|
||||
const QString name = qmlColorString.at(0) + qmlColorString.rightRef(6);
|
||||
if (QColor::isValidColor(name)) {
|
||||
color.setNamedColor(name);
|
||||
color.setAlpha(alpha);
|
||||
|
||||
Reference in New Issue
Block a user