<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection">
<div dir="auto">Hi,<br />
<br />
I understand the principle - thank you for sharing - I’m probably going to the same for push button setEnabled which has the same flaw. <br />
<br />
Once again thank you for sharing that <br />
<br />
Christian </div>
</div>
<div name="messageSignatureSection"><br />
Christian</div>
<div name="messageReplySection">Le 25 juin 2020 à 18:04 +0200, Raymond Osborn <rayosborn@mac.com>, a écrit :<br />
<blockquote type="cite" style="border-left-color: grey; border-left-width: thin; border-left-style: solid; margin: 5px 5px;padding-left: 10px;">It’s mainly the setText functions for QLabel and QLineEdit, e.g.,
<div class=""><br class="" /></div>
<div class="">class NXLabel(QtWidgets.QLabel):<br class="" />
"""A text label.<br class="" />
<br class="" />
This is being subclassed from the PyQt QLabel class because of a bug in<br class="" />
recent versions of PyQt5 (>11) that requires the box to be repainted <br class="" />
after any programmatic changes.<br class="" />
"""<br class="" />
<br class="" />
def setText(self, text):<br class="" />
"""Function to set the text in the box.<br class="" />
<br class="" />
Parameters<br class="" />
----------<br class="" />
text : str<br class="" />
Text to replace the text box contents.<br class="" />
"""<br class="" />
super(NXLabel, self).setText(str(text))<br class="" />
self.repaint()</div>
<div class=""><br class="" /></div>
<div class="">I also added a repaint to the setValue function of QSpinBox and QDoubleSpinBox. I presume they had also given problems, but it might have been a precaution. </div>
<div class=""><br class="" /></div>
<div class="">
<div class="">class NXSpinBox(QtWidgets.QSpinBox):</div>
<div class=""><br class="" /></div>
<div class=""> def setValue(self, value):</div>
<div class=""> super(NXSpinBox, self).setValue(value)</div>
<div class=""> self.repaint()</div>
<div class=""><br class="" /></div>
<div class="">It doesn’t look as if it affected QTextEdit for some reason, but there may be others that I don’t use. </div>
<div class=""><br class="" /></div>
Ray<br class="" />
<div><br class="" />
<blockquote type="cite" class="">
<div class="">On Jun 25, 2020, at 10:36 AM, Christian ARNAUD <<a href="mailto:carnaudfree@gmail.com" class="">carnaudfree@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline" />
<div class="">
<div class="WordSection1" style="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="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">Hi Raymond,</span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""> </span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="" xml:lang="EN-US">Thank you for your quick answers.</span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="" xml:lang="EN-US">Would it be possible to share how do you subclass the concerned widgets? Is there a specific method that should be overloaded to trigger the repaint event?</span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="" xml:lang="EN-US"> </span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="" xml:lang="EN-US">Christian</span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="" xml:lang="EN-US"> </span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="" xml:lang="EN-US"> </span></div>
<div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(181, 196, 223); padding: 3pt 0cm 0cm;" class="">
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span style="font-size: 12pt;" class="">De :<span class="Apple-converted-space"> </span></span></b><span style="font-size: 12pt;" class="">Raymond Osborn <<a href="mailto:rayosborn@mac.com" class="">rayosborn@mac.com</a>><br class="" />
<b class="">Date :<span class="Apple-converted-space"> </span></b>jeudi 25 juin 2020 à 15:41<br class="" />
<b class="">À :<span class="Apple-converted-space"> </span></b>PyQt mailing list <<a href="mailto:pyqt@riverbankcomputing.com" class="">pyqt@riverbankcomputing.com</a>><br class="" />
<b class="">Cc :<span class="Apple-converted-space"> </span></b>Christian ARNAUD <<a href="mailto:carnaud@free.fr" class="">carnaud@free.fr</a>><br class="" />
<b class="">Objet :<span class="Apple-converted-space"> </span></b>Re: Widgets are not updated - is this a bug?</span></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> </div>
</div>
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">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>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> </div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Ray</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><br class="" />
<br class="" /></div>
<blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class="" type="cite">
<div class="">
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span style="font-family: "Helvetica Neue"; color: rgb(127, 127, 127);" class="">From: </span></b><span style="font-family: "Helvetica Neue";" class="">Christian ARNAUD <<a href="mailto:carnaud@free.fr" style="color: blue; text-decoration: underline;" class="">carnaud@free.fr</a>></span></div>
</div>
<div class="">
<div class="">
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span style="font-size: 9pt; font-family: "Helvetica Neue"; color: rgb(127, 127, 127);" class="">Subject:<span class="apple-converted-space"> </span></span></b><b class=""><span style="font-size: 9pt; font-family: "Helvetica Neue";" class="">Widgets are not updated - is this a bug?</span></b><span style="font-size: 9pt; font-family: Helvetica;" class=""></span></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span style="font-size: 9pt; font-family: "Helvetica Neue"; color: rgb(127, 127, 127);" class="">Date:<span class="apple-converted-space"> </span></span></b><span style="font-size: 9pt; font-family: "Helvetica Neue";" class="">June 25, 2020 at 1:46:21 AM CDT</span><span style="font-size: 9pt; font-family: Helvetica;" class=""></span></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span style="font-size: 9pt; font-family: "Helvetica Neue"; color: rgb(127, 127, 127);" class="">To:<span class="apple-converted-space"> </span></span></b><span style="font-size: 9pt; font-family: "Helvetica Neue";" class=""><<a href="mailto:pyqt@riverbankcomputing.com" style="color: blue; text-decoration: underline;" class="">pyqt@riverbankcomputing.com</a>></span><span style="font-size: 9pt; font-family: Helvetica;" class=""></span></div>
</div>
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 9pt; font-family: Helvetica;" class=""><br style="caret-color: rgb(0, 0, 0); font-variant-caps: normal; text-align: start; -webkit-text-stroke-width: 0px; word-spacing: 0px;" class="" />
<br class="" /></span></div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Hi,<span style="font-size: 12pt;" class=""></span></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> <span style="font-size: 12pt;" class=""></span></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="" xml:lang="EN-US">I ran in a strange behavior where widgets in the view aren’t properly refreshed on change.</span><span style="font-size: 12pt;" class=""></span></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="" xml:lang="EN-US">Here is the code, developed to show the problem:</span><span style="font-size: 12pt;" class=""></span></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="" xml:lang="EN-US"> </span><span style="font-size: 12pt;" class=""></span></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif; background-color: white;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 51, 179);" class="" xml:lang="EN-US">import<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">sys<br class="" />
<br class="" /></span> <span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 51, 179);" class="" xml:lang="EN-US">from<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">PyQt5<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 51, 179);" class="" xml:lang="EN-US">import<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">QtWidgets<br class="" /></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 51, 179);" class="" xml:lang="EN-US">from<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">PyQt5.QtCore<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 51, 179);" class="" xml:lang="EN-US">import<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">Qt<br class="" />
<br class="" />
<br class="" /></span> <span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 51, 179);" class="" xml:lang="EN-US">class<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New";" class="" xml:lang="EN-US">MainWindow</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">(QtWidgets.QMainWindow):<br class="" />
<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 51, 179);" class="" xml:lang="EN-US">def<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(178, 0, 178);" class="" xml:lang="EN-US">__init__</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">(</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="" xml:lang="EN-US">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">):<br class="" />
QtWidgets.QMainWindow.</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(178, 0, 178);" class="" xml:lang="EN-US">__init__</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">(</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="" xml:lang="EN-US">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">)<br class="" />
<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="" xml:lang="EN-US">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">.resize(</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(23, 80, 235);" class="" xml:lang="EN-US">250</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">,<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(23, 80, 235);" class="" xml:lang="EN-US">100</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">)<br class="" />
<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="" xml:lang="EN-US">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">.setWindowTitle(</span><b class=""><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: teal;" class="" xml:lang="EN-US">"Demo"</span></b><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">)<br class="" />
<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="" xml:lang="EN-US">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">.centralWidget = QtWidgets.QWidget(</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="" xml:lang="EN-US">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">)<br class="" />
<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="" xml:lang="EN-US">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">.formlayout = QtWidgets.QFormLayout(</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="" xml:lang="EN-US">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">.centralWidget)<br class="" />
<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="" xml:lang="EN-US">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">.label1 = QtWidgets.QLabel(</span><b class=""><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: teal;" class="" xml:lang="EN-US">'Text 1'</span></b><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">,<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="" xml:lang="EN-US">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">.centralWidget)<br class="" />
<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="" xml:lang="EN-US">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">.ledit1 = QtWidgets.QLineEdit(</span><b class=""><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: teal;" class="" xml:lang="EN-US">'initial value'</span></b><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">,<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="" xml:lang="EN-US">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">.centralWidget)<br class="" />
<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="" xml:lang="EN-US">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">.bproceed = QtWidgets.QPushButton(</span><b class=""><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: teal;" class="" xml:lang="EN-US">'Proceed'</span></b><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">,<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="" xml:lang="EN-US">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">.centralWidget)<br class="" />
<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="" xml:lang="EN-US">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">.bproceed.setDefault(</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 51, 179);" class="" xml:lang="EN-US">True</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">)<br class="" />
<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="" xml:lang="EN-US">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">.bproceed.setFocusPolicy(Qt.StrongFocus)<br class="" />
<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="" xml:lang="EN-US">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">.formlayout.setWidget(</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(23, 80, 235);" class="" xml:lang="EN-US">1</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">, QtWidgets.QFormLayout.LabelRole,<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="" xml:lang="EN-US">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">.label1)<br class="" />
<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="" xml:lang="EN-US">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">.formlayout.setWidget(</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(23, 80, 235);" class="" xml:lang="EN-US">1</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">, QtWidgets.QFormLayout.FieldRole,<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="" xml:lang="EN-US">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">.ledit1)<br class="" />
<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="" xml:lang="EN-US">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">.formlayout.setWidget(</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(23, 80, 235);" class="" xml:lang="EN-US">2</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">, QtWidgets.QFormLayout.FieldRole,<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="" xml:lang="EN-US">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">.bproceed)<br class="" />
<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="" xml:lang="EN-US">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">.setCentralWidget(</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="" xml:lang="EN-US">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">.centralWidget)<br class="" />
<br class="" />
<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="" xml:lang="EN-US">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">.bproceed.clicked.connect(</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="" xml:lang="EN-US">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">.on_clicked)<br class="" />
<br class="" />
<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 51, 179);" class="" xml:lang="EN-US">def<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New";" class="" xml:lang="EN-US">on_clicked</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">(</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="" xml:lang="EN-US">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">):<br class="" />
<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="" xml:lang="EN-US">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">.ledit1.setText(</span><b class=""><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: teal;" class="" xml:lang="EN-US">''</span></b><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">)<br class="" /></span><i class=""><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(140, 140, 140);" class="" xml:lang="EN-US"><br class="" />
<br class="" /></span></i> <span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 51, 179);" class="" xml:lang="EN-US">if<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">__name__ ==<span class="apple-converted-space"> </span></span><b class=""><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: teal;" class="" xml:lang="EN-US">"__main__"</span></b><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="" xml:lang="EN-US">:<br class="" />
app = QtWidgets.QApplication(sys.argv)<br class="" />
win = MainWindow()<br class="" />
win.show()<br class="" />
sys.exit(app.exec())</span><span style="font-size: 12pt;" class=""></span></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="" xml:lang="EN-US"> </span><span style="font-size: 12pt;" class=""></span></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="" xml:lang="EN-US"> </span><span style="font-size: 12pt;" class=""></span></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="" xml:lang="EN-US">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.</span><span style="font-size: 12pt;" class=""></span></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="" xml:lang="EN-US">If the pushbutton is clicked with the enter key (after getting the focus with Tab), the text in the lineedit is correctly refreshed.</span><span style="font-size: 12pt;" class=""></span></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="" xml:lang="EN-US"> </span><span style="font-size: 12pt;" class=""></span></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="" xml:lang="EN-US">Any idea?</span><span style="font-size: 12pt;" class=""></span></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="" xml:lang="EN-US"> </span><span style="font-size: 12pt;" class=""></span></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="" xml:lang="EN-US">My env:</span><span style="font-size: 12pt;" class=""></span></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="" xml:lang="EN-US">OSX Catalina 10.15.5</span><span style="font-size: 12pt;" class=""></span></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="" xml:lang="EN-US">Python 3.6</span><span style="font-size: 12pt;" class=""></span></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="" xml:lang="EN-US">PyQt: 15.0</span><span style="font-size: 12pt;" class=""></span></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="" xml:lang="EN-US"> </span><span style="font-size: 12pt;" class=""></span></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="" xml:lang="EN-US">Thank you</span><span style="font-size: 12pt;" class=""></span></div>
</div>
<div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 9pt; font-family: Helvetica;" class=""><br class="" />
<br class="" />
_______________________________________________<br class="" />
PyQt mailing list<br class="" /></span><a href="mailto:PyQt@riverbankcomputing.com" style="color: blue; text-decoration: underline;" class=""><span style="font-size: 9pt; font-family: Helvetica;" class="">PyQt@riverbankcomputing.com</span></a><span style="font-size: 9pt; font-family: Helvetica;" class=""><br class="" /></span><a href="https://www.riverbankcomputing.com/mailman/listinfo/pyqt" style="color: blue; text-decoration: underline;" class=""><span style="font-size: 9pt; font-family: Helvetica;" class="">https://www.riverbankcomputing.com/mailman/listinfo/pyqt</span></a></div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br class="" /></div>
</blockquote>
</div>
</body>
</html>