process app events before scrolling instead of each widget

This commit is contained in:
iLLiCiTiT 2021-08-13 09:56:29 +02:00
parent b859ff99dd
commit a706fecda4
5 changed files with 5 additions and 4 deletions

View file

@ -258,6 +258,11 @@ class SettingsCategoryWidget(QtWidgets.QWidget):
def scroll_to(self, widget):
if widget:
# Process events which happened before ensurence
# - that is because some widgets could be not visible before
# this method was called and have incorrect size
QtWidgets.QApplication.processEvents()
# Scroll to widget
self.scroll_widget.ensureWidgetVisible(widget)
def set_path(self, path):

View file

@ -227,7 +227,6 @@ class DictConditionalWidget(BaseWidget):
if self.body_widget and not self.body_widget.is_expanded():
self.body_widget.toggle_content(True)
QtWidgets.QApplication.processEvents()
for input_field in self.input_fields:
if input_field.make_sure_is_visible(path, scroll_to):

View file

@ -861,7 +861,6 @@ class DictMutableKeysWidget(BaseWidget):
if self.body_widget and not self.body_widget.is_expanded():
self.body_widget.toggle_content(True)
QtWidgets.QApplication.processEvents()
for input_field in self.input_fields:
if input_field.make_sure_is_visible(path, scroll_to):

View file

@ -171,7 +171,6 @@ class DictImmutableKeysWidget(BaseWidget):
if self.body_widget and not self.body_widget.is_expanded():
self.body_widget.toggle_content(True)
QtWidgets.QApplication.processEvents()
for direct_child in self._direct_children_widgets:
if direct_child.make_sure_is_visible(path, scroll_to):

View file

@ -281,7 +281,6 @@ class ListWidget(InputWidget):
if self.body_widget and not self.body_widget.is_expanded():
self.body_widget.toggle_content(True)
QtWidgets.QApplication.processEvents()
for input_field in self.input_fields:
if input_field.make_sure_is_visible(path, scroll_to):