Re: Widgets are not updated - is this a bug?
Raymond Osborn <[email protected]> Thu, 25 Jun 2020 08:41:55 -0500
| Newsgroups | gmane.comp.python.pyqt-pykde |
|---|---|
| Message-ID | <[email protected]> |
--Apple-Mail=_6078F289-33F5-4F64-9B91-31CAB31F3CD5 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 This is a bug that has been an issue since around v5.10 but which only = affects Macs as far as I know. In my own code, I have had to subclass = virtually every widget whose contents I change programmatically in order = to add a call to repaint each time. Since I need my code to be = compatible with multiplePyQt versions, I will have to leave it in even = if it is fixed. Ray > From: Christian ARNAUD <[email protected] <mailto:[email protected]>> > Subject: Widgets are not updated - is this a bug? > Date: June 25, 2020 at 1:46:21 AM CDT > To: <[email protected] <mailto:[email protected]>> >=20 >=20 > Hi, > =20 > I ran in a strange behavior where widgets in the view aren=E2=80=99t = properly refreshed on change. > Here is the code, developed to show the problem: > =20 > import sys >=20 > from PyQt5 import QtWidgets > from PyQt5.QtCore import Qt >=20 >=20 > class MainWindow(QtWidgets.QMainWindow): > def __init__(self): > QtWidgets.QMainWindow.__init__(self) > self.resize(250, 100) > self.setWindowTitle("Demo") > self.centralWidget =3D QtWidgets.QWidget(self) > self.formlayout =3D QtWidgets.QFormLayout(self.centralWidget) > self.label1 =3D QtWidgets.QLabel('Text 1', self.centralWidget) > self.ledit1 =3D QtWidgets.QLineEdit('initial value', = self.centralWidget) > self.bproceed =3D QtWidgets.QPushButton('Proceed', = self.centralWidget) > self.bproceed.setDefault(True) > self.bproceed.setFocusPolicy(Qt.StrongFocus) > self.formlayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, = self.label1) > self.formlayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, = self.ledit1) > self.formlayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, = self.bproceed) > self.setCentralWidget(self.centralWidget) >=20 > self.bproceed.clicked.connect(self.on_clicked) >=20 > def on_clicked(self): > self.ledit1.setText('') >=20 >=20 > if __name__ =3D=3D "__main__": > app =3D QtWidgets.QApplication(sys.argv) > win =3D MainWindow() > win.show() > sys.exit(app.exec()) > =20 > =20 > If the pushbutton is clicked with the mouse or with the space key = (after getting the focus with Tab), the text in the lineedit is not = refreshed. If a repaint is forced, it is. > If the pushbutton is clicked with the enter key (after getting the = focus with Tab), the text in the lineedit is correctly refreshed. > =20 > Any idea? > =20 > My env: > OSX Catalina 10.15.5 > Python 3.6 > PyQt: 15.0 > =20 > Thank you >=20 >=20 > _______________________________________________ > PyQt mailing list > [email protected] <mailto:[email protected]> > https://www.riverbankcomputing.com/mailman/listinfo/pyqt = <https://www.riverbankcomputing.com/mailman/listinfo/pyqt> --Apple-Mail=_6078F289-33F5-4F64-9B91-31CAB31F3CD5 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; = charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; line-break: after-white-space;" class=3D"">This = is a bug that has been an issue since around v5.10 but which only = affects Macs as far as I know. In my own code, I have had to subclass = virtually every widget whose contents I change programmatically in order = to add a call to repaint each time. Since I need my code to be = compatible with multiplePyQt versions, I will have to leave it in even = if it is fixed.<div class=3D""><br class=3D""></div><div class=3D"">Ray<br= class=3D""><div><br class=3D""><blockquote type=3D"cite" class=3D""><div = class=3D""><span class=3D"" style=3D"font-family: -webkit-system-font, = "Helvetica Neue", Helvetica, sans-serif; color: rgb(127, 127, = 127);"><b class=3D"">From: </b></span><span class=3D"" = style=3D"font-family: -webkit-system-font, "Helvetica Neue", = Helvetica, sans-serif;">Christian ARNAUD <<a = href=3D"mailto:[email protected]" = class=3D"">[email protected]</a>></span></div><div class=3D""><div = style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: = 12px; font-style: normal; font-variant-caps: normal; font-weight: = normal; letter-spacing: normal; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; word-spacing: 0px; = -webkit-text-stroke-width: 0px; text-decoration: none; margin: 0px;" = class=3D""><span style=3D"font-family: -webkit-system-font, = "Helvetica Neue", Helvetica, sans-serif; color: rgb(127, 127, = 127);" class=3D""><b class=3D"">Subject:<span = class=3D"Apple-converted-space"> </span></b></span><span = style=3D"font-family: -webkit-system-font, "Helvetica Neue", = Helvetica, sans-serif;" class=3D""><b class=3D"">Widgets are not updated = - is this a bug?</b><br class=3D""></span></div><div style=3D"caret-color:= rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: = normal; font-variant-caps: normal; font-weight: normal; letter-spacing: = normal; text-align: start; text-indent: 0px; text-transform: none; = white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; = text-decoration: none; margin: 0px;" class=3D""><span = style=3D"font-family: -webkit-system-font, "Helvetica Neue", = Helvetica, sans-serif; color: rgb(127, 127, 127);" class=3D""><b = class=3D"">Date:<span = class=3D"Apple-converted-space"> </span></b></span><span = style=3D"font-family: -webkit-system-font, "Helvetica Neue", = Helvetica, sans-serif;" class=3D"">June 25, 2020 at 1:46:21 AM CDT<br = class=3D""></span></div><div style=3D"caret-color: rgb(0, 0, 0); = font-family: Helvetica; font-size: 12px; font-style: normal; = font-variant-caps: normal; font-weight: normal; letter-spacing: normal; = text-align: start; text-indent: 0px; text-transform: none; white-space: = normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; = text-decoration: none; margin: 0px;" class=3D""><span = style=3D"font-family: -webkit-system-font, "Helvetica Neue", = Helvetica, sans-serif; color: rgb(127, 127, 127);" class=3D""><b = class=3D"">To:<span = class=3D"Apple-converted-space"> </span></b></span><span = style=3D"font-family: -webkit-system-font, "Helvetica Neue", = Helvetica, sans-serif;" class=3D""><<a = href=3D"mailto:[email protected]" = class=3D"">[email protected]</a>><br = class=3D""></span></div><br style=3D"caret-color: rgb(0, 0, 0); = font-family: Helvetica; font-size: 12px; font-style: normal; = font-variant-caps: normal; font-weight: normal; letter-spacing: normal; = text-align: start; text-indent: 0px; text-transform: none; white-space: = normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; = text-decoration: none;" class=3D""><br style=3D"caret-color: rgb(0, 0, = 0); font-family: Helvetica; font-size: 12px; font-style: normal; = font-variant-caps: normal; font-weight: normal; letter-spacing: normal; = text-align: start; text-indent: 0px; text-transform: none; white-space: = normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; = text-decoration: none;" class=3D""><div class=3D"WordSection1" = style=3D"page: WordSection1; caret-color: rgb(0, 0, 0); font-family: = Helvetica; font-size: 12px; font-style: normal; font-variant-caps: = normal; font-weight: normal; letter-spacing: normal; text-align: start; = text-indent: 0px; text-transform: none; white-space: normal; = word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: = none;"><div style=3D"margin: 0cm 0cm 0.0001pt; font-size: 12pt; = font-family: Calibri, sans-serif;" class=3D""><span style=3D"font-size: = 11pt;" class=3D"">Hi,<o:p class=3D""></o:p></span></div><div = style=3D"margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: = Calibri, sans-serif;" class=3D""><span style=3D"font-size: 11pt;" = class=3D""><o:p class=3D""> </o:p></span></div><div style=3D"margin: = 0cm 0cm 0.0001pt; font-size: 12pt; font-family: Calibri, sans-serif;" = class=3D""><span lang=3D"EN-US" style=3D"font-size: 11pt;" class=3D"">I = ran in a strange behavior where widgets in the view aren=E2=80=99t = properly refreshed on change.<o:p class=3D""></o:p></span></div><div = style=3D"margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: = Calibri, sans-serif;" class=3D""><span lang=3D"EN-US" style=3D"font-size: = 11pt;" class=3D"">Here is the code, developed to show the problem:<o:p = class=3D""></o:p></span></div><div style=3D"margin: 0cm 0cm 0.0001pt; = font-size: 12pt; font-family: Calibri, sans-serif;" class=3D""><span = lang=3D"EN-US" style=3D"font-size: 11pt;" class=3D""><o:p = class=3D""> </o:p></span></div><div style=3D"margin: 0cm 0cm = 0.0001pt; font-size: 12pt; font-family: Calibri, sans-serif; = background-color: white;" class=3D""><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(0, 51, 179);" class=3D"">import<span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">sys<br class=3D""><br class=3D""></span><span = lang=3D"EN-US" style=3D"font-size: 10pt; font-family: "Courier = New"; color: rgb(0, 51, 179);" class=3D"">from<span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">PyQt5<span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(0, 51, 179);" class=3D"">import<span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">QtWidgets<br class=3D""></span><span = lang=3D"EN-US" style=3D"font-size: 10pt; font-family: "Courier = New"; color: rgb(0, 51, 179);" class=3D"">from<span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">PyQt5.QtCore<span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(0, 51, 179);" class=3D"">import<span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">Qt<br class=3D""><br class=3D""><br = class=3D""></span><span lang=3D"EN-US" style=3D"font-size: 10pt; = font-family: "Courier New"; color: rgb(0, 51, 179);" = class=3D"">class<span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New";" = class=3D"">MainWindow</span><span lang=3D"EN-US" style=3D"font-size: = 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" = class=3D"">(QtWidgets.QMainWindow):<br class=3D""> <span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(0, 51, 179);" class=3D"">def<span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(178, 0, 178);" class=3D"">__init__</span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">(</span><span lang=3D"EN-US" style=3D"font-size:= 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" = class=3D"">self</span><span lang=3D"EN-US" style=3D"font-size: 10pt; = font-family: "Courier New"; color: rgb(8, 8, 8);" = class=3D"">):<br class=3D""> = QtWidgets.QMainWindow.</span><span lang=3D"EN-US" style=3D"font-size: = 10pt; font-family: "Courier New"; color: rgb(178, 0, 178);" = class=3D"">__init__</span><span lang=3D"EN-US" style=3D"font-size: 10pt; = font-family: "Courier New"; color: rgb(8, 8, 8);" = class=3D"">(</span><span lang=3D"EN-US" style=3D"font-size: 10pt; = font-family: "Courier New"; color: rgb(148, 85, 141);" = class=3D"">self</span><span lang=3D"EN-US" style=3D"font-size: 10pt; = font-family: "Courier New"; color: rgb(8, 8, 8);" = class=3D"">)<br class=3D""> <span= class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(148, 85, 141);" class=3D"">self</span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">.resize(</span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(23, 80, 235);" class=3D"">250</span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">,<span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(23, 80, 235);" class=3D"">100</span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">)<br = class=3D""> <span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(148, 85, 141);" class=3D"">self</span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">.setWindowTitle(</span><b class=3D""><span = lang=3D"EN-US" style=3D"font-size: 10pt; font-family: "Courier = New"; color: teal;" class=3D"">"Demo"</span></b><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">)<br = class=3D""> <span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(148, 85, 141);" class=3D"">self</span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">.centralWidget =3D = QtWidgets.QWidget(</span><span lang=3D"EN-US" style=3D"font-size: 10pt; = font-family: "Courier New"; color: rgb(148, 85, 141);" = class=3D"">self</span><span lang=3D"EN-US" style=3D"font-size: 10pt; = font-family: "Courier New"; color: rgb(8, 8, 8);" = class=3D"">)<br class=3D""> <span= class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(148, 85, 141);" class=3D"">self</span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">.formlayout =3D = QtWidgets.QFormLayout(</span><span lang=3D"EN-US" style=3D"font-size: = 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" = class=3D"">self</span><span lang=3D"EN-US" style=3D"font-size: 10pt; = font-family: "Courier New"; color: rgb(8, 8, 8);" = class=3D"">.centralWidget)<br = class=3D""> <span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(148, 85, 141);" class=3D"">self</span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">.label1 =3D QtWidgets.QLabel(</span><b = class=3D""><span lang=3D"EN-US" style=3D"font-size: 10pt; font-family: = "Courier New"; color: teal;" class=3D"">'Text = 1'</span></b><span lang=3D"EN-US" style=3D"font-size: 10pt; font-family: = "Courier New"; color: rgb(8, 8, 8);" class=3D"">,<span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(148, 85, 141);" class=3D"">self</span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">.centralWidget)<br = class=3D""> <span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(148, 85, 141);" class=3D"">self</span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">.ledit1 =3D QtWidgets.QLineEdit(</span><b = class=3D""><span lang=3D"EN-US" style=3D"font-size: 10pt; font-family: = "Courier New"; color: teal;" class=3D"">'initial = value'</span></b><span lang=3D"EN-US" style=3D"font-size: 10pt; = font-family: "Courier New"; color: rgb(8, 8, 8);" = class=3D"">,<span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(148, 85, 141);" class=3D"">self</span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">.centralWidget)<br = class=3D""> <span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(148, 85, 141);" class=3D"">self</span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">.bproceed =3D QtWidgets.QPushButton(</span><b = class=3D""><span lang=3D"EN-US" style=3D"font-size: 10pt; font-family: = "Courier New"; color: teal;" = class=3D"">'Proceed'</span></b><span lang=3D"EN-US" style=3D"font-size: = 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" = class=3D"">,<span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(148, 85, 141);" class=3D"">self</span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">.centralWidget)<br = class=3D""> <span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(148, 85, 141);" class=3D"">self</span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">.bproceed.setDefault(</span><span lang=3D"EN-US"= style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(0, 51, 179);" class=3D"">True</span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">)<br = class=3D""> <span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(148, 85, 141);" class=3D"">self</span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">.bproceed.setFocusPolicy(Qt.StrongFocus)<br = class=3D""> <span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(148, 85, 141);" class=3D"">self</span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">.formlayout.setWidget(</span><span = lang=3D"EN-US" style=3D"font-size: 10pt; font-family: "Courier = New"; color: rgb(23, 80, 235);" class=3D"">1</span><span = lang=3D"EN-US" style=3D"font-size: 10pt; font-family: "Courier = New"; color: rgb(8, 8, 8);" class=3D"">, = QtWidgets.QFormLayout.LabelRole,<span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(148, 85, 141);" class=3D"">self</span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">.label1)<br = class=3D""> <span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(148, 85, 141);" class=3D"">self</span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">.formlayout.setWidget(</span><span = lang=3D"EN-US" style=3D"font-size: 10pt; font-family: "Courier = New"; color: rgb(23, 80, 235);" class=3D"">1</span><span = lang=3D"EN-US" style=3D"font-size: 10pt; font-family: "Courier = New"; color: rgb(8, 8, 8);" class=3D"">, = QtWidgets.QFormLayout.FieldRole,<span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(148, 85, 141);" class=3D"">self</span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">.ledit1)<br = class=3D""> <span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(148, 85, 141);" class=3D"">self</span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">.formlayout.setWidget(</span><span = lang=3D"EN-US" style=3D"font-size: 10pt; font-family: "Courier = New"; color: rgb(23, 80, 235);" class=3D"">2</span><span = lang=3D"EN-US" style=3D"font-size: 10pt; font-family: "Courier = New"; color: rgb(8, 8, 8);" class=3D"">, = QtWidgets.QFormLayout.FieldRole,<span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(148, 85, 141);" class=3D"">self</span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">.bproceed)<br = class=3D""> <span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(148, 85, 141);" class=3D"">self</span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">.setCentralWidget(</span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(148, 85, 141);" class=3D"">self</span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">.centralWidget)<br class=3D""><br = class=3D""> <span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(148, 85, 141);" class=3D"">self</span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">.bproceed.clicked.connect(</span><span = lang=3D"EN-US" style=3D"font-size: 10pt; font-family: "Courier = New"; color: rgb(148, 85, 141);" class=3D"">self</span><span = lang=3D"EN-US" style=3D"font-size: 10pt; font-family: "Courier = New"; color: rgb(8, 8, 8);" class=3D"">.on_clicked)<br class=3D""><br= class=3D""> <span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(0, 51, 179);" class=3D"">def<span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New";" = class=3D"">on_clicked</span><span lang=3D"EN-US" style=3D"font-size: = 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" = class=3D"">(</span><span lang=3D"EN-US" style=3D"font-size: 10pt; = font-family: "Courier New"; color: rgb(148, 85, 141);" = class=3D"">self</span><span lang=3D"EN-US" style=3D"font-size: 10pt; = font-family: "Courier New"; color: rgb(8, 8, 8);" = class=3D"">):<br = class=3D""> <span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(148, 85, 141);" class=3D"">self</span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">.ledit1.setText(</span><b class=3D""><span = lang=3D"EN-US" style=3D"font-size: 10pt; font-family: "Courier = New"; color: teal;" class=3D"">''</span></b><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">)<br class=3D""></span><i class=3D""><span = lang=3D"EN-US" style=3D"font-size: 10pt; font-family: "Courier = New"; color: rgb(140, 140, 140);" class=3D""><br class=3D""><br = class=3D""></span></i><span lang=3D"EN-US" style=3D"font-size: 10pt; = font-family: "Courier New"; color: rgb(0, 51, 179);" = class=3D"">if<span = class=3D"Apple-converted-space"> </span></span><span lang=3D"EN-US" = style=3D"font-size: 10pt; font-family: "Courier New"; color: = rgb(8, 8, 8);" class=3D"">__name__ =3D=3D<span = class=3D"Apple-converted-space"> </span></span><b class=3D""><span = lang=3D"EN-US" style=3D"font-size: 10pt; font-family: "Courier = New"; color: teal;" class=3D"">"__main__"</span></b><span = lang=3D"EN-US" style=3D"font-size: 10pt; font-family: "Courier = New"; color: rgb(8, 8, 8);" class=3D"">:<br = class=3D""> app =3D = QtWidgets.QApplication(sys.argv)<br class=3D""> win =3D = MainWindow()<br class=3D""> win.show()<br = class=3D""> sys.exit(app.exec())<o:p = class=3D""></o:p></span></div><div style=3D"margin: 0cm 0cm 0.0001pt; = font-size: 12pt; font-family: Calibri, sans-serif;" class=3D""><span = lang=3D"EN-US" style=3D"font-size: 11pt;" class=3D""><o:p = class=3D""> </o:p></span></div><div style=3D"margin: 0cm 0cm = 0.0001pt; font-size: 12pt; font-family: Calibri, sans-serif;" = class=3D""><span lang=3D"EN-US" style=3D"font-size: 11pt;" class=3D""><o:p= class=3D""> </o:p></span></div><div style=3D"margin: 0cm 0cm = 0.0001pt; font-size: 12pt; font-family: Calibri, sans-serif;" = class=3D""><span lang=3D"EN-US" style=3D"font-size: 11pt;" class=3D"">If = the pushbutton is clicked with the mouse or with the space key (after = getting the focus with Tab), the text in the lineedit is not refreshed. = If a repaint is forced, it is.<o:p class=3D""></o:p></span></div><div = style=3D"margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: = Calibri, sans-serif;" class=3D""><span lang=3D"EN-US" style=3D"font-size: = 11pt;" class=3D"">If the pushbutton is clicked with the enter key (after = getting the focus with Tab), the text in the lineedit is correctly = refreshed.<o:p class=3D""></o:p></span></div><div style=3D"margin: 0cm = 0cm 0.0001pt; font-size: 12pt; font-family: Calibri, sans-serif;" = class=3D""><span lang=3D"EN-US" style=3D"font-size: 11pt;" class=3D""><o:p= class=3D""> </o:p></span></div><div style=3D"margin: 0cm 0cm = 0.0001pt; font-size: 12pt; font-family: Calibri, sans-serif;" = class=3D""><span lang=3D"EN-US" style=3D"font-size: 11pt;" class=3D"">Any = idea?<o:p class=3D""></o:p></span></div><div style=3D"margin: 0cm 0cm = 0.0001pt; font-size: 12pt; font-family: Calibri, sans-serif;" = class=3D""><span lang=3D"EN-US" style=3D"font-size: 11pt;" class=3D""><o:p= class=3D""> </o:p></span></div><div style=3D"margin: 0cm 0cm = 0.0001pt; font-size: 12pt; font-family: Calibri, sans-serif;" = class=3D""><span lang=3D"EN-US" style=3D"font-size: 11pt;" class=3D"">My = env:<o:p class=3D""></o:p></span></div><div style=3D"margin: 0cm 0cm = 0.0001pt; font-size: 12pt; font-family: Calibri, sans-serif;" = class=3D""><span lang=3D"EN-US" style=3D"font-size: 11pt;" class=3D"">OSX = Catalina 10.15.5<o:p class=3D""></o:p></span></div><div style=3D"margin: = 0cm 0cm 0.0001pt; font-size: 12pt; font-family: Calibri, sans-serif;" = class=3D""><span lang=3D"EN-US" style=3D"font-size: 11pt;" = class=3D"">Python 3.6<o:p class=3D""></o:p></span></div><div = style=3D"margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: = Calibri, sans-serif;" class=3D""><span lang=3D"EN-US" style=3D"font-size: = 11pt;" class=3D"">PyQt: 15.0<o:p class=3D""></o:p></span></div><div = style=3D"margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: = Calibri, sans-serif;" class=3D""><span lang=3D"EN-US" style=3D"font-size: = 11pt;" class=3D""><o:p class=3D""> </o:p></span></div><div = style=3D"margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: = Calibri, sans-serif;" class=3D""><span lang=3D"EN-US" style=3D"font-size: = 11pt;" class=3D"">Thank you<o:p class=3D""></o:p></span></div></div><br = style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: = 12px; font-style: normal; font-variant-caps: normal; font-weight: = normal; letter-spacing: normal; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; word-spacing: 0px; = -webkit-text-stroke-width: 0px; text-decoration: none;" class=3D""><br = style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: = 12px; font-style: normal; font-variant-caps: normal; font-weight: = normal; letter-spacing: normal; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; word-spacing: 0px; = -webkit-text-stroke-width: 0px; text-decoration: none;" class=3D""><span = style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: = 12px; font-style: normal; font-variant-caps: normal; font-weight: = normal; letter-spacing: normal; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; word-spacing: 0px; = -webkit-text-stroke-width: 0px; text-decoration: none; float: none; = display: inline !important;" = class=3D"">_______________________________________________</span><br = style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: = 12px; font-style: normal; font-variant-caps: normal; font-weight: = normal; letter-spacing: normal; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; word-spacing: 0px; = -webkit-text-stroke-width: 0px; text-decoration: none;" class=3D""><span = style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: = 12px; font-style: normal; font-variant-caps: normal; font-weight: = normal; letter-spacing: normal; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; word-spacing: 0px; = -webkit-text-stroke-width: 0px; text-decoration: none; float: none; = display: inline !important;" class=3D"">PyQt mailing list</span><br = style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: = 12px; font-style: normal; font-variant-caps: normal; font-weight: = normal; letter-spacing: normal; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; word-spacing: 0px; = -webkit-text-stroke-width: 0px; text-decoration: none;" class=3D""><a = href=3D"mailto:[email protected]" style=3D"font-family: = Helvetica; font-size: 12px; font-style: normal; font-variant-caps: = normal; font-weight: normal; letter-spacing: normal; orphans: auto; = text-align: start; text-indent: 0px; text-transform: none; white-space: = normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; = -webkit-text-stroke-width: 0px;" = class=3D"">[email protected]</a><br style=3D"caret-color: = rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: = normal; font-variant-caps: normal; font-weight: normal; letter-spacing: = normal; text-align: start; text-indent: 0px; text-transform: none; = white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; = text-decoration: none;" class=3D""><a = href=3D"https://www.riverbankcomputing.com/mailman/listinfo/pyqt" = style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; = font-variant-caps: normal; font-weight: normal; letter-spacing: normal; = orphans: auto; text-align: start; text-indent: 0px; text-transform: = none; white-space: normal; widows: auto; word-spacing: 0px; = -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" = class=3D"">https://www.riverbankcomputing.com/mailman/listinfo/pyqt</a></d= iv></blockquote></div><br class=3D""></div></body></html>= --Apple-Mail=_6078F289-33F5-4F64-9B91-31CAB31F3CD5--