PDA

View Full Version : moveCursor not called in a QTreeView



mathieuS
22nd July 2011, 21:26
Hi,

I am facing a quite complex problem. In a QTreeView/QAbstractItemView, the moveCursor() function is sometimes simply not called.

Actually, on the base level of the tree, it behaves correctly. But on children items, the behaviour becomes weird for on some columns. Item is deselected and another item (or nothing) gets the selection.

Except from this, my model works great, so index() function must be correct. I have really no idea what further information I could give right now, since I know nothing of Qt mechanism responsible for calling moveCursor().

If someone can give me a hint, this would be great, thanks in advance.
Mathieu

Added after 21 minutes:

Ok, I've found a part of the problem. The column causing troubles contains a QComboBox. My model/view fails only on this column.
I can avoid the problem if I don't emit the dataChanged() signal in the setData() function of my model... Is it "legal" doing this, is it really necessary to emit the signal ?

Added after 25 minutes:

So, the problem relies on a bad editor closing implementation... Sorry for the mess.