Results 1 to 7 of 7

Thread: Qwt/custom widget trouble?

  1. #1
    Join Date
    Oct 2006
    Posts
    4
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Qwt/custom widget trouble?

    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!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qwt/custom widget trouble?

    Do you link your application with Qwt?

  3. The following user says thank you to jacek for this useful post:

    Nick2463 (26th October 2006)

  4. #3
    Join Date
    Oct 2006
    Posts
    4
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qwt/custom widget trouble?

    Beware: Incoming newbie moment.

    Erm... Link?

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qwt/custom widget trouble?

    Quote Originally Posted by Nick2463 View Post
    Beware: Incoming newbie moment.

    Erm... Link?
    Oh boy

    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.

  6. The following user says thank you to wysota for this useful post:

    Nick2463 (26th October 2006)

  7. #5
    Join Date
    Oct 2006
    Posts
    4
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qwt/custom widget trouble?

    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!

  8. #6
    Join Date
    Oct 2006
    Posts
    4
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qwt/custom widget trouble?

    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?
    Last edited by Nick2463; 28th October 2006 at 19:27.

  9. #7

    Unhappy Re: Qwt/custom widget trouble?

    Now I have your same problem, Did you solve it?
    Quote Originally Posted by Nick2463 View Post
    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?

Similar Threads

  1. Pin/Unpin Dock Widget
    By charlesD in forum Newbie
    Replies: 1
    Last Post: 21st June 2006, 06:57
  2. minimize child widget
    By sreedhar in forum Qt Programming
    Replies: 5
    Last Post: 15th May 2006, 12:02
  3. Replies: 4
    Last Post: 24th March 2006, 22:50
  4. Forwarding mouse events to another widget.
    By yogeshm02 in forum Qt Programming
    Replies: 8
    Last Post: 28th February 2006, 13:25
  5. [Qt 4.1.0] Split a widget on demand
    By Townk in forum Qt Programming
    Replies: 3
    Last Post: 17th February 2006, 14:16

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.