当前位置:网站首页>Qpprocess class
Qpprocess class
2022-07-22 14:46:00 【novanova2009】
QStringList Used to set parameters of external programs . It can also be done through setArguments() To set up ( Need to call start Previous call ).
QString program = "./path/to/program"; // Use double slash or not ?
QStringList arguments;
arguments << "-style" << "fusion"; // No spaces are required ?
QProcess *myProcess = new QProcess(this);
myProcess->start(program,arguments);
After the program starts running , issue started() The signal .QProcess But put one process As a sequence IO To treat , Therefore, it can be read and written , namely write(), read(), readLine() as well as getChar().process after , issue finished() The signal .finished The parameters of the signal include exitCode and exitStatus, Use them separately exitCode() and exitStatus() To obtain a .process after , You can still continue to read the buffer .
QProcess You can handle relative paths and absolute paths . Absolute path is recommended . for example :
QString program_path = QCoreApplication::applicationDirPath();
QString program = program_path + "./program";
Programs can use no extension exe, This can be achieved linux and windows Platform independent features . Besides , You can use all of /,QProcess Will be in windows Upper automatic change to \.
QProcess Can read standard output and standard error Output . If there is output , Will be issued readyReadStandardOutput() and readyReadStandardError() The signal , have access to readAllStandardOutput() or readAllStandardError() To read all the data .
边栏推荐
- Openresty Lua resty lock database lock
- 我的创作纪念日
- 网络分析---并查集上做差分
- openresty lua-resty-lock数据库锁
- C#接口基础知识重构
- 2022起重机司机(限桥式起重机)考试题库及答案
- Find problems: sequential search and dichotomy search
- [idea] common shortcut keys of idea
- 【Harmony OS】【ARK UI】ETS的List实现下拉刷新功能实现
- 深度学习-神经网络-循环神经网络(一):RNN(Recurrent Neural Network,循环神经网络;1990年)
猜你喜欢
LabVIEW cluster cannot contain input and output controls at the same time
2022r1 fast opening pressure vessel operation test and simulation test
Install Wamp with Tencent ECs, which shows that MySQL cannot be connected
Some experience of code specification
【服务器数据恢复】华为某型号服务器raid6数据恢复案例
【HMS core】【FAQ】【Account Kit】典型问题集2
Leetcode 215: the kth largest element in the array
109. 有序链表转换二叉搜索树 ●●
实操演示:如何用 ONES 制定 Scrum 迭代计划?
OS09- AutoSAR OS事件机制和实例解析
随机推荐
HCIA-R&S自用笔记(14)RIP协议
力扣(LeetCode)202. 快乐数(2022.07.21)
【电路设计】充电台灯电路拆解
PyTorch模型训练:设置随机种子,保证每次训练的结果都一样
[deep learning] Yolo to VOC VOC to Yolo
[multithreading] the difference between parallelism and concurrency
顺序表与链表(顺序表)
KVM Virtualization - create - bridge - hard disk - snapshot
Using Siemens low code to realize the agility of enterprise quality management process
[multithreading] there are several ways to create a thread pool
url链接中特殊字符转义方法
【AGC】构建服务1-云函数示例
openresty lua-resty-lock数据库锁
One of MySQL clusters, master-slave architecture (3)
Programming example of STM32 state machine -- fully automatic washing machine (Part 1)
【微信小程序】选择宝——选择困难症的拯救者
Solve the inexplicable restart problem of win10
ONES「新星计划」集训之旅圆满收官|2022届校招生
cordove 友盟插件 ++推送和统计功能
Requirement: how to import the MD file containing the public drawing bed pictures into the language bird in the form of graphics and text- 2022.7.17 (resolved)