本文整理汇总了Python中peacock.utils.WidgetUtils.loadWidget方法的典型用法代码示例。如果您正苦于以下问题:Python WidgetUtils.loadWidget方法的具体用法?Python WidgetUtils.loadWidget怎么用?Python WidgetUtils.loadWidget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类peacock.utils.WidgetUtils
的用法示例。
在下文中一共展示了WidgetUtils.loadWidget方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _callbackClipDirection
# 需要导入模块: from peacock.utils import WidgetUtils [as 别名]
# 或者: from peacock.utils.WidgetUtils import loadWidget [as 别名]
def _callbackClipDirection(self):
"""
Callback for when clip direction is altered.
"""
index = self.ClipDirection.currentIndex()
WidgetUtils.loadWidget(self.ClipSlider, self.stateKey(index), 'ClipDirection')
self.clip()
示例2: load
# 需要导入模块: from peacock.utils import WidgetUtils [as 别名]
# 或者: from peacock.utils.WidgetUtils import loadWidget [as 别名]
def load(self, key, cache, **kwargs):
"""
Load the state of the widget.
Args:
key[str]: The key to which the current settings should be stored.
cache[str|list]: A list of cache(s) that the values should be stored.
Kwargs:
passed to peacock.utils.WidgetUtils.storeWidget
"""
if not isinstance(cache, list):
cache = [cache]
for c in cache:
WidgetUtils.loadWidget(self, str(key), c, **kwargs)
示例3: load
# 需要导入模块: from peacock.utils import WidgetUtils [as 别名]
# 或者: from peacock.utils.WidgetUtils import loadWidget [as 别名]
def load(self, *args, **kwargs):
"""
Load the state of the widget.
Args:
key[str]: The key to which the current settings should be stored.
*args[list]: List of widgets to store, if not provided self is used.
Kwargs:
passed to peacock.utils.WidgetUtils.storeWidget
"""
key = kwargs.pop('key', self.stateKey())
if args:
for widget in args:
WidgetUtils.loadWidget(widget, key, **kwargs)
else:
WidgetUtils.loadWidget(self, key, **kwargs)
示例4: testLoadStore
# 需要导入模块: from peacock.utils import WidgetUtils [as 别名]
# 或者: from peacock.utils.WidgetUtils import loadWidget [as 别名]
def testLoadStore(self):
"""
Test the load/store functions.
"""
# Adjust ComboBox (Stores state of ComboBox with spin value 0)
self._box.setCurrentIndex(4)
self.assertEqual(self._box.currentText(), 'F')
# Change the SpinBox
self._spin.setValue(7)
self.assertEqual(self._spin.value(), 7)
# Adjust ComboBox (Stores state of ComboBox with spin value 7)
self._box.setCurrentIndex(1)
self.assertEqual(self._box.currentText(), 'C')
# Change SpinBox to 0 (Loads state of ComboBox with spin value 0)
self._spin.setValue(0)
self.assertEqual(self._spin.value(), 0)
self.assertEqual(self._box.currentText(), 'F')
# Change SpinBox to 7 (Loads state of ComboBox with spin value 7)
self._spin.setValue(7)
self.assertEqual(self._spin.value(), 7)
self.assertEqual(self._box.currentText(), 'C')
# Add a value to QComboBox
self._box.blockSignals(True)
self._box.clear()
for letter in 'ABCDEF':
self._box.addItem(letter)
self._box.blockSignals(False)
WidgetUtils.loadWidget(self._box, self._spin.value())
self.assertEqual(self._box.currentText(), 'C')
self._spin.setValue(0)
self.assertEqual(self._box.currentText(), 'F')
示例5: callbackBox
# 需要导入模块: from peacock.utils import WidgetUtils [as 别名]
# 或者: from peacock.utils.WidgetUtils import loadWidget [as 别名]
def callbackBox():
WidgetUtils.loadWidget(self._spin, self._box.currentText(), 'box', debug=True)
示例6: callbackSpin
# 需要导入模块: from peacock.utils import WidgetUtils [as 别名]
# 或者: from peacock.utils.WidgetUtils import loadWidget [as 别名]
def callbackSpin():
WidgetUtils.loadWidget(self._box, self._spin.value(), debug=True)