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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:45:01+00:00 2026-05-16T06:45:01+00:00

can i connect two objects that are in different classes ? lets say i

  • 0

can i connect two objects that are in different classes ?

lets say i want button1’s clicked() signal to clear line2

class A(QGroupBox):
    def __init__(self, parent=None):
        super(A, self).__init__(parent)
        self.button1= QPushButton('bt1')
        self.button1.show()

class B(QGroupBox):
    def __init__(self, parent=None):
        super(B, self).__init__(parent)
        self.line2 = QLineEdit()
        self.line2.show()

ob1 = A()
ob2 = B()
  • 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-16T06:45:02+00:00Added an answer on May 16, 2026 at 6:45 am

    Yes, create a method in object B that’s tied to a signal in object A. Note how connect is called (this is just an example):

        self.connect(self.okButton, QtCore.SIGNAL("clicked()"),
                     self, QtCore.SLOT("accept()"))
    

    The third argument is the object with the slot, and the fourth the slot name. The sending and receiving objects can definitely be different.

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

Sidebar

Related Questions

I have two servers (virtual machines - I can remotely connect to these) -
Consider this scenario that two WCF clients connect to one WCF service(server), this service
there are two databases to compare,but I can't connect one database directly. so I
I can connect with the DataContext to the Oracle database however I get errors
I can connect to my SQL Server database via sqlcmd from a DOS command
How do I enable external access to MySQL Server? I can connect locally but
I have a Solaris daemon written in Java6. Clients can connect to it using
When using SQL Server Management Studio from SQL Server 2005, I can connect to
How can I connect to a remote SQL server using Mac OS X? I
How can we connect a PHP script to MS Access (.mdb) file? I tried

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.