在桌面上运行
要指定在为工具包选择的运行设备上运行应用程序的设置,请访问Projects >Run Settings 。

工作目录
您可以指定要传递给可执行文件的命令行参数和要使用的工作目录。工作目录默认为构建结果的目录。
选择Deploy Settings >Add Deploy Step >CMake Install 添加安装选项。Qt Creator 会自动添加Working directory 字段的值作为--install 签名中的安装目录。
在终端运行
对于控制台应用程序,请选择Run in terminal 。要指定在 Linux 和 macOS 上使用的终端,请访问Preferences >Environment >System 。要使用内部终端,请访问Preferences >Terminal >Use internal terminal 。
链接库
在构建应用程序时,Qt Creator 会创建一个目录列表,链接器将在其中查找应用程序链接到的库。默认情况下,链接的库对Qt Creator 试图运行的可执行文件可见。通常,只有在以下情况下才应禁用该选项:该选项会导致不必要的副作用;使用部署步骤(如make install ),并希望确保部署的应用程序在不运行Qt Creator 时也能找到库。
要禁用当前项目的库链接,请清除Add build library search path to PATH 。要禁用所有项目的库链接,请访问Preferences >Build & Run >General ,然后清除Add linker library search paths to run environment 。
调试链接框架
在 macOS 上,选择Use debug version of frameworks (DYLD_IMAGE_SUFFIX=_debug) 可调试(例如,进入)链接框架,如 Qt 框架本身。调试应用程序代码时不需要此选项。
过滤日志类别
要在应用程序输出中打开日志类别过滤 (QLoggingCategory),请选择Enable logging category filtering 。
以不同用户身份运行
在 Linux 和 macOS 上,在Run as user 中选择Default 、root 或Other ,以不同权限构建、部署和运行应用程序。
另请参阅 "配置运行项目"、"指定要运行的自定义可执行文件"和 "指定运行环境"。
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.