Results 1 to 2 of 2

Thread: QGLWidget and wheel event

  1. #1
    Join Date
    Aug 2009
    Posts
    30
    Thanks
    13
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default QGLWidget and wheel event

    I have a window that contains two QGLWidget. I can use mouse button event, mouse position and key event to move my 3D objects but It is like the whee event doesn't work. I add setFocusPolicy(Qt::StrongFocus); for both of my QGLWidget but It still the same...
    I miss something ? Event if I click before on the widget.

    Qt Code:
    1. void Widget::mouseWheelEvent(QWheelEvent *event){
    2. screen2DGL->setZoom(event->delta());
    3. repaint();
    4. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Boston, MA
    Posts
    40
    Thanks
    1
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QGLWidget and wheel event

    It's wheelEvent, not mouseWheelEvent.

    http://doc.trolltech.com/4.5/qwidget.html#wheelEvent

  3. The following user says thank you to fanat9 for this useful post:

    shenakan (6th November 2009)

Similar Threads

  1. wheel event problem
    By bhogasena in forum Qt Programming
    Replies: 1
    Last Post: 30th January 2009, 19:11
  2. problem in mouse event
    By bhogasena in forum Qt Programming
    Replies: 0
    Last Post: 28th January 2009, 12:58

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.