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 and column.
To specify command line options, enter the following command in the Qt Creator installation or build directory:
qtcreator [option] [filename[:line_number[:column_number]]]
Note: You can use either a colon (:) or a plus sign (+) as a separator between the filename and line number and the line number and the column number. You can also use a space between the separator and the line number.
For example, on Windows:
C:\qtcreator\bin>qtcreator C:\TextFinder\textfinder.cpp +100+2
Qt\ Creator.app/Contents/MacOS/Qt\ Creator -help
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:
Note: To run a self-built Qt Creator from the command line on Windows, make sure that the Qt installation directory is included in the PATH environment variable. You can enter the following command on the command line to add Qt to the path:
The following table summarizes the available options:
|-help||Display help on command line options.|
|-version||Display Qt Creator version.|
|-client||Attempt to connect to an already running instance of Qt Creator.|
|-pid||Attempt to connect to an already running instance of Qt Creator with the specified process ID.|
|-block||Open files in editors in a running Qt Creator instance and block the command line until the first editor is closed.|
|-load <plugin>||Enable the specified plugin and all plugins that it depends on. You can combine |
|-load all||Enables all plugins.|
|-noload <plugin>||Disable the specified plugin and all plugins that depend on it.|
|-noload all||Disables all plugins.|
|-profile||Output plugin start up and shut down profiling data.|
|-pluginpath <path>||Add a path where Qt Creator looks for plugins. To specify several paths, add the |
|-settingspath <path>||Override the default path where user settings are stored.|
|-installsettingspath <path>||Override the default path from where user-independent settings are read (for example written by the installer).|
|-color <color>||Core plugin: override the selected UI color.|
|-presentationMode||Core plugin: display keyboard shortcuts as popups when you press them. Mostly useful when presenting Qt Creator to someone else.|
|-theme <default | dark>||Core plugin: apply a dark color theme to Qt Creator, without using stylesheets.|
|-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 |
|-debug [executable,]core=<corefile>[,kit=<kit>]||Debugger plugin: load the core file named |
|-debug <executable>,server=<server:port>[,kit=<kit>]||Debugger plugin: attach to a debug server running on the port |
|-wincrashevent <event-handle:pid>||Debugger plugin: Attach to crashed processes by using the specified event handle and process ID.|
|-customwizard-verbose||ProjectExplorer plugin: display additional information when loading custom wizards. For more information about custom wizards, see Adding New Custom Wizards|
|-lastsession||ProjectExplorer 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.|
|<session>||ProjectExplorer plugin: load the given 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.|
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
-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.
You can also switch to a dark theme to customize the appearance of widgets, colors, and icons without using stylesheets.
© 2018 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.