QtCreator and Command Line Arguments

QtQt Creator

Qt Problem Overview


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

Qt Solutions


Solution 1 - Qt

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.

Solution 2 - Qt

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

enter image description here

Solution 3 - Qt

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: ...

Solution 4 - Qt

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionpaul simmonsView Question on Stackoverflow
Solution 1 - QtPatrice BernassolaView Answer on Stackoverflow
Solution 2 - QtMinimus HeximusView Answer on Stackoverflow
Solution 3 - QtHarveyView Answer on Stackoverflow
Solution 4 - QtNitish KanadeView Answer on Stackoverflow