Program that just shows a window
As expected, when I build i get an error message that says that show method doesn't exist. In fact i didn't create it.
I created ui_ABase.h with qmake, giving as input the .ui file generated with Qt Designer.
How I can display the whole mainwindow created with Qt Designer?
Code:
#include <QApplication>
#include <QFont>
#include <QPushButton>
#include "ui_ABase.h"
int main(int argc, char* argv[])
{
Ui_ABase base;
base.show();
return app.exec();
}
Re: Program that just shows a window
I don't use the designer for my GUI, but when I create a new app in VS, it (annoyingly) always makes a .ui file, but it lives in a QMainWindow class. Its used in the main window's constructor like this: ui.setupUi(this);
So I would say, make a QWidget or something, and put your ui object in there, then in the widget's constructor call ui.setupUi(this); Then in main() create your QWidget:
QWidget myWidget;
myWidget.show();
Maybe that will do the trick...
Re: Program that just shows a window