Kdevelop+QTDesigner problem

Victor Ramiro vramiro at gmail.com
Wed May 17 19:44:11 BST 2006


Hi,

First of all, sorry for my poor english

I'm working with kdevelop and qtdesigner to create an app.
I created a set of interfaces form1.ui, form2.ui and form3.ui
I'm implementing theirs codes in Form1Code class, Form2Code class and
Form3Code class.

I also need that this implementing clasess works under some protocol defined
in AbstactFormClass
All this in the namespace GUI

so i have:

QWidget <- Form1 (class generated by form1.ui) <- Form1Code
QWidget <- Form2 (class generated by form2.ui) <- Form2Code
QWidget <- Form3 (class generated by form3.ui) <- Form3Code

and also:

AbstractFormClass <- Form1
AbstractFormClass <- Form2
AbstractFormClass <- Form3

In the code i have:

QWidget * form = getFormFromStackWidgets();  // supouse that form is a Form1
object
AbstractFormClass * aform = (AbstractFormClass *) form;
Object* result = aform->method();   // dynamic binding to Form1::method

well, debugging i found that result is always NULL.
Why?, method is never called. Instead, i entered to qt_cast from
Form1.moc(why??, someone explain this to me...)
Well, i think the problem is in qt_cast code:

void* QTGUI::FormGUICode::qt_cast( const char* clname )
{
    if ( !qstrcmp( clname, "GUI::Form1Code" ) )
        return this;
    if ( !qstrcmp( clname, "AbstractFormClass" ) )  // <-- here is wrong??
        return (AbstractFormClass*)this;
    return FormPRespuesta::qt_cast( clname );
}

I think, this should be:

void* QTGUI::FormGUICode::qt_cast( const char* clname )
{
    if ( !qstrcmp( clname, "GUI::Form1Code" ) )
        return this;
    if ( !qstrcmp( clname, "GUI::AbstractFormClass" ) )  // <-- here is ok!!
        return (AbstractFormClass*)this;
    return FormPRespuesta::qt_cast( clname );
}

I can't change the Form1Code.moc...so, how can i fix this?

Thanks
-- 
Victor A. Ramiro Cid
<vramiro@[ing,dcc].uchile.cl>
Depto. Ciencias de la Computacion
Escuela de Ingenieria, Universidad de Chile
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop/attachments/20060517/4ca81323/attachment.html>


More information about the KDevelop mailing list