You designed a widget in the designer, but are using the Ui for a dialog. It works this way, because QDialog inherits QWidget, but more appropriate way is to design a dialog for a dialog, a widget for a widget and a mainwindow for a mainwindow.

Qt Code:
  1. // dialog.h
  2. #include "ui_widget1.h"
  3. // you must include this because you designed a widget in the designer
  4. #include <QDialog>
  5.  
  6. class Dialog : public QDialog
  7. {
  8. Q_OBJECT
  9.  
  10. public:
  11. Dialog(QWidget *parent = 0);
  12.  
  13. private:
  14. Ui::Widget1 ui; // corrected the name, check the object name property in the designer
  15. };
To copy to clipboard, switch view to plain text mode