Results 1 to 3 of 3

Thread: QTableWidget, persistent editors and keyboard navigating in view mode

  1. #1
    Join Date
    Apr 2007
    Location
    Toruń, POLAND
    Posts
    24
    Thanks
    7
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default QTableWidget, persistent editors and keyboard navigating in view mode

    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

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableWidget, persistent editors and keyboard navigating in view mode

    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

  3. #3
    Join Date
    Apr 2007
    Location
    Toruń, POLAND
    Posts
    24
    Thanks
    7
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: QTableWidget, persistent editors and keyboard navigating in view mode

    Marcel, thanks for your answer.

    Quote Originally Posted by marcel View Post
    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?)

    Quote Originally Posted by marcel View Post
    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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.