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

List:       kde-devel
Subject:    Accessing a QAction in a Kommander Plugin
From:       Eric Laffoon <sequitur () kde ! org>
Date:       2008-02-21 5:09:44
Message-ID: 200802202109.44277.sequitur () kde ! org
[Download RAW message or body]

Hi all,
I rarely get time to do much C++ and as Andras is on vacation I don't have my 
usual answer guy. So here's what I'm trying to do...

Kommander cannot create a MainWindow Kommander widget, but it can use one 
created in Qt Designer. It can connect signals from Actions to scripts. That 
works great, and BTW I'm still talking about Qt3/KDE3 versions for the moment 
as I know this is not going to be an issue in KDE4.

The problem is in communicating with Actions created with Designer in 
Kommander at run time. It occured to me that it should be possible with a 
proxy, a plugin that took the Action name as an argument and then performed a 
defined function, which then called the appropriate public member. This is 
easy enough to do if you're writing the whole thing in C++. Create a new 
Action and then
foo = myAction->isEnabled();

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? 
TIA.
-- 
Eric Laffoon
Project Lead Quanta plus/Kommander
http://kdewebdev.org
 
>> 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