| 10 | #include "ui_dataview.h" |
| 11 | |
| 12 | DataView::DataView(QWidget *parent) : |
| 13 | QWidget(parent), |
| 14 | ui(new Ui::DataView) |
| 15 | { |
| 16 | ui->setupUi(this); |
| 17 | |
| 18 | _keyLineEdit = new QLineEdit(); |
| 19 | _timeLineEdit = new QLineEdit(); |
| 20 | _typeLineEdit = new QLineEdit(); |
| 21 | _typeLineEdit->setEnabled(false); |
| 22 | _refcountLineEdit = new QLineEdit(); |
| 23 | _refcountLineEdit->setEnabled(false); |
| 24 | _encodLineEdit = new QLineEdit(); |
| 25 | _encodLineEdit->setEnabled(false); |
| 26 | _idletimeLineEdit = new QLineEdit(); |
| 27 | _idletimeLineEdit->setEnabled(false); |
| 28 | |
| 29 | _headHLayout = new QHBoxLayout(); |
| 30 | _headHLayout->addWidget(new QLabel("Key:"),2); |
| 31 | _headHLayout->addWidget(_keyLineEdit,8); |
| 32 | _headHLayout->addStretch(1); |
| 33 | _headHLayout->addWidget(new QLabel("Ttl(ms):"),2); |
| 34 | _headHLayout->addWidget(_timeLineEdit,4); |
| 35 | _headHLayout->addStretch(1); |
| 36 | _headHLayout->addWidget(new QLabel("Type:"),2); |
| 37 | _headHLayout->addWidget(_typeLineEdit,4); |
| 38 | _headHLayout->addStretch(1); |
| 39 | _headHLayout->addWidget(new QLabel("RefCount:"),2); |
| 40 | _headHLayout->addWidget(_refcountLineEdit,4); |
| 41 | _headHLayout->addStretch(1); |
| 42 | _headHLayout->addWidget(new QLabel("Encoding:"),2); |
| 43 | _headHLayout->addWidget(_encodLineEdit,4); |
| 44 | _headHLayout->addStretch(1); |
| 45 | _headHLayout->addWidget(new QLabel("IdleTime(s):"),2); |
| 46 | _headHLayout->addWidget(_idletimeLineEdit,4); |
| 47 | _headHLayout->addStretch(6); |
| 48 | |
| 49 | _tableView = new QTableView(this); |
| 50 | _itemTableModel = new ValueTableModel(this); |
| 51 | _itemTableModel->setColumnCount(0); |
| 52 | _tableView->setContextMenuPolicy(Qt::ActionsContextMenu); |
| 53 | _tableView->setAlternatingRowColors(false); |
| 54 | //_tableView->setItemDelegate(new ValueTableDelegate()); |
| 55 | _tableView->setModel(_itemTableModel); |
| 56 | _tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive); |
| 57 | _leftVlayout = new QVBoxLayout(); |
| 58 | _leftVlayout->addWidget(_tableView); |
| 59 | |
| 60 | _bodyAddButton = new QPushButton(tr("插入")); //Insert |
| 61 | _bodyDelButton = new QPushButton(tr("删除")); //Delete |
| 62 | _bodyRefreshButton = new QPushButton(tr("刷新")); //Refresh |
| 63 | _bodyOkButton = new QPushButton(tr("提交")); //Submit |
| 64 | _bodyAddHeadButton = new QPushButton(tr("链头插入")); //InsertHead |
| 65 | _bodyAddTailButton = new QPushButton(tr("链尾插入")); //InsertTail |
| 66 | _bodyDelHeadButton = new QPushButton(tr("删除链头")); //DeleteHead |
| 67 | _bodyDelTailButton = new QPushButton(tr("删除链尾")); //DeleteTail |
| 68 | _bodyAddHeadButton->setVisible(false); |
| 69 | _bodyAddTailButton->setVisible(false); |
nothing calls this directly
no test coverage detected