在此页面

打开终端

打开Terminal 视图:

  • 转到View >Output ,然后选择Terminal
  • 选择Terminal 输出视图。
  • 选择Alt+5(或 macOS 上的Cmd+5)。
  • Projects >Run Settings 中为应用程序选择Run in Terminal ,然后运行该应用程序。
  • Projects >Build Settings >Build Environment 中选择Open Terminal 按钮。

终端

在终端中查看输出

  • 要在终端中选择一个单词,请双击该单词。
  • 要选择整行,请点击三下。
  • 要选择所有文本,请在上下文菜单中选择Select All 或选择Ctrl+A
  • 要打开浏览器中的链接、编辑器中的文件或项目视图中的文件夹,请将鼠标悬停在它们上方,然后选择Ctrl
  • 要在输出中搜索,请选择Ctrl+F

从终端运行Qt Creator 命令

要在终端中使用qtc 命令行选项,请输入:

qtc [option] [filename[:line_number[:column_number]]]

要查看选项,请输入

qtc -help

插入Qt Creator 变量

要在终端中插入Qt Creator 变量的扩展值,请在Insert Macro Variable 列表中选择它们。

设置键盘快捷键首选项

除了用于打开终端首选项或定位器以及退出Qt Creator 的快捷键外,大多数Qt Creator 键盘快捷键在终端中都被禁用。要防止Qt Creator 键盘快捷方式干扰终端,请选择<span translate=Qt Creator 快捷键优先。" src="images/keyboardlock.png" title="Qt Creator 快捷键优先。"/> 。

要向终端发送 escape 键而不是关闭终端,请选择Shift+Esc 。要将此设置为默认行为,请访问Preferences >Terminal >Block shortcuts in terminal

终端首选项

在单独窗口中运行终端

要在单独窗口中打开终端,请访问Preferences >Terminal ,并清除Use internal terminal

在 Linux 和 macOS 上使用系统终端

在 Linux 和 macOS 上,可以通过选择Preferences >Environment >System 来设置打开终端。

另请参阅 使用Qt Creator 变量查看输出命令行选项键盘快捷键

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.