Hello everyone.

In the books I have reading regarding qt4 the designer programm was used to create dialogs. But this time I thought the best solution was to create the ui form in designer, describe it as widget and after - use such widget as main windget in mainwindow.

I was looking in google form a lolution. I coold find some information regarding it, but it didn't work well.

What I did:

there is the ui file "mainwidget.h" as qwidget.

For the first try all I want is to see it's working:

mainwidget.h
Qt Code:
  1. #ifndef MAINWIDGET_H
  2. #define MAINWIDGET_H
  3.  
  4. #include <QWidget>
  5. #include "ui_mainwidget.h"
  6. class MainWidget : public QWidget, public Ui::MainWidget
  7. {
  8. Q_OBJECT
  9. public:
  10. MainWidget(QWidget *parent = 0);
  11.  
  12. };
  13. #endif
To copy to clipboard, switch view to plain text mode 

and mainwidget.cpp
Qt Code:
  1. #include "mainwidget.h"
  2.  
  3. MainWidget::MainWidget(QWidget *parent) : QWidget(parent)
  4. {
  5.  
  6. }
To copy to clipboard, switch view to plain text mode 

Then i create the main.cpp:
Qt Code:
  1. #include <QApplication>
  2. #include "mainwidget.h"
  3.  
  4. int main(int argc, char **argv){
  5. QApplication app(argc, argv);
  6. MainWidget wgt;
  7. wgt.show();
  8. return app.exec();
  9. }
To copy to clipboard, switch view to plain text mode 

Then I create the .pro file, add the RESOURCES line, copy the icon's folder.
It compiles with no errors. It even does launch, but I cannot see anything - just empty window of the desired size.

Is there anything I am doing wrong in here?