本文整理汇总了Python中qgis.gui.QgsSpinBox类的典型用法代码示例。如果您正苦于以下问题:Python QgsSpinBox类的具体用法?Python QgsSpinBox怎么用?Python QgsSpinBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QgsSpinBox类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createEditor
def createEditor(self, parent, options, index):
setting = index.model().data(index, Qt.UserRole)
if setting.valuetype == Setting.FOLDER:
return FileDirectorySelector(parent)
elif setting.valuetype == Setting.FILE:
return FileDirectorySelector(parent, True)
elif setting.valuetype == Setting.SELECTION:
combo = QComboBox(parent)
combo.addItems(setting.options)
return combo
elif setting.valuetype == Setting.MULTIPLE_FOLDERS:
return MultipleDirectorySelector(parent)
else:
value = self.convertValue(index.model().data(index, Qt.EditRole))
if isinstance(value, int):
spnBox = QgsSpinBox(parent)
spnBox.setRange(-999999999, 999999999)
return spnBox
elif isinstance(value, float):
spnBox = QgsDoubleSpinBox(parent)
spnBox.setRange(-999999999.999999, 999999999.999999)
spnBox.setDecimals(6)
return spnBox
elif isinstance(value, str):
return QLineEdit(parent)
示例2: QgsSpinBox
# coding: utf-8
from qgis.gui import QgsSpinBox
spin_box = QgsSpinBox()
spin_box.show()