Qt

Using Command Line Options

You can start Qt Creator and specify some options from the command line. For example, you can open a file to any line.

To specify command line options, enter the following command in the Qt Creator installation or build directory:

qtcreator [option] [filename[:line_number]]

Note: You can use either a colon (:) or a plus sign (+) as a separator between the filename and line number. You can also use a space between the separator and the line number.

For example:

  • C:\qtcreator\bin>qtcreator -help
  • C:\qtcreator\bin>qtcreator C:\TextFinder\textfinder.cpp:100
  • C:\qtcreator\bin>qtcreator C:\TextFinder\textfinder.cpp +100

To open a project that is located in a particular folder, you can pass on the folder name as a command line argument. Qt Creator looks for a session that matches the folder name and loads it. Or it looks for a project file in the folder and opens it. For example:

qtcreator .

The following table summarizes the available options:

OptionDescription
-helpDisplay help on command line options.
-versionDisplay Qt Creator version.
-clientAttempt to connect to an already running instance of Qt Creator.
-load <plugin>Load the specified plugin.
-noload <plugin>Do not load the specified plugin.
-profileOutput plugin start up and shut down profiling data.
-settingspath <path>Override the default path where user settings are stored.
-color <color>Core plugin: override the selected UI color.
-debug <pid>Debugger plugin: attach to the process with the given process ID.
-debug <executable>[,kit=<kit>]Debugger plugin: launch and debug the executable with the name executable. A kit can be specified to point to non-default debuggers and sysroots.
-debug [executable,]core=<corefile>[,kit=<kit>]Debugger plugin: load the core file named corefile. The parameter executable specifies the executable that produced the core file. If this parameter is omitted, Qt Creator will attempt to reconstruct it from the core file itself. This will fail for paths with more than about 80 characters. In such cases the executable parameter is mandatory. A kit can be specified to point to non-default debuggers and sysroots.
-debug <executable>,server=<server:port>[,kit=<kit>]Debugger plugin: attach to a debug server running on the port port on the server server. The parameter executable specifies a local copy of the executable the remote debug server is manipulating. A kit can be specified to point to non-default debuggers and sysroots.
-wincrashevent <event-handle>Debugger plugin: Attach to crashed processes by using the specified event handle.
-customwizard-verboseProjectExplorer plugin: display additional information when loading custom wizards. For more information about custom wizards, see Adding New Custom Wizards
-lastsessionProjectExplorer plugin: load the last session when Qt Creator starts. Open the projects and files that were open when you last exited Qt Creator. For more information about managing sessions, see Managing Sessions.
-blockOpen files in editors in a running Qt Creator instance and block the command line until the first editor is closed.

Using Custom Styles

Qt Creator is a Qt application, and therefore, it accepts the command line options that all Qt applications accept. For example, you can use the -style and -stylesheet options to apply custom styles and stylesheets. The styling is only applied during the current session.

Exercise caution when applying styles, as overriding the existing styling may make some items difficult to see. Also, setting a stylesheet may affect the text editor color scheme and the styling of the integrated Qt Designer.