このページでは

コマンドラインから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 -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

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.