QtCreator and Command Line Arguments

2020-02-02 10:38发布

Is there a way to send command line arguments to a program being debugged in QtCreator?

标签: qt qt-creator
4条回答
爷、活的狠高调
2楼-- · 2020-02-02 10:56

For Qt Creator 3.3.2, to set the working directory and command line arguments:

Projects (far left of Qt Creator)
- Build & Run (tab)
-- Run (sub tab) - brings up "Run Settings"
--- Arguments: ...
--- Working directory: ...

查看更多
我想做一个坏孩纸
3楼-- · 2020-02-02 11:13

Go in the "Project" part on the left of QtCreator and then in the "Run Settings" tab. There is a Arguments line edit where you can put all you need to pass to your app when launching it.

For Qt Creator from Qt 5.6 Go in the "Projects part on the left and then in the "Build & Run" tab. Here you have a "Command line arguments" edit where you can put all parameters you want to pass to your app.

查看更多
Summer. ? 凉城
4楼-- · 2020-02-02 11:15

As the accepted answer is outdated, I post this picture which answers the question for a newer version of QtCreator:

enter image description here

查看更多
Juvenile、少年°
5楼-- · 2020-02-02 11:16

As per the image below, Build & Run has an input for command line arguments (in the screen shot it is highlighted with a blue border as it has the focus) :-

enter image description here

Qt Creator with Qt version 5.6.1

查看更多
登录 后发表回答