View Full Version : how connect in qt4....
otortos
8th March 2006, 21:51
Hi,
I was working with qt3 and it was so easy to me ( i am not a c++ programmer ) to write the code. I have one main screen, and a secondary. To call the second screen from the main in designer, i just press the menu "edit", "slots", "new function" and then write the code. I don't know how is in the new qt4, could somebody explain me a little?
Thanks.
Try reading FAQ (http://www.qtcentre.org/forum/faq.php?faq=qt_general_category#faq_qt_designer_2f orms)
jacek
9th March 2006, 13:23
or Qt Designer documentation (http://doc.trolltech.com/4.1/designer-using-a-component.html).
otortos
9th March 2006, 17:33
Well, i saw Qt Designer documentation....even i try the example with this erros:
ain.cpp: In function ‘int main(int, char**)’:
main.cpp:8: error: ‘imagedialog’ is not a member of ‘Ui’
main.cpp:8: error: expected `;' before ‘ui’
main.cpp:9: error: ‘ui’ was not declared in this scope
make: *** [main.o] Error 1
I did copy exactly the first example......
That's the reason i am posting this question.
Thanks
jacek
9th March 2006, 17:45
main.cpp:8: error: ‘imagedialog’ is not a member of ‘Ui’
Shouldn't it be "ImageDialog"? In C++ identifiers are case sensitive.
otortos
9th March 2006, 18:46
I did in both ways, ImageDialog and imagedialog....same error
jacek
9th March 2006, 19:09
Then check what is the value of your form's objectName property.
otortos
9th March 2006, 19:12
the name is the same: imagedialog
my files: imagedialog.ui, main.cpp
then i use qmake -project....then qmake and make.
the code of main.cpp is a copy of documentation.
jacek
9th March 2006, 19:38
Do you have #include "ui_imagedialog.h" at the top of main.cpp?
otortos
9th March 2006, 19:43
Yes, i repeat...is a copy of the documentation....the first two lines are:
#include "ui_imagedialog.h"
#include <QApplication>
jacek
9th March 2006, 22:20
Could you post the sources and .ui file as an attachment?
otortos
9th March 2006, 22:34
Yes, thanks for your help.....
jacek
9th March 2006, 22:52
I've fixed the main.cpp file --- class name must match the one from .ui file. If you create a template based on QMainWindow, you must use QMainWindow in your code.
I've also attached a simple example how to use .ui files in your code.
otortos
10th March 2006, 15:29
Thanks for your help....
Powered by vBulletin® Version 4.2.5 Copyright © 2023 vBulletin Solutions Inc. All rights reserved.