(self, master)
Initialize the attributes and set up the interface
Initialize the attributes and set up the interface
Initialize the attributes and set up the interface
def __init__(self, master):
        """Initialize the attributes and set up the interface"""
        QDialog.__init__(self, master, windowTitle=self.captionTitle)
        WidgetMessagesMixin.__init__(self)
        ConcurrentMixin.__init__(self)
        self.setLayout(QVBoxLayout())

        self.insert_message_bar()
        self.layout().insertWidget(0, self.message_bar)
        self.master = master

        self.keep_running = False
        self.scheduled_call = None
        self.saved_state = None
        self.saved_progress = 0
        self.scores = []
        self.add_to_model = Queue()

        self.filter = QLineEdit()
        self.filter.setPlaceholderText("Filter ...")
        self.filter.textChanged.connect(self.filter_changed)
        self.layout().addWidget(self.filter)
        # Remove focus from line edit
        self.setFocus(Qt.ActiveWindowFocusReason)

        self.rank_model = QStandardItemModel(self)
        self.model_proxy = QSortFilterProxyModel(
            self, filterCaseSensitivity=Qt.CaseInsensitive
        )
        self.model_proxy.setSourceModel(self.rank_model)
        self.rank_table = view = QTableView(
            selectionBehavior=QTableView.SelectRows,
            selectionMode=QTableView.SingleSelection,
            showGrid=False,
            editTriggers=gui.TableView.NoEditTriggers)
        if self._has_bars:
            view.setItemDelegate(TableBarItem())
        else:
            view.setItemDelegate(HorizontalGridDelegate())
        view.setModel(self.model_proxy)
        view.selectionModel().selectionChanged.connect(
            self.on_selection_changed)
        view.horizontalHeader().setStretchLastSection(True)
        view.horizontalHeader().hide()
        self.layout().addWidget(view)

        self.button = gui.button(
            self, self, "Start", callback=self.toggle, default=True)
def __init__ ( self , master ) : QDialog . __init__ ( self , master , windowTitle = self . captionTitle ) WidgetMessagesMixin . __init__ ( self ) ConcurrentMixin . __init__ ( self ) self . setLayout ( QVBoxLayout ( ) ) self . insert_message_bar ( ) self . layout ( ) . insertWidget ( 0 , self . message_bar ) self . master = master self . keep_running = False self . scheduled_call = None self . saved_state = None self . saved_progress = 0 self . scores = [ ] self . add_to_model = Queue ( ) self . filter = QLineEdit ( ) self . filter . setPlaceholderText ( "Filter ..." ) self . filter . textChanged . connect ( self . filter_changed ) self . layout ( ) . addWidget ( self . filter ) # Remove focus from line edit self . setFocus ( Qt . ActiveWindowFocusReason ) self . rank_model = QStandardItemModel ( self ) self . model_proxy = QSortFilterProxyModel ( self , filterCaseSensitivity = Qt . CaseInsensitive ) self . model_proxy . setSourceModel ( self . rank_model ) self . rank_table = view = QTableView ( selectionBehavior = QTableView . SelectRows , selectionMode = QTableView . SingleSelection , showGrid = False , editTriggers = gui . TableView . NoEditTriggers ) if self . _has_bars : view . setItemDelegate ( TableBarItem ( ) ) else : view . setItemDelegate ( HorizontalGridDelegate ( ) ) view . setModel ( self . model_proxy ) view . selectionModel ( ) . selectionChanged . connect ( self . on_selection_changed ) view . horizontalHeader ( ) . setStretchLastSection ( True ) view . horizontalHeader ( ) . hide ( ) self . layout ( ) . addWidget ( view ) self . button = gui . button ( self , self , "Start" , callback = self . toggle , default = True )