Do not assume implicit string-ish → QColor conversion

We want to mark the corresponding QColor ctor(s) explicit.
Use Qt::GlobalColor or the new QColor::fromString() instead.

Change-Id: I68bf75a094e6821b97682de5a0ffd975834d22d0
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This commit is contained in:
Marc Mutz 2022-02-15 10:13:46 +01:00
parent abe3b4c9b9
commit 61e3fe7fd9
3 changed files with 4 additions and 4 deletions

View File

@ -101,8 +101,8 @@ public:
m_colorNames << (str + " " + c);
QStringList duet = c.split(' ');
m_firstColor << duet[0];
m_secondColor << duet[1];
m_firstColor << QColor::fromString(duet[0]);
m_secondColor << QColor::fromString(duet[1]);
}
setAttribute(Qt::WA_OpaquePaintEvent, true);

View File

@ -3548,7 +3548,7 @@ void tst_QSettings::rainersSyncBugOnMac()
void tst_QSettings::recursionBug()
{
QPixmap pix(10,10);
pix.fill("blue");
pix.fill(Qt::blue);
{
QSettings settings(settingsPath("starrunner.ini"), QSettings::IniFormat);

View File

@ -2180,7 +2180,7 @@ void tst_QTextEdit::setDocumentPreservesPalette()
QPalette defaultPal = ed->palette();
QPalette whitePal = ed->palette();
whitePal.setColor(QPalette::Active, QPalette::Text, "white");
whitePal.setColor(QPalette::Active, QPalette::Text, Qt::white);
QVERIFY(whitePal != ed->palette());