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


Python WidgetUtils.createIcon方法代码示例

本文整理汇总了Python中peacock.utils.WidgetUtils.createIcon方法的典型用法代码示例。如果您正苦于以下问题:Python WidgetUtils.createIcon方法的具体用法?Python WidgetUtils.createIcon怎么用?Python WidgetUtils.createIcon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在peacock.utils.WidgetUtils的用法示例。


在下文中一共展示了WidgetUtils.createIcon方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __addButton

# 需要导入模块: from peacock.utils import WidgetUtils [as 别名]
# 或者: from peacock.utils.WidgetUtils import createIcon [as 别名]
 def __addButton(self, name, tooltip, icon):
     qobject = QtWidgets.QPushButton(self)
     qobject.setToolTip(tooltip)
     qobject.clicked.connect(getattr(self, '_callback' + name))
     qobject.setIcon(WidgetUtils.createIcon(icon))
     qobject.setIconSize(self._icon_size)
     qobject.setFixedSize(qobject.iconSize())
     qobject.setStyleSheet("QPushButton {border:none}")
     self.ButtonLayout.addWidget(qobject)
     setattr(self, name, qobject)
开发者ID:huangh-inl,项目名称:moose,代码行数:12,代码来源:MediaControlWidgetBase.py

示例2: _callbackHideButton

# 需要导入模块: from peacock.utils import WidgetUtils [as 别名]
# 或者: from peacock.utils.WidgetUtils import createIcon [as 别名]
    def _callbackHideButton(self):
        """
        Toggles the collapsible content.
        """
        self._collapsed = not self._collapsed
        self._collapsible_widget.setHidden(self._collapsed)
#        PeacockCollapsibleWidget.toggleCollapsed(self._collapsible_layout, self._collapsed)

        name = 'plus.svg' if self._collapsed else 'minus.svg'
        self._collapse_button.setIcon(WidgetUtils.createIcon(name))
开发者ID:FHilty,项目名称:moose,代码行数:12,代码来源:PeacockCollapsibleWidget.py

示例3: _setupPNGButton

# 需要导入模块: from peacock.utils import WidgetUtils [as 别名]
# 或者: from peacock.utils.WidgetUtils import createIcon [as 别名]
 def _setupPNGButton(self, qobject):
     """
     Setup method png image output.
     """
     qobject.clicked.connect(self._callbackPNGButton)
     qobject.setIcon(WidgetUtils.createIcon('png.svg'))
     qobject.setIconSize(self._icon_size)
     qobject.setFixedSize(qobject.iconSize())
     qobject.setToolTip("Create a png file of the current figure.")
     qobject.setStyleSheet("QPushButton {border:none}")
开发者ID:aeslaughter,项目名称:moose,代码行数:12,代码来源:OutputWidgetBase.py

示例4: _setupPythonButton

# 需要导入模块: from peacock.utils import WidgetUtils [as 别名]
# 或者: from peacock.utils.WidgetUtils import createIcon [as 别名]
 def _setupPythonButton(self, qobject):
     """
     Setup method for python script output button.
     """
     qobject.clicked.connect(self._callbackPythonButton)
     qobject.setIcon(WidgetUtils.createIcon('py.svg'))
     qobject.setIconSize(self._icon_size)
     qobject.setFixedSize(qobject.iconSize())
     qobject.setToolTip("Create python script to reproduce this figure.")
     qobject.setStyleSheet("QPushButton {border:none}")
开发者ID:aeslaughter,项目名称:moose,代码行数:12,代码来源:OutputWidgetBase.py

示例5: _setupLiveScriptButton

# 需要导入模块: from peacock.utils import WidgetUtils [as 别名]
# 或者: from peacock.utils.WidgetUtils import createIcon [as 别名]
 def _setupLiveScriptButton(self, qobject):
     """
     Setup method png image output.
     """
     qobject.clicked.connect(self._callbackLiveScriptButton)
     qobject.setIcon(WidgetUtils.createIcon('script.svg'))
     qobject.setIconSize(self._icon_size)
     qobject.setFixedSize(qobject.iconSize())
     qobject.setToolTip("Show the current python script.")
     qobject.setStyleSheet("QPushButton {border:none}")
开发者ID:aeslaughter,项目名称:moose,代码行数:12,代码来源:OutputWidgetBase.py

示例6: __init__

# 需要导入模块: from peacock.utils import WidgetUtils [as 别名]
# 或者: from peacock.utils.WidgetUtils import createIcon [as 别名]
    def __init__(self):
        super(ViewerCornerWidget, self).__init__()

        self._icon_size = QtCore.QSize(24, 24)

        self.MainLayout = QtWidgets.QHBoxLayout()
        self.MainLayout.setContentsMargins(0, 0, 0, 0)
        self.MainLayout.setSpacing(10)
        self.setLayout(self.MainLayout)

        self.CloseButton = QtWidgets.QPushButton(WidgetUtils.createIcon('close.ico'), 'Close')
        self.CloneButton = QtWidgets.QPushButton(WidgetUtils.createIcon('copy.ico'), 'Clone')

        #self.MainLayout.addStretch()
        self.MainLayout.addWidget(self.CloneButton)
        self.MainLayout.addWidget(self.CloseButton)

        self.setup()
        self.adjustSize()
开发者ID:FHilty,项目名称:moose,代码行数:21,代码来源:ViewerCornerWidget.py

示例7: _setupLiveTableButton

# 需要导入模块: from peacock.utils import WidgetUtils [as 别名]
# 或者: from peacock.utils.WidgetUtils import createIcon [as 别名]
 def _setupLiveTableButton(self, qobject):
     """
     Setup method for python script output button.
     """
     qobject.clicked.connect(self._callbackLiveTableButton)
     qobject.setIcon(WidgetUtils.createIcon('table.svg'))
     qobject.setIconSize(self._icon_size)
     qobject.setFixedSize(qobject.iconSize())
     qobject.setToolTip("Show a table of the CSV data for each open file.")
     qobject.setStyleSheet("QPushButton {border:none}")
开发者ID:FHilty,项目名称:moose,代码行数:12,代码来源:OutputPlugin.py


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