예제 #1
0
 def paintEvent(self, event):
     ptr = FlowBoardPainter(self)
     ptr.fillBackground()
     if self.checkState() == Qt.Checked:
         ptr.setPen(QPen(QColor(255, 255, 255), 2, Qt.DotLine))
         ptr.drawRect(self.rect().adjusted(1, 1, -1, -1))
     iconrect = self.rect().adjusted(2, 2, -2, -2)
     ptr.drawImage(iconrect.topLeft(), self._tool.getIcon(iconrect.size()))
     ptr.end()
예제 #2
0
 def paintEvent(self, event):
     super(FlowSolverWidget, self).paintEvent(event)
     ptr = FlowBoardPainter(self)
     ptr.fillBackground()
     if self._board:
         if self._solver and self._solver.solved:
             ptr.drawFlowHighlights(self._grid, self._solver)
         ptr.drawGrid(self._grid)
         ptr.drawBoardFeatures(self._grid, self._board)
         if self._solver:
             ptr.drawFlows(self._grid, self._solver)
     ptr.end()
예제 #3
0
 def paintEvent(self, event):
     ptr = FlowBoardPainter(self)
     ptr.fillBackground()
     ptr.end()
     super(FlowToolChooser, self).paintEvent(event)
예제 #4
0
 def _makeIcon(self, size):
     img = FlowTool._emptyIcon(size)
     ptr = FlowBoardPainter(img)
     ptr.drawBlock(img.rect())
     ptr.end()
     return img
예제 #5
0
 def _makeIcon(self, size):
     img = FlowTool._emptyIcon(size)
     ptr = FlowBoardPainter(img)
     ptr.drawEndpoint(img.rect(), self.endpointKey, scale=1)
     ptr.end()
     return img
예제 #6
0
 def _emptyIcon(size):
     img = QImage(size, QImage.Format_ARGB32_Premultiplied)
     ptr = FlowBoardPainter(img)
     ptr.fillBackground()
     ptr.end()
     return img