本文整理汇总了Python中PyQt5.QtGui.QBrush.style方法的典型用法代码示例。如果您正苦于以下问题:Python QBrush.style方法的具体用法?Python QBrush.style怎么用?Python QBrush.style使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtGui.QBrush
的用法示例。
在下文中一共展示了QBrush.style方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: BrushFormation
# 需要导入模块: from PyQt5.QtGui import QBrush [as 别名]
# 或者: from PyQt5.QtGui.QBrush import style [as 别名]
class BrushFormation(InstrumentFormation):
''' Specialize to Qt <QBrush> '''
def __init__(self, parentSelector, role=""):
InstrumentFormation.__init__(self, name="Brush", parentSelector=parentSelector, role=role)
self.instrument = QBrush()
self.styleProperties=[BaseStyleProperty("Color", self.instrument.setColor, self.selector,
resettableValueFactory=ResettableColorValue,
layoutFactory=ColorStylePropertyLayout,
default=self.instrument.color()),
BaseStyleProperty("Style", # Was Pattern
self.instrument.setStyle, self.selector,
default=self.instrument.style(),
# ResettableIntValue defaults and works
layoutFactory=ComboBoxStylePropertyLayout,
domainModel = config.BrushModel),]
'''
sic, BrushPattern is called Style in Qt
Need Pattern, since defaults to NoBrush and that means color is moot.
If we just have Color, once it is set, no way to go back to unfilled.
TODO: user friendly: if user chooses color, ensure pattern is not NoBrush
'''
# TODO gradients and texture not working?
def applyTo(self, morph):
#print "setBrush on morph", self.instrument.color()
# Morph knows it's scale and applies it to self instrument
morph.scaleInstrument(self.instrument) # No baseValue, defaults to 1
# Tell Morph to use self.instrument to draw itself
morph.setBrush(self.instrument)
"""