Results 1 to 2 of 2

Thread: How to get the points (screen interval) using QwtPlotZoomer?

  1. #1
    Join Date
    Feb 2012
    Location
    Stuttgart / Germany
    Posts
    35
    Thanks
    6
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default How to get the points (screen interval) using QwtPlotZoomer?

    Hello,

    I don't know if someone else had this problem, at least I didn't find a solution yet.
    I created a zoomer in my application, but when I create the polygon to zoom-in I need to get the new x-axis and y-axis that's been showed in my plot. I can get all the curve points, but it's not right, I need to know just the points that's been displayed. With the code below I create the zoomer:

    Qt Code:
    1. zoomer = new QwtPlotZoomer(QwtPlot::xBottom, channelSelection->currentIndex(),plot.at(graphAreaSelection->currentIndex())->canvas() );
    2. plot.at(graphAreaSelection->currentIndex())->setCanvasBackground(Qt::white);
    3. zoomer->setRubberBandPen( QColor( Qt::black ) );
    4. zoomer->setTrackerPen( QColor( Qt::black ) );
    5. zoomer->setMousePattern( QwtEventPattern::MouseSelect2,Qt::RightButton, Qt::ControlModifier );
    6. zoomer->setMousePattern( QwtEventPattern::MouseSelect3,Qt::RightButton );
    7.  
    8. connect(zoomer, SIGNAL(selected(QPolygon )), this, SLOT(autoRescale(QPolygon )));
    To copy to clipboard, switch view to plain text mode 

    With this connect I can know when the user created the polygon to perform the zoom-in, inside of my autoRescale I can get the polygon using:

    Qt Code:
    1. zoomer->selection();
    To copy to clipboard, switch view to plain text mode 

    I think this polygon I get with selection() is my new plot area, am I right? If I'm right, how can I convert this polygon to coordinates? Because with the coordinates I can find how many points is been showed.

    I hope someone can understand me, it's hard to explain.

    Thanks

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,313
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to get the points (screen interval) using QwtPlotZoomer?

    Connect a slot for the QwtScaleWidget::scaleDivChanged() signal.

    Uwe

Similar Threads

  1. Replies: 2
    Last Post: 2nd May 2012, 09:49
  2. Phonon and the meta interval
    By huilui in forum Qt Programming
    Replies: 3
    Last Post: 7th February 2012, 06:08
  3. Replies: 2
    Last Post: 12th May 2011, 07:30
  4. QSpinBox interval
    By Jordan in forum Newbie
    Replies: 9
    Last Post: 25th May 2010, 11:07
  5. maximum text width of interval
    By osiris81 in forum Qt Programming
    Replies: 2
    Last Post: 20th January 2010, 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.