From c2fc1f179ec2265a28305d93a840fe22e2de9a15 Mon Sep 17 00:00:00 2001 From: Ludovic LANGE Date: Sat, 24 Sep 2022 22:06:09 +0200 Subject: [PATCH] replace BackgroundColorRole/TextColorRole with BackgroundRole/ForegroundRole (qt6) Since long time ago (12yrs), Qt::BackgroundColorRole/Qt::TextColorRole are aliased by Qt::BackgroundRole/Qt::ForegroundRole and raise a deprecation warning. Qt6 remove those values, thus we need to use Qt::BackgroundRole/Qt::ForegroundRole. --- canframemodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/canframemodel.cpp b/canframemodel.cpp index cdcaa19..c69080f 100644 --- a/canframemodel.cpp +++ b/canframemodel.cpp @@ -408,7 +408,7 @@ QVariant CANFrameModel::data(const QModelIndex &index, int role) const const unsigned char *data = reinterpret_cast(thisFrame.payload().constData()); int dataLen = thisFrame.payload().count(); - if (role == Qt::BackgroundColorRole) + if (role == Qt::BackgroundRole) { if (dbcHandler != nullptr && interpretFrames && !ignoreDBCColors) { @@ -441,7 +441,7 @@ QVariant CANFrameModel::data(const QModelIndex &index, int role) const } } - if (role == Qt::TextColorRole) + if (role == Qt::ForegroundRole) { if (dbcHandler != nullptr && interpretFrames && !ignoreDBCColors) {