简体   繁体   English

无法在 Qt Creator 中修改选项卡设置

[英]Cannot modify tab settings in Qt Creator

I want tab to insert 2 spaces.我想要制表符插入 2 个空格。 All other solutions seem to be references an older version of Qt Creator.所有其他解决方案似乎都引用了旧版本的 Qt Creator。

Tools -> Options -> Text Editor -> Behaviour -> Tabs and Indentation工具 -> 选项 -> 文本编辑器 -> 行为 -> 制表符和缩进

No 'Options' option exists in the dropdown menu.下拉菜单中不存在“选项”选项。

Tools -> Options -> C++ -> Code Styles -> Edit工具 -> 选项 -> C++ -> 代码样式 -> 编辑

'Code Styles' does NOT exist in that path.该路径中不存在“代码样式”。

Qt Creator -> Preferences -> Behavior > Text Editor Qt Creator -> 首选项 -> 行为 > 文本编辑器

This seems to be the appropriate place to modify settings for the whole IDE, but they don't seem to be getting saved to the project.这似乎是修改整个 IDE 设置的合适位置,但它们似乎没有保存到项目中。

在此处输入图片说明 Qt 5.2.1 Qt 5.2.1

There are "Project Settings" that have precedence over the global settings under Tools -> Options -> Text Editor -> ...有“项目设置”优先于工具 -> 选项 -> 文本编辑器 -> ...
These settings can be found in the Projects "UI section" and you have to define a custom "Code Style" for this:这些设置可以在项目“UI 部分”中找到,您必须为此定义自定义“代码样式”:

  1. Switch to "Projects" (Ctrl-5)切换到“项目”(Ctrl-5)
  2. From the column to the right select "Code Style" (not "Editor") under "Project Settings"从右侧的列中选择“项目设置”下的“代码样式”(不是“编辑器”)
  3. Click "Edit..."点击“编辑...”
  4. Click "Copy Built-in Code Style"点击“复制内置代码样式”
  5. On the "General" tab adjust tab settings在“常规”选项卡上调整选项卡设置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM