Widgets are not updated - is this a bug?
Christian ARNAUD <[email protected]> Thu, 25 Jun 2020 08:46:21 +0200
| Newsgroups | gmane.comp.python.pyqt-pykde |
|---|---|
| Message-ID | <[email protected]> |
> This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
--B_3675919583_909009751
Content-type: text/plain;
charset="UTF-8"
Content-transfer-encoding: quoted-printable
Hi,
=20
I ran in a strange behavior where widgets in the view aren=E2=80=99t properly ref=
reshed on change.
Here is the code, developed to show the problem:
=20
import sys
from PyQt5 import QtWidgets
from PyQt5.QtCore import Qt
class MainWindow(QtWidgets.QMainWindow):
=C2=A0=C2=A0=C2=A0 def __init__(self):
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 QtWidgets.QMainWindow.__init__(self)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 self.resize(250, 100)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 self.setWindowTitle("Demo")
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 self.centralWidget =3D QtWidgets.QWidget(self)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 self.formlayout =3D QtWidgets.QFormLayout(self.centralWidget)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 self.label1 =3D QtWidgets.QLabel('Text 1', self.centralWidget)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 self.ledit1 =3D QtWidgets.QLineEdit('initial value', self.cent=
ralWidget)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 self.bproceed =3D QtWidgets.QPushButton('Proceed', self.centra=
lWidget)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 self.bproceed.setDefault(True)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 self.bproceed.setFocusPolicy(Qt.StrongFocus)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 self.formlayout.setWidget(1, QtWidgets.QFormLayout.LabelRole=
, self.label1)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 self.formlayout.setWidget(1, QtWidgets.QFormLayout.FieldRole=
, self.ledit1)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 self.formlayout.setWidget(2, QtWidgets.QFormLayout.FieldRole=
, self.bproceed)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 self.setCentralWidget(self.centralWidget)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 self.bproceed.clicked.connect(self.on_clicked)
=C2=A0=C2=A0=C2=A0 def on_clicked(self):
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 self.ledit1.setText('')
if __name__ =3D=3D "__main__":
=C2=A0=C2=A0=C2=A0 app =3D QtWidgets.QApplication(sys.argv)
=C2=A0=C2=A0=C2=A0 win =3D MainWindow()
=C2=A0=C2=A0=C2=A0 win.show()
=C2=A0=C2=A0=C2=A0 sys.exit(app.exec())
=20
=20
If the pushbutton is clicked with the mouse or with the space key (after ge=
tting the focus with Tab), the text in the lineedit is not refreshed. If a r=
epaint is forced, it is.
If the pushbutton is clicked with the enter key (after getting the focus wi=
th 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
--B_3675919583_909009751
Content-type: text/html;
charset="UTF-8"
Content-transfer-encoding: quoted-printable
<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" xmlns:w=3D"urn:schema=
s-microsoft-com:office:word" xmlns:m=3D"http://schemas.microsoft.com/office/20=
04/12/omml" xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta http-equiv=3DC=
ontent-Type content=3D"text/html; charset=3Dutf-8"><meta name=3DGenerator content=3D=
"Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:12.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style></head><body lang=3DFR link=3D"#0563C1" vlink=3D"#954F72"><div class=3DW=
ordSection1><p class=3DMsoNormal><span style=3D'font-size:11.0pt'>Hi,<o:p></o:p>=
</span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt'><o:p> </o:=
p></span></p><p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt'>I =
ran in a strange behavior where widgets in the view aren=E2=80=99t properly refres=
hed on change.<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US styl=
e=3D'font-size:11.0pt'>Here is the code, developed to show the problem:<o:p></=
o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt'>=
<o:p> </o:p></span></p><p class=3DMsoNormal style=3D'background:white'><spa=
n lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New";color:#0033B3=
;mso-fareast-language:FR'>import </span><span lang=3DEN-US style=3D'font-size:10=
.0pt;font-family:"Courier New";color:#080808;mso-fareast-language:FR'>sys<br=
><br></span><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier Ne=
w";color:#0033B3;mso-fareast-language:FR'>from </span><span lang=3DEN-US style=
=3D'font-size:10.0pt;font-family:"Courier New";color:#080808;mso-fareast-langu=
age:FR'>PyQt5 </span><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"C=
ourier New";color:#0033B3;mso-fareast-language:FR'>import </span><span lang=3D=
EN-US style=3D'font-size:10.0pt;font-family:"Courier New";color:#080808;mso-fa=
reast-language:FR'>QtWidgets<br></span><span lang=3DEN-US style=3D'font-size:10.=
0pt;font-family:"Courier New";color:#0033B3;mso-fareast-language:FR'>from </=
span><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New";colo=
r:#080808;mso-fareast-language:FR'>PyQt5.QtCore </span><span lang=3DEN-US styl=
e=3D'font-size:10.0pt;font-family:"Courier New";color:#0033B3;mso-fareast-lang=
uage:FR'>import </span><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:=
"Courier New";color:#080808;mso-fareast-language:FR'>Qt<br><br><br></span><s=
pan lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New";color:#0033=
B3;mso-fareast-language:FR'>class </span><span lang=3DEN-US style=3D'font-size:1=
0.0pt;font-family:"Courier New";color:black;mso-fareast-language:FR'>MainWin=
dow</span><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New"=
;color:#080808;mso-fareast-language:FR'>(QtWidgets.QMainWindow):<br>=C2=A0=C2=A0=C2=A0 <=
/span><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New";col=
or:#0033B3;mso-fareast-language:FR'>def </span><span lang=3DEN-US style=3D'font-=
size:10.0pt;font-family:"Courier New";color:#B200B2;mso-fareast-language:FR'=
>__init__</span><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courie=
r New";color:#080808;mso-fareast-language:FR'>(</span><span lang=3DEN-US style=
=3D'font-size:10.0pt;font-family:"Courier New";color:#94558D;mso-fareast-langu=
age:FR'>self</span><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Cou=
rier New";color:#080808;mso-fareast-language:FR'>):<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 QtWidg=
ets.QMainWindow.</span><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:=
"Courier New";color:#B200B2;mso-fareast-language:FR'>__init__</span><span la=
ng=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New";color:#080808;mso=
-fareast-language:FR'>(</span><span lang=3DEN-US style=3D'font-size:10.0pt;font-=
family:"Courier New";color:#94558D;mso-fareast-language:FR'>self</span><span=
lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New";color:#080808;=
mso-fareast-language:FR'>)<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 </span><span lang=3DEN-US style=3D'=
font-size:10.0pt;font-family:"Courier New";color:#94558D;mso-fareast-languag=
e:FR'>self</span><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Couri=
er New";color:#080808;mso-fareast-language:FR'>.resize(</span><span lang=3DEN-=
US style=3D'font-size:10.0pt;font-family:"Courier New";color:#1750EB;mso-farea=
st-language:FR'>250</span><span lang=3DEN-US style=3D'font-size:10.0pt;font-fami=
ly:"Courier New";color:#080808;mso-fareast-language:FR'>, </span><span lang=3D=
EN-US style=3D'font-size:10.0pt;font-family:"Courier New";color:#1750EB;mso-fa=
reast-language:FR'>100</span><span lang=3DEN-US style=3D'font-size:10.0pt;font-f=
amily:"Courier New";color:#080808;mso-fareast-language:FR'>)<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 </span><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New"=
;color:#94558D;mso-fareast-language:FR'>self</span><span lang=3DEN-US style=3D'f=
ont-size:10.0pt;font-family:"Courier New";color:#080808;mso-fareast-language=
:FR'>.setWindowTitle(</span><b><span lang=3DEN-US style=3D'font-size:10.0pt;font=
-family:"Courier New";color:teal;mso-fareast-language:FR'>"Demo"</=
span></b><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New";=
color:#080808;mso-fareast-language:FR'>)<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 </span><span lang=
=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New";color:#94558D;mso-f=
areast-language:FR'>self</span><span lang=3DEN-US style=3D'font-size:10.0pt;font=
-family:"Courier New";color:#080808;mso-fareast-language:FR'>.centralWidget =
=3D QtWidgets.QWidget(</span><span lang=3DEN-US style=3D'font-size:10.0pt;font-fam=
ily:"Courier New";color:#94558D;mso-fareast-language:FR'>self</span><span la=
ng=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New";color:#080808;mso=
-fareast-language:FR'>)<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 </span><span lang=3DEN-US style=3D'fon=
t-size:10.0pt;font-family:"Courier New";color:#94558D;mso-fareast-language:F=
R'>self</span><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier =
New";color:#080808;mso-fareast-language:FR'>.formlayout =3D QtWidgets.QFormLay=
out(</span><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New=
";color:#94558D;mso-fareast-language:FR'>self</span><span lang=3DEN-US style=3D'=
font-size:10.0pt;font-family:"Courier New";color:#080808;mso-fareast-languag=
e:FR'>.centralWidget)<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 </span><span lang=3DEN-US style=3D'font-=
size:10.0pt;font-family:"Courier New";color:#94558D;mso-fareast-language:FR'=
>self</span><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier Ne=
w";color:#080808;mso-fareast-language:FR'>.label1 =3D QtWidgets.QLabel(</span>=
<b><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New";color:=
teal;mso-fareast-language:FR'>'Text 1'</span></b><span lang=3DEN-US style=3D'fon=
t-size:10.0pt;font-family:"Courier New";color:#080808;mso-fareast-language:F=
R'>, </span><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier Ne=
w";color:#94558D;mso-fareast-language:FR'>self</span><span lang=3DEN-US style=3D=
'font-size:10.0pt;font-family:"Courier New";color:#080808;mso-fareast-langua=
ge:FR'>.centralWidget)<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 </span><span lang=3DEN-US style=3D'font=
-size:10.0pt;font-family:"Courier New";color:#94558D;mso-fareast-language:FR=
'>self</span><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier N=
ew";color:#080808;mso-fareast-language:FR'>.ledit1 =3D QtWidgets.QLineEdit(</s=
pan><b><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New";co=
lor:teal;mso-fareast-language:FR'>'initial value'</span></b><span lang=3DEN-US=
style=3D'font-size:10.0pt;font-family:"Courier New";color:#080808;mso-fareast=
-language:FR'>, </span><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:=
"Courier New";color:#94558D;mso-fareast-language:FR'>self</span><span lang=3DE=
N-US style=3D'font-size:10.0pt;font-family:"Courier New";color:#080808;mso-far=
east-language:FR'>.centralWidget)<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 </span><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:"Courier New";color:#94558D;mso-fareast-=
language:FR'>self</span><span lang=3DEN-US style=3D'font-size:10.0pt;font-family=
:"Courier New";color:#080808;mso-fareast-language:FR'>.bproceed =3D QtWidgets.=
QPushButton(</span><b><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"=
Courier New";color:teal;mso-fareast-language:FR'>'Proceed'</span></b><span l=
ang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New";color:#080808;ms=
o-fareast-language:FR'>, </span><span lang=3DEN-US style=3D'font-size:10.0pt;fon=
t-family:"Courier New";color:#94558D;mso-fareast-language:FR'>self</span><sp=
an lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New";color:#08080=
8;mso-fareast-language:FR'>.centralWidget)<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 </span><span la=
ng=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New";color:#94558D;mso=
-fareast-language:FR'>self</span><span lang=3DEN-US style=3D'font-size:10.0pt;fo=
nt-family:"Courier New";color:#080808;mso-fareast-language:FR'>.bproceed.set=
Default(</span><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier=
New";color:#0033B3;mso-fareast-language:FR'>True</span><span lang=3DEN-US sty=
le=3D'font-size:10.0pt;font-family:"Courier New";color:#080808;mso-fareast-lan=
guage:FR'>)<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 </span><span lang=3DEN-US style=3D'font-size:10.0p=
t;font-family:"Courier New";color:#94558D;mso-fareast-language:FR'>self</spa=
n><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New";color:#=
080808;mso-fareast-language:FR'>.bproceed.setFocusPolicy(Qt.StrongFocus)<br>=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 </span><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"=
Courier New";color:#94558D;mso-fareast-language:FR'>self</span><span lang=3DEN=
-US style=3D'font-size:10.0pt;font-family:"Courier New";color:#080808;mso-fare=
ast-language:FR'>.formlayout.setWidget(</span><span lang=3DEN-US style=3D'font-s=
ize:10.0pt;font-family:"Courier New";color:#1750EB;mso-fareast-language:FR'>=
1</span><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New";c=
olor:#080808;mso-fareast-language:FR'>, QtWidgets.QFormLayout.LabelRole, </s=
pan><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New";color=
:#94558D;mso-fareast-language:FR'>self</span><span lang=3DEN-US style=3D'font-si=
ze:10.0pt;font-family:"Courier New";color:#080808;mso-fareast-language:FR'>.=
label1)<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 </span><span lang=3DEN-US style=3D'font-size:10.0pt;fo=
nt-family:"Courier New";color:#94558D;mso-fareast-language:FR'>self</span><s=
pan lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New";color:#0808=
08;mso-fareast-language:FR'>.formlayout.setWidget(</span><span lang=3DEN-US st=
yle=3D'font-size:10.0pt;font-family:"Courier New";color:#1750EB;mso-fareast-la=
nguage:FR'>1</span><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Cou=
rier New";color:#080808;mso-fareast-language:FR'>, QtWidgets.QFormLayout.Fie=
ldRole, </span><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier=
New";color:#94558D;mso-fareast-language:FR'>self</span><span lang=3DEN-US sty=
le=3D'font-size:10.0pt;font-family:"Courier New";color:#080808;mso-fareast-lan=
guage:FR'>.ledit1)<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 </span><span lang=3DEN-US style=3D'font-siz=
e:10.0pt;font-family:"Courier New";color:#94558D;mso-fareast-language:FR'>se=
lf</span><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New";=
color:#080808;mso-fareast-language:FR'>.formlayout.setWidget(</span><span la=
ng=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New";color:#1750EB;mso=
-fareast-language:FR'>2</span><span lang=3DEN-US style=3D'font-size:10.0pt;font-=
family:"Courier New";color:#080808;mso-fareast-language:FR'>, QtWidgets.QFor=
mLayout.FieldRole, </span><span lang=3DEN-US style=3D'font-size:10.0pt;font-fami=
ly:"Courier New";color:#94558D;mso-fareast-language:FR'>self</span><span lan=
g=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New";color:#080808;mso-=
fareast-language:FR'>.bproceed)<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 </span><span lang=3DEN-US st=
yle=3D'font-size:10.0pt;font-family:"Courier New";color:#94558D;mso-fareast-la=
nguage:FR'>self</span><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"=
Courier New";color:#080808;mso-fareast-language:FR'>.setCentralWidget(</span=
><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New";color:#9=
4558D;mso-fareast-language:FR'>self</span><span lang=3DEN-US style=3D'font-size:=
10.0pt;font-family:"Courier New";color:#080808;mso-fareast-language:FR'>.cen=
tralWidget)<br><br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 </span><span lang=3DEN-US style=3D'font-size:1=
0.0pt;font-family:"Courier New";color:#94558D;mso-fareast-language:FR'>self<=
/span><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New";col=
or:#080808;mso-fareast-language:FR'>.bproceed.clicked.connect(</span><span l=
ang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New";color:#94558D;ms=
o-fareast-language:FR'>self</span><span lang=3DEN-US style=3D'font-size:10.0pt;f=
ont-family:"Courier New";color:#080808;mso-fareast-language:FR'>.on_clicked)=
<br><br>=C2=A0=C2=A0=C2=A0 </span><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"=
Courier New";color:#0033B3;mso-fareast-language:FR'>def </span><span lang=3DEN=
-US style=3D'font-size:10.0pt;font-family:"Courier New";color:black;mso-fareas=
t-language:FR'>on_clicked</span><span lang=3DEN-US style=3D'font-size:10.0pt;fon=
t-family:"Courier New";color:#080808;mso-fareast-language:FR'>(</span><span =
lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New";color:#94558D;m=
so-fareast-language:FR'>self</span><span lang=3DEN-US style=3D'font-size:10.0pt;=
font-family:"Courier New";color:#080808;mso-fareast-language:FR'>):<br>=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0 </span><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Couri=
er New";color:#94558D;mso-fareast-language:FR'>self</span><span lang=3DEN-US s=
tyle=3D'font-size:10.0pt;font-family:"Courier New";color:#080808;mso-fareast-l=
anguage:FR'>.ledit1.setText(</span><b><span lang=3DEN-US style=3D'font-size:10.0=
pt;font-family:"Courier New";color:teal;mso-fareast-language:FR'>''</span></=
b><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Courier New";color:#=
080808;mso-fareast-language:FR'>)<br></span><i><span lang=3DEN-US style=3D'font-=
size:10.0pt;font-family:"Courier New";color:#8C8C8C;mso-fareast-language:FR'=
><br><br></span></i><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Co=
urier New";color:#0033B3;mso-fareast-language:FR'>if </span><span lang=3DEN-US=
style=3D'font-size:10.0pt;font-family:"Courier New";color:#080808;mso-fareast=
-language:FR'>__name__ =3D=3D </span><b><span lang=3DEN-US style=3D'font-size:10.0pt=
;font-family:"Courier New";color:teal;mso-fareast-language:FR'>"__main_=
_"</span></b><span lang=3DEN-US style=3D'font-size:10.0pt;font-family:"Cour=
ier New";color:#080808;mso-fareast-language:FR'>:<br>=C2=A0=C2=A0=C2=A0 app =3D QtWidgets.=
QApplication(sys.argv)<br>=C2=A0=C2=A0=C2=A0 win =3D MainWindow()<br>=C2=A0=C2=A0=C2=A0 win.show()<br>=
=C2=A0=C2=A0=C2=A0 sys.exit(app.exec())<o:p></o:p></span></p><p class=3DMsoNormal><span la=
ng=3DEN-US style=3D'font-size:11.0pt'><o:p> </o:p></span></p><p class=3DMsoNo=
rmal><span lang=3DEN-US style=3D'font-size:11.0pt'><o:p> </o:p></span></p><=
p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt'>If the pushbutto=
n is clicked with the mouse or with the space key (after getting the focus w=
ith Tab), the text in the lineedit is not refreshed. If a repaint is forced,=
it is.<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US style=3D'font=
-size:11.0pt'>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><=
/o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt'=
><o:p> </o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US style=3D'font=
-size:11.0pt'>Any idea?<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DE=
N-US style=3D'font-size:11.0pt'><o:p> </o:p></span></p><p class=3DMsoNormal=
><span lang=3DEN-US style=3D'font-size:11.0pt'>My env:<o:p></o:p></span></p><p c=
lass=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt'>OSX Catalina 10.15.=
5<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:=
11.0pt'>Python 3.6<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt'>PyQt: 15.0<o:p></o:p></span></p><p class=3DMsoNormal>=
<span lang=3DEN-US style=3D'font-size:11.0pt'><o:p> </o:p></span></p><p cla=
ss=3DMsoNormal><span lang=3DEN-US style=3D'font-size:11.0pt'>Thank you<o:p></o:p><=
/span></p></div></body></html>
--B_3675919583_909009751--