Kdevelop+QTDesigner problem

Victor Ramiro vramiro at gmail.com
Sat May 20 02:26:29 BST 2006


I sent this mail, but  i dont know if it arrived ok :S
in the boy there are new information

Thanks,
Victor Ramiro

---------- Forwarded message ----------
From: Victor Ramiro <vramiro at gmail.com>
Date: May 17, 2006 2:44 PM
Subject: Kdevelop+QTDesigner problem
To: kdevelop at barney.cs.uni-potsdam.de


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?

UPDATE:

i put in the declaration of the derived clases the complete path to
the class, ie
GUI::AbstractFormClass, and this genereted the correct code, but it
still dont work
as i spect. I don't understand how de metaobject takes the control
when i'm debugging
because i never get in the aform->method() :S

Thanks
-- 
Victor A. Ramiro Cid
<vramiro@[ing,dcc].uchile.cl>
Depto. Ciencias de la Computacion
Escuela de Ingenieria, Universidad de Chile

-- 
Victor A. Ramiro Cid
<vramiro@[ing,dcc].uchile.cl>
Depto. Ciencias de la Computacion
Escuela de Ingenieria, Universidad de Chile




More information about the KDevelop mailing list