-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatapageitemshowmore.cpp
35 lines (29 loc) · 1.33 KB
/
datapageitemshowmore.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "datapageitemshowmore.h"
#include "include/common.h"
datapageitemshowmore::datapageitemshowmore()
{
tableview = new QTableWidget();
mainlayout = new QVBoxLayout();
tableview->setColumnCount(2);
tableview->setHorizontalHeaderLabels(QStringList()<<u8"合约名"<<u8"价格");
//tableview->setModel(model);
//tableview->setEnabled(false);
tableview->setEditTriggers(QAbstractItemView::NoEditTriggers);
//tableview->setMinimumSize(400,400);
tableview->setStyleSheet("background-color:rgb(44,44,44)");
tableview->horizontalHeader()->setStyleSheet("QHeaderView::section{background-color:rgb(44,44,44);}");
tableview->verticalHeader()->hide();
tableview->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
tableview->setMinimumSize(400,400);
mainlayout->addWidget(tableview);
this->setStyleSheet("color:rgb(255,255,255)");
this->setLayout(mainlayout);
}
void datapageitemshowmore::addRow(QString name, double price){
log_error("datapageitemshowmore::addRow");
std::cout<<"Value:"<<price<<endl;
int rowcount = tableview->rowCount();
tableview->insertRow(rowcount);
tableview->setItem(rowcount,0,new QTableWidgetItem(name));
tableview->setItem(rowcount,1,new QTableWidgetItem(QString::number(price)));
}