<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">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,<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">Thank you for your quick answers.<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">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?<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">Christian<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class=""> </o:p></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?<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></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.<o:p class=""></o:p></div><div class=""><div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Ray<o:p class=""></o:p></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=""><o:p class=""></o:p></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><o:p class=""></o:p></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=""><o:p class=""></o:p></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=""><o:p class=""></o:p></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=""><o:p class=""></o:p></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><o:p class=""></o:p></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=""><o:p class=""></o:p></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=""><o:p class=""></o:p></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="">I ran in a strange behavior where widgets in the view aren’t properly refreshed on change.</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></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="">Here is the code, developed to show the problem:</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></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=""> </span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></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="">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="">sys<br class=""><br class=""></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 51, 179);" class="">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="">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="">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="">QtWidgets<br class=""></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 51, 179);" class="">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="">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="">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="">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="">class<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New";" class="">MainWindow</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">(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="">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="">__init__</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">(</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">):<br class=""> QtWidgets.QMainWindow.</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(178, 0, 178);" class="">__init__</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">(</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" 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="">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">.resize(</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(23, 80, 235);" class="">250</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">,<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="">100</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" 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="">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">.setWindowTitle(</span><b class=""><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: teal;" class="">"Demo"</span></b><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" 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="">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">.centralWidget = QtWidgets.QWidget(</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" 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="">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">.formlayout = QtWidgets.QFormLayout(</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">.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="">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">.label1 = QtWidgets.QLabel(</span><b class=""><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: teal;" class="">'Text 1'</span></b><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" 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="">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">.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="">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">.ledit1 = QtWidgets.QLineEdit(</span><b class=""><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: teal;" class="">'initial value'</span></b><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" 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="">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">.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="">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">.bproceed = QtWidgets.QPushButton(</span><b class=""><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: teal;" class="">'Proceed'</span></b><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" 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="">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">.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="">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">.bproceed.setDefault(</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 51, 179);" class="">True</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" 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="">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">.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="">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">.formlayout.setWidget(</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(23, 80, 235);" class="">1</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">, 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="">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">.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="">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">.formlayout.setWidget(</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(23, 80, 235);" class="">1</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">, 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="">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">.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="">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">.formlayout.setWidget(</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(23, 80, 235);" class="">2</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">, 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="">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">.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="">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">.setCentralWidget(</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">.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="">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">.bproceed.clicked.connect(</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">.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="">def<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New";" class="">on_clicked</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">(</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(148, 85, 141);" class="">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" 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="">self</span><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">.ledit1.setText(</span><b class=""><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: teal;" class="">''</span></b><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">)<br class=""></span><i class=""><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(140, 140, 140);" class=""><br class=""><br class=""></span></i><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 51, 179);" class="">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="">__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="">"__main__"</span></b><span lang="EN-US" style="font-size: 10pt; font-family: "Courier New"; color: rgb(8, 8, 8);" class="">:<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=""><o:p class=""></o:p></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=""> </span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></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=""> </span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></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="">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=""><o:p class=""></o:p></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="">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=""><o:p class=""></o:p></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=""> </span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></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="">Any idea?</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></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=""> </span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></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="">My env:</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></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="">OSX Catalina 10.15.5</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></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="">Python 3.6</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></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="">PyQt: 15.0</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></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=""> </span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></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="">Thank you</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></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></body></html>