QtCreator and Command Line Arguments

68,779

Solution 1

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

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

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

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

Share:
68,779

Related videos on Youtube

paul simmons
Author by

paul simmons

Updated on July 05, 2022

Comments

  • paul simmons
    paul simmons almost 2 years

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

  • matiu
    matiu almost 13 years
    if you have a ';' in one of your params, put a '\' before it. eg. --docroot=static-content;/resources --deploy-path=/ becomes --docroot=static-content\;/resources --deploy-path=/ in qtcreator run settings page .. otherwise it'll stop reading at ';' and ignore all the rest of the command line.
  • Harvey
    Harvey about 9 years
    This does not match QtCreator version 3.3.2 There is no "Run Settings" or am I missing something?
  • kayleeFrye_onDeck
    kayleeFrye_onDeck about 8 years
    Yep. There's two buttons in a dark-grey box, one called Build and one called Run. You need to click the Run button and it will switch to it for you.
  • user3673
    user3673 over 7 years
    This is no longer the correct answer. Deprecate the green checkmark and note the fact.
  • Patrice Bernassola
    Patrice Bernassola over 7 years
    Instead of downvoting a correct answer when question was asked (7 years ago), why not only update the answer by replacing "Run settings" by "Build and Run"?