def _refresh_editor_and_scrollbars(self): """ Refrehes editor content and scollbars. We generate a fake resize event to refresh scroll bar. We have the same problem as described here: http://www.qtcentre.org/threads/44803 and we apply the same solution (don't worry, there is no visual effect, the editor does not grow up at all, even with a value = 500) """ TextHelper(self.editor).mark_whole_doc_dirty() self.editor.repaint() s = self.editor.size() s.setWidth(s.width() + 1) self.editor.resizeEvent(QResizeEvent(self.editor.size(), s))
def resizeEvent(self, event: QResizeEvent): if event.size().width() < 800: self.batch_processing_btn.hide() else: self.batch_processing_btn.show()
def resizeEvent(self, event: QResizeEvent): # resize so that the center remains constant dd: QSize = (event.size() - event.oldSize()) / 2 self.translate(dd.width(), dd.height()) super().resizeEvent(event)