[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: using same KAction in MainWindow and View
From:       Kevin Krammer <kevin.krammer () gmx ! at>
Date:       2005-01-02 16:36:13
Message-ID: 200501021736.13717.kevin.krammer () gmx ! at
[Download RAW message or body]

On Saturday 01 January 2005 18:58, Andreas Pakulat wrote:
> On 01.Jan 2005 - 18:28:38, Kevin Krammer wrote:
> > On Friday 31 December 2004 02:46, Andreas Pakulat wrote:
> > > 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?)
> >
> > For example by casting the view's parentWidget() to KMainWindow (if it is
> > the view's parent) or using the widget returned by
> > KApplication::mainWidget()
>
> Ok, but how can I add a RadioButton-Action into my widget (which is
> derived from QWidget? Using a->plug(this) gives me a warning, as does
> a->plug(myButtonGroup). The same for a QFrame... Do I have to write an
> apropriate Widget for this? How do I do that?

Hmm, good question.
My guess is that you could subclass KRadioAction and reimplement plug() so 
that it creates a QRadioButton if the widget passed to plug is a QButtonGroup 
and otherwise call the implementation of KRadioAction.

> I start to think that using a hardcoded QButtonGroup and the SLOT from
> the KMainwindow might be easier...

Might indeed be easier.

Cheers,
Kevin

-- 
Kevin Krammer <kevin.krammer@gmx.at>
Qt/KDE Developer, Debian User
www.mrunix.de - German Unix/Linux programming forum
www.qtforum.org - Qt programming forum
 
>> 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