KDE/kdelibs/kdeui/actions
David Faure
faure at kde.org
Tue Dec 4 20:23:59 CET 2007
SVN commit 744875 by dfaure:
Restore source compatibility
CCMAIL: rodda at kde.org, release-team at kde.org, kretschmann at kde.org
M +8 -0 kactioncollection.cpp
M +9 -0 kactioncollection.h
--- trunk/KDE/kdelibs/kdeui/actions/kactioncollection.cpp #744874:744875
@@ -506,6 +506,14 @@
return KActionCollectionPrivate::s_allCollections;
}
+void KActionCollection::associateWidget(QWidget* widget) const
+{
+ foreach (QAction* action, actions()) {
+ if (!widget->actions().contains(action))
+ widget->addAction(action);
+ }
+}
+
void KActionCollection::addAssociatedWidget(QWidget * widget)
{
if (!d->associatedWidgets.contains(widget)) {
--- trunk/KDE/kdelibs/kdeui/actions/kactioncollection.h #744874:744875
@@ -81,6 +81,15 @@
void clear();
/**
+ * Associate all actions in this collection to the given \a widget.
+ * Unlike addAssociatedWidget, this method only adds all current actions
+ * in the collection to the given widget. Any action added after this call
+ * will not be added to the given widget automatically.
+ * So this is just a shortcut for a foreach loop and a widget->addAction call.
+ */
+ void associateWidget(QWidget* widget) const;
+
+ /**
* Associate all actions in this collection to the given \a widget, including any actions
* added after this association is made.
*
More information about the release-team
mailing list