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

  • SEARCH
  • Home
  • 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 7555921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:44:22+00:00 2026-05-30T11:44:22+00:00

This is probably something stupid, but I really can’t figure it out myself. I’m

  • 0

This is probably something stupid, but I really can’t figure it out myself.

I’m using wrapper class for QtGui.QAction. Code goes like this:

class Action_Abstract(Abstract):

    def __init__(self, app, menu):
        Abstract.__init__(self, app)

        action = QtGui.QAction(self.get_window())
        action.setText('Text')
        action.triggered.connect(self.execute)

        menu.addAction(action)

    def execute(self):
        print 'Called'

No errors thrown, action appears in menu. But self.execute is not called, when I click on action.
Funny thing is, if I replace self.execute with QtGui.qApp.quit from example, it works.

What am I missing here?

  • 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-05-30T11:44:24+00:00Added an answer on May 30, 2026 at 11:44 am

    Do you keep a reference to the instance of Action_Abstract?

    If you don’t, the problem may be that the Python object is garbage-collected which will also cut the connection to self.execute.

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

Sidebar

Related Questions

this is probably something stupid, but i can't figure it out. I'm getting a
Probably a stupid question but so far I can't figure this out... I have
This is probably something stupid I am missing but it has really got me
I'm probably doing something realy stupid but I cant get this to work: var
This is something stupid I probably should know, but Googling fails me: When compiling
This is probably something silly I'm missing but I'm definitely lost. I'm using .NET
This is probably something really simple but I cant see what! Any images I
I get the feeling this is probably something I should know but I can't
My problem is quite annoying, probably something really stupid but I've been going around
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'dbuser1'@'localhost This is probably something stupid, but

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.