Make the main view model use the system colors and alternate row

background
This commit is contained in:
Collin Kidder
2019-02-26 20:28:19 -05:00
parent b91dad5f03
commit 31961361dd
+4 -2
View File
@@ -227,6 +227,7 @@ QVariant CANFrameModel::data(const QModelIndex &index, int role) const
int dLen; int dLen;
QString tempString; QString tempString;
CANFrame thisFrame; CANFrame thisFrame;
static bool rowFlip = false;
if (!index.isValid()) if (!index.isValid())
return QVariant(); return QVariant();
@@ -246,8 +247,9 @@ QVariant CANFrameModel::data(const QModelIndex &index, int role) const
return msg->bgColor; return msg->bgColor;
} }
} }
//return QApplication::palette().color(QPalette::Button); rowFlip = !rowFlip;
return QColor(Qt::white); if (rowFlip) return QApplication::palette().color(QPalette::Base);
else return QApplication::palette().color(QPalette::AlternateBase);
} }
if (role == Qt::TextAlignmentRole) if (role == Qt::TextAlignmentRole)