def paintEvent(self, event): super().paintEvent(event) painter = QStylePainter(self) opt = QStyleOptionFrame() opt.initFrom(self) painter.drawPrimitive(QStyle.PE_FrameDockWidget, opt) painter.end()
def paintEvent(self, event): super().paintEvent(event) painter = QStylePainter(self) opt = QStyleOptionFrame() opt.initFrom(self) painter.drawPrimitive(QStyle.PE_FrameDockWidget, opt) painter.end()
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()
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()
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)
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)