• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python icons.getQIcon函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中silx.gui.icons.getQIcon函数的典型用法代码示例。如果您正苦于以下问题:Python getQIcon函数的具体用法?Python getQIcon怎么用?Python getQIcon使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: __createTreeWindow

    def __createTreeWindow(self, treeView):
        toolbar = qt.QToolBar(self)
        toolbar.setIconSize(qt.QSize(16, 16))
        toolbar.setStyleSheet("QToolBar { border: 0px }")

        action = qt.QAction(toolbar)
        action.setIcon(icons.getQIcon("tree-expand-all"))
        action.setText("Expand all")
        action.setToolTip("Expand all selected items")
        action.triggered.connect(self.__expandAllSelected)
        action.setShortcut(qt.QKeySequence(qt.Qt.ControlModifier + qt.Qt.Key_Plus))
        toolbar.addAction(action)
        treeView.addAction(action)
        self.__expandAllAction = action

        action = qt.QAction(toolbar)
        action.setIcon(icons.getQIcon("tree-collapse-all"))
        action.setText("Collapse all")
        action.setToolTip("Collapse all selected items")
        action.triggered.connect(self.__collapseAllSelected)
        action.setShortcut(qt.QKeySequence(qt.Qt.ControlModifier + qt.Qt.Key_Minus))
        toolbar.addAction(action)
        treeView.addAction(action)
        self.__collapseAllAction = action

        widget = qt.QWidget(self)
        layout = qt.QVBoxLayout(widget)
        layout.setContentsMargins(0, 0, 0, 0)
        layout.setSpacing(0)
        layout.addWidget(toolbar)
        layout.addWidget(treeView)
        return widget
开发者ID:vallsv,项目名称:silx,代码行数:32,代码来源:Viewer.py


示例2: __init__

    def __init__(self, parent=None):
        self.__pixmap = None
        self.__positionCount = None
        self.__firstValue = 0.
        self.__secondValue = 1.
        self.__minValue = 0.
        self.__maxValue = 1.
        self.__hoverRect = qt.QRect()
        self.__hoverControl = None

        self.__focus = None
        self.__moving = None

        self.__icons = {
            'first': icons.getQIcon('previous'),
            'second': icons.getQIcon('next')
        }

        # call the super constructor AFTER defining all members that
        # are used in the "paint" method
        super(RangeSlider, self).__init__(parent)

        self.setFocusPolicy(qt.Qt.ClickFocus)
        self.setAttribute(qt.Qt.WA_Hover)

        self.setMinimumSize(qt.QSize(50, 20))
        self.setMaximumHeight(20)

        # Broadcast value changed signal
        self.sigValueChanged.connect(self.__emitPositionChanged)
开发者ID:dnaudet,项目名称:silx,代码行数:30,代码来源:RangeSlider.py


示例3: __initContent

    def __initContent(self):
        """Create all expected actions and set the content of this toolbar."""
        action = qt.QAction("Create a new custom NXdata", self)
        action.setIcon(icons.getQIcon("nxdata-create"))
        action.triggered.connect(self.__createNewNxdata)
        self.addAction(action)
        self.__addNxDataAction = action

        action = qt.QAction("Remove the selected NXdata", self)
        action.setIcon(icons.getQIcon("nxdata-remove"))
        action.triggered.connect(self.__removeSelectedNxdata)
        self.addAction(action)
        self.__removeNxDataAction = action

        self.addSeparator()

        action = qt.QAction("Create a new axis to the selected NXdata", self)
        action.setIcon(icons.getQIcon("nxdata-axis-add"))
        action.triggered.connect(self.__appendNewAxisToSelectedNxdata)
        self.addAction(action)
        self.__addNxDataAxisAction = action

        action = qt.QAction("Remove the selected NXdata axis", self)
        action.setIcon(icons.getQIcon("nxdata-axis-remove"))
        action.triggered.connect(self.__removeSelectedAxis)
        self.addAction(action)
        self.__removeNxDataAxisAction = action
开发者ID:vallsv,项目名称:silx,代码行数:27,代码来源:CustomNxdataWidget.py


示例4: testCacheReleased

 def testCacheReleased(self):
     icon1 = icons.getQIcon("crop")
     icon1_id = str(icon1.__repr__())
     icon1 = None
     # alloc another thing in case the old icon1 object is reused
     _icon3 = icons.getQIcon("colormap")
     icon2 = icons.getQIcon("crop")
     icon2_id = str(icon2.__repr__())
     self.assertNotEquals(icon1_id, icon2_id)
开发者ID:silx-kit,项目名称:silx,代码行数:9,代码来源:test_icons.py


示例5: __init__

    def __init__(self, parent=None, plot=None, title=''):
        super(_BaseProfileToolBar, self).__init__(title, parent)

        self.__profile = None
        self.__profileTitle = ''

        assert isinstance(plot, PlotWidget)
        self._plotRef = weakref.ref(
            plot, WeakMethodProxy(self.__plotDestroyed))

        self._profileWindow = None

        # Set-up interaction manager
        roiManager = RegionOfInterestManager(plot)
        self._roiManagerRef = weakref.ref(roiManager)

        roiManager.sigInteractiveModeFinished.connect(
            self.__interactionFinished)
        roiManager.sigRegionOfInterestChanged.connect(self.updateProfile)
        roiManager.sigRegionOfInterestAdded.connect(self.__roiAdded)

        # Add interactive mode actions
        for kind, icon, tooltip in (
                ('hline', 'shape-horizontal',
                 'Enables horizontal line profile selection mode'),
                ('vline', 'shape-vertical',
                 'Enables vertical line profile selection mode'),
                ('line', 'shape-diagonal',
                 'Enables line profile selection mode')):
            action = roiManager.getInteractionModeAction(kind)
            action.setIcon(icons.getQIcon(icon))
            action.setToolTip(tooltip)
            self.addAction(action)

        # Add clear action
        action = qt.QAction(icons.getQIcon('profile-clear'),
                            'Clear Profile', self)
        action.setToolTip('Clear the profile')
        action.setCheckable(False)
        action.triggered.connect(self.clearProfile)
        self.addAction(action)

        # Initialize color
        self._color = None
        self.setColor('red')

        # Listen to plot limits changed
        plot.getXAxis().sigLimitsChanged.connect(self.updateProfile)
        plot.getYAxis().sigLimitsChanged.connect(self.updateProfile)

        # Listen to plot scale
        plot.getXAxis().sigScaleChanged.connect(self.__plotAxisScaleChanged)
        plot.getYAxis().sigScaleChanged.connect(self.__plotAxisScaleChanged)

        self.setDefaultProfileWindowEnabled(True)
开发者ID:vallsv,项目名称:silx,代码行数:55,代码来源:_BaseProfileToolBar.py


示例6: __init__

        def __init__(self, parent=None):
            qt.QToolBar.__init__(self, parent)
            self.setIconSize(qt.QSize(16, 16))

            action = qt.QAction(self)
            action.setIcon(icons.getQIcon("stats-active-items"))
            action.setText("Active items only")
            action.setToolTip("Display stats for active items only.")
            action.setCheckable(True)
            action.setChecked(True)
            self.__displayActiveItems = action

            action = qt.QAction(self)
            action.setIcon(icons.getQIcon("stats-whole-items"))
            action.setText("All items")
            action.setToolTip("Display stats for all available items.")
            action.setCheckable(True)
            self.__displayWholeItems = action

            action = qt.QAction(self)
            action.setIcon(icons.getQIcon("stats-visible-data"))
            action.setText("Use the visible data range")
            action.setToolTip("Use the visible data range.<br/>"
                              "If activated the data is filtered to only use"
                              "visible data of the plot."
                              "The filtering is a data sub-sampling."
                              "No interpolation is made to fit data to"
                              "boundaries.")
            action.setCheckable(True)
            self.__useVisibleData = action

            action = qt.QAction(self)
            action.setIcon(icons.getQIcon("stats-whole-data"))
            action.setText("Use the full data range")
            action.setToolTip("Use the full data range.")
            action.setCheckable(True)
            action.setChecked(True)
            self.__useWholeData = action

            self.addAction(self.__displayWholeItems)
            self.addAction(self.__displayActiveItems)
            self.addSeparator()
            self.addAction(self.__useVisibleData)
            self.addAction(self.__useWholeData)

            self.itemSelection = qt.QActionGroup(self)
            self.itemSelection.setExclusive(True)
            self.itemSelection.addAction(self.__displayActiveItems)
            self.itemSelection.addAction(self.__displayWholeItems)

            self.dataRangeSelection = qt.QActionGroup(self)
            self.dataRangeSelection.setExclusive(True)
            self.dataRangeSelection.addAction(self.__useWholeData)
            self.dataRangeSelection.addAction(self.__useVisibleData)
开发者ID:vallsv,项目名称:silx,代码行数:54,代码来源:StatsWidget.py


示例7: _initGui

    def _initGui(self):
        qt.loadUi(pyFAI.utils.get_ui_file("calibration-experiment.ui"), self)
        icon = icons.getQIcon("pyfai:gui/icons/task-settings")
        self.setWindowIcon(icon)

        self.initNextStep()

        self._detectorLabel.setAcceptDrops(True)
        self._image.setAcceptDrops(True)
        self._mask.setAcceptDrops(True)

        self._imageLoader.setDialogTitle("Load calibration image")
        self._maskLoader.setDialogTitle("Load mask image")
        self._darkLoader.setDialogTitle("Load dark image")

        self._customDetector.clicked.connect(self.__customDetector)

        self.__plot = self.__createPlot(parent=self._imageHolder)
        self.__plot.setObjectName("plot-experiment")
        self.__plotBackground = SynchronizePlotBackground(self.__plot)

        layout = qt.QVBoxLayout(self._imageHolder)
        layout.addWidget(self.__plot)
        layout.setContentsMargins(1, 1, 1, 1)
        self._imageHolder.setLayout(layout)

        self._detectorFileDescription.setElideMode(qt.Qt.ElideMiddle)

        self._calibrant.setFileLoadable(True)
        self._calibrant.sigLoadFileRequested.connect(self.loadCalibrant)

        self.__synchronizeRawView = SynchronizeRawView()
        self.__synchronizeRawView.registerTask(self)
        self.__synchronizeRawView.registerPlot(self.__plot)
开发者ID:kif,项目名称:pyFAI,代码行数:34,代码来源:ExperimentTask.py


示例8: __createPlot

    def __createPlot(self, parent):
        plot = silx.gui.plot.PlotWidget(parent=parent)
        plot.setKeepDataAspectRatio(True)
        plot.setDataMargins(0.1, 0.1, 0.1, 0.1)
        plot.setGraphXLabel("X")
        plot.setGraphYLabel("Y")

        colormap = CalibrationContext.instance().getRawColormap()
        plot.setDefaultColormap(colormap)

        from silx.gui.plot import tools
        toolBar = tools.InteractiveModeToolBar(parent=self, plot=plot)
        plot.addToolBar(toolBar)
        toolBar = tools.ImageToolBar(parent=self, plot=plot)
        colormapDialog = CalibrationContext.instance().getColormapDialog()
        toolBar.getColormapAction().setColorDialog(colormapDialog)
        plot.addToolBar(toolBar)

        toolBar = qt.QToolBar(self)
        plot3dAction = qt.QAction(self)
        plot3dAction.setIcon(icons.getQIcon("pyfai:gui/icons/3d"))
        plot3dAction.setText("3D visualization")
        plot3dAction.setToolTip("Display a 3D visualization of the detector")
        plot3dAction.triggered.connect(self.__display3dDialog)
        toolBar.addAction(plot3dAction)
        plot.addToolBar(toolBar)

        return plot
开发者ID:kif,项目名称:pyFAI,代码行数:28,代码来源:ExperimentTask.py


示例9: __init__

 def __init__(self, parent):
     super(_Plot2dView, self).__init__(
         parent=parent,
         modeId=PLOT2D_MODE,
         label="Image",
         icon=icons.getQIcon("view-2d"))
     self.__resetZoomNextTime = True
开发者ID:vasole,项目名称:silx,代码行数:7,代码来源:DataViews.py


示例10: __init__

    def __init__(self, parent=None, maskImageWidget=None):
        """

        :param maskImageWidget: Parent SilxMaskImageWidget
        """
        qt.QToolButton.__init__(self, parent)
        self.maskImageWidget = maskImageWidget
        self.setIcon(icons.getQIcon("document-save"))
        self.clicked.connect(self._saveToolButtonSignal)
        self.setToolTip('Save Graph')

        self._saveMenu = qt.QMenu()
        self._saveMenu.addAction(
                SaveImageListAction("Image Data", self.maskImageWidget))
        self._saveMenu.addAction(
                SaveImageListAction("Colormap Clipped Seen Image Data",
                                    self.maskImageWidget, clipped=True))
        self._saveMenu.addAction(
                SaveImageListAction("Clipped and Subtracted Seen Image Data",
                                    self.maskImageWidget, clipped=True, subtract=True))
        # standard silx save action
        self._saveMenu.addAction(PlotActions.SaveAction(
                plot=self.maskImageWidget.plot, parent=self))

        if QPyMcaMatplotlibSave is not None:
            self._saveMenu.addAction(SaveMatplotlib("Matplotlib",
                                                    self.maskImageWidget))
开发者ID:maurov,项目名称:pymca,代码行数:27,代码来源:SilxMaskImageWidget.py


示例11: __init__

 def __init__(self, parent, plot3d=None):
     super(VideoAction, self).__init__(parent, plot3d)
     self.setText('Record video..')
     self.setIcon(getQIcon('camera'))
     self.setToolTip(
         'Record a video of a 360 degrees rotation of the 3D scene.')
     self.setCheckable(False)
     self.triggered[bool].connect(self._triggered)
开发者ID:dnaudet,项目名称:silx,代码行数:8,代码来源:io.py


示例12: __getNxIcon

 def __getNxIcon(self, baseIcon):
     iconHash = baseIcon.cacheKey()
     icon = self.__iconCache.get(iconHash, None)
     if icon is None:
         nxIcon = icons.getQIcon("layer-nx")
         icon = self.__createCompoundIcon(baseIcon, nxIcon)
         self.__iconCache[iconHash] = icon
     return icon
开发者ID:vallsv,项目名称:silx,代码行数:8,代码来源:NexusSortFilterProxyModel.py


示例13: toggleViewAction

    def toggleViewAction(self):
        """Returns a checkable action that shows or closes this widget.

        See :class:`QMainWindow`.
        """
        action = super(BaseMaskToolsDockWidget, self).toggleViewAction()
        action.setIcon(icons.getQIcon('image-mask'))
        action.setToolTip("Display/hide mask tools")
        return action
开发者ID:dnaudet,项目名称:silx,代码行数:9,代码来源:_BaseMaskToolsWidget.py


示例14: _warningIcon

 def _warningIcon(self):
     if self._cacheWarningIcon is None:
         icon = icons.getQIcon("pyfai:gui/icons/warning")
         pixmap = icon.pixmap(64)
         coloredIcon = qt.QIcon()
         coloredIcon.addPixmap(pixmap, qt.QIcon.Normal)
         coloredIcon.addPixmap(pixmap, qt.QIcon.Disabled)
         self._cacheWarningIcon = coloredIcon
     return self._cacheWarningIcon
开发者ID:kif,项目名称:pyFAI,代码行数:9,代码来源:AbstractCalibrationTask.py


示例15: __init__

    def __init__(self, plot, parent=None):
        # Uses two images for checked/unchecked states
        self._states = {
            False: (icons.getQIcon('plot-ydown'),
                    "Orient Y axis downward"),
            True: (icons.getQIcon('plot-yup'),
                   "Orient Y axis upward"),
        }

        icon, tooltip = self._states[plot.getYAxis().isInverted()]
        super(YAxisInvertedAction, self).__init__(
            plot,
            icon=icon,
            text='Invert Y Axis',
            tooltip=tooltip,
            triggered=self._actionTriggered,
            checkable=False,
            parent=parent)
        plot.getYAxis().sigInvertedChanged.connect(self._yAxisInvertedChanged)
开发者ID:vasole,项目名称:silx,代码行数:19,代码来源:control.py


示例16: createDefaultContextMenu

    def createDefaultContextMenu(self, index):
        """Create a default context menu at this position.

        :param qt.QModelIndex index: Index of the item
        """
        index = self.__model.index(index.row(), 0, parent=index.parent())
        item = self.__model.itemFromIndex(index)

        menu = qt.QMenu()

        weakself = weakref.proxy(self)

        if isinstance(item, _NxDataItem):
            action = qt.QAction("Add a new axis", menu)
            action.triggered.connect(lambda: weakself.model().appendAxisToNxdataItem(item))
            action.setIcon(icons.getQIcon("nxdata-axis-add"))
            action.setIconVisibleInMenu(True)
            menu.addAction(action)
            menu.addSeparator()
            action = qt.QAction("Remove this NXdata", menu)
            action.triggered.connect(lambda: weakself.model().removeNxdataItem(item))
            action.setIcon(icons.getQIcon("remove"))
            action.setIconVisibleInMenu(True)
            menu.addAction(action)
        else:
            if isinstance(item, _DatasetItemRow):
                if item.getDataset() is not None:
                    action = qt.QAction("Remove this dataset", menu)
                    action.triggered.connect(lambda: item.setDataset(None))
                    menu.addAction(action)

            if isinstance(item, _DatasetAxisItemRow):
                menu.addSeparator()
                action = qt.QAction("Remove this axis", menu)
                action.triggered.connect(lambda: weakself.model().removeAxisItem(item))
                action.setIcon(icons.getQIcon("remove"))
                action.setIconVisibleInMenu(True)
                menu.addAction(action)

        return menu
开发者ID:vallsv,项目名称:silx,代码行数:40,代码来源:CustomNxdataWidget.py


示例17: __init__

    def __init__(self, parent=None, sceneGlWindow=None):
        """

        :param QWidget parent: Parent widget
        :param SceneGLWindow sceneGlWindow: :class:`SceneGlWindow` displaying
            the data.
        """
        super(OpenAction, self).__init__(parent)
        self._sceneGlWindow = sceneGlWindow

        self.setIcon(icons.getQIcon("document-open"))
        self.setText("Load data from a file")
        self.setCheckable(False)
        self.triggered[bool].connect(self._openMenu)
开发者ID:vasole,项目名称:pymca,代码行数:14,代码来源:SilxGLWindow.py


示例18: __createPlotToolBar

    def __createPlotToolBar(self, plot):
        from silx.gui.plot import tools
        toolBar = tools.InteractiveModeToolBar(parent=self, plot=plot)
        plot.addToolBar(toolBar)
        toolBar = tools.ImageToolBar(parent=self, plot=plot)
        colormapDialog = CalibrationContext.instance().getColormapDialog()
        toolBar.getColormapAction().setColorDialog(colormapDialog)
        plot.addToolBar(toolBar)

        toolBar = qt.QToolBar(self)
        plot3dAction = qt.QAction(self)
        plot3dAction.setIcon(icons.getQIcon("pyfai:gui/icons/3d"))
        plot3dAction.setText("3D visualization")
        plot3dAction.setToolTip("Display a 3D visualization of the sample stage")
        plot3dAction.triggered.connect(self.__display3dDialog)
        toolBar.addAction(plot3dAction)
        plot.addToolBar(toolBar)
开发者ID:kif,项目名称:pyFAI,代码行数:17,代码来源:GeometryTask.py


示例19: __init__

    def __init__(self):
        qt.QWidget.__init__(self)

        self.integration_config = {}
        self.list_dataset = ListDataSet()  # Contains all datasets to be treated.

        try:
            qt.loadUi(get_ui_file(self.uif), self)
        except AttributeError as _error:
            logger.error("I looks like your installation suffers from this bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=697348")
            raise RuntimeError("Please upgrade your installation of PyQt (or apply the patch)")

        pyfaiIcon = icons.getQIcon("pyfai:gui/images/icon")
        self.setWindowIcon(pyfaiIcon)

        self.aborted = False
        self.progressBar.setValue(0)
        self.list_model = TreeModel(self, self.list_dataset.as_tree())
        self.listFiles.setModel(self.list_model)
        self.listFiles.setSelectionBehavior(qt.QAbstractItemView.SelectRows)
        self.listFiles.setSelectionMode(qt.QAbstractItemView.ExtendedSelection)
        self.create_connections()
        self.set_validator()
        self.update_number_of_frames()
        self.update_number_of_points()
        self.processing_thread = None
        self.processing_sem = threading.Semaphore()
        self.update_sem = threading.Semaphore()

        # disable some widgets:
        self.multiframe.setVisible(False)
        self.label_10.setVisible(False)
        self.frameShape.setVisible(False)
        # Online visualization
        self.fig = None
        self.axplt = None
        self.aximg = None
        self.img = None
        self.plot = None
        self.radial_data = None
        self.data_h5 = None  # one in hdf5 dataset while processing.
        self.data_np = None  # The numpy one is used only at the end.
        self.last_idx = -1
        self.slice = slice(0, -1, 1)  # Default slicing
        self._menu_file()
开发者ID:kif,项目名称:pyFAI,代码行数:45,代码来源:diffmap_widget.py


示例20: __init__

    def __init__(self, plot, icon, text, tooltip=None,
                 triggered=None, checkable=False, parent=None):
        assert plot is not None
        self._plotRef = weakref.ref(plot)

        if not isinstance(icon, qt.QIcon):
            # Try with icon as a string and load corresponding icon
            icon = icons.getQIcon(icon)

        super(PlotAction, self).__init__(icon, text, parent)

        if tooltip is not None:
            self.setToolTip(tooltip)

        self.setCheckable(checkable)

        if triggered is not None:
            self.triggered[bool].connect(triggered)
开发者ID:dnaudet,项目名称:silx,代码行数:18,代码来源:PlotAction.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python plot.PlotWidget类代码示例发布时间:2022-05-27
下一篇:
Python client.CQLClient类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap