Skip to content

Commit

Permalink
Labeling: Use Remove icon instead of drawing
Browse files Browse the repository at this point in the history
  • Loading branch information
btbest committed May 22, 2023
1 parent f177f69 commit 66952c7
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 deletions ilastik/widgets/listModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
# on the ilastik web site at:
# http://ilastik.org/license.html
###############################################################################
from PyQt5.QtGui import QColor, QPixmap, QIcon, QPainter, QPen, QImage
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import QObject, QAbstractTableModel, QItemSelectionModel, Qt, QModelIndex, pyqtSignal
from ilastik.shell.gui.iconMgr import ilastikIcons

import logging

Expand Down Expand Up @@ -221,25 +222,7 @@ def data(self, index, role):
if index.row() in self.unremovable_rows:
return

row = index.row()
pixmap = QPixmap(_NPIXELS, _NPIXELS)
pixmap.fill(Qt.transparent)
painter = QPainter()
painter.begin(pixmap)
painter.setRenderHint(QPainter.Antialiasing)
painter.setBrush(QColor("red"))
painter.drawEllipse(1, 1, _NPIXELS - 2, _NPIXELS - 2)
pen = QPen(QColor("black"))
pen.setWidth(2)
painter.setPen(pen)

x = _XSTART
y = _NPIXELS - x
painter.drawLine(x, x, y, y)
painter.drawLine(y, x, x, y)

painter.end()
icon = QIcon(pixmap)
icon = QIcon(ilastikIcons.RemSel)
return icon

def flags(self, index):
Expand Down

0 comments on commit 66952c7

Please sign in to comment.