def __init__(self, parent=None): QListWidget.__init__(self, parent) self.setAlternatingRowColors(True) self.setStyleSheet('QListView::item { padding: 0.5ex }') self.setContextMenuPolicy(Qt.ContextMenuPolicy.ActionsContextMenu) self.ac_edit = ac = QAction(QIcon(I('edit_input.png')), _('Rename this bookmark'), self) self.addAction(ac) self.ac_delete = ac = QAction(QIcon(I('trash.png')), _('Remove this bookmark'), self) self.addAction(ac)
def __init__(self, parent=None): QListWidget.__init__(self, parent) self.setAlternatingRowColors(True) self.setStyleSheet('QListView::item { padding: 0.5ex }') self.setContextMenuPolicy(Qt.ContextMenuPolicy.ActionsContextMenu) self.ac_edit = ac = QAction(QIcon(I('edit_input.png')), _('Rename this bookmark'), self) self.addAction(ac) self.ac_delete = ac = QAction(QIcon(I('trash.png')), _('Remove this bookmark'), self) self.addAction(ac) self.gesture_manager = GestureManager(self) self.setVerticalScrollMode(QAbstractItemView.ScrollMode.ScrollPerPixel)
def __init__(self, all_authors, parent): QListWidget.__init__(self, parent) self.setDragEnabled(True) self.setSelectionMode( QAbstractItemView.SelectionMode.ExtendedSelection) self.setDropIndicatorShown(True) self.setDragDropMode(QAbstractItemView.DragDropMode.InternalMove) self.setAlternatingRowColors(True) self.d = ItemDelegate(all_authors, self) self.d.edited.connect(self.edited, type=Qt.ConnectionType.QueuedConnection) self.setItemDelegate(self.d)
def __init__(self, actions, parent=None, is_source=True): QListWidget.__init__(self, parent) self.setSelectionMode(QAbstractItemView.SelectionMode.ExtendedSelection) self.setDragEnabled(True) self.viewport().setAcceptDrops(True) self.setDropIndicatorShown(True) self.setDragDropMode(QAbstractItemView.DragDropMode.InternalMove) self.setDefaultDropAction(Qt.DropAction.CopyAction if ismacos else Qt.DropAction.MoveAction) self.setMinimumHeight(400) self.is_source = is_source if is_source: actions = self.sort_actions_alphabetically(actions) actions = [None] + actions self.set_names(actions)
def __init__(self, parent=None): QListWidget.__init__(self, parent) self.setSelectionMode( QAbstractItemView.SelectionMode.ExtendedSelection)