PDA

View Full Version : CTrl + A



navi1084
23rd October 2008, 07:59
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.

maverick_pol
23rd October 2008, 09:19
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.