[Qt-creator] Script manager

Nicolas Arnaud-Cormos nicolas at kdab.com
Tue Jan 12 12:30:09 CET 2010


On Tuesday 12 January 2010 12:11:53 Eike Ziller wrote:
> > I would like to create some simple scripts to do some repetitive tasks
> > for my  daily work, and I was thinking of creating a script plugin (where
> > the user can access the current editor and the actionmanager for
> > example).
> 
> Uh, what do you need the action manager for, for "daily work"? :)

We are porting application (from Motif to Qt for example) and porting has a 
lot of repetitive task.
For example, changing a callback (myCallback) in a slot (mySlot) , which 
involves:
 * renaming it in the header
 * moving it to public slots or whatever
 * removing parameters
 * switching to the source
 * renaming
 * removing parameters 
 * ...

With a script interface, it would be easy to do such a thing, I just need to 
be able to access the editor and the actionManager (to switch header).

Im' thinking of a script like (that's just to give you an idea, it would be 
more complicated):
currentEditor.replace("myCallback", "mySlot");
actionManager.execute("CppEditor.SwitchHeaderToSource");
...

We need a lot of these little scripts to help us being productive, and having 
a script plugin would be far way easier than creating a specific C++ plugin.
Imagine now that I call this script callbackToSlot.qs, put it in a script 
directory (that the plugin know), I could do:
 * shortcut to excute the script (I'm thinking of Alt+space)
 * a combobox with completion is shown
 * "callbackToSlot + Enter
 * the callback is change in a slot, in the header and source file.

Note that's something we are already doing with xemacs, I'm just looking to Qt 
Creator to replace xemacs in my daily work.
Anyway, if there's nothing yet, I'll start my own one.

Thanks,
Nicolas

-- 
Nicolas Arnaud-Cormos | nicolas at kdab.com | Software Ingeneer
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - Qt Experts - Platform-independent software solutions




More information about the Qt-creator-old mailing list