QtExamples/QtCustomDialogEx/ExDlgSetHeaders.cpp
touwoyimuli b265921182 feat: QFileDialog QMessageBox QInputDialog QColorDialog and QFontDialog
QFileDialog    文件对话框
QColorDialog   颜色对话框
QFontDialog    字体对话框
QInputDialog   输入对话框
QMessageBox    消息对话框
2019-10-08 00:18:34 +08:00

29 lines
678 B
C++

#include "ExDlgSetHeaders.h"
#include "ui_ExDlgSetHeaders.h"
#include <QMessageBox>
ExDlgSetHeaders::ExDlgSetHeaders(QWidget *parent) :
QDialog(parent),
ui(new Ui::ExDlgSetHeaders)
{
ui->setupUi(this);
m_model = new QStringListModel(this);
ui->listView->setModel(m_model);
}
ExDlgSetHeaders::~ExDlgSetHeaders()
{
QMessageBox::information(this,"提示","设置表头消息框被删除");
delete ui;
}
void ExDlgSetHeaders::setHeaderList(QStringList &headers)
{
m_model->setStringList(headers); //初始化字符串列表
}
QStringList ExDlgSetHeaders::headerList()
{
return m_model->stringList(); //返回字符串列表
}