I try to run an example.
plot.pro
SOURCES += \
main.cpp
CONFIG += qwt
QWT_LOCATION = c:/Qwt-6.1.0
INCLUDEPATH += $${QWT_LOCATION}/include
LIBS = -L$${QWT_LOCATION}/lib \
-lqwtd
SOURCES += \
main.cpp
CONFIG += qwt
QWT_LOCATION = c:/Qwt-6.1.0
INCLUDEPATH += $${QWT_LOCATION}/include
LIBS = -L$${QWT_LOCATION}/lib \
-lqwtd
To copy to clipboard, switch view to plain text mode
main.cpp
#include <QtGui\QApplication>
#include <qwt_plot.h>
int main(int argc, char* argv[])
{
// this is a simple plot without any data!
myPlot->setTitle("my first plot");
myPlot
->setCanvasBackground
(QColor(Qt
::darkBlue));
myPlot->show();
return app.exec();
}
#include <QtGui\QApplication>
#include <qwt_plot.h>
int main(int argc, char* argv[])
{
// this is a simple plot without any data!
QApplication app(argc,argv);
QwtPlot *myPlot = new QwtPlot;
myPlot->setTitle("my first plot");
myPlot->setCanvasBackground(QColor(Qt::darkBlue));
myPlot->show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Output:
QWidget: Must construct a QApplication before a QPaintDevice
D:\Documents\Qt\HelloPlot\build-HelloPlot-Microsoft_Visual_C-Debug\debug\HelloPlot.exe exited with code 1
What should be in qwtconfig.pri? "CONFIG += QwtDll" or "#CONFIG += QwtDll"? or no difference?
I use:
- Visual Studio Command Prompt (2010)
- Qt4.8.5
- Qwt-6.1.0
- Compiler: Microsoft Visual C++ Compiler 10.0 (x86)
Bookmarks