PDA

View Full Version : QTableWidget, persistent editors and keyboard navigating in view mode



macias
22nd July 2007, 18:39
Hello,

Several issues here -- I created QTableWidget with persistent editors (for each cell). When editing user can press [esc] and the cell goes into view mode (the text cursor disappears). Then user can press for example [up] or [down], focus goes accordingly to key pressed and immediately the next cell goes into edit mode.
I didn't this, it is built-in guess. Fiddling with editTriggers does not change a thing.

It is in general quite awkward for me -- I thought persistent editor is a, well, persistent editor, so user can be ONLY in edit mode.

Anyway, questions:
1) is it a better method to intercept [escape] than eventFilter (btw. I just guess eventFilter will help me with it)? I would like to stop going to this view mode

2) how to explicitly go to view mode -- which method should I call?

3) on the other hand, when I am in view mode I would like to stay in it as long as I wish -- so I would like to press [up] twice to go two cells up, so how to maintain view mode?

Thanks in advance for your help.

have a nice day, bye

marcel
22nd July 2007, 19:02
1&2) I think calling QTableWidget::closePersistentEditor will be enough.

3) Are you positively sure that the editor is closed? Point 2 should solve this.

Regards

macias
22nd July 2007, 19:21
Marcel, thanks for your answer.



1&2) I think calling QTableWidget::closePersistentEditor will be enough.


No, no :-) I don't want to close those editors -- that's the point. They should be persistent -- until the user quits the program. Maybe from another point of view -- I need tabular editor. The easiest way to do this is to use QTableWidget with permanent edit mode (persistent editors).

Besides:
ad.1) I don't understand your answer vs. my question -- I would like to know how to stop going to view mode (if I close the editor I definitively end up in view mode, right?)



3) Are you positively sure that the editor is closed? Point 2 should solve this.


No editor is closed. But since it is possible to be in view mode regardless opened editor for each cell (so in theory there should be no place for view mode) I think there should be a way to control how long I am in this view mode.

have a nice day, bye