i have a simple window with a quit button in qt.The working code is shown below
#include <QApplication>
#include <QDialog>
#include <QPushButton>
class MyWidget : public QWidget
{
public:
MyWidget(QWidget *parent = 0);
};
MyWidget::MyWidget(QWidget *parent)
: QWidget(parent)
{
setFixedSize(200, 120);
QPushButton *btquit = new QPushButton(tr("Quit"), this);
btquit->setGeometry(62, 40, 75, 30);
btquit->setFont(QFont("Times", 18, QFont::Bold));
connect(btquit, SIGNAL(clicked()), qApp, SLOT(quit()));
}
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MyWidget widget;
widget.show();
return app.exec();
}
Now i want to code this program using qt designer.I created a widget named "mywindow" and a button inside that main widget named "btquit" in the ui file using qt designer. How to rewrite the above code with the ui file.The name of ui file is mywindow.ui