[Kommander-devel] Re: Accessing a QAction in a Kommander Plugin
Andras Mantia
amantia at kdewebdev.org
Thu Feb 21 15:44:25 EST 2008
> Hi Eric,
>
> On Thursday 21 February 2008, Eric Laffoon wrote:
>
>> The problem is I have to take in a QString with the name of that action
>> and
>> then call it. For openers, I'm not sure but I think the Actions are
>> named
>> with QCString. I could be wrong. Regardless I'm having a bear of a time
>> figuring out the basic syntax and I don't have time to study this in
>> depth.
>> I have the Action name as declared in the editor, so it's in the ui/kmdr
>> file. Can someone give me the syntax for a simple working function
>> prototype here and the required include files?
>
> If the problem is finding the QAction pointer, you can use the child()
> method
> the main window inherits from QObject.
>
> This returns a QObject* and if you just have to change a property
> like "enabled" you can do it right there through the setProperty() method.
>
> Otherwise you have to cast to QAction*
I am supposed to be on vacation. :) I don't have time to read all the
mails, but what Eric would like is to execute a QAction or make it
enabled/disabled via DCOP (yes, this is KDE3 code), just like you can do
with the KAction's in virtually any KDE application.
Andras
More information about the Kommander-devel
mailing list