Пример #1
0
 def paintEvent(self, e):
     cr = self.contentsRect()
     painter = QPainter(self)
     painter.setClipRegion(e.region())
     if self.__data.isDown:
         qDrawWinButton(painter, 0, 0, self.width(), self.height(),
                        self.palette(), True)
     painter.save()
     if self.__data.isDown:
         shiftSize = buttonShift(self)
         painter.translate(shiftSize.width(), shiftSize.height())
     painter.setClipRect(cr)
     self.drawContents(painter)
     if not self.__data.icon.isNull():
         iconRect = QRect(cr)
         iconRect.setX(iconRect.x() + self.margin())
         if self.__data.itemMode != QwtLegendData.ReadOnly:
             iconRect.setX(iconRect.x() + BUTTONFRAME)
         iconRect.setSize(self.__data.icon.size())
         iconRect.moveCenter(QPoint(iconRect.center().x(), cr.center().y()))
         painter.drawPixmap(iconRect, self.__data.icon)
     painter.restore()
Пример #2
0
 def paintEvent(self, e):
     cr = self.contentsRect()
     painter = QPainter(self)
     painter.setClipRegion(e.region())
     if self.__data.isDown:
         qDrawWinButton(painter, 0, 0, self.width(), self.height(),
                        self.palette(), True)
     painter.save()
     if self.__data.isDown:
         shiftSize = buttonShift(self)
         painter.translate(shiftSize.width(), shiftSize.height())
     painter.setClipRect(cr)
     self.drawContents(painter)
     if not self.__data.icon.isNull():
         iconRect = QRect(cr)
         iconRect.setX(iconRect.x()+self.margin())
         if self.__data.itemMode != QwtLegendData.ReadOnly:
             iconRect.setX(iconRect.x()+BUTTONFRAME)
         iconRect.setSize(self.__data.icon.size())
         iconRect.moveCenter(QPoint(iconRect.center().x(),
                                    cr.center().y()))
         painter.drawPixmap(iconRect, self.__data.icon)
     painter.restore()
Пример #3
0
 def paintEvent(self, event):
     QFrame.paintEvent(self, event)
     painter = QPainter(self)
     painter.setClipRect(self.contentsRect())
     self.drawContents(painter)
Пример #4
0
 def paintEvent(self, event):
     QFrame.paintEvent(self,event)
     painter = QPainter(self)
     painter.setClipRect(self.contentsRect())
     self.drawContents(painter)