Results 1 to 4 of 4

Thread: Using Qwt with QVector

  1. #1
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    39
    Thanks
    15
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Using Qwt with QVector

    Okay so I may get flamed here but I have to ask anyway.

    can anyone point me to a good example of using a QVector in a qwt plot. I should point out that I have scoured the web etc but also being a complete noob I get stuck quite often. I am slowly bringing myself up to speed.

    In short I have a QVector of floats that I have read in from a binary file and I want to plot them in qwt. And this is where I come apart. I have tried and failed miserably. Generally once I see a very simple example I can get myself off and running. I started to go down the QwtArraySeriesData route and gort myself completely lost in "cannot allocate an object of abstract type" errors. Yes I am a super beginner but everyone has to start somewhere right?

    I would have posted this in the newbie forum but suspected it would get moved to here anyway. Any help or simple example/s are appreciated.

    Cheers
    Oz

  2. #2
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Using Qwt with QVector

    Hi,

    how do you want to plot a series of floats? for each point, you need an x- and a y-value.

    assuming, you have a QVector with x-values and a QVector with y-values, you can use "SetSamples(...)" (or thelike) to add your points to a curve. have a look at the documentation of QwtPlotCurve and you'll find the appropriate method.

    hth,
    Felix

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

    OzQTNoob (9th February 2012)

  4. #3
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    39
    Thanks
    15
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Using Qwt with QVector

    Hi Felix,

    I will have a look and see how I go. So is using QwtArraySeriesData the wrong way to go then?

  5. #4
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Using Qwt with QVector

    it depends on how you have your data. if you have two QVector, you don't have to care about any data object - it will be created internally.

Similar Threads

  1. QVector::reserve() bug?
    By Caius Aérobus in forum Qt Programming
    Replies: 3
    Last Post: 6th June 2019, 11:34
  2. Replies: 5
    Last Post: 2nd September 2011, 23:11
  3. Problem with qvector
    By zorro68 in forum Qt Programming
    Replies: 1
    Last Post: 23rd February 2008, 01:02
  4. Qvector
    By phillip_Qt in forum Qt Programming
    Replies: 3
    Last Post: 27th November 2007, 10:46
  5. QVector
    By sabeesh in forum Qt Programming
    Replies: 2
    Last Post: 17th September 2007, 14:37

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.