From fb90b6016c0db6e9f45b072854aa9a5d6825a94b Mon Sep 17 00:00:00 2001 From: wumu <mayi@mayi.com> Date: 星期三, 08 五月 2024 22:16:20 +0800 Subject: [PATCH] 0508 --- internal_system_v1/coverinfo.cpp | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/internal_system_v1/coverinfo.cpp b/internal_system_v1/coverinfo.cpp index b1eb2ea..cf28952 100644 --- a/internal_system_v1/coverinfo.cpp +++ b/internal_system_v1/coverinfo.cpp @@ -1,20 +1,24 @@ -#include "coverinfo.h" +锘�#include "coverinfo.h" #include "ui_coverinfo.h" #include <QDebug> #include <QDirIterator> #include <QFileDialog> #include <QSqlQuery> #include <QSqlRecord> +#include "windows.h" int g_comId = 0; // 鍏ㄥ眬鍙橀噺锛屼繚瀛樺崟浣峣d +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(); // 浠庢暟鎹簱璇诲彇鏁版嵁 } @@ -42,6 +46,7 @@ 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()) @@ -56,6 +61,9 @@ 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; @@ -126,6 +134,7 @@ } if(business.size() > 0){ ui->label_business->setText(business); + ui->label_business->setToolTip(business); }else{ ui->label_business->setText(""); } -- Gitblit v1.8.0