PDA

View Full Version : Qwt/custom widget trouble?



Nick2463
26th October 2006, 21:51
Has anyone else had problems getting Qwt 5 to work for Qt4 on a windows box?

What I did to install:

cd qwt 5.0.0rc0
qmake
make

Did I miss an important step somewhere? I installed the designer plugin, and that works well (although I'm not totally sure, as I'm not using designer for my QMainWindow widget as its easier to customize/read in plain C++). Problem is, when I try to make a new QwtPlot, at compile time it says that 'QwtPlot::QwtPlot(QWidget*)' is an undefined reference. As a temporary fix, I put in a dummy constructor in my mainwindow.cpp file:

#include <Qwt\qwt_plot.h>

QwtPlot::QwtPlot(QWidget*){
}

And then it says 'vtable for QwtPlot' is an undefined reference. Hmmmm. Its like I have no moc or .obj files for Qwt.

Another thing that is strange, is that I can compile the Qwt examples as long as they're in that original qwt 5 folder that I unzipped to my desktop. But if I move them out of that folder, they have the same problem as my MainWindow code. I must be missing something.

Thanks for any help!

jacek
26th October 2006, 22:08
Do you link your application with Qwt?

Nick2463
26th October 2006, 22:09
Beware: Incoming newbie moment.

Erm... Link?

wysota
26th October 2006, 22:58
Beware: Incoming newbie moment.

Erm... Link?
Oh boy :D

You have to link your application to the functionality provided by Qwt. Otherwise how would it know that you want to use Qwt and where to find its methods?

If you installed Qwt correctly, then probably everything you need is to add LIBS+=-lqwt to your project file and rerun qmake to generate a new Makefile.

Nick2463
26th October 2006, 23:25
Oh snap!

I didn't even think to look in the .pro file to see if it was linking correctly. Funny thing is I've been stuck on this problem for like 2 days. Now it works flawlessly. Thanks!

Nick2463
28th October 2006, 19:53
Ok, I figure I'll just continue this old thread, since its another problem I'm having with Qwt..

I've got a plot graph made, and it works great, so I'm trying to add zoom/scroll functionality. I figured, after finding those awesome scrollbar and scrollzoomer classes in the realtime_plot example that Uwe provided that I could just implement those and it'd be kosher. So I put them in, updated the headers and put on the usual accrediting.

Problem is, now as soon as compile those with my QMainWindow application I get the following error at runtime:

Error: The application failed to Initialize Properly (0x0000005).

Error Code 5, if I remember right, meant something along the lines of denied access to some location in memory. I haven't implemented any pointers or initializers to either of those classes yet (the same problem happens when I do) from my application, it just fails out from just #including them into the file.

Has anyone else tried to implement these files in their applications before, or have had a similar problem like this?

tingxx
17th June 2008, 03:48
Now I have your same problem, Did you solve it?

Ok, I figure I'll just continue this old thread, since its another problem I'm having with Qwt..

I've got a plot graph made, and it works great, so I'm trying to add zoom/scroll functionality. I figured, after finding those awesome scrollbar and scrollzoomer classes in the realtime_plot example that Uwe provided that I could just implement those and it'd be kosher. So I put them in, updated the headers and put on the usual accrediting.

Problem is, now as soon as compile those with my QMainWindow application I get the following error at runtime:

Error: The application failed to Initialize Properly (0x0000005).

Error Code 5, if I remember right, meant something along the lines of denied access to some location in memory. I haven't implemented any pointers or initializers to either of those classes yet (the same problem happens when I do) from my application, it just fails out from just #including them into the file.

Has anyone else tried to implement these files in their applications before, or have had a similar problem like this?