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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:39:56+00:00 2026-06-08T19:39:56+00:00

can I use a return statement from a slot function to provide input to

  • 0

can I use a return statement from a slot function to provide input to a different ‘lambda’d’ slot?

something along the lines of the following which I know does not work – as X and Y seem to just be boolean:

class : mainwindow(QtGui.QMainWindow, Ui_test):
    def __init__ (self, parent = None):
        super(mainwindow,self).__init__(parent)
        self.setupUi(self)
        X = QtCore.QObject.connect(self.actionOpenX, OtCore.SIGNAL("triggered()", self.file_dialog)
        Y = QtCore.QObject.connect(self.actionOpenY, OtCore.SIGNAL("triggered()", self.file_dialog)
        QtCore.QObject.connect(self.actionProcess, QtCore.SIGNAL("triggered()", lambda : self.updateUi(X,Y))

def update_Ui(self, X, Y):
    for line in X:
        for line in Y:
            "do something"

def file_dialog(self)
    filedlg = QtGui.QFileDialog(self)
    self.filename = filedlg.getOpenFileName()
return self.filename

I am sure something like this is possible and I am having serious brain freeze atm.

many thanks in advance for any help

  • 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-08T19:39:58+00:00Added an answer on June 8, 2026 at 7:39 pm

    The return value of QObject.connect is simply a boolean that indicates whether the connection succeeded or failed. It has nothing to do with the return value of the slot.

    It seems from your example code that you want to get some filenames from the user in one step, and then process them in a separate second step.

    In order to do this, the filenames need to be kept somewhere until the user decides to start the processing step. One common way to do this is to display the chosen filenames in a list-widget, or group of line-edits so they can be retrieved later. Alternatively, the filenames could simply be appended to an internal list (i.e. a private attribute of the class instance).

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

Sidebar

Related Questions

We can use grep to return the lines with matched words, but how to
how can we clean the stack... return statement is used to go out from
Can I use yield return when the return type is an IGrouping<TKey, TElement> or
Why can't we use return keyword inside ternary operators in C, like this: sum
How can I use DATEDIFF to return the difference between two dates in years,
I know I can use window.location.pathname to return a url, but how do I
How can I use Membership.GeneratePassword to return a password that ONLY contains alpha or
Solution Edit: Turns out you can't use the PHP SDK to return the correct
Can I use a native method which returns a pointer? I used the following
I can use the following to get the contents of a folder with no

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.