From kde-devel Fri Dec 31 01:46:54 2004 From: Andreas Pakulat Date: Fri, 31 Dec 2004 01:46:54 +0000 To: kde-devel Subject: using same KAction in MainWindow and View Message-Id: <20041231014654.GA17715 () morpheus ! matrix ! de> X-MARC-Message: https://marc.info/?l=kde-devel&m=110445765208605 Hi, I got a small problem with a KAction. I'm going to have 4 radiobuttons to setup a rotation for an image in my app. I'd like to have these 4 radiobuttons both in the view for my document and also in the mainwindow's menu. Only I could not find a tutorial or howto on how to do that... Currently I'm experimenting with a simple KAction which is setup with XML-file: setupActions() { new KAction(i18n("rotation"), 0, this, SLOT(rotate()), actioncollection()); ... } In the mainwindow-class. As far as I understand it, getting this action onto the widget of my view should be acomplished by getting the actionCollection from the mainwindow (how do I get that?) and then fetching the KAction from it and using it's plug-function to attach it to my widget or later on to the QButtonGroup. Is there some tutorial or howto on this out there or can somebody here explain me how to do this? I probably could work around it with "hardcoded" radiobuttons and seperate slots in the view-class, but I'd like to avoid that... Andreas -- Tonight's the night: Sleep in a eucalyptus tree. >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<