本文整理汇总了Python中PyQt5.Qt.QSpinBox.setSuffix方法的典型用法代码示例。如果您正苦于以下问题:Python QSpinBox.setSuffix方法的具体用法?Python QSpinBox.setSuffix怎么用?Python QSpinBox.setSuffix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.Qt.QSpinBox
的用法示例。
在下文中一共展示了QSpinBox.setSuffix方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createEditor
# 需要导入模块: from PyQt5.Qt import QSpinBox [as 别名]
# 或者: from PyQt5.Qt.QSpinBox import setSuffix [as 别名]
def createEditor(self, parent, option, index):
sb = QSpinBox(parent)
sb.setMinimum(0)
sb.setMaximum(5)
sb.setSuffix(' ' + _('stars'))
sb.setSpecialValueText(_('Not rated'))
return sb
示例2: createEditor
# 需要导入模块: from PyQt5.Qt import QSpinBox [as 别名]
# 或者: from PyQt5.Qt.QSpinBox import setSuffix [as 别名]
def createEditor(self, parent, option, index):
sb = QSpinBox(parent)
sb.setMinimum(0)
sb.setMaximum(5)
sb.setSuffix(' ' + _('stars'))
return sb
示例3: create_sz
# 需要导入模块: from PyQt5.Qt import QSpinBox [as 别名]
# 或者: from PyQt5.Qt.QSpinBox import setSuffix [as 别名]
def create_sz(label):
ans = QSpinBox(self)
ans.setSuffix(' px'), ans.setMinimum(100), ans.setMaximum(10000)
l.addRow(label, ans)
ans.valueChanged.connect(self.changed_timer.start)
return ans
示例4: __init__
# 需要导入模块: from PyQt5.Qt import QSpinBox [as 别名]
# 或者: from PyQt5.Qt.QSpinBox import setSuffix [as 别名]
#.........这里部分代码省略.........
sp.la = la = QLabel('<p>' + msg)
la.setWordWrap(True)
l.addWidget(la)
self.styles_list = sl = QListWidget(sp)
l.addWidget(sl)
self.style_map = OrderedDict()
self.font_page = fp = QWidget(st)
st.addTab(fp, _('&Fonts and Sizes'))
fp.l = l = QFormLayout()
fp.setLayout(l)
fp.f = []
def add_hline():
f = QFrame()
fp.f.append(f)
f.setFrameShape(f.HLine)
l.addRow(f)
for x, label, size_label in (
('title', _('&Title font family:'), _('&Title font size:')),
('subtitle', _('&Subtitle font family'),
_('&Subtitle font size:')),
('footer', _('&Footer font family'), _('&Footer font size')),
):
attr = '%s_font_family' % x
ff = FontFamilyChooser(fp)
setattr(self, attr, ff)
l.addRow(label, ff)
ff.family_changed.connect(self.emit_changed)
attr = '%s_font_size' % x
fs = QSpinBox(fp)
setattr(self, attr, fs)
fs.setMinimum(8), fs.setMaximum(200), fs.setSuffix(' px')
fs.setValue(prefs[attr])
fs.valueChanged.connect(self.emit_changed)
l.addRow(size_label, fs)
add_hline()
self.changed_timer = t = QTimer(self)
t.setSingleShot(True), t.setInterval(500), t.timeout.connect(
self.emit_changed)
def create_sz(label):
ans = QSpinBox(self)
ans.setSuffix(' px'), ans.setMinimum(100), ans.setMaximum(10000)
l.addRow(label, ans)
ans.valueChanged.connect(self.changed_timer.start)
return ans
self.cover_width = create_sz(_('Cover &width:'))
self.cover_height = create_sz(_('Cover &height:'))
fp.cla = la = QLabel(
_('Note that the preview to the side is of fixed aspect ratio, so changing the cover'
' width above will not have any effect. If you change the height, you should also change the width nevertheless'
' as it will be used in actual cover generation.'))
la.setWordWrap(True)
l.addRow(la)
self.templates_page = tp = QWidget(st)
st.addTab(tp, _('&Text'))
tp.l = l = QVBoxLayout()
tp.setLayout(l)
tp.la = la = QLabel(
_('The text on the generated cover is taken from the metadata of the book.'
' This is controlled via templates. You can use the <b>, <i> and <br> tags'
' in the templates for bold, italic and line breaks, respectively. The'