Skip to content

Commit 0bf4ef5

Browse files
authored
replaced QtCore.QCoreApplication.processEvents() (Open-MSS#3060)
1 parent 110d6ee commit 0bf4ef5

11 files changed

Lines changed: 927 additions & 808 deletions

‎mslib/msui/mpl_qtwidget.py‎

Lines changed: 129 additions & 791 deletions
Large diffs are not rendered by default.

‎mslib/msui/mscolab.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,8 @@ def after_login(self, emailid, url, response):
277277
logging.debug("after login %s %s", emailid, url)
278278
# emailid by direct call
279279
self.email = emailid
280-
self.connect_window.close()
280+
self.connect_window.done(QDialog.Accepted)
281281
self.connect_window = None
282-
QtWidgets.QApplication.processEvents()
283282
# fill value of mscolab url if found in QSettings storage
284283

285284
_json = response.json()

‎mslib/msui/mscolab_connect_dialog.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import webbrowser
3131
from urllib.parse import urljoin
3232

33-
from PyQt5 import QtWidgets
3433
from PyQt5.QtWidgets import QDialog, QMessageBox
3534

3635
from mslib.msui.qt5 import ui_mscolab_connect_dialog as ui_conn
@@ -123,7 +122,8 @@ def set_status(self, _type="Error", msg=""):
123122
self.statusLabel.setText(_msg)
124123
# windows can have a cp1252 encoding, don't use special chars
125124
logging.debug("set_status: %s", msg)
126-
QtWidgets.QApplication.processEvents()
125+
# Repaint this widget only, without spinning the full Qt event loop.
126+
self.statusLabel.repaint()
127127

128128
def add_mscolab_urls(self):
129129
url_list = config_loader(dataset="default_MSCOLAB")

‎mslib/msui/topview.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,8 +531,7 @@ def changeMapSection(self, index=0, only_kwargs=False):
531531
return kwargs
532532

533533
logging.debug("switching to map section '%s' - '%s'", current_map_key, kwargs)
534-
self.mpl.canvas.redraw_map(kwargs)
535-
self.mpl.navbar.clear_history()
534+
self.mpl.canvas.redraw_map(kwargs, on_finished=self.mpl.navbar.clear_history)
536535

537536
def setIdentifier(self, identifier):
538537
super().setIdentifier(identifier)

0 commit comments

Comments
 (0)