PDA

View Full Version : Qwtplot3d with Qt 5?



thegreger
21st October 2013, 15:49
I'm not sure if I should place this in the Newbie forum or in the Qwt forum, but here goes:

After something like four months of experience in Qt, Qt Creator and C++, I need to incorporate a 3d plotting tool into my project. By the looks of things, Qwtplot3d should do everything I need, but I haven't managed to get it working.
Compiling Qwt3d wasn't much of an issue. A few minor changes, and I'm left with libqwtplot3d.a, libqwtplot3dd.a, qwtplot3d.dll and qwtplot3dd.dll. However, when I try to link it into my project, I'm getting strange errors. If I create an arbitrary push button, and simply connect it being pressed to the code

SurfacePlot *plot3 = new SurfacePlot(this);
then upon pressing the button, the program will crash with the error "QWidget: Must construct a QApplication before a QPaintDevice". This despite the fact that I had created my QApplication back in main.cpp.

I thought that it was an obvious case of user error, so I tried compiling one of the examples provided with Qwtplot3d. Needed to change a few minor things in the .pro-file (pointing at the .dll file rather than a .lib file that doesn't exist, changing "TEMPLATE = vcapp" to "TEMPLATE = app", etc), but eventually the example did build without errors. When running it, it simply exits immediately with the error "The program has unexpectedly finished."

Is there any known issues with Qwtplot3d when combined with Qt5, Qt Creator and MinGW? This user seemed to have a very similar problem, but his question is as of yet unanswered: http://www.qtcentre.org/threads/53732-Qwtplot3d-Problem-gt-Using-QtCreator-MinGW?highlight=qwt3d

Grateful for any advice.