本文整理汇总了Python中silx.gui.icons.getQIcon函数的典型用法代码示例。如果您正苦于以下问题:Python getQIcon函数的具体用法?Python getQIcon怎么用?Python getQIcon使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getQIcon函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
示例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)
示例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
示例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)
示例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)
示例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)
示例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)
示例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
示例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
示例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))
示例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)
示例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
示例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
示例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
示例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)