Try this:
Qt Code:
  1. #include <QApplication>
  2. #include <QMainWindow>
  3.  
  4. #include "ui_test.h"
  5.  
  6. int main(int argc, char *argv[]){
  7. QApplication app(argc, argv);
  8. QMainWindow *window = new QMainWindow();
  9. Ui::Test ui;
  10. ui.setupUi(window);
  11.  
  12. window->show();
  13. return app.exec();
  14. }
To copy to clipboard, switch view to plain text mode 
but first check whether you have set the objectName property of your form to "Test".