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


Python WidgetUtils.storeWidget方法代码示例

本文整理汇总了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()
开发者ID:aeslaughter,项目名称:moose,代码行数:9,代码来源:ClipPlugin.py

示例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)
开发者ID:huangh-inl,项目名称:moose,代码行数:18,代码来源:MooseWidget.py

示例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)
开发者ID:FHilty,项目名称:moose,代码行数:20,代码来源:MooseWidget.py

示例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)
开发者ID:aeslaughter,项目名称:moose,代码行数:24,代码来源:ClipPlugin.py

示例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)
开发者ID:aeslaughter,项目名称:moose,代码行数:4,代码来源:test_StoreLoadWidgetState.py

示例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)
开发者ID:FHilty,项目名称:moose,代码行数:4,代码来源:test_StoreLoadWidgetState.py


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