@@ -39,29 +39,43 @@ mbServerDeviceUi::mbServerDeviceUi(mbServerDevice *device, QWidget *parent) :
3939
4040 m_timerId = 0 ;
4141
42+ QTableView *tbl;
43+
4244 m_device = device;
4345 connect (device, &mbServerDevice::nameChanged, this , &mbServerDeviceUi::deviceChanged);
4446 connect (device, &mbServerDevice::changed, this , &mbServerDeviceUi::deviceChanged);
4547 // memory models
4648 m_model_0x = new mbServerDeviceUiModel_0x (m_device, this );
47- ui->tableView_0x ->setModel (m_model_0x);
48- ui->tableView_0x ->setItemDelegate (new mbServerDeviceUiDelegateBool (this ));
49- ui->tableView_0x ->setSelectionMode (QAbstractItemView::ContiguousSelection);
49+ tbl = ui->tableView_0x ;
50+ tbl->setModel (m_model_0x);
51+ tbl->setItemDelegate (new mbServerDeviceUiDelegateBool (this ));
52+ tbl->setSelectionMode (QAbstractItemView::ContiguousSelection);
53+ tbl->setAlternatingRowColors (true );
54+ tbl->setStyleSheet (" QHeaderView::section { background-color:lightgray }" );
5055
5156 m_model_1x = new mbServerDeviceUiModel_1x (m_device, this );
52- ui->tableView_1x ->setModel (m_model_1x);
53- ui->tableView_1x ->setItemDelegate (new mbServerDeviceUiDelegateBool (this ));
54- ui->tableView_1x ->setSelectionMode (QAbstractItemView::ContiguousSelection);
57+ tbl = ui->tableView_1x ;
58+ tbl->setModel (m_model_1x);
59+ tbl->setItemDelegate (new mbServerDeviceUiDelegateBool (this ));
60+ tbl->setSelectionMode (QAbstractItemView::ContiguousSelection);
61+ tbl->setAlternatingRowColors (true );
62+ tbl->setStyleSheet (" QHeaderView::section { background-color:lightgray }" );
5563
5664 m_model_3x = new mbServerDeviceUiModel_3x (m_device, this );
57- ui->tableView_3x ->setModel (m_model_3x);
58- ui->tableView_3x ->setItemDelegate (new mbServerDeviceUiDelegate (this ));
59- ui->tableView_3x ->setSelectionMode (QAbstractItemView::ContiguousSelection);
65+ tbl = ui->tableView_3x ;
66+ tbl->setModel (m_model_3x);
67+ tbl->setItemDelegate (new mbServerDeviceUiDelegate (this ));
68+ tbl->setSelectionMode (QAbstractItemView::ContiguousSelection);
69+ tbl->setAlternatingRowColors (true );
70+ tbl->setStyleSheet (" QHeaderView::section { background-color:lightgray }" );
6071
6172 m_model_4x = new mbServerDeviceUiModel_4x (m_device, this );
62- ui->tableView_4x ->setModel (m_model_4x);
63- ui->tableView_4x ->setItemDelegate (new mbServerDeviceUiDelegate (this ));
64- ui->tableView_4x ->setSelectionMode (QAbstractItemView::ContiguousSelection);
73+ tbl = ui->tableView_4x ;
74+ tbl->setModel (m_model_4x);
75+ tbl->setItemDelegate (new mbServerDeviceUiDelegate (this ));
76+ tbl->setSelectionMode (QAbstractItemView::ContiguousSelection);
77+ tbl->setAlternatingRowColors (true );
78+ tbl->setStyleSheet (" QHeaderView::section { background-color:lightgray }" );
6579
6680 connect (ui->tabWidget , &QTabWidget::currentChanged, this , &mbServerDeviceUi::tabChanged);
6781}
0 commit comments