#include "leadingcompany.h" #include "ui_leadingcompany.h" LeadingCompany::LeadingCompany(QWidget *parent) : QMainWindow(parent), ui(new Ui::LeadingCompany) { ui->setupUi(this); ui->menubar->hide(); ui->statusbar->hide(); m_industryLeaderModel = new QStandardItemModel(this); m_industryLeaderModel->setColumnCount(6); m_trendLeaderModel = new QStandardItemModel(this); m_trendLeaderModel->setColumnCount(7); ui->tableView_industry->setModel(m_industryLeaderModel); ui->tableView_trend->setModel(m_trendLeaderModel); QStringList industryLabels; industryLabels<<"åå—"<<"代å·"<<"行业"<<"ç‰çº§"<<"市值"<<"收盘价"; m_industryLeaderModel->setHorizontalHeaderLabels(industryLabels); QStringList trendLabels; trendLabels<<"åå—"<<"代å·"<<"趋势方å‘"<<"行业"<<"ç‰çº§"<<"市值"<<"收盘价"; m_trendLeaderModel->setHorizontalHeaderLabels(trendLabels); } LeadingCompany::~LeadingCompany() { delete ui; } void LeadingCompany::on_pushButton_add_clicked() { QString name = ui->lineEdit_stockName->text(); QString code = ui->lineEdit_stockCode->text(); QString type = ui->comboBox->currentText(); // æ·»åŠ åˆ°æ•°æ®åº“ // æ·»åŠ åˆ°æ–‡æœ¬æµè§ˆå™¨æ¥æç¤ºæ¶ˆæ¯ ui->textBrowser->append(QString("%1 %2 %3").arg(type).arg(name).arg(code)); }