本文整理匯總了Python中qtpy.QtWidgets.QInputDialog.getInt方法的典型用法代碼示例。如果您正苦於以下問題:Python QInputDialog.getInt方法的具體用法?Python QInputDialog.getInt怎麽用?Python QInputDialog.getInt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類qtpy.QtWidgets.QInputDialog
的用法示例。
在下文中一共展示了QInputDialog.getInt方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: change_history_depth
# 需要導入模塊: from qtpy.QtWidgets import QInputDialog [as 別名]
# 或者: from qtpy.QtWidgets.QInputDialog import getInt [as 別名]
def change_history_depth(self):
"Change history max entries" ""
depth, valid = QInputDialog.getInt(
self, _("History"), _("Maximum entries"), self.get_option("max_entries"), 10, 10000
)
if valid:
self.set_option("max_entries", depth)
示例2: change_max_line_count
# 需要導入模塊: from qtpy.QtWidgets import QInputDialog [as 別名]
# 或者: from qtpy.QtWidgets.QInputDialog import getInt [as 別名]
def change_max_line_count(self):
"Change maximum line count"""
mlc, valid = QInputDialog.getInt(self, _('Buffer'),
_('Maximum line count'),
self.get_option('max_line_count'),
0, 1000000)
if valid:
self.shell.setMaximumBlockCount(mlc)
self.set_option('max_line_count', mlc)
示例3: _add_fittable_model
# 需要導入模塊: from qtpy.QtWidgets import QInputDialog [as 別名]
# 或者: from qtpy.QtWidgets.QInputDialog import getInt [as 別名]
def _add_fittable_model(self, model_type):
if issubclass(model_type, models.Polynomial1D):
text, ok = QInputDialog.getInt(self, 'Polynomial1D',
'Enter Polynomial1D degree:')
# User decided not to create a model after all
if not ok:
return
model = model_type(int(text))
else:
model = model_type()
# Grab any user-defined regions so we may initialize parameters only
# for the selected data.
mask = self.hub.region_mask
spec = self._get_selected_plot_data_item().data_item.spectrum
# Initialize the parameters
model = initialize(model, spec.spectral_axis[mask], spec.flux[mask])
self._add_model(model)