Results 1 to 2 of 2

Thread: CTrl + A

  1. #1
    Join Date
    Aug 2008
    Posts
    134
    Thanks
    10
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default CTrl + A

    Hi,
    In my table widget i have set the following:
    setSelectionMode (QAbstractItemView::SingleSelection );
    setSelectionBehavior(QAbstractItemView::SelectRows );
    setEditTriggers(QAbstractItemView::NoEditTriggers) ;

    i need to select one at a time. but when i press Ctrl+A then all the items will be selected(focused). how can i avoid this.

  2. #2
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: CTrl + A

    Hi,
    I belive that Ctrl+A is a standard shortcut for selecting all.
    1. Maybe when Ctrl+A when it is left to itself it select all rows, but when you detect a Ctrl+A and implement your own method for it and select only one row ( which will occur after the standard CTRL+A selected all rows).
    2. You might also try to to ignore key events if your not entering/editing any data from keyboard in the view.
    3. I suppose you might turn off the automatic shortcuts somehow, but here someone more exp should give you an advice.
    Look at setting/releasing shortcuts for widgets; overridng shortcuts/disabling shortcuts, etc.
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

Similar Threads

  1. Ctrl key to allow user to stop docking a window
    By irudkin in forum Qt Programming
    Replies: 2
    Last Post: 7th June 2007, 04:42
  2. Replies: 1
    Last Post: 8th March 2007, 10:12
  3. Replies: 2
    Last Post: 4th February 2007, 22:03
  4. Replies: 2
    Last Post: 24th July 2006, 18:36

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.