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 8430997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:44:14+00:00 2026-06-10T05:44:14+00:00

I am trying to connect a push button signal to a callable I created,

  • 0

I am trying to connect a push button signal to a callable I created, but for some reason this error keeps on popping up. I’ve checked to make sure QtCore is imported … what else am I missing?

Sample code:

from PyQt4 import QtCore
from PyQt4 import QtGui
import sys

class guiFindFiles(QtGui.QWidget):
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)

        #Create window
        self.setFixedSize(400,180)
        self.setWindowTitle("Choose the files to use")

        #Create all layouts to be used by window
        self.windowLayout = QtGui.QVBoxLayout()
        self.fileLayout1 = QtGui.QHBoxLayout()
        self.fileLayout2 = QtGui.QHBoxLayout()
        self.fileLayout3 = QtGui.QHBoxLayout()

        #Create the prompt for user to load in the q script to use
        self.qFileTF = QtGui.QLineEdit("Choose the q script file to use")
        self.qFileButton = QtGui.QPushButton("Open")
        self.qFileButton.setFixedSize(100,27)
        self.fileLayout1.addWidget(self.qFileTF)
        self.fileLayout1.addWidget(self.qFileButton)

                    #Connect all the signals and slots
        self.connect(self.qFileButton, SIGNAL("pressed()"), self.loadFile)

        def loadFile():
            fileName = []

            selFile = QtGui.QFileDailog.getOpenFileName(self)
            print selFile
  • 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-10T05:44:16+00:00Added an answer on June 10, 2026 at 5:44 am

    SIGNAL is inside QtCore, so the line should be:

    self.connect(self.qFileButton, QtCore.SIGNAL("pressed()"), self.loadFile)
    

    but you really should use the new style connections:

    self.qFileButton.pressed.connect(self.loadFile)
    

    And, unless you meant to differentiate a click from press/release couple, you’d better use clicked signal:

    self.qFileButton.clicked.connect(self.loadFile)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have suddenly started seeing this strange error when trying to push my database
I trying to connect to a Java Service with some special security requirements It
When I am trying to connect to my SVN repository on some remote server
I am trying to connect the JSF to database. This are the files web.xml
I'm trying to connect to a FTP using Apaches FTPSClient but I keep getting
I'm trying to push an update of my app on the itunes Connect. I
Got that error when trying to push updated app to Heroku (probably the same
I'm trying to send a push notification to APNs using Erlang. This is the
I'm trying so send push notifications ton my iPhone (APNS). I read this post
When trying to connect to EC2 over SSH I get the following error: joshua-scotts-macbook-pro:.ec2

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.