PDA

View Full Version : how to get code for dialog in qt4.1.2



quickNitin
7th June 2006, 13:03
hi
this is really some stupid question but can't help.
In Qt3.3.4 when we r-click on dialog we get an option o explore the code and add to it.
How i can get code in Qt4.1.2 There no such menu appears.

jacek
7th June 2006, 13:25
Where exactly did you see that? In Qt Designer?

quickNitin
7th June 2006, 13:33
in qt4.1.2 also a menu apears but there is no menu item which will took me to its ui class source.

sunil.thaha
7th June 2006, 13:41
It doesnot have the open u r looking for
Please refer the Article

http://doc.trolltech.com/qq/qq14-designer.html

quickNitin
8th June 2006, 12:09
i got the header source of uic and added my code but on make it gives following errors, i can't understand what it mean.
I have both qt3.3.4 and qt4.1.2 installed on my system but i don't think this should be any issue and i had make sure i use qt4.1.2 components.


make
g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED ... -o main.o main.cpp
g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED ... -o MyDialog.o MyDialog.cpp
/usr/local/Trolltech/Qt-4.1.2/bin/moc -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED ... MyDialog.h -o moc_MyDialog.cpp
g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED ... -o moc_MyDialog.o moc_MyDialog.cpp
moc_MyDialog.cpp:43: error: ‘staticMetaObject’ is not a member of ‘Ui_Dialog’
moc_MyDialog.cpp: In member function ‘virtual void* MyDialog::qt_metacast(const char*)’:
moc_MyDialog.cpp:59: error: ‘qt_metacast’ is not a member of ‘Ui_Dialog’
moc_MyDialog.cpp: In member function ‘virtual int MyDialog::qt_metacall(QMetaObject::Call, int, void**)’:
moc_MyDialog.cpp:64: error: ‘qt_metacall’ is not a member of ‘Ui_Dialog’
make: *** [moc_MyDialog.o] Error 1

jacek
8th June 2006, 13:09
i got the header source of uic and added my code
You shouldn't modify the code produced by uic.

Read this: http://doc.trolltech.com/4.1/designer-using-a-component.html (especially the part about single inheritance approach).

quickNitin
8th June 2006, 14:12
i am sorry for language mistake. By adding my code i mean i inherited that class. and i have again produced the code for dialog.
I am following multiple inheritance approach.
Can this problem be due to order of putting classes for inheritance. I have put QDialog after Ui_class.
i will check it

quickNitin
8th June 2006, 14:18
ya code got compiled but i am still searching for reason of error. Once i studied the cause but i had forget it.

wysota
8th June 2006, 14:35
QObject subclass has to go first in the inheritance code. Otherwise moc won't work properly.