Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. [Solved]More qwt plot questions
QtWS25 Last Chance

[Solved]More qwt plot questions

Scheduled Pinned Locked Moved 3rd Party Software
7 Posts 5 Posters 7.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    toho71
    wrote on last edited by
    #1

    In the documentation of QWT plot there is a code like this

    @#include "../include/qwt_plot.h>

    QwtPlot *myPlot;
    long curve1, curve2; // keys
    double x[100], y1[100], y2[100]; // x and y values

    myPlot = new QwtPlot("Two Graphs", parent, name);

    // add curves
    curve1 = myPlot->insertCurve("Graph 1");
    curve2 = myPlot->insertCurve("Graph 2");

    getSomeValues(x, y1, y2);

    // copy the data into the curves
    myPlot->setCurveData(curve1, x, y1, 100);
    myPlot->setCurveData(curve2, x, y2, 100);

    // finally, refresh the plot
    myPlot->replot();
    @

    But when I try to use this methods setCurveData and insertCurve the compiler says
    error: ‘class QwtPlot’ has no member named ‘insertCurve’ etc.

    And the documentation is upto date I think.

    The other QWT widgets works and got there members but not this.

    is it a old doc on the net or;

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      I have downloaded qwt-6.0.1 as a zip file less than a week ago. It is fairly small (<4MB). It contains in the doc directory an html documentation. The files have been generated on August 1, 2011. I assume that this the most recent documentation available. At least it refers to the compatibility of qwt 6.x on the main page.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • K Offline
        K Offline
        koahnig
        wrote on last edited by
        #3

        This seems to be the same documentation on the "web ":http://qwt.sourceforge.net/index.html

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply
        0
        • J Offline
          J Offline
          JulienMaille
          wrote on last edited by
          #4

          Did you look in Qwt's headers files for setCurveData and insertCurve?

          1 Reply Last reply
          0
          • L Offline
            L Offline
            lgeyer
            wrote on last edited by
            #5

            Well, QwtPlot neither has a setCurveData or a insertCurve member nor does its documentation have an example like the one you've listed above. You're most probably mixing 5.x libraries with 6.x documentation and vice versa. They are not compatible.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              Scylla
              wrote on last edited by
              #6

              There was never such methods. Try something like this:
              @
              QwtPlot *myPlot = new QwtPlot("Two Graphs");
              QwtPlotCurve *curve1 = new QwtPlotCurve("Graph 1");
              QwtPlotCurve *curve2 = new QwtPlotCurve("Graph 2");

              //set curve color
              curve1->setPen(QPen(Qt::green, 2));
              curve1->setPen(QPen(Qt::red, 2));

              // add curves
              curve1->attach(myPlot);
              curve2->attach(myPlot);

              const int MAX_VALUES = 100;
              double x[MAX_VALUES], y1[MAX_VALUES], y2[MAX_VALUES];// x and y values
              getSomeValues(x, y1, y2);

              // copy the data into the curves
              curve1->setRawSamples(x, y1, MAX_VALUES);
              curve1->setRawSamples(x, y2, MAX_VALUES);

              // finally, refresh the plot
              myPlot->replot();
              @
              it's untestet...
              And of course take a look at very well examples in the qwt source.

              1 Reply Last reply
              0
              • T Offline
                T Offline
                toho71
                wrote on last edited by
                #7

                Yes this looks like my old function.
                Thank you

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved