def __init__(self, parent): QTreeView.__init__(self, parent) self.setAnimated(True) self.setHeaderHidden(True) self.setObjectName('recipes') self.setExpandsOnDoubleClick(True) self.doubleClicked.connect(self.double_clicked) self.setSizePolicy(QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding)
def __init__(self, parent=None): QTreeView.__init__(self, parent) self.setHeaderHidden(True) self.setAnimated(True) self.activated.connect(self.item_activated) self.clicked.connect(self.item_activated) set_no_activate_on_click(self) self.initialized = False self.setExpandsOnDoubleClick(False)
def __init__(self, *args): QTreeView.__init__(self, *args) self.setFocusPolicy(Qt.FocusPolicy.NoFocus) self.delegate = Delegate(self) self.setItemDelegate(self.delegate) self.setMinimumWidth(80) self.header().close() self.setMouseTracking(True) self.set_style_sheet() self.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu) self.customContextMenuRequested.connect(self.context_menu) QApplication.instance().palette_changed.connect(self.set_style_sheet, type=Qt.ConnectionType.QueuedConnection)
def __init__(self, *args): QTreeView.__init__(self, *args) self._model = Matches() self.setModel(self._model) self.rt_delegate = RichTextDelegate(self) self.img_delegate = ImageDelegate(self) for i in self._model.HTML_COLS: self.setItemDelegateForColumn(i, self.rt_delegate) for i in self._model.IMG_COLS: self.setItemDelegateForColumn(i, self.img_delegate)
def __init__(self, *args): QTreeView.__init__(self, *args) self.setFocusPolicy(Qt.FocusPolicy.NoFocus) self.delegate = Delegate(self) self.setItemDelegate(self.delegate) self.setMinimumWidth(80) self.header().close() self.setMouseTracking(True) self.set_style_sheet() self.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu) self.context_menu = None self.customContextMenuRequested.connect(self.show_context_menu) QApplication.instance().palette_changed.connect( self.set_style_sheet, type=Qt.ConnectionType.QueuedConnection) self.setVerticalScrollMode(QAbstractItemView.ScrollMode.ScrollPerPixel) self.gesture_manager = GestureManager(self)
def __init__(self, *args): QTreeView.__init__(self,*args) self._model = Matches([p for p in store_plugins()]) self.setModel(self._model) self.setIconSize(QSize(24, 24)) self.rt_delegate = RichTextDelegate(self) self.delegate = Delegate() self.setItemDelegate(self.delegate) for i in self._model.HTML_COLS: self.setItemDelegateForColumn(i, self.rt_delegate) for i in range(self._model.columnCount()): self.resizeColumnToContents(i) self.model().sort(1, Qt.SortOrder.AscendingOrder) self.header().setSortIndicator(self.model().sort_col, self.model().sort_order)