fix typo and use QPersistentModelIndex where appropriate

Authored by alcinos on Sep 7 2017, 10:12 PM.