Skip to content

Commit

Permalink
Merge pull request #10015 from Eism/qml_warnings_fix
Browse files Browse the repository at this point in the history
[MU4] Fixed qml warnings caused by closing notation
  • Loading branch information
Eism authored Dec 8, 2021
2 parents 2dab0fd + e0a3da2 commit d9edfd5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ Item {
property bool isSelected: false

function updateIsSelected() {
treeItemDelegateLoader.isSelected = instrumentsTreeModel.isSelected(styleData.index)
treeItemDelegateLoader.isSelected = (Boolean(styleData.index.row) && instrumentsTreeModel.isSelected(styleData.index))
}

Connections {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,19 @@ Rectangle {
delegate: NotationSwitchButton {
id: button

navigation.name: "NotationTab" + model.index
navigation.name: "NotationTab" + index
navigation.panel: navPanel
navigation.row: 1
navigation.column: model.index + 1
navigation.column: index + 1

text: model.title
needSave: model.needSave

ButtonGroup.group: notationsView.radioButtonGroup
checked: model.index === notationsView.currentIndex
checked: index === notationsView.currentIndex

function resolveNextNotationIndex() {
var nextIndex = model.index - 1
var nextIndex = index - 1
if (nextIndex < 0) {
return 0
}
Expand All @@ -101,18 +101,18 @@ Rectangle {
}

onToggled: {
notationSwitchModel.setCurrentNotation(model.index)
notationSwitchModel.setCurrentNotation(index)
}

onCloseRequested: {
if (model.index !== notationsView.currentIndex) {
notationSwitchModel.closeNotation(model.index)
if (index !== notationsView.currentIndex) {
notationSwitchModel.closeNotation(index)
return
}

var index = button.resolveNextNotationIndex()
notationSwitchModel.closeNotation(model.index)
notationSwitchModel.setCurrentNotation(index)
var nextIndex = button.resolveNextNotationIndex()
notationSwitchModel.setCurrentNotation(nextIndex)
notationSwitchModel.closeNotation(index)
}
}
}
Expand Down

0 comments on commit d9edfd5

Please sign in to comment.