Ejemplo n.º 1
0
 def __init__(self,parent):
      QAbstractButton.__init__(self)
      self.scaledSize = 1000
      self.setMinimumSize(24,24)
      self.setCheckable(True);
      self._onColor1= QColor(0,255,0)
      self._onColor2= QColor(0,192,0)
      self._offColor1= QColor(0,28,0)
      self._offColor2= QColor(0,128,0)
      self.show()
Ejemplo n.º 2
0
 def __init__(self, parent):
     QAbstractButton.__init__(self)
     self.scaledSize = 1000
     self.setMinimumSize(24, 24)
     self.setCheckable(True)
     self._onColor1 = QColor(0, 255, 0)
     self._onColor2 = QColor(0, 192, 0)
     self._offColor1 = QColor(0, 28, 0)
     self._offColor2 = QColor(0, 128, 0)
     self.show()
Ejemplo n.º 3
0
 def __init__(self, parent=None, size=16):
     QAbstractButton.__init__(self, parent)
     self.setCursor(Qt.ArrowCursor)
     self.setFocusPolicy(Qt.NoFocus)
     self.setToolTip(u"Clear")
     self.setVisible(False)
     self.setMinimumSize(size+2, size+2)
     pixmap = QPixmap()
     if pixmap.load(Resources.get("icons/delete.svg")):
         self.icon = pixmap.scaled(size, size, Qt.KeepAspectRatio, Qt.SmoothTransformation)
         # Use QImage because QPainter using a QPixmap does not support CompositionMode_Multiply -Dan
         image = self.icon.toImage()
         painter = QPainter(image)
         painter.setRenderHint(QPainter.Antialiasing, True)
         painter.setCompositionMode(QPainter.CompositionMode_Multiply)
         painter.drawPixmap(0, 0, self.icon)
         painter.end()
         self.icon_pressed = QPixmap(image)
     else:
         self.icon = self.icon_pressed = None
Ejemplo n.º 4
0
 def __init__(self, parent=None, size=16):
     QAbstractButton.__init__(self, parent)
     self.setCursor(Qt.ArrowCursor)
     self.setFocusPolicy(Qt.NoFocus)
     self.setToolTip(u"Clear")
     self.setVisible(False)
     self.setMinimumSize(size + 2, size + 2)
     pixmap = QPixmap()
     if pixmap.load(Resources.get("icons/delete.svg")):
         self.icon = pixmap.scaled(size, size, Qt.KeepAspectRatio,
                                   Qt.SmoothTransformation)
         # Use QImage because QPainter using a QPixmap does not support CompositionMode_Multiply -Dan
         image = self.icon.toImage()
         painter = QPainter(image)
         painter.setRenderHint(QPainter.Antialiasing, True)
         painter.setCompositionMode(QPainter.CompositionMode_Multiply)
         painter.drawPixmap(0, 0, self.icon)
         painter.end()
         self.icon_pressed = QPixmap(image)
     else:
         self.icon = self.icon_pressed = None
Ejemplo n.º 5
0
 def leaveEvent(self, event):
     if self.isEnabled():
         self.update()
     QAbstractButton.leaveEvent(self, event)
Ejemplo n.º 6
0
 def enterEvent(self, event):
     if self.isEnabled():
         self.update()
     QAbstractButton.enterEvent(self, event)
Ejemplo n.º 7
0
 def __init__(self, titlebar):
     QAbstractButton.__init__(self, titlebar)
     self.setFocusPolicy(Qt.NoFocus)
Ejemplo n.º 8
0
 def leaveEvent(self, event):
     if self.isEnabled():
         self.update()
     QAbstractButton.leaveEvent(self, event)
Ejemplo n.º 9
0
 def enterEvent(self, event):
     if self.isEnabled():
         self.update()
     QAbstractButton.enterEvent(self, event)
Ejemplo n.º 10
0
 def __init__(self, titlebar):
     QAbstractButton.__init__(self, titlebar)
     self.setFocusPolicy(Qt.NoFocus)