本文整理汇总了Python中symbols.icon函数的典型用法代码示例。如果您正苦于以下问题:Python icon函数的具体用法?Python icon怎么用?Python icon使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了icon函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createTimeSignatureWidget
def createTimeSignatureWidget(self):
self.timeSignatureLabel = QLabel()
self.timeSignature = QComboBox(editable=True)
icons = {"(4/4)": symbols.icon("time_c44"), "(2/2)": symbols.icon("time_c22")}
self.timeSignature.setModel(listmodel.ListModel(timeSignaturePresets, self.timeSignature, icon=icons.get))
self.timeSignature.setCompleter(None)
self.timeSignatureLabel.setBuddy(self.timeSignature)
示例2: icon
def icon(name):
"""Returns an icon if defined."""
d = get(name).variables
icon = d.get('icon')
if icon:
return icons.get(icon)
icon = d.get('symbol')
if icon:
return symbols.icon(icon)
示例3: createPickupWidget
def createPickupWidget(self):
self.pickupLabel = QLabel()
self.pickup = QComboBox()
pickups = ['']
pickups.extend(durations)
self.pickup.setModel(listmodel.ListModel(pickups, self.pickup,
display = lambda item: item or _("None"),
icon = lambda item: symbols.icon('note_{0}'.format(item.replace('.', 'd'))) if item else None))
self.pickup.view().setIconSize(QSize(22, 22))
self.pickupLabel.setBuddy(self.pickup)
示例4: createMetronomeWidget
def createMetronomeWidget(self):
self.metronomeLabel = QLabel()
self.metronomeNote = QComboBox()
self.metronomeNote.setModel(listmodel.ListModel(durations, display=None,
icon = lambda item: symbols.icon('note_{0}'.format(item.replace('.', 'd')))))
self.metronomeNote.setCurrentIndex(durations.index('4'))
self.metronomeNote.view().setIconSize(QSize(22, 22))
self.metronomeEqualSign = QLabel('=')
self.metronomeEqualSign.setFixedWidth(self.metronomeEqualSign.minimumSizeHint().width())
self.metronomeValue = QComboBox(editable=True)
self.metronomeValue.setModel(listmodel.ListModel(metronomeValues, self.metronomeValue,
display=format))
self.metronomeValue.setCompleter(None)
self.metronomeValue.setValidator(QIntValidator(0, 999, self.metronomeValue))
self.metronomeValue.setCurrentIndex(metronomeValues.index(100))
self.metronomeTempo = widgets.tempobutton.TempoButton()
self.metronomeTempo.tempo.connect(self.setMetronomeValue)
self.metronomeLabel.setBuddy(self.metronomeNote)
示例5: actionData
def actionData(self):
"""Should yield name, icon, function (may be None) for every action."""
for name, title in self.actionTexts():
yield name, symbols.icon(name), None
示例6: icon
def icon(self):
"""Should return an icon for our tab."""
return symbols.icon("spanner_phrasingslur")
示例7: actionData
def actionData(self):
self._barlines = {}
for name, ly_text, title in self.barlines():
yield name, symbols.icon(name), None
self._barlines[name] = ly_text
示例8: actionData
def actionData(self):
"""Should yield name, icon, function (may be None) for every action."""
for m in dynamic_marks:
name = 'dynamic_' + m
yield name, symbols.icon(name), None