removed unused code

This commit is contained in:
Jakub Trllo 2024-07-05 13:36:25 +02:00
parent 4bbc1e3c9a
commit 6f37ae40f6

View file

@ -183,80 +183,6 @@ class CustomPaintDelegate(QtWidgets.QStyledItemDelegate):
return icon
# class CustomPaintMultiselectComboBox(QtWidgets.QComboBox):
# def paintEvent(self, event):
# painter = QtWidgets.QStylePainter(self)
# option = QtWidgets.QStyleOptionComboBox()
# self.initStyleOption(option)
# painter.drawComplexControl(QtWidgets.QStyle.CC_ComboBox, option)
# idx = self.currentIndex()
# status_name = self.itemData(idx, self._name_role)
# if status_name is None:
# painter.drawControl(QtWidgets.QStyle.CE_ComboBoxLabel, option)
# return
#
# painter.save()
#
# status_icon = self.itemData(idx, self._icon_role)
# content_field_rect = self.style().subControlRect(
# QtWidgets.QStyle.CC_ComboBox,
# option,
# QtWidgets.QStyle.SC_ComboBoxEditField
# ).adjusted(1, 0, -1, 0)
#
# metrics = option.fontMetrics
# version_text_width = metrics.width(option.currentText) + 2
# version_text_rect = QtCore.QRect(content_field_rect)
# version_text_rect.setWidth(version_text_width)
#
# painter.drawText(
# version_text_rect,
# QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter,
# option.currentText
# )
#
# status_text_rect = QtCore.QRect(content_field_rect)
# status_text_rect.setLeft(version_text_rect.right() + 2)
# if status_icon is not None and not status_icon.isNull():
# icon_rect = QtCore.QRect(status_text_rect)
# diff = icon_rect.height() - metrics.height()
# if diff < 0:
# diff = 0
# top_offset = diff // 2
# bottom_offset = diff - top_offset
# icon_rect.adjust(0, top_offset, 0, -bottom_offset)
# icon_rect.setWidth(metrics.height())
# status_icon.paint(
# painter,
# icon_rect,
# QtCore.Qt.AlignCenter,
# QtGui.QIcon.Normal,
# QtGui.QIcon.On
# )
# status_text_rect.setLeft(icon_rect.right() + 2)
#
# if status_text_rect.width() <= 0:
# return
#
# if status_text_rect.width() < metrics.width(status_name):
# status_name = self.itemData(idx, self._short_name_role)
# if status_text_rect.width() < metrics.width(status_name):
# status_name = ""
#
# color = QtGui.QColor(self.itemData(idx, self._text_color_role))
#
# pen = painter.pen()
# pen.setColor(color)
# painter.setPen(pen)
# painter.drawText(
# status_text_rect,
# QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter,
# status_name
# )
# painter.restore()
# painter.end()
class CustomPaintMultiselectComboBox(QtWidgets.QComboBox):
value_changed = QtCore.Signal()
focused_in = QtCore.Signal()