diff --git a/ordered_relation_editor/gui/ordered_relation_editor_widget.py b/ordered_relation_editor/gui/ordered_relation_editor_widget.py index 242fb83..73fc36c 100644 --- a/ordered_relation_editor/gui/ordered_relation_editor_widget.py +++ b/ordered_relation_editor/gui/ordered_relation_editor_widget.py @@ -96,7 +96,7 @@ def updateUi(self): self.mAttributeFormView.layout().addWidget(self.attribute_form) self.update_buttons() - self.view.rootObject().clearIndex() + self.view.rootObject().setCurrentIndex(0) def parentFormValueChanged(self, attribute, newValue): if self.attribute_form: diff --git a/ordered_relation_editor/qml/OrderedImageList.qml b/ordered_relation_editor/qml/OrderedImageList.qml index c3e2a96..046275c 100644 --- a/ordered_relation_editor/qml/OrderedImageList.qml +++ b/ordered_relation_editor/qml/OrderedImageList.qml @@ -78,8 +78,8 @@ Rectangle { Row { id: row anchors { fill: parent; margins: 2 } - Image { source: ImagePath; width: 50; fillMode: Image.PreserveAspectFit } - Text { text: Description } + Image { source: ImagePath; width: 50; fillMode: Image.PreserveAspectFit; visible: ImagePath !== "" } + Text { text: Description; height: 40; verticalAlignment: Text.AlignVCenter; padding: 4 } } } DropArea { @@ -122,4 +122,9 @@ Rectangle { function currentIndex() { return listView.currentIndex } + + function setCurrentIndex(i){ + listView.currentIndex = i + orderedModel.onViewCurrentFeatureChanged(listView.currentIndex) + } }