Events editor
BogDan Vatra
taipanromania at gmail.com
Mon Nov 10 17:51:09 UTC 2008
Hi,
I want to create an event editor for qt designer integration plugin.
First, let me say something about the event editor.
An event editor is an editor for signals (events) like property
editor, but instead to set properties you will use this to manage the
slots. This editor will create (if they not exists or remove/comment
if they already exists) for you slots: void on_<widget name>_<signal
name>(<signal parameters>);
Let's take an example. Let's say you have a form (form.ui), based on
QWidget, with a button. The name for the widget is myForm and for the
button myButton. Let's say you have subclassed this form ("form.cpp"
and "form.h").
form.h:
#include <QWidget>
class MyFormClass:public QWidget, private Ui::myForm
{
MyFormClass(.....);
private slots: // private slots section
}
When you open the form.ui file and select the button in event editor
will appear all the signals for QPushButton. If you click on the
"clicked" signal, I want to create for you a slot named "void
on_myButton_cicked(bool checked )".
What I want the event editor to do:
1. If you don't subclass the form, the event editor can subclass the
form for you.
2. Let you create or remove/comments slots.
3. Rename all the slots related to a widget when you rename the widget
name. Here I think is better to search and rename all declarations who
use this widget.
What I have done:
1. I manage to find the ui_<form_name>.h where is it. Please don't
remove "KDevelop::DUChain::documents( )" function, it helped me a lot.
2. I found the class declaration (main form object name).
3. I found all classes who inherits the ui class.
3. I found all functions of this class (here seems "isSlot" property
is not to working) .
4. I found how to rename a declaration.
What I don't know how to do:
1. how to add a function to a class (definition and implementation). I
need a function like this: void addSlot(DUContext * classContext,
ClassFunctionDeclaration cfd); This function should add a declaration
and a definition to .h and .cpp files.
2. how to remove (or comment) a function from a class. I need a
function like this: void removeSlot(ClassFunctionDeclaration cfd);
This function should remove the declaration and the definition from .h
and .cpp files.
3. More stuff, but for now this two will help me a lot.
P.S. I hope you understand what I want to say, my English is not so good.
BogDan,
More information about the KDevelop-devel
mailing list