wumu
2025-02-26 637610bcf851d70657c2dcf251d6daed2429a9a5
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
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "leadingcompany.h"
#include "ui_leadingcompany.h"
 
#pragma execution_character_set("utf-8")
 
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));
}