Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 2

Qt-interest Archive, May 2007
update a persistent model index?


Message 1 in thread

Hi,

I have troubles with using the QPersistentModelIndex class. My tree
model supports drag&drop of elements. Now if I drag an element that is
used as root index of a view, the view's content changes to the model
root content.

E.g. the tree view shows the whole model:
Foo
  +-Bar
      +-x
      +-y

The list view has a persistent the model index for 'Bar' as root index
and shows this:
x
y


Now if 'Bar' is dragged to another location, the list view displays the
content of the model's root, as if an invalid index (QModelIndex()) was
set as root.

So my question is: do I have to manually update the persistent model
index in some way, or do I have to update the list view when the index
is moved?

Thanks,
M

--
 [ signature omitted ]