Skip to content

Fix model-entity renaming.

David Thompson requested to merge dcthomp/smtk:fix-rename into master

I don't know how the previous code ever worked. Perhaps a different path was being used? Anyway:

  1. The signal-slot connection made between the editor-delegate and mode was as a Qt::QueuedConnection, but this won't work because the QModelIndex is no longer valid after the method emitting the signal completes (it re-sorts items by name after emitting the signal).

    Other methods to change the color and other properties probably suffer the same problem.

  2. The code fetching the "set property" operator traverses the descriptive phrase tree to get the session owning the model entity in a broken way instead of just calling owningSession() on the phrase's related entity.

    This pattern is definitely used elsewhere and needs to be fixed.

  3. This fix will not work for renaming meshes or other non-model entities in the descriptive phrase tree. We should handle the case when the phrase->relatedEntity() is not valid.

Close #153

Edited by Haocheng LIU

Merge request reports