Python Forum
[PyGUI] Pressing button by code after gui is loaded - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: GUI (https://python-forum.io/forum-10.html)
+--- Thread: [PyGUI] Pressing button by code after gui is loaded (/thread-22584.html)



Pressing button by code after gui is loaded - KaiBehncke - Nov-18-2019

Dear users,

I use an application where a gui is started:

class alkisImportDlg(QDialog, alkisImportDlgBase):

    def __init__(self):
        QDialog.__init__(self)
        self.setupUi(self)
        self.setWindowIcon(QIcon('logo.svg'))
        self.setWindowFlags(Qt.WindowMinimizeButtonHint)
        self.leSERVICE.setText(s.value("service", ""))
        self.leHOST.setText(s.value("host", "xxxx.xxxxxren.intern"))
        self.lePORT.setText(s.value("port", "5432"))
        self.leDBNAME.setText(s.value("dbname", "alkisnas7"))
        .....
        ......
        [color=#E74C3C]self.pbStart.clicked.connect(self.run)[/color]
In my .ui-file the button is created like:
<item>
<widget class="QPushButton" name="pbStart">
<property name="text">
<string>Starten</string>
</property>
</widget>
</item>


But what I need is, that after loading the GUI a function is called (without manually clicking)
that starts "self.run".

Could anybody give me a hint please?
Thank you very much, Kai


RE: Pressing button by code after gui is loaded - Denni - Nov-18-2019

Question is PyGui another version of Qt -- like PyQt and PySide2 ?? or is it one of these latter two?