Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7990461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:01:02+00:00 2026-06-04T13:01:02+00:00

In a subclass of QGraphicsView , I implemented the wheelEvent(event) event-handler as follow: def

  • 0

In a subclass of QGraphicsView, I implemented the wheelEvent(event) event-handler as follow:

def wheelEvent(self, event):

    print "Wheel event received"
    event.ignore()

From what I understand, this should actually do little more than printing the above string. The QWheelEvent.ignore() should pass the event to the parent and go about its usual business (namely scrolling). The documentation is explicit about this:

If you reimplement this handler, it is very important that you ignore() the event if you do not handle it, so that the widget’s parent can interpret it.

In this case, the QGraphicsView is the main widget, so it has no parent (unless by parent one means the parent class from which it is derived).

In practice however, the string is printed as expected but the view does not scroll its content.

So how do I implement this method and get the QGraphicsView to scroll?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T13:01:04+00:00Added an answer on June 4, 2026 at 1:01 pm

    Well if you are never calling the main class, it will be pretty hard for the parent (and yes that’s the object you are inheriting from) to do anything, when would the code run?

    Adding super(type(self), self) should help (thanks to @mata for the correct python2 syntax)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the UIPanGesture subclass: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { NSLog(@touches began); self
I have a UIViewController subclass that accesses self.navigationController in viewDidLoad:. Depending on where it
I have a view subclass that starts from activity subclass like that: this.setContentView(instanceOfMyView); In
I have an NSObject subclass in which I implemented the isEqual: and hash methods
I have implemented signals for mousePressEvent() in a QGraphicsScene subclass, but I can't figure
I have a UIView subclass that I'd like to instantiate from a NIB file.
If I have a subclass that has methods I've overridden from the parent class,
I have a subclass of UIImageView and would like to pass self as a
I subclass a NSTextField and in subclass use an event method (keyUp),i want to
If subclass in objective-c wants to override a super class's method, does it have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.