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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:25:35+00:00 2026-06-01T20:25:35+00:00

in main.py def setNumberFormat2(self): dialog = numberformatdlg2.NumberFormatDlg(self.format, self) self.connect(dialog, SIGNAL(changed), self.refreshTable) dialog.show() and in

  • 0

in main.py

def setNumberFormat2(self):
    dialog = numberformatdlg2.NumberFormatDlg(self.format, self)
    self.connect(dialog, SIGNAL("changed"), self.refreshTable)
    dialog.show()

and in form.py:

class NumberFormatDlg(QDialog):
  def __init__(self, format, parent=None):
       .....
     self.connect(buttonBox.button(QDialogButtonBox.Apply),
                                  SIGNAL("clicked()"), self.apply)
     self.connect(buttonBox, SIGNAL("rejected()"),
                                  self, SLOT("reject()"))
     self.setWindowTitle("Set Number Format (Modeless)")


  def apply(self):
     ....
     self.emit(SIGNAL("changed"))

According to the author:

Finally, we emit a changed signal, and as we have seen, this causes
the caller’s refreshTable() method to be called, which in turn formats
all the numbers in the table using the caller’s format dictionary.

When we emit, how does it know we which SLOT we want to apply? Essentially, if we have

self.connect(dialog, SIGNAL("changed"), self.refreshTable)
self.connect(dialog, SIGNAL("changed"), self.anotherMethod)

How does self.emit(...) know which slot we are applying? or am I missing some information?

Thanks.

  • 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-01T20:25:37+00:00Added an answer on June 1, 2026 at 8:25 pm

    self.emit doesn’t “know” anything – it just fires the signal.
    The self.connect() method is catching the signal and running the given function with the signal parameters.

    If you connect two functions to a signal, I think that both will run.
    You probably shouldn’t do it, because it’ll make your code a bit unreadable.

    • If you want to run two functions, create a function that is called
      changed_signal that will call the other functions.
    • If you want to run different functions for different uses, just fire different signals.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the code: class Dummy(object): def __init__(self, v): self.ticker = v def main():
I have this class: class View(object): def main_page(self, extra_placeholders = None): file = '/media/Shared/sites/www/subdomains/pypular/static/layout.tmpl'
class Node(object): def __init__(self, data): self.data = data if __name__ == __main__: a =
Can i do editing in the irb shell ? irb(main):001:0> class MyClass irb(main):002:1> def
Example: require 'commandline' class App < CommandLine::Application def initialize end def main raise 'foo'
static void main(args){ System.in.withReader { def input = it.readLine() for(def i = 0; i
Please, I need help with my code: def start(): def start_tkinter(): global main,l main.destroy()
In Ruby, I can define a method foo=(bar) : irb(main):001:0> def foo=(bar) irb(main):002:1> p
I'm trying to run the following rocket launching application: object HelloWorld { def main(args:
Here is a snippet of the code- import java.util.concurrent.LinkedBlockingQueue def main(args:Array[String]) { val queue=new

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.