コマンドラインからQt Creator を実行する
コマンドラインからQt Creator を起動し、いくつかのオプションを指定することができます。たとえば、ファイルの任意の行と列から開くことができます。
コマンドラインオプションを使用するには、Qt Creator の実行ファイルが含まれているディレクトリで次のコマンドを入力するか、コマンドの一部としてQt Creator へのパスを指定します:
qtcreator [option] [filename[:line_number[:column_number]]]
注: ファイル名と行番号の間、および行番号と列番号の間には、区切り文字としてコロン (:) またはプラス記号 (+) のいずれかを使用できます 。また、区切り文字と行番号の間にスペースを入れることもできます。
CLI コマンドの例
以下は、Qt Creator をデフォルトの場所にインストールした場合の、サポートされているプラットフォームにおけるコマンドの例です。 Qt Online Installer デフォルトの場所にインストールした場合の、各プラットフォームでのコマンド例です。必要に応じてパスを変更してください。
Windowsの場合:
C:\Qt\Tools\QtCreator\bin\qtcreator -helpC:\Qt\Tools\QtCreator\bin\qtcreator C:\TextFinder\textfinder.cpp:100:2C:\Qt\Tools\QtCreator\bin\qtcreator C:\TextFinder\textfinder.cpp +100+2
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
macOSの場合:
~/Qt/Qt\ Creator.app/Contents/MacOS/Qt\ Creator -help
ディレクトリからプロジェクトを開く
特定のディレクトリにあるプロジェクトを開くには、ディレクトリ名をコマンドライン引数として指定します。Qt Creator は、ディレクトリ名に一致するセッションを検索して読み込みます。あるいは、そのディレクトリ内のプロジェクトファイルを検索して開きます。
たとえば、Windows では:
C:\qtcreator\bin>qtcreator.exe C:\Examples\alarms
「コマンドラインオプション」も参照してください 。
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.