Results 1 to 2 of 2

Thread: How do i propagate events from GraphicsView to Main Window?

  1. #1
    Join Date
    Mar 2012
    Posts
    14
    Thanks
    1
    Platforms
    Windows

    Default How do i propagate events from GraphicsView to Main Window?

    Example..

    I have a text browser widget in my main window class..

    I have re-implemented the mouse event handler for the graphicsView sub class..

    Now, when i mouse click on my graphics view, i wan my text browser in main window class to display the x-y coordinates..

    because the mouse press event is a function of the graphics view class, i could not access the text browser widget and pass the x-y coordinates to it..

    how can i go about doing this??

    Thankss..

  2. #2
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How do i propagate events from GraphicsView to Main Window?

    In the event handler emit a signal containing the coordinates and connect it to a slot that will update the text browser widget.

    Or, you could install your text browser as an event filter of the graphics view. Then you need to implement eventFilter() method and you can see all the graphics view events inside your text browser.

Similar Threads

  1. Propagate mouse events 'physically' rather than 'logically'
    By sebastian.f in forum Qt Programming
    Replies: 5
    Last Post: 14th May 2009, 19:46
  2. Replies: 2
    Last Post: 4th May 2009, 11:57
  3. Adding events to GraphicsView
    By mkarakaplan in forum Qt Programming
    Replies: 6
    Last Post: 4th May 2009, 00:26
  4. Replies: 11
    Last Post: 11th August 2008, 09:14
  5. Replies: 15
    Last Post: 23rd March 2007, 16:16

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.