Results 1 to 2 of 2

Thread: QwtPlotZoomer keypatterns

  1. #1

    Default QwtPlotZoomer keypatterns

    Hello. I'm developing program with QwtPlot and subclass of QwtPlotZoomer. I decided to add keyboard zooming ability alongside with mouse, but it didn't work while mouse zooming worked perfectly
    Qt Code:
    1. zoom->setMousePattern( QwtEventPattern::MouseSelect1, Qt::LeftButton); // zoom selection
    2. zoom->setMousePattern( QwtEventPattern::MouseSelect2, Qt::LeftButton, Qt::ControlModifier ); // zoom out to full size
    3. zoom->setMousePattern( QwtEventPattern::MouseSelect3, Qt::LeftButton, Qt::AltModifier ); // zoom out to previous size
    4. zoom->setMousePattern( QwtEventPattern::MouseSelect6, Qt::LeftButton, Qt::ControlModifier | Qt::AltModifier ); // zoom in to nex size
    5. zoom->setKeyPattern( QwtEventPattern::KeyRedo, Qt::Key_I, Qt::ShiftModifier );
    6. zoom->setKeyPattern( QwtEventPattern::KeyUndo, Qt::Key_O, Qt::ShiftModifier );
    7. zoom->setKeyPattern( QwtEventPattern::KeyHome, Qt::Key_Home );
    8. //zoom->setObjectName(QStringLiteral("%1").arg(listCurrTabGraphs.count() + 1));
    9. zoom->setZoomBase(true);
    10. zoom->setEnabled(false);
    11. zoom->setEnabled(true);
    12. zoom->canvas()->installEventFilter(this);
    To copy to clipboard, switch view to plain text mode 

    I installed eventFilter and saw that KeyPress events not rising

    I created test application with this 2 widgets only and it worked. I have no idea how to handle this error.

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

    Default Re: QwtPlotZoomer keypatterns

    Maybe with overloading QApplication::notify() you can find out where your events get lost.

    Uwe

Similar Threads

  1. QwtPlotZoomer example
    By ken123 in forum Qwt
    Replies: 2
    Last Post: 20th October 2011, 16:20
  2. QwtPlotZoomer question
    By TorAn in forum Qwt
    Replies: 11
    Last Post: 17th May 2011, 22:56
  3. QwtPlotZoomer very slow
    By locke in forum Qwt
    Replies: 2
    Last Post: 7th July 2010, 17:56
  4. Sorry - more QwtPlotZoomer questions
    By cnbp173 in forum Qwt
    Replies: 4
    Last Post: 7th May 2010, 10:26
  5. Problem with QwtPlotZoomer
    By seguprasad in forum Qt Programming
    Replies: 1
    Last Post: 21st November 2007, 09:31

Tags for this Thread

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.