Originally Posted by
Kapil
you create an object of ur form class in the main and then call the UI function of it, which sould enable the display of the ui..
Then make it form_obj->show();
main.cpp
int main(int argc,char *argv[])
{
app.setQuitOnLastWindown(true);
Ui::MainWindow ui;
ui.setupUi(form);
form->show();
return app.exec();
}
int main(int argc,char *argv[])
{
QApplication app(argc,argv);
app.setQuitOnLastWindown(true);
QMainWindow *form = new QMainWindow;
Ui::MainWindow ui;
ui.setupUi(form);
form->show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
then execute ur project...
Its validate only for Qt4...
You dont must use uic. Use qmake for bulding your project.
1) subclass you form class
/////// formnew.h
#include "from1.h"
class FormNew::Form1()
{
}
/////// formnew.h
#include "from1.h"
class FormNew::Form1()
{
}
To copy to clipboard, switch view to plain text mode
2) write main app function
#include "formnew.h"
int main( int argc, char ** argv )
{
QFormNew frm;
a.setMainWidget(&frm);
frm.show();
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
return a.exec();
}
#include "formnew.h"
int main( int argc, char ** argv )
{
QApplication a( argc, argv );
QFormNew frm;
a.setMainWidget(&frm);
frm.show();
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
return a.exec();
}
To copy to clipboard, switch view to plain text mode
3) read about qmake
Bookmarks