QWidget: Must construct a QApplication before a QPaintDevice
QWidget: Must construct a QApplication before a QPaintDevice
Anyone know how to repair that problem.?
I use Qwt library.
7 replies
CONFIG += QwtDll this line must be ->
#CONFIG += QwtDll
from” here”:http://www.qtcentre.org/threads/10959-QWidget-Must-construct-a-QApplication-before-a-QPaintDevice
I create action for button like this.
- void MainWindow::buttonclickhandler()
- {
- QwtPlot *myPlot=new QwtPlot;
- QwtText title( "Two Curves" );
- QwtPlotCurve *curve1 = new QwtPlotCurve("Curve 1");
- double t[100];
- double y[100];
- for (int i=0;i<100;i++)
- {
- t[i]=i;
- y[i]=sin(2*20*i);
- }
- curve1->setRawSamples(t,y,100);
- curve1->attach(myPlot);
- myPlot->show();
- myPlot->replot();
- }
and when i Start compilate I get error like this: QWidget: Must construct a QApplication before a QPaintDevice
Patience is a virtue.
Bumping your topic after one hour is most likely to annoy your fellow developers on the forum and make them stay away from your topic.
Do as the error message suggests: construct a QApplication instance before creating any other widget.
If you really did that, then it’s most likely the you mix debug and release versions of your libraries.
And you never get that error on compilation, but only during runtime.
You must log in to post a reply. Not a member yet? Register here!



