diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 2667c837ba..18c2dabb0f 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -42,8 +42,6 @@ Item anchors.topMargin: UM.Theme.getSize("default_margin").height visible: extrudersModel.count > 1 - currentIndex: Math.max(Cura.ExtruderManager.activeExtruderIndex, 0) - Repeater { id: repeater @@ -68,6 +66,18 @@ Item } } + //When active extruder changes for some other reason, switch tabs. + //Don't directly link currentIndex to Cura.ExtruderManager.activeExtruderIndex! + //This causes a segfault in Qt 5.11. Something with VisualItemModel removing index -1. We have to use setCurrentIndex instead. + Connections + { + target: Cura.ExtruderManager + onActiveExtruderChanged: + { + tabBar.setCurrentIndex(Cura.ExtruderManager.activeExtruderIndex); + } + } + //When the model of the extruders is rebuilt, the list of extruders is briefly emptied and rebuilt. //This causes the currentIndex of the tab to be in an invalid position which resets it to 0. //Therefore we need to change it back to what it was: The active extruder index.