From 10457ff67b999e9cc99624801c635e7f25e0d5ef Mon Sep 17 00:00:00 2001 From: wumu <mayi@mayi.com> Date: 星期四, 31 八月 2023 23:36:05 +0800 Subject: [PATCH] 0831 --- internal_system_v1/clientmainwindow.cpp | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 115 insertions(+), 0 deletions(-) diff --git a/internal_system_v1/clientmainwindow.cpp b/internal_system_v1/clientmainwindow.cpp index f0b28a9..1d290f3 100644 --- a/internal_system_v1/clientmainwindow.cpp +++ b/internal_system_v1/clientmainwindow.cpp @@ -1,14 +1,129 @@ #include "clientmainwindow.h" #include "ui_clientmainwindow.h" +#include <QDebug> +#include <QFileDialog> ClientMainWindow::ClientMainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::ClientMainWindow) { ui->setupUi(this); + + initUi(); } ClientMainWindow::~ClientMainWindow() { delete ui; } + +void ClientMainWindow::initUi() +{ + m_searchInfo = new SearchInfo(this); + ui->tabWidget->addTab(m_searchInfo,"淇℃伅鏌ヨ"); + + m_coverInfo = new CoverInfo(this); + m_coverInfo->setParent(ui->tab); + + m_auditPro = new AuditProject(this); + m_auditworkload = new AuditWorkload(this); + m_problemMon = new ProblemMoney(this); + m_problemCnt = new ProblemCount(this); + m_probleRect = new ProblemRectification(this); + m_problemNotMon = new ProblemNotMoney(this); + m_punish = new Punish(this); + m_caseClue = new CaseClue(this); + + ui->stackedWidget->addWidget(m_auditPro); + ui->stackedWidget->addWidget(m_auditworkload); + ui->stackedWidget->addWidget(m_problemMon); + ui->stackedWidget->addWidget(m_problemCnt); + ui->stackedWidget->addWidget(m_probleRect); + ui->stackedWidget->addWidget(m_problemNotMon); + ui->stackedWidget->addWidget(m_punish); + ui->stackedWidget->addWidget(m_caseClue); + + ui->stackedWidget->setCurrentIndex(0); + +// m_searchInfo = new SearchInfo(this); +// ui->tabWidget->addTab(m_searchInfo,"淇℃伅鏌ヨ"); + +// m_coverInfo = new CoverInfo(this); +// m_coverInfo->setParent(ui->tab); + + +} + +void ClientMainWindow::on_pushButton_auditPro_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); +} + +void ClientMainWindow::on_pushButton_auditWorkload_clicked() +{ + ui->stackedWidget->setCurrentIndex(1); +} + +void ClientMainWindow::on_pushButton_problemMoney_clicked() +{ + ui->stackedWidget->setCurrentIndex(2); +} + +void ClientMainWindow::on_pushButton_problemCount_clicked() +{ + ui->stackedWidget->setCurrentIndex(3); +} + +void ClientMainWindow::on_pushButton_problemRectification_clicked() +{ + ui->stackedWidget->setCurrentIndex(4); +} + +void ClientMainWindow::on_pushButton_problemNotMoney_clicked() +{ + ui->stackedWidget->setCurrentIndex(5); +} + +void ClientMainWindow::on_pushButton_punish_clicked() +{ + ui->stackedWidget->setCurrentIndex(6); +} + +void ClientMainWindow::on_pushButton_caseClue_clicked() +{ + ui->stackedWidget->setCurrentIndex(7); +} + +void ClientMainWindow::on_pushButton_clicked() +{ + QXlsx::Document doc; + doc.write(1,2,"mayibase"); + doc.write(2,2,"is good"); + doc.write("A1","鐮佽殎杞欢"); + doc.mergeCells("A1:A4"); + doc.mergeCells("B1:C1"); + if(doc.saveAs("Data/test.xlsx")) + { + qDebug()<<"save is ok"; + }else{ + qDebug()<<"save is fail"; + } + +} + +void ClientMainWindow::on_pushButton_2_clicked() +{ + QXlsx::Document doc("test.xlsx"); + qDebug()<<doc.read("A1"); + qDebug()<<doc.read("B1"); + qDebug()<<doc.read("C1"); +} + +void ClientMainWindow::on_pushButton_openXlsxFile_clicked() +{ + QStringList files = QFileDialog::getOpenFileNames(this,"鎵撳紑鐢靛瓙鏂囨。","./","*.xlsx *.xls"); + qDebug()<<"files:"<<files; + for(auto f:files){ + ui->listWidget->addItem(f); + } +} -- Gitblit v1.8.0