Hi all,
I am getting this error on my application, even before main() is executed:
QWidget: Must construct a QApplication before a QPaintDevice
To copy to clipboard, switch view to plain text mode
The funny (?) thing is that I only get it when choosing "debug and build" in QDevelop's menus. When compiling for release it works flawlessly. Any ideas?
Here is my main, not even the first line (line number 9 in this code) is printed:
#include <cstdlib>
#include "mainwindowimpl.h"
#include <QApplication>
using namespace std;
int main(int argc, char ** argv)
{
printf("111111111111");
MainWindowImpl win;
win.show();
app.connect( &app, SIGNAL( lastWindowClosed() ), &app, SLOT( quit() ) );
return app.exec();
}
#include <cstdlib>
#include "mainwindowimpl.h"
#include <QApplication>
using namespace std;
int main(int argc, char ** argv)
{
printf("111111111111");
QApplication app( argc, argv );
MainWindowImpl win;
win.show();
app.connect( &app, SIGNAL( lastWindowClosed() ), &app, SLOT( quit() ) );
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Here is the generated faulty pro file
TEMPLATE = app
QT = gui core
CONFIG += qt warn_on console debug_and_release
OBJECTS_DIR = build
MOC_DIR = build
UI_DIR = build
FORMS = ui/mainwindow.ui
HEADERS = src/mainwindowimpl.h
SOURCES = src/mainwindowimpl.cpp src/main.cpp
INCLUDEPATH = d:\source\qwt-5.0.2\src
LIBS = d:\source\qwt-5.0.2\lib\libqwt5.a
TEMPLATE = app
QT = gui core
CONFIG += qt warn_on console debug_and_release
OBJECTS_DIR = build
MOC_DIR = build
UI_DIR = build
FORMS = ui/mainwindow.ui
HEADERS = src/mainwindowimpl.h
SOURCES = src/mainwindowimpl.cpp src/main.cpp
INCLUDEPATH = d:\source\qwt-5.0.2\src
LIBS = d:\source\qwt-5.0.2\lib\libqwt5.a
To copy to clipboard, switch view to plain text mode
Here is the working pro file:
TEMPLATE = app
QT = gui core
CONFIG += qt warn_on console release
OBJECTS_DIR = build
MOC_DIR = build
UI_DIR = build
FORMS = ui/mainwindow.ui
HEADERS = src/mainwindowimpl.h
SOURCES = src/mainwindowimpl.cpp src/main.cpp
INCLUDEPATH = d:\source\qwt-5.0.2\src
LIBS = d:\source\qwt-5.0.2\lib\libqwt5.a
TEMPLATE = app
QT = gui core
CONFIG += qt warn_on console release
OBJECTS_DIR = build
MOC_DIR = build
UI_DIR = build
FORMS = ui/mainwindow.ui
HEADERS = src/mainwindowimpl.h
SOURCES = src/mainwindowimpl.cpp src/main.cpp
INCLUDEPATH = d:\source\qwt-5.0.2\src
LIBS = d:\source\qwt-5.0.2\lib\libqwt5.a
To copy to clipboard, switch view to plain text mode
System is MingW, Xp, Qt 4.3.2, QDevelop 0.25.
Bookmarks