当前位置: 首页>>代码示例>>Python>>正文


Python gui.QgsSpinBox类代码示例

本文整理汇总了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)
开发者ID:mj10777,项目名称:QGIS,代码行数:25,代码来源:ConfigDialog.py

示例2: QgsSpinBox

# coding: utf-8
from qgis.gui import QgsSpinBox

spin_box = QgsSpinBox()

spin_box.show()
开发者ID:GEO-IASS,项目名称:pyqgis-samples,代码行数:6,代码来源:qgis-sample-QgsSpinBox.py


注:本文中的qgis.gui.QgsSpinBox类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。