Results 1 to 3 of 3

Thread: zooming with ctrl + mouse wheel

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2014
    Posts
    10
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Unhappy zooming with ctrl + mouse wheel

    My problem is very interesting to me. I am working on Qwt and I would like to enable zoom respect X and Y axis separately. I achived zoom only X axis but Y axis didn't work. I couldn't get it. I will be glad if you give an advise.

    Here is my code:
    Qt Code:
    1. void Kmh::keyPressEvent(QKeyEvent *event)
    2. {
    3. zoom_in_out = new QwtPlotMagnifier( canvas() );
    4.  
    5. if(event->key() == Qt::Key_Shift)
    6. {
    7. zoom_in_out->setWheelModifiers(Qt::ShiftModifier);
    8. zoom_in_out->setAxisEnabled(Qt::XAxis,false);
    9. }
    10. else if(event->key() == Qt::Key_Control)
    11. {
    12. zoom_in_out->setWheelModifiers(Qt::ControlModifier);
    13. zoom_in_out->setAxisEnabled(Qt::YAxis,false);
    14. }
    15. }
    To copy to clipboard, switch view to plain text mode 
    shift + mousewheel is working for zoom respect X axis. But ctrl + mousewheel is zooming both X and Y axis. What am I doing wrong?

    Regards
    Last edited by alperyazir66; 2nd January 2014 at 12:33. Reason: spelling corrections

Similar Threads

  1. QPrintPreviewWidget mouse wheel events
    By ChrisW67 in forum Qt Programming
    Replies: 3
    Last Post: 26th October 2013, 06:32
  2. Replies: 0
    Last Post: 16th July 2012, 09:56
  3. Replies: 0
    Last Post: 6th March 2012, 10:56
  4. Can usb mouse wheel work in Qt/E ?
    By earth in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 26th August 2011, 11:00
  5. Scrolling on Mouse Wheel
    By penny in forum Qt Programming
    Replies: 4
    Last Post: 7th April 2011, 07:30

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
  •  
Qt is a trademark of The Qt Company.