Results 1 to 5 of 5

Thread: Overloading QGraphicsView function from Qt Designer

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Feb 2008
    Posts
    491
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11
    Thanks
    12
    Thanked 142 Times in 135 Posts

    Default Re: Overloading QGraphicsView function from Qt Designer

    QGraphicsView::wheelEvent() is not a signal so there is nothing to connect. What you want to do is override wheelEvent() not overload it.

    I've just dabbled in Python so I'm not sure this is correct, but at the bottom of your mainWindow class add the following and delete the "self.connect" statement:
    Qt Code:
    1. // added this line so next line would indent
    2. self.nodeDropGraphicsView.wheelEvent = self.wheelEvent
    3.  
    4. def wheelEvent(self, event):
    5. print("wheel event")
    To copy to clipboard, switch view to plain text mode 

  2. The following user says thank you to norobro for this useful post:

    drumboy354 (17th November 2011)

Similar Threads

  1. overloading paintEvent() function
    By Aayush in forum Qt Programming
    Replies: 5
    Last Post: 20th July 2011, 19:59
  2. How to use QGraphicsView in designer
    By dpatel in forum Qt Programming
    Replies: 3
    Last Post: 6th June 2011, 11:51
  3. Replies: 3
    Last Post: 27th August 2010, 06:00
  4. Replies: 1
    Last Post: 30th July 2010, 07:50
  5. QGraphicsView scale function
    By forrestfsu in forum Qt Programming
    Replies: 2
    Last Post: 12th October 2006, 14:05

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.