Exemplo n.º 1
0
 def paintEvent(self, event):
     super().paintEvent(event)
     painter = QStylePainter(self)
     opt = QStyleOptionFrame()
     opt.initFrom(self)
     painter.drawPrimitive(QStyle.PE_FrameDockWidget, opt)
     painter.end()
Exemplo n.º 2
0
 def paintEvent(self, event):
     super().paintEvent(event)
     painter = QStylePainter(self)
     opt = QStyleOptionFrame()
     opt.initFrom(self)
     painter.drawPrimitive(QStyle.PE_FrameDockWidget, opt)
     painter.end()
Exemplo n.º 3
0
 def paintEvent(self, event):
     painter = QStylePainter(self)
     opt = QStyleOption()
     opt.initFrom(self)
     painter.drawPrimitive(QStyle.PE_Widget, opt)
     if not self.__icon.isNull():
         rect = self.contentsRect()
         if opt.state & QStyle.State_Active:
             mode = QIcon.Active
         else:
             mode = QIcon.Disabled
         self.__icon.paint(painter, rect, Qt.AlignCenter, mode, QIcon.Off)
     painter.end()
Exemplo n.º 4
0
 def paintEvent(self, event):
     painter = QStylePainter(self)
     opt = QStyleOption()
     opt.initFrom(self)
     painter.drawPrimitive(QStyle.PE_Widget, opt)
     if not self.__icon.isNull():
         rect = self.contentsRect()
         if opt.state & QStyle.State_Active:
             mode = QIcon.Active
         else:
             mode = QIcon.Disabled
         self.__icon.paint(painter, rect, Qt.AlignCenter, mode, QIcon.Off)
     painter.end()
Exemplo n.º 5
0
    def paintEvent(self, event):
        painter = QStylePainter(self)
        option = QStyleOptionButton()
        option.initFrom(self)
        option.text = ""
        option.icon = self.icon()
        option.iconSize = self.iconSize()
        option.features = QStyleOptionButton.Flat
        if self.isDown():
            option.state |= QStyle.State_Sunken
            painter.drawPrimitive(QStyle.PE_PanelButtonBevel, option)

        if not option.icon.isNull():
            if option.state & QStyle.State_Active:
                mode = (QIcon.Active if option.state & QStyle.State_MouseOver
                        else QIcon.Normal)
            else:
                mode = QIcon.Disabled
            if self.isChecked():
                state = QIcon.On
            else:
                state = QIcon.Off
            option.icon.paint(painter, option.rect, Qt.AlignCenter, mode, state)
Exemplo n.º 6
0
    def paintEvent(self, event):
        painter = QStylePainter(self)
        option = QStyleOptionButton()
        option.initFrom(self)
        option.text = ""
        option.icon = self.icon()
        option.iconSize = self.iconSize()
        option.features = QStyleOptionButton.Flat
        if self.isDown():
            option.state |= QStyle.State_Sunken
            painter.drawPrimitive(QStyle.PE_PanelButtonBevel, option)

        if not option.icon.isNull():
            if option.state & QStyle.State_Active:
                mode = (QIcon.Active if option.state
                        & QStyle.State_MouseOver else QIcon.Normal)
            else:
                mode = QIcon.Disabled
            if self.isChecked():
                state = QIcon.On
            else:
                state = QIcon.Off
            option.icon.paint(painter, option.rect, Qt.AlignCenter, mode,
                              state)