Results 1 to 1 of 1

Thread: QwtPlotZoomer autoscale on right mouse click

  1. #1
    Join Date
    Mar 2009
    Posts
    34
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QwtPlotZoomer autoscale on right mouse click

    Hi,

    Im using a a QwtPlotZoomer as follows:
    Qt Code:
    1. zoomer = new QwtPlotZoomer(plot->canvas());
    2. zoomer->setRubberBandPen(QPen(Qt::lightGray));
    3. zoomer->setTrackerPen(QPen(Qt::lightGray));
    To copy to clipboard, switch view to plain text mode 

    how can i autoscale the plot to the default zoom setting (100%) on a right mouse click?

    edit: seems that would work:
    Qt Code:
    1. void MainWindow::resetScale() {
    2. zoomer->zoom(0);
    3. plot->setAxisAutoScale(QwtPlot::xBottom);
    4. plot->setAxisAutoScale(QwtPlot::yLeft);
    5. zoomer->setZoomBase();
    6. plot->replot();
    7. }
    To copy to clipboard, switch view to plain text mode 

    Thanks,
    S
    Last edited by Surfman19; 15th July 2015 at 10:34.

Similar Threads

  1. Change mouse bindings for qwtplotzoomer
    By ivareske in forum Qwt
    Replies: 5
    Last Post: 22nd January 2019, 09:27
  2. Replies: 2
    Last Post: 16th July 2012, 12:40
  3. Replies: 3
    Last Post: 10th October 2011, 16:55
  4. Replies: 3
    Last Post: 4th December 2007, 10:04
  5. mouse click event
    By vijay anandh in forum Qt Programming
    Replies: 1
    Last Post: 1st May 2006, 09:24

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.