[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Adding KActionCollection to a window
From: David Jarvie <lists () astrojar ! org ! uk>
Date: 2007-01-28 18:39:18
Message-ID: 200701281839.18808.lists () astrojar ! org ! uk
[Download RAW message or body]
In KDE 4 code, I can't get actions to apply to a whole dialog window - they
only happen after clicking on a particular widget within the window.
The dialog is subclassed from KDialog. Its constructor contains the following
relevant code:
KActionCollection* actions = new KActionCollection(this);
actions->setAssociatedWidget(topLevelWidget());
actions->addAssociatedWidget(mListView);
KStandardAction::selectAll(mListView, SLOT(selectAll()), actions);
KStandardAction::deselect(mListView, SLOT(clearSelection()), actions);
where mListView is a QTreeView widget contained within the dialog widget.
When I click inside the QTreeView, the standard shortcuts ctrl-A and
shift-ctrl-A work to (de)select view items. But the shortcuts don't work when
the KDialog widget has focus without first clicking in the view. How can I
get the shortcuts to apply to the window as a whole?
--
David Jarvie.
KAlarm author and maintainer.
http://www.astrojar.org.uk/linux/kalarm.html
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic