aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/todo
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2019-08-29 11:40:38 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2019-09-03 09:15:30 +0000
commit82bcf4e9f54337faf24a7372cfd622632f4988f8 (patch)
tree8d6576cef11e1b6819f6567d872e28e4b450af28 /src/plugins/todo
parent6f4aa0458c991e3f81154469265899e30fe8121e (diff)
Remove usages of deprecated APIs
Replaced: QPalette::ColorRole::Background -> QPalette::ColorRole::Window QPalette::ColorRole::Foreground -> QPalette::ColorRole::WindowText Qt::ItemDataRole::TextColorRole -> Qt::ItemDataRole::ForegroundRole QFontMetrics::width() -> QFontMetrics::horizontalAdvance() Task-number: QTBUG-76491 Change-Id: I1302e6b569e725daa6f7be1428ffe055657fc644 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/todo')
-rw-r--r--src/plugins/todo/todoitemsmodel.cpp2
-rw-r--r--src/plugins/todo/todooutputpane.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/todo/todoitemsmodel.cpp b/src/plugins/todo/todoitemsmodel.cpp
index 03d48a13527..7776ec169cb 100644
--- a/src/plugins/todo/todoitemsmodel.cpp
+++ b/src/plugins/todo/todoitemsmodel.cpp
@@ -78,7 +78,7 @@ QVariant TodoItemsModel::data(const QModelIndex &index, int role) const
TodoItem item = m_todoItemsList->at(index.row());
- if (role == Qt::TextColorRole)
+ if (role == Qt::ForegroundRole)
return item.color;
switch (index.column()) {
diff --git a/src/plugins/todo/todooutputpane.cpp b/src/plugins/todo/todooutputpane.cpp
index 9f8a528124a..940f6e97f23 100644
--- a/src/plugins/todo/todooutputpane.cpp
+++ b/src/plugins/todo/todooutputpane.cpp
@@ -178,7 +178,7 @@ void TodoOutputPane::todoTreeViewClicked(const QModelIndex &index)
item.text = index.sibling(row, Constants::OUTPUT_COLUMN_TEXT).data().toString();
item.file = Utils::FilePath::fromUserInput(index.sibling(row, Constants::OUTPUT_COLUMN_FILE).data().toString());
item.line = index.sibling(row, Constants::OUTPUT_COLUMN_LINE).data().toInt();
- item.color = index.data(Qt::TextColorRole).value<QColor>();
+ item.color = index.data(Qt::ForegroundRole).value<QColor>();
item.iconType = static_cast<IconType>(index.sibling(row, Constants::OUTPUT_COLUMN_TEXT)
.data(Qt::UserRole).toInt());