예제 #1
0
 def resizeEvent(self, *args):
     QDialog.resizeEvent(self, *args)
     if self.table_column_widths is not None:
         for c, w in enumerate(self.table_column_widths):
             self.table.setColumnWidth(c, w)
     else:
         # the vertical scroll bar might not be rendered, so might not yet
         # have a width. Assume 25. Not a problem because user-changed column
         # widths will be remembered
         w = self.table.width() - 25 - self.table.verticalHeader().width()
         w //= self.table.columnCount()
         for c in range(0, self.table.columnCount()):
             self.table.setColumnWidth(c, w)
예제 #2
0
    def resizeEvent(self, *args):
        QDialog.resizeEvent(self, *args)

        # Do this if we are resizing for the first time to reset state.
        if self.is_pane and self.height() == 0:
            self.gui.quickview_splitter.set_sizes()

        if self.books_table_column_widths is not None:
            for c,w in enumerate(self.books_table_column_widths):
                self.books_table.setColumnWidth(c, w)
        else:
            # the vertical scroll bar might not be rendered, so might not yet
            # have a width. Assume 25. Not a problem because user-changed column
            # widths will be remembered
            w = self.books_table.width() - 25 - self.books_table.verticalHeader().width()
            w //= self.books_table.columnCount()
            for c in range(0, self.books_table.columnCount()):
                self.books_table.setColumnWidth(c, w)
        self.save_state()