diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index 25e0222707..7dfcbd03ad 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -2118,8 +2118,7 @@ QPixmap MainWindow::splashImage() const y = h - 20; } - QColor color; - color.setNamedColor(QString::fromLatin1(tc->second.c_str())); + QColor color(QString::fromLatin1(tc->second.c_str())); if (color.isValid()) { painter.setPen(color); painter.setFont(fontExe); @@ -2129,8 +2128,7 @@ QPixmap MainWindow::splashImage() const } painter.setFont(fontVer); painter.drawText(x + (l + 235), y - 7, version); - QColor warningColor; - warningColor.setNamedColor(QString::fromLatin1(wc->second.c_str())); + QColor warningColor(QString::fromLatin1(wc->second.c_str())); if (suffix == QLatin1String("dev") && warningColor.isValid()) { fontVer.setPointSizeF(14.0); painter.setFont(fontVer); diff --git a/src/Gui/Splashscreen.cpp b/src/Gui/Splashscreen.cpp index 28ebd96d39..da6f9e48cf 100644 --- a/src/Gui/Splashscreen.cpp +++ b/src/Gui/Splashscreen.cpp @@ -162,7 +162,7 @@ public: // choose text color auto tc = cfg.find("SplashTextColor"); if (tc != cfg.end()) { - QColor col; col.setNamedColor(QString::fromLatin1(tc->second.c_str())); + QColor col(QString::fromStdString(tc->second)); if (col.isValid()) { textColor = col; } diff --git a/src/Gui/View3DPy.cpp b/src/Gui/View3DPy.cpp index 9ec7fb3a07..4936080ce2 100644 --- a/src/Gui/View3DPy.cpp +++ b/src/Gui/View3DPy.cpp @@ -877,7 +877,7 @@ Py::Object View3DInventorPy::saveImage(const Py::Tuple& args) if (colname.compare(QLatin1String("Current"), Qt::CaseInsensitive) == 0) bg = QColor(); // assign an invalid color here else - bg.setNamedColor(colname); + bg = QColor(colname); QImage img; getView3DIventorPtr()->getViewer()->savePicture(w, h, s, bg, img); @@ -926,7 +926,7 @@ Py::Object View3DInventorPy::saveVectorGraphic(const Py::Tuple& args) if (colname.compare(QLatin1String("Current"), Qt::CaseInsensitive) == 0) bg = getView3DIventorPtr()->getViewer()->backgroundColor(); else - bg.setNamedColor(colname); + bg = QColor(colname); getView3DIventorPtr()->getViewer()->saveGraphic(ps,bg,vo.get()); out->closeFile(); diff --git a/src/Mod/Spreadsheet/Gui/SheetTableView.cpp b/src/Mod/Spreadsheet/Gui/SheetTableView.cpp index fb57a8f85c..3a9f33585c 100644 --- a/src/Mod/Spreadsheet/Gui/SheetTableView.cpp +++ b/src/Mod/Spreadsheet/Gui/SheetTableView.cpp @@ -1159,8 +1159,7 @@ QString SheetTableView::toHtml() const boldFont.setBold(true); boldFormat.setFont(boldFont); - QColor bgColor; - bgColor.setNamedColor(QLatin1String("#f0f0f0")); + QColor bgColor(QLatin1String("#f0f0f0")); QTextCharFormat bgFormat; bgFormat.setBackground(QBrush(bgColor));