Results 1 to 3 of 3

Thread: [Qt/Qwt] disconnect first and last point on a curve

  1. #1

    Unhappy [Qt/Qwt] disconnect first and last point on a curve

    Hello every one,

    First sorry for my bad english but i'll try to be explicit...

    I developed an application that creates a graph composed of curves.
    I have a series of points that I associate with curves and I read them through

    Qt Code:
    1. curve->setStyle(QwtPlotCurve::Lines);
    To copy to clipboard, switch view to plain text mode 

    I'm using this code

    Qt Code:
    1. QwtPlotCurve *curve;
    2. QwtSymbol sym;
    3.  
    4. sym.setStyle(QwtSymbol::Cross);
    5. sym.setPen(couleurCourbe(i));
    6. sym.setSize(5);
    7.  
    8.  
    9.  
    10. curve = new QwtPlotCurve();
    11. curve->setTitle(liste.at(i));
    12. curve->setSymbol(sym);
    13. curve->setPen(couleurCourbe(i));
    14. curve->setStyle(QwtPlotCurve::Lines);
    15. curve->setRenderHint(QwtPlotItem::RenderAntialiased);
    To copy to clipboard, switch view to plain text mode 


    All pooints are connecting and the last point is connect with the first too.... (as a polygon).

    Someone has a trick to disconnect firts and last point ???

    Thanks a lot.

  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: [Qt/Qwt] disconnect first and last point on a curve

    show the code where you set the data to the curve, please. this has nothing to do with curve settings...

    btw: this forum has a subforum especially for qwt, I suggest to put your qwt-related questions there next time

  3. #3

    Default Re: [Qt/Qwt] disconnect first and last point on a curve

    The code where I set the data to the cruve is :
    Qt Code:
    1. liste_courbe->append(curve);
    2.  
    3.  
    4. myPlot = new QwtPlot("XXXXX",this);
    5. mainLayout->addWidget(myPlot);
    6. this->setLayout(mainLayout);
    7.  
    8.  
    9.  
    10.  
    11. for(int k=0; k<nbParam; k++)
    12. {
    13. QList<QByteArray> liste_SL2;
    14. QList<QByteArray> liste_val;
    15.  
    16. ....
    17.  
    18. nbValeur = liste_SL2.size()-1;
    19.  
    20. QVector<double> x;
    21. QVector<double> y;
    22.  
    23. for (int i=0; i<nbValeur; i++)
    24. {
    25. double newX = liste_SL2.at(i).toDouble();
    26. double newY = liste_val.at(i).toDouble();
    27.  
    28. if(x.contains(newX))
    29. {
    30. if(!y.contains(newY))
    31. {
    32. x.append(newX);
    33. y.append(newY);
    34. }
    35. }
    36. else
    37. {
    38. x.append(newX);
    39. y.append(newY);
    40. }
    41.  
    42. liste_courbe->at(k)->setData(x.data(), y.date(), x.size());
    43.  
    44. liste_courbe->at(k)->attach(myPlot);
    45.  
    46. }
    To copy to clipboard, switch view to plain text mode 



    btw: this forum has a subforum especially for qwt, I suggest to put your qwt-related questions there next time
    Ok sorry, I'll post to the subforum next

Similar Threads

  1. Replies: 4
    Last Post: 29th April 2010, 07:11
  2. Replies: 1
    Last Post: 22nd January 2010, 15:34
  3. Replies: 1
    Last Post: 9th December 2009, 18:14
  4. Replies: 1
    Last Post: 3rd December 2009, 15:23
  5. get the point of a fitted curve
    By giusepped in forum Qwt
    Replies: 1
    Last Post: 2nd January 2009, 05:03

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.