Results 1 to 3 of 3

Thread: Handling Mouse Events of a parent widget

  1. #1
    Join Date
    Feb 2007
    Posts
    81
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Handling Mouse Events of a parent widget

    I have a QTabWidget that contains four custom opengl widgets as child tabs, and the OpenGL widget class has mouse event handlers for rotating, panning, and zooming the 3d view.

    Those handlers are only used when the ALT key is pressed, but when the ALT key is not pressed, I want to send those mouse events to the parent widget, the QTabWidget. Is there a way to do that? The QTabWidget will then handle events where the user wants to select something in the viewport and interact with the model inside the viewport rather than just rotate or pan the view.

    I tried calling parentWidget()->mouseMoveEvent(event) for example, and it says that function is protected. The QTabWidget has mouse Event handlers defined as public functions, so I'm not sure what is wrong.

    I hope that makes sense, and I appreciate any help that can be given. Thanks,
    Dave

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,518 Times in 1,388 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Handling Mouse Events of a parent widget

    J-P Nurmi

  3. #3
    Join Date
    Feb 2007
    Posts
    81
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Handling Mouse Events of a parent widget

    ok i apologize. I'm an idiot. I just found this right after posting this question:

    http://labs.trolltech.com/blogs/2006...t-propagation/

Similar Threads

  1. mouse moving don't produce mouse events
    By coralbird in forum Qt Programming
    Replies: 1
    Last Post: 13th September 2006, 06:13
  2. Move child widget along with the parent widget
    By sreedhar in forum Qt Programming
    Replies: 2
    Last Post: 15th May 2006, 12:00
  3. QStackerWidget and mouse events
    By high_flyer in forum Qt Programming
    Replies: 3
    Last Post: 25th April 2006, 19:25
  4. Referencing Parent Widget from Child
    By taylor34 in forum Qt Programming
    Replies: 8
    Last Post: 11th April 2006, 15:13
  5. Forwarding mouse events to another widget.
    By yogeshm02 in forum Qt Programming
    Replies: 8
    Last Post: 28th February 2006, 13:25

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.