Python Forum
Inherting from different class in PYQT
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Inherting from different class in PYQT
#1
I want to pull "self.t" from class Third and print the info in Class Fourth where it says "pass." How would I inherit it?
class Third(QWidget):
    def __init__(self, parent=None):
        super(Third, self).__init__()
        self.cp()

    def cp(self):
        for y in App.patientlist:
            if str(y[11]) == self.patnum:
                patselected = y
        self.t  = patselected
        self.bbbb.show()
    


class Fourth(QWidget):
    def __init__(self):
        super(Fourth, self).__init__()
        self.editor()
    def editor(self):
        pass ###I WANT self.t FROM CLASS THIRD PRINTED HERE.
Reply


Messages In This Thread
Inherting from different class in PYQT - by zykbee - Feb-08-2018, 01:44 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020