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


Python WidgetUtils.loadWidget方法代码示例

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

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

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

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

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

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


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