Construct QColor instances from int instead of QString

Change-Id: I75c72d71fef024a2229f8f78a96d3f02a1fbf72b
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2020-11-16 23:42:08 +01:00
parent 900007e781
commit 5efbdd5f10
3 changed files with 8 additions and 8 deletions

View File

@@ -91,7 +91,7 @@ QList<QColor> BackgroundAction::colors()
static QColor alphaZero(Qt::transparent);
static QList<QColor> colorList = {alphaZero,
QColor(Qt::black),
QColor("#4c4e50"),
QColor(0x4c4e50),
QColor(Qt::darkGray),
QColor(Qt::lightGray),
QColor(Qt::white)};

View File

@@ -679,7 +679,7 @@ void FormEditorFlowActionItem::paint(QPainter *painter, const QStyleOptionGraphi
pen.setJoinStyle(Qt::MiterJoin);
pen.setCosmetic(true);
QColor flowColor = "#e71919";
QColor flowColor(0xe71919);
if (qmlItemNode().rootModelNode().hasAuxiliaryData("areaColor"))
flowColor = qmlItemNode().rootModelNode().auxiliaryData("areaColor").value<QColor>();
@@ -857,7 +857,7 @@ public:
bool hitTest = false)
: width(2)
, adjustedWidth(width / scaleFactor)
, color(QColor("#e71919"))
, color(QColor(0xe71919))
, lineBrush(QBrush(color))
, penStyle(Qt::SolidLine)
, dashPattern()
@@ -1776,7 +1776,7 @@ void FormEditorFlowDecisionItem::paint(QPainter *painter, const QStyleOptionGrap
pen.setJoinStyle(Qt::MiterJoin);
pen.setCosmetic(true);
QColor flowColor = "#e71919";
QColor flowColor(0xe71919);
if (qmlItemNode().rootModelNode().hasAuxiliaryData("blockColor"))
flowColor = qmlItemNode().rootModelNode().auxiliaryData("blockColor").value<QColor>();

View File

@@ -313,16 +313,16 @@ FormatDescriptions TextEditorSettingsPrivate::initialFormats()
Format(QColor(192, 0, 0), QColor()));
formatDescr.emplace_back(C_LOG_AUTHOR_NAME, tr("Log Author Name"),
tr("Applied to author names in VCS log."),
Format(QColor("#007af4"), QColor()));
Format(QColor(0x007af4), QColor()));
formatDescr.emplace_back(C_LOG_COMMIT_DATE, tr("Log Commit Date"),
tr("Applied to commit dates in VCS log."),
Format(QColor("#006600"), QColor()));
Format(QColor(0x006600), QColor()));
formatDescr.emplace_back(C_LOG_COMMIT_HASH, tr("Log Commit Hash"),
tr("Applied to commit hashes in VCS log."),
Format(QColor("#ff0000"), QColor()));
Format(QColor(0xff0000), QColor()));
formatDescr.emplace_back(C_LOG_DECORATION, tr("Log Decoration"),
tr("Applied to commit decorations in VCS log."),
Format(QColor("#ff00ff"), QColor()));
Format(QColor(0xff00ff), QColor()));
formatDescr.emplace_back(C_LOG_COMMIT_SUBJECT, tr("Log Commit Subject"),
tr("Applied to commit subjects in VCS log."),
Format{QColor{}, QColor{}});