Skip to content

Commit c25977a

Browse files
committed
Remember formatter selection
Fix #4027
1 parent f8f7f20 commit c25977a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/qml/value-editor/editors/MultilineEditor.qml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import QtQuick 2.0
22
import QtQuick.Controls 1.2
33
import QtQuick.Controls.Styles 1.2
44
import QtQuick.Layouts 1.1
5+
import Qt.labs.settings 1.0
56
import "../../common/"
67
import "./formatters/formatters.js" as Formatters
78

@@ -156,12 +157,12 @@ ColumnLayout
156157
textRole: "name"
157158
objectName: "rdm_value_editor_formatter_combobox"
158159

159-
onCurrentIndexChanged: {
160-
Formatters.defaultFormatterIndex = currentIndex
161-
loadFormattedValue()
162-
}
163-
Component.onCompleted: {
164-
currentIndex = Formatters.defaultFormatterIndex;
160+
onCurrentIndexChanged: loadFormattedValue()
161+
162+
Settings {
163+
id: defaultFormatterSettings
164+
category: "formatters"
165+
property alias defaultFormatterIndex: formatterSelector.currentIndex
165166
}
166167
}
167168

src/qml/value-editor/editors/formatters/formatters.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ var json = {
7878
}
7979
}
8080

81-
var defaultFormatterIndex = 0;
8281
var enabledFormatters = [plain, json, hex, hexTable]
8382

8483

0 commit comments

Comments
 (0)