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.
// dialog.h
#include "ui_widget1.h"
// you must include this because you designed a widget in the designer
#include <QDialog>
{
Q_OBJECT
public:
private:
Ui::Widget1 ui; // corrected the name, check the object name property in the designer
};
// dialog.h
#include "ui_widget1.h"
// you must include this because you designed a widget in the designer
#include <QDialog>
class Dialog : public QDialog
{
Q_OBJECT
public:
Dialog(QWidget *parent = 0);
private:
Ui::Widget1 ui; // corrected the name, check the object name property in the designer
};
To copy to clipboard, switch view to plain text mode
Bookmarks