diff --git a/src/plugins/texteditor/behaviorsettingspage.cpp b/src/plugins/texteditor/behaviorsettingspage.cpp
index 563c0b5a4c3..4a73fd2be59 100644
--- a/src/plugins/texteditor/behaviorsettingspage.cpp
+++ b/src/plugins/texteditor/behaviorsettingspage.cpp
@@ -159,6 +159,7 @@ void BehaviorSettingsPage::settingsFromUI(TabSettings &tabSettings,
BehaviorSettings &behaviorSettings) const
{
tabSettings.m_spacesForTabs = m_d->m_page.insertSpaces->isChecked();
+ tabSettings.m_autoSpacesForTabs = m_d->m_page.autoInsertSpaces->isChecked();
tabSettings.m_autoIndent = m_d->m_page.autoIndent->isChecked();
tabSettings.m_smartBackspace = m_d->m_page.smartBackspace->isChecked();
tabSettings.m_tabSize = m_d->m_page.tabSize->value();
@@ -179,6 +180,7 @@ void BehaviorSettingsPage::settingsToUI()
{
const TabSettings &tabSettings = m_d->m_tabSettings;
m_d->m_page.insertSpaces->setChecked(tabSettings.m_spacesForTabs);
+ m_d->m_page.autoInsertSpaces->setChecked(tabSettings.m_autoSpacesForTabs);
m_d->m_page.autoIndent->setChecked(tabSettings.m_autoIndent);
m_d->m_page.smartBackspace->setChecked(tabSettings.m_smartBackspace);
m_d->m_page.tabSize->setValue(tabSettings.m_tabSize);
diff --git a/src/plugins/texteditor/behaviorsettingspage.ui b/src/plugins/texteditor/behaviorsettingspage.ui
index 31258741672..eddd849c261 100644
--- a/src/plugins/texteditor/behaviorsettingspage.ui
+++ b/src/plugins/texteditor/behaviorsettingspage.ui
@@ -7,7 +7,7 @@
0
0
615
- 421
+ 461
@@ -27,13 +27,46 @@
-
+
+
-
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Fixed
+
+
+
+ 30
+ 20
+
+
+
+
+ -
+
+
+ false
+
+
+ Automatically determine whether to insert spaces or tabs based on the previous line in the file
+
+
+ Based on the previous line
+
+
+
+
+
+ -
Enable automatic &indentation
- -
+
-
Backspace will go back one indentation level instead of one space.
@@ -75,6 +108,42 @@
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ Braces will be flush with indented block, except first indent level.
+
+
+ Indent brace&s
+
+
+
-
@@ -107,42 +176,6 @@
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- Braces will be flush with indented block, except first indent level.
-
-
- Indent brace&s
-
-
-
-
@@ -328,7 +361,6 @@
insertSpaces
tabSize
autoIndent
- indentSize
smartBackspace
tabKeyBehavior
cleanWhitespace
@@ -345,12 +377,12 @@
setEnabled(bool)
- 47
- 184
+ 67
+ 252
- 91
- 212
+ 148
+ 281
@@ -361,12 +393,28 @@
setEnabled(bool)
- 20
- 20
+ 40
+ 251
- 20
- 20
+ 77
+ 310
+
+
+
+
+ insertSpaces
+ toggled(bool)
+ autoInsertSpaces
+ setEnabled(bool)
+
+
+ 105
+ 49
+
+
+ 105
+ 78
diff --git a/src/plugins/texteditor/tabsettings.cpp b/src/plugins/texteditor/tabsettings.cpp
index 2f3721ff6b9..0efee830158 100644
--- a/src/plugins/texteditor/tabsettings.cpp
+++ b/src/plugins/texteditor/tabsettings.cpp
@@ -36,6 +36,7 @@
#include
static const char *spacesForTabsKey = "SpacesForTabs";
+static const char *autoSpacesForTabsKey = "AutoSpacesForTabs";
static const char *smartBackspaceKey = "SmartBackspace";
static const char *autoIndentKey = "AutoIndent";
static const char *tabSizeKey = "TabSize";
@@ -65,6 +66,7 @@ void TabSettings::toSettings(const QString &category, QSettings *s) const
group.insert(0, category);
s->beginGroup(group);
s->setValue(QLatin1String(spacesForTabsKey), m_spacesForTabs);
+ s->setValue(QLatin1String(autoSpacesForTabsKey), m_autoSpacesForTabs);
s->setValue(QLatin1String(autoIndentKey), m_autoIndent);
s->setValue(QLatin1String(smartBackspaceKey), m_smartBackspace);
s->setValue(QLatin1String(tabSizeKey), m_tabSize);
@@ -84,6 +86,7 @@ void TabSettings::fromSettings(const QString &category, const QSettings *s)
*this = TabSettings(); // Assign defaults
m_spacesForTabs = s->value(group + QLatin1String(spacesForTabsKey), m_spacesForTabs).toBool();
+ m_autoSpacesForTabs = s->value(group + QLatin1String(autoSpacesForTabsKey), m_autoSpacesForTabs).toBool();
m_autoIndent = s->value(group + QLatin1String(autoIndentKey), m_autoIndent).toBool();
m_smartBackspace = s->value(group + QLatin1String(smartBackspaceKey), m_smartBackspace).toBool();
m_tabSize = s->value(group + QLatin1String(tabSizeKey), m_tabSize).toInt();
@@ -316,6 +319,7 @@ void TabSettings::reindentLine(QTextBlock block, int delta) const
bool TabSettings::equals(const TabSettings &ts) const
{
return m_spacesForTabs == ts.m_spacesForTabs
+ && m_autoSpacesForTabs == ts.m_autoSpacesForTabs
&& m_autoIndent == ts.m_autoIndent
&& m_smartBackspace == ts.m_smartBackspace
&& m_tabSize == ts.m_tabSize