Jun-28-2025, 06:21 PM
Hi
I wish to retrieve a pushbutton by its name. I suppose I have to use the function
QfindChild(parent,name)
in a code like the following :
Please, can somebody inform me on which module I have to import .
Thanks
Arbiel
I wish to retrieve a pushbutton by its name. I suppose I have to use the function
QfindChild(parent,name)
in a code like the following :
from PyQt5.QtWidgets import QPushButton
class Courriel(QtWidgets.QWidget):
def __init__(self):
super(Courriel,self).__init__()
def init(self, Fenster)
liste = ['b1',…]
for item in liste :
btn=QPushButton(item)
btn.setObjectName('name'+item)
…
Fenster=QtWidgets.QWidget()
myCourriel=Courriel()
myCourriel.init(Fenster)
item='my button'
myButton=QfindChild(myCourriel,'name+item)
….Please, can somebody inform me on which module I have to import .
Thanks
Arbiel
using Ubuntu 22.04.5 LTS, Python 3.10.12
having substituted «https://www.lilo.org/fr/» to google, «https://protonmail.com/» to any other unsafe mail service and bépo to azerty (french keyboard layouts)
having substituted «https://www.lilo.org/fr/» to google, «https://protonmail.com/» to any other unsafe mail service and bépo to azerty (french keyboard layouts)
