当前位置:网站首页>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 ~
边栏推荐
- Lua conditional statement
- Mgr and greatsql resource summary
- Common rendering pipeline grooming
- Summary of the lowest level error types in PHP
- Research and Analysis on the development of China's Melamine Industry from 2022 to 2028 and market prospect forecast report
- China's new generation information technology industry "14th five year plan" special planning and innovation strategic direction report 2022 ~ 2028
- lua 循环语句
- Photoshop:ps how to enlarge a picture without blurring
- C语言:如何给全局变量起一个别名?
- The Milvus graphical management tool Attu is coming!
猜你喜欢

Huawei officially entered the "front loading" stage, and the millimeter wave radar track entered the "localization +4d" cycle

2022 heavyweight: growth law - skillfully use digital marketing to break through enterprise difficulties

C language: how to give an alias to a global variable?
![[Part VI] source code analysis and application details of countdownlatch [key]](/img/6e/085e257c938a8c7b88c12c36df83e1.jpg)
[Part VI] source code analysis and application details of countdownlatch [key]

Dry goods sharing | BitSet application details

Industry reshuffle, a large number of programmers are going to lose their jobs? How can we break the current workplace dilemma

Design a MySQL table for message queue to store message data

MYSQL 行转列、列转行、多列转一行、一行转多列

ShardingSphere-proxy-5.0.0部署之分表实现(一)

The most widely used dynamic routing protocol: OSPF
随机推荐
移动安全必备之CS呢【NETHUNTER】
设计消息队列存储消息数据的 MySQL 表格
Colab教程(超级详细版)及Colab Pro/Colab Pro+使用评测
lua 循环语句
OpenCV源代码编译
Unprecedented analysis of Milvus source code architecture
It is meaningful to define genus, and D can use it to explain semantics
[issue 30] shopee golang development experience
Preparing for the Blue Bridge Cup Day11__ Basic operation of serial port communication
Opencv source code compilation
Ten key defensive points in the detailed attack and defense drill
How to package a colorpicker component for color selection?
2202-簡曆制作
[leetcode] the k-largest element in the array
细数攻防演练中十大关键防守点
ImageView grayed, reflected, rounded, watermarked
AWS lambda: how to store secrets to external APIs- AWS Lambda: How to store secret to external API?
Analysis report on production and marketing demand and investment forecast of China's Melamine Industry from 2022 to 2028
Colab tutorial (super detailed version) and colab pro/colab pro+ usage evaluation
Go time format assignment