| | |
| | | #include "coverinfo.h" |
| | | #include "coverinfo.h" |
| | | #include "ui_coverinfo.h" |
| | | #include <QDebug> |
| | | #include <QDirIterator> |
| | | #include <QFileDialog> |
| | | #include <QSqlQuery> |
| | | #include <QSqlRecord> |
| | | #include "windows.h" |
| | | |
| | | #pragma execution_character_set("utf-8") |
| | | |
| | | int g_comId = 0; // 全局变量,保存单位id |
| | | QString g_dataRootPath; // 数据的根目录 |
| | | |
| | | CoverInfo::CoverInfo(QWidget *parent) : |
| | | QMainWindow(parent), |
| | | ui(new Ui::CoverInfo) |
| | | { |
| | | ui->setupUi(this); |
| | | readInfo(); |
| | | readDataFromSQL(); // 从数据库读取数据 |
| | | CoInitializeEx(NULL, COINIT_MULTITHREADED); // 先将COM库初始化 |
| | | |
| | | //readInfo(); |
| | | //readDataFromSQL(); // 从数据库读取数据 |
| | | |
| | | } |
| | | |
| | |
| | | if(dirRe.exists()){ |
| | | dirPath = dirPathRelease; |
| | | } |
| | | g_dataRootPath = dirPath; // 将根目录保存起来 |
| | | QStringList list; |
| | | QDirIterator it(dirPath, {"*.xls","*.xlsx"}, QDir::Files | QDir::NoSymLinks | QDir::NoDotAndDotDot, QDirIterator::Subdirectories); |
| | | while(it.hasNext()) |
| | |
| | | qDebug()<<"index:"<<index; |
| | | if(index > 0){ |
| | | QAxObject excel("Excel.Application"); |
| | | if(!excel.setControl("Excel.Application")){ |
| | | excel.setControl("ket.Application"); // wps内核 |
| | | } |
| | | excel.setProperty("Visible",false); |
| | | excel.setProperty("DisplayAlerts",false); |
| | | qDebug()<<"open:"<<str; |
| | |
| | | } |
| | | if(business.size() > 0){ |
| | | ui->label_business->setText(business); |
| | | ui->label_business->setToolTip(business); |
| | | }else{ |
| | | ui->label_business->setText(""); |
| | | } |