From 8583410617c756e072ee997f918395d6f29b8246 Mon Sep 17 00:00:00 2001 From: Scott Kostyshak Date: Thu, 19 Mar 2020 10:16:19 -0400 Subject: [PATCH] Fix Qt deprecation warns for setTextColor() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit fixes the following warning from Qt 5.14: error: ‘void QTreeWidgetItem::setTextColor(int, const QColor&)’ is deprecated: Use QTreeWidgetItem::setForeground() instead [-Werror=deprecated-declarations] setForeground was introduced in Qt 4.2 [1]. We have a couple of commented out uses of a setTextColor() method in GuiDocument.cpp, but the QTextEdit::setTextColor() is not deprecated so no change is needed. [1] https://doc.qt.io/archives/qt-4.8/qtreewidgetitem.html#setForeground --- src/frontends/qt/PanelStack.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontends/qt/PanelStack.cpp b/src/frontends/qt/PanelStack.cpp index c61c8e0244..243542d321 100644 --- a/src/frontends/qt/PanelStack.cpp +++ b/src/frontends/qt/PanelStack.cpp @@ -212,7 +212,7 @@ static void setTreeItemStatus(QTreeWidgetItem * tree_item, bool enabled) // Change the color from black to gray or viceversa QPalette::ColorGroup new_color = enabled ? QPalette::Active : QPalette::Disabled; - tree_item->setTextColor(0, QApplication::palette().color(new_color, + tree_item->setForeground(0, QApplication::palette().color(new_color, QPalette::Text)); }