当前位置:网站首页>QT actual combat case (38) -- using qpprocess class to realize the function of starting process
QT actual combat case (38) -- using qpprocess class to realize the function of starting process
2022-06-12 23:29:00 【wendy_ ya】
Catalog
One 、 Project introduction
utilize QProcess Class implements the function of starting a process ( Take the Notepad program as an example ).
Two 、 Basic configuration of the project
Create a new one Qt Case study , Project name: “ProcessTest”, Base class selection “QWidget”, Click to select Create UI Interface check box , Complete project creation .
3、 ... and 、UI Interface design
UI The interface layout is as follows :
Only... Is created in the interface 1 Controls , Its name and type are as follows :
Serial number | name | type | attribute |
---|---|---|---|
① | pbn_process | QPushButton | text: Start a process |
Four 、 The main program realizes
4.1 widget.h The header file
The header file contains the header file , Then add a private object , Declare button click slot function :
#include<QProcess>
private:
QProcess myProcess;
private slots:
void on_pbn_process_clicked();
4.2 widget.cpp Source file
Define button click slot function :
void Widget::on_pbn_process_clicked()
{
// Start Notepad process
myProcess.start("notepad.exe");
}
Here's the launch of Windows System Notepad program ( namely notepad.exe, Because it is in Windows In the system directory of , The directory has been added to the system PATH In the environment variables , So you don't need to write a specific path ).
5、 ... and 、 Effect demonstration
The complete effect is as follows :
ok, The above is the whole content of this article , If it helps you , Remember to like it ~
边栏推荐
- Sequence maximum return
- Is the stock account opened by qiniu Gang safe and reliable?
- 2202-简历制作
- Zabbix的功能介绍和常用术语
- The fate of Internet people is that it is difficult to live to 30?
- 2022 heavyweight: growth law - skillfully use digital marketing to break through enterprise difficulties
- Opencv source code compilation
- Ten key defensive points in the detailed attack and defense drill
- How to package a colorpicker component for color selection?
- 设计消息队列存储消息数据的 MySQL 表格
猜你喜欢
Record 5 - the serial port of stm32f411ceu6 realizes the sending and receiving of fixed length data and variable length data
[opencv learning] use the Tesseract OCR movement to recognize numbers
Alien skin exposure X7 color filter plug-in, raw post-processing tool
Develop a web office suite from scratch (5): mouse hover over text
CS for mobile security [nethunter]
〖Kubernetes指南④〗Pod快速入门
80 lines of code to realize simple rxjs
[opencv learning] small ticket recognition based on perspective transformation and OCR recognition
[Part 8] semaphore source code analysis and application details [key points]
Using baserecyclerviewadapterhelper to implement tree structure
随机推荐
Colab教程(超级详细版)及Colab Pro/Colab Pro+使用评测
InfoQ 极客传媒 15 周年庆征文|简述构建微服务架构的四大挑战
Shardingsphere-proxy-5.0.0 deployment table implementation (I)
OpenCV源代码编译
Modify the text color of the menu on the right of toobar
Avoid using asp Net core 3.0 to inject services for startup classes
Face detection: mtcnn
lua 条件语句
Analysis report on the "fourteenth five year plan" and the latest development trend of China's medical information industry from 2022 to 2028
移动安全必备之CS呢【NETHUNTER】
CST learning: four element array design of circular patch antenna (III) array formation and parallel excitation
Deep learning neural network: implementation method of convolution [direct method (no loss of precision), GEMM (matrix multiplication, no loss of precision), FFT (Fourier transform, loss of precision)
Mgr and greatsql resource summary
cookie
启牛帮开通的股票账户是安全可信的吗?
2202-簡曆制作
【LeetCode】5. Longest Palindromic Substring
【LeetCode】300. Longest ascending subsequence
Pytorch中的梯度累加【在实验时,由于GPU显存限制,遇到batch_size不能再增大的情况。为解决该问题,使用梯度累加方法】
Pytorch common parameter initialization methods: [uniform distribution, normal (Gaussian) distribution, Xavier, Kaiming, orthogonal matrix, sparse matrix, constant, identity matrix, zero filling]