Make the main view model use the system colors and alternate row
background
This commit is contained in:
+4
-2
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user