def paintEvent(self, event): painter = QPainter(self) option = QStyleOption() option.rect = self.rect() option.state = QStyle.State_Horizontal option.palette = self.palette() self.style().drawPrimitive(QStyle.PE_IndicatorToolBarSeparator, option, painter, self)
def paintEvent(self, event): super(FilterEditor, self).paintEvent(event) if not self.text(): return option = QStyleOption() option.rect = self.glyph_rect painter = QPainter(self) style = QApplication.style() style.drawPrimitive(QStyle.PE_IndicatorTabClose, option, painter)
def paintEvent(self, pe): # Those lines are from # http://stackoverflow.com/questions/18344135/why-do-stylesheets-not-work-when-subclassing-qwidget-and-using-q-object # the big idea is : According to the Qt help files, "Every widget displaying custom content must implement the paintEvent". o = QStyleOption() o.initFrom(self) p = QPainter(self) self.style().drawPrimitive(QStyle.PE_Widget, o, p, self) w = self.minimumWidth() pen = QPen() pen.setColor(QColor(128, 128, 192)) # pen.setWidth(1) p.setPen(pen) p.drawLine(0, 0, max(0, self.width() - 1), self.height() - 1)
def paintEvent(self, event): painter = QPainter(self) option = QStyleOption() option.rect = self.rect() option.state = QStyle.State_Horizontal self.style().drawControl(QStyle.CE_ToolBar, option, painter, self)