48 lines
957 B
C++
48 lines
957 B
C++
#ifndef HISTORICALRECORDS_H
|
|
#define HISTORICALRECORDS_H
|
|
|
|
#include <QWidget>
|
|
#include <QtSql>
|
|
#include <QDataWidgetMapper>
|
|
#include <QSqlTableModel>
|
|
#include <QTableView>
|
|
namespace Ui {
|
|
class historicalrecords;
|
|
}
|
|
|
|
class historicalrecords : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit historicalrecords(QWidget *parent = nullptr);
|
|
~historicalrecords();
|
|
|
|
private slots:
|
|
void on_pushButton_clicked();
|
|
|
|
void on_pushButton_2_clicked();
|
|
|
|
void on_pushButton_3_clicked();
|
|
|
|
|
|
|
|
void on_pushButton_4_clicked();
|
|
|
|
private:
|
|
Ui::historicalrecords *ui;
|
|
void exportTableViewToExcel(QTableView* tableView);
|
|
QString getDesktopPath();
|
|
QSqlTableModel* model;
|
|
// QSqlQueryModel *model;
|
|
QSqlQuery query;
|
|
void exportTableViewToCsv(const QString &filePath);
|
|
|
|
|
|
|
|
void openTable();//打开数据表
|
|
void getFieldNames();//获取字段名称,填充“排序字段”的comboBox
|
|
};
|
|
|
|
#endif // HISTORICALRECORDS_H
|