34 Star 361 Fork 203

mahuifa/QMDemo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
widget.cpp 1022 Bytes
一键复制 编辑 原始数据 按行查看 历史
#include "widget.h"
#include "ui_widget.h"
#include "test1.h"
#include "test2.h"
#include "test3.h"
#include <QProcess>
#include <QDebug>
#include <qdir.h>
Widget::Widget(QWidget *parent)
: QWidget(parent)
, ui(new Ui::Widget)
{
ui->setupUi(this);
this->resize(800, 700);
qApp->setStyleSheet("*{font: 9pt '宋体';}");
this->setWindowTitle(QString("QXlsx操作Excel 示例程序 - V%1").arg(APP_VERSION));
}
Widget::~Widget()
{
delete ui;
}
void Widget::on_but_show_clicked()
{
InterFace* interFace = static_cast<InterFace*>(ui->tabWidget->currentWidget()); // 获取当前tabwidget中的widget并转换为接口对象
bool ret = QProcess::startDetached("D:/WPS Office/ksolaunch.exe",
QStringList() << QDir::currentPath() + "/" + interFace->getExcelName()); // 打开当前示例用到excel文件
if(!ret)
{
qWarning() << "打开Excel失败,请注意wps路径是否存在,或者替换其它程序打开excel";
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/mahuifa/QMDemo.git
git@gitee.com:mahuifa/QMDemo.git
mahuifa
QMDemo
QMDemo
master

搜索帮助