Fix model-entity renaming.
I don't know how the previous code ever worked. Perhaps a different path was being used? Anyway:
-
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.
-
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.
-
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