Run Qt Creator from the command line
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 use command-line options, enter the following command in the directory that contains the Qt Creator executable or specify the path to Qt Creator as a part of the command:
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.
Examples of CLI commands
The following are examples of the commands on supported platforms when you install Qt Creator with Qt Online Installer to the default location. Change the paths as necessary.
On Windows:
C:\Qt\Tools\QtCreator\bin\qtcreator -help
C:\Qt\Tools\QtCreator\bin\qtcreator C:\TextFinder\textfinder.cpp:100:2
C:\Qt\Tools\QtCreator\bin\qtcreator C:\TextFinder\textfinder.cpp +100+2
On Linux:
~/Qt/Tools/QtCreator/bin/qtcreator -help
~/Qt/Tools/QtCreator/bin/qtcreator /src/TextFinder/textfinder.cpp:100:2
~/Qt/Tools/QtCreator/bin/qtcreator /src/TextFinder/textfinder.cpp+100+2
On macOS:
~/Qt/Qt\ Creator.app/Contents/MacOS/Qt\ Creator -help
Open a project from a directory
To open a project that is located in a particular directory, you can pass on the directory name as a command-line argument. Qt Creator looks for a session that matches the directory name and loads it. Or it looks for a project file in the directory and opens it.
For example, on Windows:
C:\qtcreator\bin>qtcreator.exe C:\Examples\alarms
See also Command-Line Options.
Copyright © The Qt Company Ltd. and other contributors. 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.