Results 1 to 4 of 4

Thread: KeyPatternCode and QwtPlotZoomer/QwtPlotPicker

  1. #1
    Join Date
    Nov 2008
    Location
    Berlin, Germany
    Posts
    13
    Thanks
    3
    Qt products
    Qt3 Qt4 Qt/Embedded PyQt3 PyQt4
    Platforms
    Unix/X11 Windows Maemo/MeeGo

    Default KeyPatternCode and QwtPlotZoomer/QwtPlotPicker

    I have a QwtPlot that works with a QwtPlotPicker fine. I also implemented a QwtPlotZoomer that works fine. So when I left-click into the plot, both of them appear. What I really want is that the zoomer only appears when I synchronously press the Shift button on the keyboard, or the Ctrl key. I tried to catch this by implementing the keyPressEvent in the surrounding QMainWindow. But it turns out that the picker and the zoomer are not activated at all when the shift key is pressed. What is the hidden magic? I did not manage to make use of the KeyPatternCode.

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

    Default Re: KeyPatternCode and QwtPlotZoomer/QwtPlotPicker

    Quote Originally Posted by eehmke View Post
    What I really want is that the zoomer only appears when I synchronously press the Shift button on the keyboard
    Qt Code:
    1. zoomer->setMousePattern( QwtEventPattern::MouseSelect1, Qt::LeftButton, Qt::ShiftModifier );
    To copy to clipboard, switch view to plain text mode 
    HTH,
    Uwe

  3. #3
    Join Date
    Nov 2008
    Location
    Berlin, Germany
    Posts
    13
    Thanks
    3
    Qt products
    Qt3 Qt4 Qt/Embedded PyQt3 PyQt4
    Platforms
    Unix/X11 Windows Maemo/MeeGo

    Default Re: KeyPatternCode and QwtPlotZoomer/QwtPlotPicker

    Quote Originally Posted by Uwe View Post
    Qt Code:
    1. zoomer->setMousePattern( QwtEventPattern::MouseSelect1, Qt::LeftButton, Qt::ShiftModifier );
    To copy to clipboard, switch view to plain text mode 
    I tried this already. With or without this code, as soon a I press the shift button, zoomer and picker will not appear at all. As a workaround, I activate the zoomer with a toolbar button, as in the BodeDemo example. I forgot to mention I use PyQt/Qwt5. With the line above in the initializer, the zoomer stops working completely.

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

    Default Re: KeyPatternCode and QwtPlotZoomer/QwtPlotPicker

    Quote Originally Posted by eehmke View Post
    I forgot to mention I use PyQt/Qwt5. With the line above in the initializer, the zoomer stops working completely.
    There should be no difference between Qwt 5.x and Qwt 6.x here. Test this line with Qwt 5.2 in the spectrogram example. When it works there try to find out what makes the difference to your application.

    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. Sorry - more QwtPlotZoomer questions
    By cnbp173 in forum Qwt
    Replies: 4
    Last Post: 7th May 2010, 10:26
  4. QwtPlotZoomer, using two zoomers.
    By jma in forum Qwt
    Replies: 2
    Last Post: 30th September 2008, 09:29
  5. Replies: 1
    Last Post: 25th August 2008, 21:49

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.