'Toggle horizontal scrollbar'

@Slot(bool)
def toggle_hscrollbar(self, checked):

    self.parent_widget.sig_option_changed.emit('show_hscrollbar', checked)
    self.show_hscrollbar = checked
    self.header().setStretchLastSection((not checked))
    self.header().setHorizontalScrollMode(QAbstractItemView.ScrollPerPixel)
    try:
        self.header().setSectionResizeMode(QHeaderView.ResizeToContents)
    except:
        self.header().setResizeMode(QHeaderView.ResizeToContents)
