python - How can I force a repaint in PySide? -
i have think repainting issue pyside widget. how can force widget (or whole window/app) repaint in middle of method?
def on_button_clicked(): window.resulttextedit.setplaintext("parsing file...") # indicate delay, message should visible while parsing # in fact never appears # can force repaint here? result = parse() # (takes little while) window.resulttextedit.setplaintext(result) # display results once done app = qapplication(sys.argv) window = qtuitools.quiloader().load("application.ui") window.userbutton.clicked.connect(on_button_clicked) window.show() sys.exit(app.exec_())
for widget needs repaint in middle of event, can call widget.repaint()
. note rest of ui unresponsive during repaint (which fine one-off call, not if you're repainting repeatedly).
(thanks mel pointing me https://stackoverflow.com/a/11806126/4720935 )
Comments
Post a Comment