Qwidget: must construct a QApplication before a QPaintDevice
Your answer is here. You have to construct QApplication first.
Normally your main.cpp should look somehow like that:
#include <QtGui/QApplication>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
MainWindow w;
w.show();
return a.exec();
}
#include <QtGui/QApplication>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
You can try to use QtCreator to start a new project - this code will be generated automatically.
Next time in your posts please use correct tags (quote, code etc.) and write in a proper forum (this post should be in newbie forum).
Bookmarks