Example #1
0
    def __init__(self, parent=None):
        if isinstance(parent, QWidget):
            self._font = parent.font()
        else:
            self._font = None

        QStyledItemDelegate.__init__(self, parent)
 def __init__(self, choices=None, parent=None):
     self.logger = logging.getLogger(self.__class__.__name__)
     QStyledItemDelegate.__init__(self, parent)
     self.choices = choices if (choices is not None
                                and type(choices) is list) else []
     self.logger.debug('ComboBox Delegate Choices: {}'.format(
         pformat(self.choices)))
Example #3
0
 def __init__(self, parent=None):
     QStyledItemDelegate.__init__(self, parent)
     self.factor = settings.corkSizeFactor / 100.
     self.defaultSize = QSize(300, 200)
     self.lastPos = None
     self.editing = None
     self.margin = 5
Example #4
0
 def __init__(self, parent=None):
     QStyledItemDelegate.__init__(self, parent)
     self.factor = settings.corkSizeFactor / 100.
     self.defaultSize = QSize(300, 200)
     self.lastPos = None
     self.editing = None
     self.margin = 5
Example #5
0
    def __init__(self, parent=None):
        if isinstance(parent, QWidget):
            self._font = parent.font()
        else:
            self._font = None

        QStyledItemDelegate.__init__(self, parent)
Example #6
0
    def __init__(self, parent=None):
        QStyledItemDelegate.__init__(self, parent)
        self.factor = settings.corkSizeFactor / 100.
        self.lastPos = None
        self.editing = None
        self.margin = 5

        self.bgColors = {}
Example #7
0
    def __init__(self, parent=None):
        QStyledItemDelegate.__init__(self, parent)
        self.factor = settings.corkSizeFactor / 100.
        self.lastPos = None
        self.editing = None
        self.margin = 5

        self.bgColors = {}
Example #8
0
 def __init__(self,
              min_val: float,
              max_val: float,
              step: float,
              unit: str,
              parent=None):
     QStyledItemDelegate.__init__(self, parent)
     self.min = min_val
     self.max = max_val
     self.step = step
     self.unit = " " + unit
Example #9
0
    def __init__(self, layersView, listModel, parent=None):
        QStyledItemDelegate.__init__(self, parent=parent)
        self.currentIndex = -1
        self._view = layersView
        self._w = LayerItemWidget()
        self._listModel = listModel
        self._listModel.rowsAboutToBeRemoved.connect(self.handleRemovedRows)

        # We keep a dict of all open editors for easy access.
        # Note that the LayerWidget uses persistent editors.
        # (This is for convenience of testing.)
        # This is also why we don't need to override the paint() method here.
        self._editors = {}
Example #10
0
    def __init__(self, layersView, listModel, parent=None):
        QStyledItemDelegate.__init__(self, parent=parent)
        self.currentIndex = -1
        self._view = layersView
        self._w = LayerItemWidget()
        self._listModel = listModel
        self._listModel.rowsAboutToBeRemoved.connect(self.handleRemovedRows)

        # We keep a dict of all open editors for easy access.
        # Note that the LayerWidget uses persistent editors.
        # (This is for convenience of testing.)
        # This is also why we don't need to override the paint() method here.
        self._editors = {}
Example #11
0
    def __init__(self, parentView: QTableView):
        QStyledItemDelegate.__init__(self, parentView)

        parentView.setMouseTracking(True)
        self.doc_hovered_item = QTextDocument(self)
        self.doc_hovered_item.setDocumentMargin(0)
        self.doc_not_hovered = QTextDocument(self)
        self.doc_not_hovered.setDocumentMargin(0)
        self.last_hovered_pos = QPoint(0, 0)
        self.ctx_mnu = QMenu()
        self.last_link = None
        self.last_text = None
        self.action_copy_link = self.ctx_mnu.addAction("Copy Link Location")
        self.action_copy_link.triggered.connect(self.on_action_copy_link_triggered)
        self.action_copy_text = self.ctx_mnu.addAction("Copy text")
        self.action_copy_text.triggered.connect(self.on_action_copy_text_triggered)
Example #12
0
    def __init__(self, parent=None):
        QStyledItemDelegate.__init__(self, parent)
        self.no_index = QModelIndex()
        self.hoverrow = None
        self.hover_index = None
        self.controls = []

        # We have to control if mouse is in the buttons box to add some tolerance for vertical mouse
        # misplacement around the buttons. The button box effectively overlaps upper and lower rows.
        #   row 0
        #             --------- <- tolerance zone
        #   row 1     |buttons|
        #             --------- <- tolerance zone
        #   row 2
        # button_box_extended_border_ration controls the thickness of the tolerance zone
        self.button_box = QRect()
        self.button_box_extended_border_ratio = float(0.3)
Example #13
0
    def __init__(self, parent=None):
        QStyledItemDelegate.__init__(self, parent)
        self.no_index = QModelIndex()
        self.hover_index = self.no_index
        self.controls = []
        self.column_drawing_actions = []
        self.font_metrics = None

        self.hovering_over_tag_edit_button = False

        # TODO: restore this behavior, so there is really some tolerance zone!
        # We have to control if mouse is in the buttons box to add some tolerance for vertical mouse
        # misplacement around the buttons. The button box effectively overlaps upper and lower rows.
        #   row 0
        #             --------- <- tolerance zone
        #   row 1     |buttons|
        #             --------- <- tolerance zone
        #   row 2
        # button_box_extended_border_ration controls the thickness of the tolerance zone
        self.button_box = QRect()
        self.button_box_extended_border_ratio = float(1.0)
    def __init__(self, parentView: QTableView, link_color: str = ''):
        QStyledItemDelegate.__init__(self, parentView)

        parentView.setMouseTracking(True)
        self.doc_hovered_item = QTextDocument(self)
        self.doc_hovered_item.setDocumentMargin(0)
        self.doc_not_hovered = QTextDocument(self)
        self.doc_not_hovered.setDocumentMargin(0)
        self.last_hovered_pos = QPoint(0, 0)
        self.ctx_mnu = QMenu()
        self.last_link = None
        self.last_text = None
        if not link_color:
            self.link_color = parentView.palette().color(
                QPalette.Normal,
                parentView.palette().Link).name()
        else:
            self.link_color = link_color
        self.action_copy_link = self.ctx_mnu.addAction("Copy Link Location")
        self.action_copy_link.triggered.connect(
            self.on_action_copy_link_triggered)
        self.action_copy_text = self.ctx_mnu.addAction("Copy text")
        self.action_copy_text.triggered.connect(
            self.on_action_copy_text_triggered)
Example #15
0
 def __init__(self, values: List[str], parent=None):
     QStyledItemDelegate.__init__(self, parent)
     self.values = values
     self.palette = QPalette()
     self.palette.setColor(QPalette.Text, Qt.white)
Example #16
0
 def __init__(self, parent=None):
     QStyledItemDelegate.__init__(self, parent)
 def __init__(self, mdlStatus, parent=None):
     QStyledItemDelegate.__init__(self, parent)
     self.mdlStatus = mdlStatus
Example #18
0
 def __init__(self, parent=None):
     QStyledItemDelegate.__init__(self, parent)
Example #19
0
 def __init__(self, department_list):
     QStyledItemDelegate.__init__(self)
     self.department_list = department_list
Example #20
0
 def __init__(self):
     QStyledItemDelegate.__init__(self)
Example #21
0
 def __init__(self, parent, attrs_widget):
     QStyledItemDelegate.__init__(self, parent)
     self.attrs_widget = attrs_widget
Example #22
0
 def __init__(self, choices=None, parent=None):
     QStyledItemDelegate.__init__(self, parent)
     self.choices = choices if (choices is not None
                                and type(choices) is list) else []
 def __init__(self, format="%c", parent=None):
     QStyledItemDelegate.__init__(self, parent)
     self.format = format
Example #24
0
 def __init__(self, parent, balance_is_zero):
     QStyledItemDelegate.__init__(self, parent)
     self.balance_is_zero = balance_is_zero
Example #25
0
 def __init__(_, parent):
     QStyledItemDelegate.__init__(_, parent)
 def __init__(self, text="", parent=None):
     QStyledItemDelegate.__init__(self, parent)
     self.text = text
     self._isMousePressed = False
 def __init__(self, choices=None, parent=None):
     QStyledItemDelegate.__init__(self, parent)
     self.choices = choices if (choices is not None and type(choices) is list) else []
Example #28
0
 def __init__(self, parent):
     QStyledItemDelegate.__init__(self, parent)
     self.balance_is_zero = True
     signals.on_balance_status_changed.connect(
         self.on_balance_status_changed)
Example #29
0
 def __init__(self, parent, model, added_node_list):
     QStyledItemDelegate.__init__(self, parent)
     self.added_node_list = added_node_list
     self.model = model
 def __init__(self, mdlLabels, parent=None):
     QStyledItemDelegate.__init__(self, parent)
     self.mdlLabels = mdlLabels
Example #31
0
 def __init__(self, parent, attrs_widget):
     QStyledItemDelegate.__init__(self, parent)
     self.attrs_widget = attrs_widget
 def __init__(self, parent, widget):
     QStyledItemDelegate.__init__(self, parent)
     self.widget = widget
Example #33
0
 def __init__(self, mdlPersos, parent=None):
     QStyledItemDelegate.__init__(self, parent)
     self.mdlPersos = mdlPersos
Example #34
0
 def __init__(self, parent=None):
     QStyledItemDelegate.__init__(self, parent)
     self._tooltipRowIndex = -1
Example #35
0
 def __init__(self, rootIndex=None, parent=None):
     QStyledItemDelegate.__init__(self, parent)
     self.rootIndex = rootIndex
 def __init__(self, parent, widget):
     QStyledItemDelegate.__init__(self, parent)
     self.widget = widget
Example #37
0
 def __init__(self, mdlStatus, parent=None):
     QStyledItemDelegate.__init__(self, parent)
     self.mdlStatus = mdlStatus
 def __init__(self, *args, **kwargs):
     QStyledItemDelegate.__init__(self, *args, **kwargs)
     self._display_text = True
Example #39
0
 def __init__(self, text="", parent=None):
     QStyledItemDelegate.__init__(self, parent)
     self.text = text
     self._isMousePressed = False
 def __init__(self, format="%c", parent=None):
     QStyledItemDelegate.__init__(self, parent)
     self.format = format
 def __init__(self, mdlCharacter, parent=None):
     QStyledItemDelegate.__init__(self, parent)
     self.mdlCharacter = mdlCharacter
 def __init__(self, rootIndex=None, parent=None):
     QStyledItemDelegate.__init__(self, parent)
     self.rootIndex = rootIndex
Example #43
0
 def __init__(self, thumbnails: ThumbnailStorage, parent: QObject = None):
     QStyledItemDelegate.__init__(self, parent)
     self.thumbnails = thumbnails
     self.snow_indicator = QImage(':/icons/snowflake.svg')
     self.snow_indicator = self.snow_indicator.scaledToWidth(24)
Example #44
0
 def __init__(self, mdlLabels, parent=None):
     QStyledItemDelegate.__init__(self, parent)
     self.mdlLabels = mdlLabels
Example #45
0
 def __init__(self):
     QStyledItemDelegate.__init__(self) 
     self.padding = 2
     self.AlignmentFlag =  Qt.AlignLeft
Example #46
0
 def __init__(self, parent, model, added_node_list):
     QStyledItemDelegate.__init__(self, parent)
     self.added_node_list = added_node_list
     self.model = model
Example #47
0
 def __init__(self, mdlCharacter, parent=None):
     QStyledItemDelegate.__init__(self, parent)
     self.mdlCharacter = mdlCharacter