本文整理汇总了Python中peacock.utils.WidgetUtils.storeWidget方法的典型用法代码示例。如果您正苦于以下问题:Python WidgetUtils.storeWidget方法的具体用法?Python WidgetUtils.storeWidget怎么用?Python WidgetUtils.storeWidget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类peacock.utils.WidgetUtils
的用法示例。
在下文中一共展示了WidgetUtils.storeWidget方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _callbackClipSlider
# 需要导入模块: from peacock.utils import WidgetUtils [as 别名]
# 或者: from peacock.utils.WidgetUtils import storeWidget [as 别名]
def _callbackClipSlider(self, value):
"""
Callback for slider.
"""
index = self.ClipDirection.currentIndex()
WidgetUtils.storeWidget(self.ClipSlider, self.stateKey(index), 'ClipDirection')
self.clip()
示例2: store
# 需要导入模块: from peacock.utils import WidgetUtils [as 别名]
# 或者: from peacock.utils.WidgetUtils import storeWidget [as 别名]
def store(self, key, cache, **kwargs):
"""
Store the widget state.
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.storeWidget(self, str(key), c, **kwargs)
示例3: store
# 需要导入模块: from peacock.utils import WidgetUtils [as 别名]
# 或者: from peacock.utils.WidgetUtils import storeWidget [as 别名]
def store(self, *args, **kwargs):
"""
Store the widget state.
Args:
*args[list]: List of widgets to store, if not provided self is used.
Kwargs:
passed to peacock.utils.WidgetUtils.storeWidget
"""
self.blockSignals(True)
key = kwargs.pop('key', self.stateKey())
if args:
for widget in args:
WidgetUtils.storeWidget(widget, key, **kwargs)
else:
WidgetUtils.storeWidget(self, key, **kwargs)
self.blockSignals(False)
示例4: _setupClipSlider
# 需要导入模块: from peacock.utils import WidgetUtils [as 别名]
# 或者: from peacock.utils.WidgetUtils import storeWidget [as 别名]
def _setupClipSlider(self, qobject):
"""
Setup method for clip origin selection.
"""
qobject.setOrientation(QtCore.Qt.Horizontal)
qobject.setRange(0, self._increments)
qobject.setSliderPosition(self._increments/2)
qobject.setProperty('cache', ['ClipDirection'])
qobject.valueChanged.connect(self._callbackClipSlider)
# Store the initial state of the slide for index 0, why?
#
# Perform the following:
# (1) Clipping enabled
# (2) Change the axis to 'y'
# (3) Move the slider
# (4) Change the axis back to 'x'
#
# Without this 'x' would be at the 'y' position instead of at the midpoint.
qobject.setEnabled(True)
WidgetUtils.storeWidget(qobject, self.stateKey(0), 'ClipDirection')
qobject.setEnabled(False)
示例5: callbackSpin
# 需要导入模块: from peacock.utils import WidgetUtils [as 别名]
# 或者: from peacock.utils.WidgetUtils import storeWidget [as 别名]
def callbackSpin():
WidgetUtils.storeWidget(self._spin, self._box.currentText(), 'box', debug=True)
示例6: callbackBox
# 需要导入模块: from peacock.utils import WidgetUtils [as 别名]
# 或者: from peacock.utils.WidgetUtils import storeWidget [as 别名]
def callbackBox():
WidgetUtils.storeWidget(self._box, self._spin.value(), debug=True)