[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: 2 problems with cvs from yesterday 14:00 german time
From: Michael Koch <m_koch () bigfoot ! de>
Date: 2000-03-09 12:32:33
[Download RAW message or body]
Am Thu, 09 Mar 2000 schrieb aleXXX:
> On Don, 09 Mär 2000, Simon Hausmann wrote:
> >
> > The point of the actioncollection is..well... it collects actions :-)
> >
> > The reason why you allocate an action object in your part is because you
> > want to use it to create some fancy menu item or toolbar button for
> > example. You use an xml document to specify where/how your
> > menu/toolbar/anything item appears.
> >
> > So when KParts wants to build the GUI items for your view it parses the
> > XML document and add uses the name attributes of the Action tags to query
> > the view for the actual QAction objects (so that it can plug them into the
> > correct container widgets) . So in somehow there has to be a way to query
> > a view for an action, addressed by a name. That's why we collect all
> > actions in a QActionCollection, by using the Qt object hierarchy
> > (specifying the action objects as qobject children of the actioncollection
> > object) .
>
> Ahh, thank you. :-)
> So it is that easy ? :-)
>
> So the QActionSelection is a protected/private member of KPart
> (or something not far away) and actionselection() returns a pointer to it ?
QActionCollection not selection.
> To go some mails back, actionselection() should already work in the constructor
> of a class derived from a class containing an actionselection, shouldn't it ?
It should work. AFAIK virtual methods can be called when the constructor of the
class containing them is finished.
> Did I add a KAction to a class derived from QObject in my post ?
> Well, I didn't think about it, it should just be a simple example.
You have another problem with this: You cannot use KStdAction's because they
only return pointers. Then you have to write this:
KAction( *(KStdAction::something(...) ) ).
This looks very confusing and I dont know if this works.
Ciao,
Michael
--
koch@kde.org, m_koch@bigfoot.de
http://heaven.riednet.wh.tu-darmstadt.de/~mkoch
To me vi is Zen. To use vi is to practice zen. Every command is
a koan. Profound to the user, unintelligible to the uninitiated.
You discover truth everytime you use it.
-- reddy@lion.austin.ibm.com
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic