ccpn.ui.gui.widgets package

Submodules

ccpn.ui.gui.widgets.Action module

Module Documentation here

class ccpn.ui.gui.widgets.Action.Action(parent, text, callback=None, shortcut=None, checked=True, checkable=False, icon=None, translate=True, enabled=True, toolTip=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Base.Base, PyQt5.QtWidgets.QAction

ccpn.ui.gui.widgets.Application module

Module Documentation here

class ccpn.ui.gui.widgets.Application.Application(applicationName, applicationVersion, organizationName='CCPN', organizationDomain='ccpn.ac.uk')[source]

Bases: PyQt5.QtWidgets.QApplication

runFunctionOnThread(func)[source]
runFunctionOnThreadAtIdle(func)[source]
start()[source]
class ccpn.ui.gui.widgets.Application.TestApplication[source]

Bases: ccpn.ui.gui.widgets.Application.Application

ccpn.ui.gui.widgets.Application.newTestApplication(projectPath=None, useTestProjects=False, nologging=False, interface='NoUi', debug=True, noApplication=False)[source]

Create a full application for testing. This will contain an empty project and preferences.

If interface is specified as ‘NoUi’ no mainWindow will be created, but a full application and project will be created.

if interface is specified as ‘Gui’ a mainWindow will be created, but the event execution loop will not be started.

Popups can be instantiated with exec_ which will automatically show the mainWindow.

The mainWindow can be instantiated manually with app.start(); however, any code after this cannot be guaranteed to run after closing mainWindow.

Set noApplication=True for a basic test that only creates a QApplication; a Ccpn application will not be created.

Parameters
  • projectPath – str or Path object, path of project to load on startup

  • useTestProjects – bool, True uses the Ccpn testing folder as the root for the project to load

  • nologging – bool, enable or disable lopgging

  • interface – ‘NoUi’ or ‘Gui’, determines whether mainWindow is created

  • debug – bool, enable/disable debugging

  • noApplication – bool, enable/disable creation of CCpn application

Returns

instance of new application

ccpn.ui.gui.widgets.Arrow module

Module Documentation here

class ccpn.ui.gui.widgets.Arrow.Arrow(pos=None, angle=90, pen=None, movable=False, bounds=None)[source]

Bases: pyqtgraph.graphicsItems.ArrowItem.ArrowItem

mouseClickEvent(ev)[source]
mouseDragEvent(ev)[source]
setMovable(m)[source]

Set whether the line is movable by the user.

setPen(pen)[source]

Set the pen for drawing the line. Allowable arguments are any that are valid for mkPen.

sigDragged
sigPositionChangeFinished
sigPositionChanged

ccpn.ui.gui.widgets.BalloonMetrics module

class ccpn.ui.gui.widgets.BalloonMetrics.Axis(value)[source]

Bases: enum.IntEnum

An enumeration.

X = 0
Y = 1
class ccpn.ui.gui.widgets.BalloonMetrics.BalloonMetrics(corner_radius=3, pointer_side=Side.RIGHT, pointer_height=10, pointer_width=20)[source]

Bases: object

property body_rect

- None, immutable -

property body_rect_viewport

- None, immutable -

from_inner(rect: PyQt5.QtCore.QRect)[source]
from_outer(rect: PyQt5.QtCore.QRect)[source]
property inner

- None, immutable -

property inner_viewport

- None, immutable -

property outer

- None, immutable -

property outer_viewport

- None, immutable -

property pointer

- None, immutable -

property pointer_rect

- None, immutable -

property pointer_viewport

- None, immutable -

reset()[source]
exception ccpn.ui.gui.widgets.BalloonMetrics.InvalidStateError[source]

Bases: ValueError

class ccpn.ui.gui.widgets.BalloonMetrics.Pointer(left, top, bottom)[source]

Bases: tuple

class POINTS(value)[source]

Bases: enum.IntEnum

An enumeration.

LEFT = 0
RIGHT = 2
TOP = 1
bottom: PyQt5.QtCore.QPoint

Alias for field number 2

left: PyQt5.QtCore.QPoint

Alias for field number 0

top: PyQt5.QtCore.QPoint

Alias for field number 1

class ccpn.ui.gui.widgets.BalloonMetrics.Side(value)[source]

Bases: enum.IntEnum

An enumeration.

BOTTOM = 3
LEFT = 0
RIGHT = 2
TOP = 1
class ccpn.ui.gui.widgets.BalloonMetrics.SubscriptableQPoint(target)[source]

Bases: object

ccpn.ui.gui.widgets.BalloonMetrics.calc_side_distance_outside_rect(test_rect: PyQt5.QtCore.QRect, target_rect: PyQt5.QtCore.QRect)[source]
ccpn.ui.gui.widgets.BalloonMetrics.display_rect(rect, name='')[source]
ccpn.ui.gui.widgets.BalloonMetrics.new_rect_lefttop_rightbottom(left_top, right_bottom)[source]
ccpn.ui.gui.widgets.BalloonMetrics.new_rect_xleftytop_xrightybottom(xleft, ytop, xright, ybottom)[source]
ccpn.ui.gui.widgets.BalloonMetrics.rect_bottom(rect: PyQt5.QtCore.QRect)[source]
ccpn.ui.gui.widgets.BalloonMetrics.rect_bottom_right(rect: PyQt5.QtCore.QRect)[source]
ccpn.ui.gui.widgets.BalloonMetrics.rect_get_side(rect: PyQt5.QtCore.QRect, side: ccpn.ui.gui.widgets.BalloonMetrics.Side) int[source]
ccpn.ui.gui.widgets.BalloonMetrics.rect_right(rect: PyQt5.QtCore.QRect)[source]
ccpn.ui.gui.widgets.BalloonMetrics.test_body_rect()[source]
ccpn.ui.gui.widgets.BalloonMetrics.test_expand()[source]
ccpn.ui.gui.widgets.BalloonMetrics.test_expand_sides()[source]
ccpn.ui.gui.widgets.BalloonMetrics.test_find_side_outside_rect_offset()[source]
ccpn.ui.gui.widgets.BalloonMetrics.test_inners_from_outer()[source]
ccpn.ui.gui.widgets.BalloonMetrics.test_override_offset()[source]
ccpn.ui.gui.widgets.BalloonMetrics.test_pointer_position()[source]
ccpn.ui.gui.widgets.BalloonMetrics.test_pointer_positions()[source]
ccpn.ui.gui.widgets.BalloonMetrics.test_pointer_rects_from_outer()[source]
ccpn.ui.gui.widgets.BalloonMetrics.test_rects_from_outer()[source]
ccpn.ui.gui.widgets.BalloonMetrics.test_reduce()[source]
ccpn.ui.gui.widgets.BalloonMetrics.test_reset()[source]
ccpn.ui.gui.widgets.BalloonMetrics.test_viewport_views()[source]

ccpn.ui.gui.widgets.BarGraph module

Module Documentation Here

class ccpn.ui.gui.widgets.BarGraph.BarGraph(application=None, viewBox=None, xValues=None, yValues=None, objects=None, brush=None, drawLabels=True, labelDistanceRatio=0.1, **kwds)[source]

Bases: pyqtgraph.graphicsItems.BarGraphItem.BarGraphItem

drawLabels(ratio=0.5)[source]

The label Text is the str of the x values and is used to find and set an object to it. NB, changing the text to any other str may not set the objects correctly!

getValueDict()[source]
mouseClickEvent(event)[source]
mouseDoubleClickEvent(self, QGraphicsSceneMouseEvent)[source]
setObjects(objects, objAttr='pid')[source]
setValues(xValues, yValues)[source]
class ccpn.ui.gui.widgets.BarGraph.CustomLabel(text, application=None)[source]

Bases: PyQt5.QtWidgets.QGraphicsSimpleTextItem

A text annotation of a bar.

getCustomObject()[source]
paint(self, QPainter, QStyleOptionGraphicsItem, QWidget)[source]
setCustomObject(obj)[source]
class ccpn.ui.gui.widgets.BarGraph.CustomViewBox(application=None, *args, **kwds)[source]

Bases: pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox

addLabelMenu()[source]
addSelectionBox()[source]
clearSelection()[source]
getLabels()[source]
getThreshouldLine()[source]
hideAllLabels()[source]
inYRange(yValue, y1, y2)[source]
itemsSelected
mouseClickEvent(event)[source]
mouseDragEvent(event)[source]

Re-implementation of PyQtGraph mouse drag event to allow custom actions off of different mouse drag events. Same as spectrum Display. Check SpectrumDisplay View Box for more documentation.

selectAboveThreshold()[source]

Reimplement this in the module subclass

showAboveThreshold()[source]
showAllLabels()[source]
showExportDialog()[source]
upDateSelections(positions)[source]
updateSelectionFromCurrent()[source]
wheelEvent(self, QGraphicsSceneWheelEvent)[source]
property xLine

- None, immutable -

ccpn.ui.gui.widgets.BarGraphWidget module

class ccpn.ui.gui.widgets.BarGraphWidget.BarGraphWidget(parent, application=None, xValues=None, yValues=None, colour='r', objects=None, threshouldLine=0, backgroundColour='w', **kwds)[source]

Bases: ccpn.ui.gui.widgets.Widget.Widget

addLegend()[source]
addLegendItem(pen='r', name='')[source]
clear()[source]
clearBars()[source]
setData(viewBox, xValues, yValues, objects, colour, replace=True)[source]
setThresholdLine()[source]
setViewBoxLimits(xMin, xMax, yMin, yMax)[source]
showLegend(value: False)[source]
showThresholdLine(value=True)[source]
updateViewBoxLimits()[source]

Updates with default paarameters. Minimum values to show the data only

ccpn.ui.gui.widgets.Base module

Base class for gridding, optionally setting up size policies and layout, optionally inserting itself into parent using keyword, grid, gridspan, hAlign, vAlign

The proper way for adding widgets explicitly is: widget.getLayout().addWidget(row, col, [rowspan, [colspan])

class ccpn.ui.gui.widgets.Base.Base[source]

Bases: ccpn.ui.gui.widgets.DropBase.DropBase, ccpn.ui.gui.widgets.Base.SignalBlocking

addSpacer(width, height, grid, gridSpan=(1, 1), expandX=False, expandY=False, parent=None)[source]

Convenience to insert spacer width, height: in pixels grid=(row,col): tuple or list defining row, column gridSpan: tuple or list defining grid-span along row, column

if either expandX or expandY are True, then the corresponding expanding policy is set to ‘minimumExpanding’ otherwise it is set to ‘fixed’

Returns

Spacer widget

enableWidget(flag: bool)[source]

Enable or disable widget depending on flag

getLayout()[source]

return the layout of self

getParent()[source]

A method to return the parent of a widget

static onDestroyed(widget)[source]
setGridLayout(margins=(0, 0, 0, 0), spacing=(0, 0))[source]

Add a QGridlayout to self

class ccpn.ui.gui.widgets.Base.SignalBlocking[source]

Bases: object

Class to add widget blocking methods to a subclass. Blocks signals from nested widgets.

Blocking is applied by a contextManager

blockWidgetSignals(root=None, recursive=True, additionalWidgets=None)[source]

Block all signals for the widget.

root is the widget to be blocked, if no widget specified then self is assumed. If recursive=False then only the specified widget is blocked.

Updates are also blocked for the widget, this should automatically block updates for all nested widgets.

Parameters
  • root – widget to be blocked, defaults to self

  • recursive – bool, defaults to True

property widgetIsBlocked

- None, immutable - True if widget is blocked, i.e., blocking level > 0

ccpn.ui.gui.widgets.BasePopup module

Module Documentation here

class ccpn.ui.gui.widgets.BasePopup.BasePopup(parent=None, title='', location=None, hide=False, modal=False, closeFunc=None, tipText=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Widget.Widget

body(master)[source]
closeEvent(self, QCloseEvent)[source]
open()[source]

ccpn.ui.gui.widgets.Blank module

Module Documentation here

class ccpn.ui.gui.widgets.Blank.Blank(parent=None, title='Blank', **kwds)[source]

Bases: ccpn.ui.gui.popups.Dialog.CcpnDialog

changeEvent(self, QEvent)[source]

ccpn.ui.gui.widgets.Button module

This module implements the Button class

class ccpn.ui.gui.widgets.Button.Button(parent=None, text='', callback=None, icon=None, toggle=None, **kwds)[source]

Bases: PyQt5.QtWidgets.QPushButton, ccpn.ui.gui.widgets.Base.Base

getText()[source]

Get the text of the button

setCallback(callback=None)[source]

Sets callback; disconnects if callback=None

setSelected(selected)[source]
setText(text)[source]

Set the text of the button, applying the translator first

ccpn.ui.gui.widgets.ButtonList module

Module Documentation here

class ccpn.ui.gui.widgets.ButtonList.ButtonBoxList(parent=None, texts=None, callbacks=None, icons=None, tipTexts=None, direction='h', commands=None, ok='OK', cancel='cancel', destructive=('Discard', "Don't Save"), images=None, **kwargs)[source]

Bases: PyQt5.QtWidgets.QDialogButtonBox, ccpn.ui.gui.widgets.Base.Base, ccpn.ui.gui.widgets.ButtonList.ButtonListMixin

addButtons(texts, callbacks, icons=None, tipTexts=None)[source]
class ccpn.ui.gui.widgets.ButtonList.ButtonList(parent=None, texts=None, callbacks=None, icons=None, setMinimumWidth=True, tipTexts=None, direction='h', commands=None, images=None, setLastButtonFocus=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Widget.Widget, ccpn.ui.gui.widgets.ButtonList.ButtonListMixin

addButtons(texts, callbacks, icons=None, tipTexts=None, setMinimumWidth=True)[source]
class ccpn.ui.gui.widgets.ButtonList.ButtonListMixin[source]

Bases: object

getButton(buttonName: str)[source]

Return the button with the given name or return None :param buttonName(str) - name of the button

setButtonEnabled(buttonName: str, enable: bool = True)[source]

Enable/Disable a button by name :param buttonName(str) - name of the button :param enable(bool) - True or False

setButtonVisible(buttonName: str, visible: bool = True)[source]

Show/hide a button by name :param buttonName(str) - name of the button :param visible(bool) - True or False

class ccpn.ui.gui.widgets.ButtonList.UtilityButtonList(parent, webBrowser=None, helpUrl=None, helpMsg=None, doClone=True, doHelp=True, doClose=True, cloneText=None, helpText=None, closeText=None, cloneCmd=None, helpCmd=None, closeCmd=None, cloneTip='Duplicate window', helpTip='Show help', closeTip='Close window', *args, **kwds)[source]

Bases: ccpn.ui.gui.widgets.ButtonList.ButtonList

closePopup()[source]
duplicatePopup()[source]
launchHelp()[source]

ccpn.ui.gui.widgets.CalibrateXSpectrum1DWidget module

Module Documentation here

class ccpn.ui.gui.widgets.CalibrateXSpectrum1DWidget.CalibrateX1DWidgets(parent=None, mainWindow=None, strip=None, enableClose=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Frame.Frame

APPLYLABEL = 'Apply'
CLOSELABEL = 'Close X'
setOriginalPos(value)[source]

ccpn.ui.gui.widgets.CalibrateXSpectrumNDWidget module

Module Documentation here

class ccpn.ui.gui.widgets.CalibrateXSpectrumNDWidget.CalibrateXNDWidgets(parent=None, mainWindow=None, strip=None, enableClose=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.CalibrateXSpectrum1DWidget.CalibrateX1DWidgets

CLOSELABEL = 'Close'

ccpn.ui.gui.widgets.CalibrateYSpectrum1DWidget module

Module Documentation here

class ccpn.ui.gui.widgets.CalibrateYSpectrum1DWidget.CalibrateY1DWidgets(parent=None, mainWindow=None, strip=None, enableClose=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Frame.Frame

APPLYLABEL = 'Apply'
CLOSELABEL = 'Close X'
setOriginalPos(value)[source]

ccpn.ui.gui.widgets.CalibrateYSpectrumNDWidget module

Module Documentation here

class ccpn.ui.gui.widgets.CalibrateYSpectrumNDWidget.CalibrateYNDWidgets(parent=None, mainWindow=None, strip=None, enableClose=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.CalibrateYSpectrum1DWidget.CalibrateY1DWidgets

CLOSELABEL = 'Close'

ccpn.ui.gui.widgets.CallbackTimer module

Module Documentation here

class ccpn.ui.gui.widgets.CallbackTimer.CallbackTimer(callback)[source]

Bases: PyQt5.QtCore.QTimer

ccpn.ui.gui.widgets.CcpnGridItem module

class ccpn.ui.gui.widgets.CcpnGridItem.CcpnGridItem(gridColour)[source]

Bases: pyqtgraph.graphicsItems.UIGraphicsItem.UIGraphicsItem

generatePicture()[source]
paint(self, QPainter, QStyleOptionGraphicsItem, widget: QWidget = None)[source]
viewRangeChanged()[source]

Called when the view widget/viewbox is resized/rescaled

viewTransformChanged()[source]

Called whenever the transformation matrix of the view has changed. (eg, the view range has changed or the view was resized)

ccpn.ui.gui.widgets.CcpnModuleArea module

class ccpn.ui.gui.widgets.CcpnModuleArea.CcpnModuleArea(mainWindow, **kwargs)[source]

Bases: pyqtgraph.dockarea.DockArea.DockArea, ccpn.ui.gui.widgets.DropBase.DropBase

addModule(module, position=None, relativeTo=None, **kwds)[source]

With these settings the user can close all the modules from the label ‘close module’ or pop up and when re-add a new module it makes sure there is a container available.

addTempArea()[source]
apoptose(propagate=True)[source]
property ccpnModules

- None, immutable -

childState(obj, docksOnly=False)[source]
dragEnterEvent(self, QDragEnterEvent)[source]
dragLeaveEvent(self, QDragLeaveEvent)[source]
dragMoveEvent(self, QDragMoveEvent)[source]
dropEvent(self, QDropEvent)[source]
findMaximisedDock(event)[source]
getContainer(obj)[source]
makeContainer(typ)[source]
property modules

- None, immutable -

moveDock(dock, position, neighbor)[source]

Move an existing Dock to a new location.

moveModule(dock, position, neighbor)

Move an existing Dock to a new location.

paintEvent(ev)[source]

Draws central label

repopulateModules()[source]

Repopulate all modules to globally refresh all pulldowns, etc.

restoreModuleState(layout, module, discard=False)[source]

Search the restore tree for a given module

restoreState(state, restoreSpectrumDisplay=False)[source]

Restore Dock configuration as generated by saveState.

Note that this function does not create any Docks–it will only restore the arrangement of an existing set of Docks.

saveState(docksOnly=False)[source]

Return a serialized (storable) representation of the state of all Docks in this DockArea.

property spectrumDisplays

- None, immutable - Return the list of opened spectrumDisplays in the order of their opening. Contrary to mainWindow.spectrumDisplays that return in alphabetical order.

class ccpn.ui.gui.widgets.CcpnModuleArea.TempAreaWindow(area, mainWindow=None, **kwargs)[source]

Bases: ccpn.ui.gui.lib.GuiWindow.GuiWindow, ccpn.ui.gui.widgets.MainWindow.MainWindow

closeEvent(self, QCloseEvent)[source]

ccpn.ui.gui.widgets.CcpnWebView module

class ccpn.ui.gui.widgets.CcpnWebView.CcpnWebView(mainWindow=None, name='HtmlModule', urlPath=None)[source]

Bases: ccpn.ui.gui.modules.CcpnModule.CcpnModule

IGNORE_SHORTCUTS = False
className = 'CcpnWebView'

ccpn.ui.gui.widgets.CheckBox module

CheckBox widget

class ccpn.ui.gui.widgets.CheckBox.CheckBox(parent=None, checked=False, text='', callback=None, checkable=True, **kwds)[source]

Bases: PyQt5.QtWidgets.QCheckBox, ccpn.ui.gui.widgets.Base.Base

get()[source]
getText()[source]

Get the text of the button

set(checked)[source]
setCallback(callback)[source]
class ccpn.ui.gui.widgets.CheckBox.EditableCheckBox(parent, text=None, checked=False, callback=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Widget.Widget

isChecked()[source]
setChecked(value)[source]
setText(value)[source]
text()[source]

ccpn.ui.gui.widgets.CheckBoxes module

class ccpn.ui.gui.widgets.CheckBoxes.CheckBoxes(parent, texts=None, selectedInd=None, exclusive=False, selectAll=None, deselectAll=None, callback=None, direction='h', tipTexts=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Widget.Widget

clearIndex(i)[source]
deselectAll()[source]
get()[source]
getCheckBox(text)[source]
getIndex()[source]
getSelectedIndexes()[source]
getSelectedText()[source]
property isChecked

- None, immutable -

selectAll()[source]
set(text)[source]
setCallback(callback)[source]
setCheckBoxes(texts=None, selectedInd=None, direction='h', tipTexts=None)[source]

Change the checkBoxes in the checkBox group

setChecked(value)[source]
setIndex(i)[source]
setSelectedByText(texts, checkFlag, presetAll=True)[source]

ccpn.ui.gui.widgets.ColourDialog module

Module Documentation here

class ccpn.ui.gui.widgets.ColourDialog.ColourDialog(parent=None, doAlpha=False, **kwds)[source]

Bases: PyQt5.QtWidgets.QColorDialog

get()[source]
getColor(initial: QColor | Qt.GlobalColor, QGradient=Qt.white, parent: QWidget = None, title: str = '', options: QColorDialog.ColorDialogOptions | QColorDialog.ColorDialogOption = QColorDialog.ColorDialogOptions()) QColor[source]
quit()[source]
set(colour)[source]
setColour(colour)[source]
ccpn.ui.gui.widgets.ColourDialog.inverseGrey(colour)[source]

ccpn.ui.gui.widgets.Column module

Module Documentation here

class ccpn.ui.gui.widgets.Column.Column(headerText, getValue, getEditValue=None, setEditValue=None, editClass=None, editArgs=None, editKw=None, tipText=None, getColor=None, getIcon=None, stretch=False, format=None, editDecimals=None, editStep=None, alignment=1)[source]

Bases: object

getFormatValue(obj)[source]
orderFunc(objA, objB)[source]
class ccpn.ui.gui.widgets.Column.ColumnClass(columnList)[source]

Bases: object

addColumn(newColumn)[source]
property columns

- None, immutable -

property formats

- None, immutable -

property functions

- None, immutable -

property getEditValues

- None, immutable -

property headings

- None, immutable -

property numColumns

- None, immutable -

property setEditValues

- None, immutable -

property tipTexts

- None, immutable -

ccpn.ui.gui.widgets.ColumnViewSettings module

Module Documentation here

class ccpn.ui.gui.widgets.ColumnViewSettings.ColumnViewSettings(parent=None, table=None, dfObject=None, direction='v', hiddenColumns=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Frame.Frame

hide show check boxes corresponding to the table columns

checkBoxCallBack()[source]
initCheckBoxes()[source]
showColumns()[source]
updateWidgets(table)[source]
class ccpn.ui.gui.widgets.ColumnViewSettings.ColumnViewSettingsPopup(table, dataFrameObject=None, parent=None, hiddenColumns=None, title='Column Settings', **kwds)[source]

Bases: ccpn.ui.gui.popups.Dialog.CcpnDialogMainWidget

FIXEDHEIGHT = False
FIXEDWIDTH = True
USESCROLLWIDGET = True
getHiddenColumns()[source]
setHiddenColumns(texts)[source]

ccpn.ui.gui.widgets.CompoundBaseWidget module

Base class for compound widgets

class ccpn.ui.gui.widgets.CompoundBaseWidget.CompoundBaseWidget(parent, layoutDict, orientation, showBorder, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Frame.Frame, ccpn.ui.gui.widgets.Base.SignalBlocking

Base widget for Compound classes; inherits from Frame (and hence Base) Implements the addNotifier and deleteNotifiers methods

addNotifier(notifier)[source]

add a notifer to the widget

addObjectNotifier(theObject, triggers, targetName, func, *args, **kwds)[source]

Add and store a notifier with widget;

Parameters
  • theObject – A valid V3 core or current object

  • triggers – any of the triggers, as defined in Notifier class

  • targetName – a valid target for theObject, as defined in the Notifier class

  • func – callback function on triggering

  • args – optional arguments to func

  • kwds – optional keyword arguments to func

Returns

Notifier instance

deleteNotifiers()[source]

Delete all notifiers associated with the widget

eventFilter(target, event)[source]

call the user callback when the pulldown has been clicked

setFixedHeights(fixedHeights)[source]

Set fixed heights of widgets

setFixedWidths(fixedWidths)[source]

Set maximumWidths of widgets

setMaximumWidths(maximumWidths)[source]

Set maximumWidths of widgets

setMinimumWidths(minimumWidths)[source]

Set minimumwidths of widgets

setPreSelect(callBack=None)[source]

Add a user callback to the pulldown that fires on a mouse click. facilitates populating the pulldown list just before it opens :param callBack = method to call on click:

ccpn.ui.gui.widgets.CompoundView module

This widget is based on the CcpNmr ChemBuild. Credits to Tim Stevens, University of Cambridge December 2010-2012

class ccpn.ui.gui.widgets.CompoundView.AromaticItem(scene, compoundView, atomGroup)[source]

Bases: ccpn.ui.gui.widgets.CompoundView.AtomGroupItem

paint(self, QPainter, QStyleOptionGraphicsItem, widget: QWidget = None)[source]
syncGroup()[source]
class ccpn.ui.gui.widgets.CompoundView.Atom(compound, element, name, isVariable=False)[source]

Bases: object

defaultName()[source]
delete()[source]
setBaseValences(n)[source]
setName(name)[source]
setVariable(value=True)[source]
class ccpn.ui.gui.widgets.CompoundView.AtomGroup(compound, varAtoms, groupType)[source]

Bases: object

delete()[source]
class ccpn.ui.gui.widgets.CompoundView.AtomGroupItem(scene, compoundView, atomGroup)[source]

Bases: PyQt5.QtWidgets.QGraphicsItem

boundingRect(self) QRectF[source]
paint(self, QPainter, QStyleOptionGraphicsItem, widget: QWidget = None)[source]
class ccpn.ui.gui.widgets.CompoundView.AtomItem(scene, compoundView, atom)[source]

Bases: PyQt5.QtWidgets.QGraphicsItem

boundingRect(self) QRectF[source]
delete()[source]
deselect()[source]
hoverEnterEvent(self, QGraphicsSceneHoverEvent)[source]
hoverLeaveEvent(self, QGraphicsSceneHoverEvent)[source]
itemChange(self, QGraphicsItem.GraphicsItemChange, Any) Any[source]
mouseDoubleClickEvent(self, QGraphicsSceneMouseEvent)[source]
mouseMoveEvent(self, QGraphicsSceneMouseEvent)[source]
mousePressEvent(self, QGraphicsSceneMouseEvent)[source]
mouseReleaseEvent(self, QGraphicsSceneMouseEvent)[source]
moveAtom(coords)[source]
paint(self, QPainter, QStyleOptionGraphicsItem, widget: QWidget = None)[source]
select()[source]
syncToAtom()[source]
class ccpn.ui.gui.widgets.CompoundView.AtomLabel(scene, atomView, compoundView, atom)[source]

Bases: PyQt5.QtWidgets.QGraphicsItem

boundingRect(self) QRectF[source]
hoverEnterEvent(self, QGraphicsSceneHoverEvent)[source]
hoverLeaveEvent(self, QGraphicsSceneHoverEvent)[source]
mouseDoubleClickEvent(self, QGraphicsSceneMouseEvent)[source]
paint(self, QPainter, QStyleOptionGraphicsItem, widget: QWidget = None)[source]
syncLabel()[source]
class ccpn.ui.gui.widgets.CompoundView.Bond(varAtoms, bondType='single', autoVar=True)[source]

Bases: object

checkAmineVar(nAtom, hAtom)[source]
checkCarboxylVar(oAtom, hAtom)[source]
delete()[source]
deleteAll()[source]
removeDuplicates()[source]
setBondType(bondType)[source]
class ccpn.ui.gui.widgets.CompoundView.BondItem(scene, compoundView, bond)[source]

Bases: PyQt5.QtWidgets.QGraphicsItem

boundingRect(self) QRectF[source]
delete()[source]
deselect()[source]
getDistToBond(pos)[source]
mouseDoubleClickEvent(self, QGraphicsSceneMouseEvent)[source]
mousePressEvent(self, QGraphicsSceneMouseEvent)[source]
paint(self, QPainter, QStyleOptionGraphicsItem, widget: QWidget = None)[source]
select()[source]
syncToBond()[source]
class ccpn.ui.gui.widgets.CompoundView.Compound(name)[source]

Bases: object

addHydrogens()[source]
center(origin=None)[source]
copyCompound(compoundB, coords=None, refVar=None)[source]
copyVarAtoms(atoms, coords=None)[source]
delete()[source]
getAtom(element, name, isVariable=False)[source]
getCcpMolType()[source]
hasSubGraph(fragement)[source]
resolveTempAtomNames()[source]
save(filePath)[source]
setAromatic(atoms)[source]
setAtomGroup(atoms, groupType)[source]
setAtomsEquivalent(atoms)[source]
setAtomsProchiral(atoms)[source]
unsetAromatic(atoms)[source]
unsetAtomGroup(atoms, groupType)[source]
unsetAtomsEquivalent(atoms)[source]
unsetAtomsProchiral(atoms)[source]
class ccpn.ui.gui.widgets.CompoundView.CompoundView(parent=None, smiles=None, variant=None, preferences=None, **kwds)[source]

Bases: PyQt5.QtWidgets.QGraphicsView, ccpn.ui.gui.widgets.Base.Base

addGraphicsItems()[source]
centerView()[source]
centroid(views)[source]
centroidAtoms(atoms)[source]
changeBackground()[source]
drawBackground(self, QPainter, QRectF)[source]
drawForeground(self, QPainter, QRectF)[source]
exportPdf()[source]
exportSvg()[source]
getMenuAtom(posFilter=None, negFilter=None)[source]
getMenuLinkAtoms()[source]
getStats()[source]
mouseMoveEvent(self, QMouseEvent)[source]
mousePressEvent(self, QMouseEvent)[source]
mouseReleaseEvent(self, QMouseEvent)[source]
popupContextMenu(pos)[source]
queryAtomName(atomLabel)[source]
resetView()[source]
resetZoom()[source]
resizeEvent(self, QResizeEvent)[source]
rotateAtoms(x0, y0, deltaAngle)[source]
rotateLeft(angle=0.08726646259971667)[source]
rotateRight(angle=0.08726646259971667)[source]
setAtomName()[source]
setCompound(compound, variantInd=None, replace=True)[source]

Set the compound on the graphic scene.

setSmiles(smiles)[source]

set the smiles

setVariant(variant)[source]
setupContextMenu()[source]
show3D()[source]
showSkeletal()[source]
updateAll()[source]
wheelEvent(self, QWheelEvent)[source]
class ccpn.ui.gui.widgets.CompoundView.EquivItem(scene, compoundView, atomGroup)[source]

Bases: ccpn.ui.gui.widgets.CompoundView.AtomGroupItem

paint(self, QPainter, QStyleOptionGraphicsItem, widget: QWidget = None)[source]
syncGroup()[source]
class ccpn.ui.gui.widgets.CompoundView.ProchiralItem(scene, compoundView, atomGroup)[source]

Bases: ccpn.ui.gui.widgets.CompoundView.AtomGroupItem

paint(self, QPainter, QStyleOptionGraphicsItem, widget: QWidget = None)[source]
syncGroup()[source]
class ccpn.ui.gui.widgets.CompoundView.SelectionBox(scene, compoundView)[source]

Bases: PyQt5.QtWidgets.QGraphicsItem

boundingRect(self) QRectF[source]
paint(self, QPainter, QStyleOptionGraphicsItem, widget: QWidget = None)[source]
updateRegion(begin=None, end=None)[source]
class ccpn.ui.gui.widgets.CompoundView.VarAtom(variantA, atom, freeValences=None, chirality=None, coords=(0.0, 0.0, 0.0), isLabile=False, charge=0)[source]

Bases: object

atomInSameRing(atom)[source]
autoSetChirality()[source]
delete()[source]
findAtomsInBranch(firstAtomInBranch, atoms=None)[source]
getAtomDist(varAtom)[source]
getBondAngle(varAtom)[source]
getBondAngles()[source]
getBondToAtom(varAtom)[source]
getBranchesSortedByLength()[source]
getContext()[source]
getFirstNeighbourPriorities()[source]
getFourthNeighbourPriorities()[source]
getPreferredBondAngles(prevAngle, neighbours=None, ignoredAtoms=[], ignoreHydrogens=True)[source]
getPriorities()[source]
getRings()[source]
getSecondNeighbourPriorities()[source]
getStereochemistry()[source]
getStereochemistryEZ(other)[source]
getStereochemistryRS()[source]
getThirdNeighbourPriorities()[source]
isAromatic()[source]
isHydrogen()[source]
priorityNumber()[source]
setCharge(charge, autoVar=True)[source]
setChirality(chirality, autoVar=True)[source]
setCoords(x, y, z)[source]
setLabile(value=True)[source]
setName(name)[source]
setStereo(stereoVarAtoms)[source]
setVariable(boolean)[source]
snapRings(rings, neighbours, atoms, prevAngle, bondLength)[source]
snapToGrid(prevAtom, bondLength=50.0, prevAngle=None, angles=[], remainingAtoms=[], ignoreHydrogens=True)[source]
toggleAromatic()[source]
updateNeighbours()[source]
updateValences()[source]
class ccpn.ui.gui.widgets.CompoundView.Variant(compound, templateVarAtoms=None)[source]

Bases: object

autoNameAtoms(varAtoms)[source]
center(atoms=None, origin=None)[source]
checkBaseValences()[source]
copyAtoms(varAtoms, coords=None, tempNames=True)[source]
deduceStereo()[source]
delete()[source]
getBond(varAtomA, varAtomB, autoVar=True)[source]
getCentroid(atoms=None)[source]
getCommonIsoMass()[source]
getDescriptor(ccpnStyle=False)[source]
getMolFormula()[source]
getRings(varAtoms)[source]
minimise2d(atoms=None, maxCycles=250, bondLength=50.0, drawFunc=None)[source]
minimise3d(atoms=None, maxCycles=100, bondLength=50.0, drawFunc=None)[source]
setDefault(value=True)[source]
shuffleStereo()[source]
snapAtomsToGrid(atoms=None, prevAtom=None, ignoreHydrogens=True, bondLength=50.0)[source]
snapRingToGrid(ring, anchor=None, prevAngle=None, bondLength=45.0, skippedAtoms={})[source]
updateDescriptor()[source]
ccpn.ui.gui.widgets.CompoundView.crossProduct(v1, v2)[source]

Returns the cross product of v1 and v2. Both must be 3-dimensional vectors.

ccpn.ui.gui.widgets.CompoundView.dotProduct(v1, v2)[source]

The inner product between v1 and v2.

ccpn.ui.gui.widgets.CompoundView.importChemComp(chemComp, variantInd: int = 0)[source]
ccpn.ui.gui.widgets.CompoundView.importSmiles(smilesString, compoundName='Unnamed', project=None)[source]
ccpn.ui.gui.widgets.CompoundView.loadCompoundPickle(fileName)[source]
ccpn.ui.gui.widgets.CompoundView.vectorsSubtract(v1, v2)[source]

Subtract vectors v1 and v2.

ccpn.ui.gui.widgets.CompoundWidgets module

class ccpn.ui.gui.widgets.CompoundWidgets.CheckBoxCompoundWidget(parent=None, mainWindow=None, showBorder=False, orientation='left', minimumWidths=None, maximumWidths=None, fixedWidths=None, labelText='', text='', callback=None, checked=False, editable=True, compoundKwds=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.CompoundBaseWidget.CompoundBaseWidget

Compound class comprising a Label and a CheckBox, combined in a CompoundBaseWidget (i.e. a Frame)

orientation widget layout ———— ———————— left: Label CheckBox

right: CheckBox Label

top: Label

CheckBox

bottom: CheckBox

Label

get()[source]
isChecked()[source]

Convenience: Return whether checkBox is checked

layoutDict = {'bottom': [(1, 0), (0, 0)], 'left': [(0, 0), (0, 1)], 'right': [(0, 1), (0, 0)], 'top': [(0, 0), (1, 0)]}
set(checked)[source]
class ccpn.ui.gui.widgets.CompoundWidgets.ColourSelectionWidget(parent=None, labelName=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Widget.Widget

colour()[source]
currentText()[source]
setColour(value)[source]
class ccpn.ui.gui.widgets.CompoundWidgets.CompoundViewCompoundWidget(parent=None, mainWindow=None, showBorder=False, orientation='left', minimumWidths=None, maximumWidths=None, fixedWidths=None, labelText='', callback=None, editable=False, compoundKwds=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.CompoundBaseWidget.CompoundBaseWidget

Compound class comprising a Label and an compoundView, combined in a CompoundBaseWidget (i.e. a Frame)

orientation widget layout ———— —————————- left: Label compoundView

right: compoundView Label

top: Label

compoundView

bottom: compoundView

Label

layoutDict = {'bottom': [(1, 0), (0, 0)], 'left': [(0, 0), (0, 1)], 'right': [(0, 1), (0, 0)], 'top': [(0, 0), (1, 0)]}
minimumSizeHint(self) QSize[source]
resizeEvent(self, QResizeEvent)[source]
class ccpn.ui.gui.widgets.CompoundWidgets.DoubleSpinBoxCompoundWidget(parent=None, mainWindow=None, showBorder=False, orientation='left', minimumWidths=None, maximumWidths=None, fixedWidths=None, labelText='', value=None, range=(None, None), step=None, showButtons=True, decimals=None, callback=None, editable=False, compoundKwds=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.CompoundBaseWidget.CompoundBaseWidget

Compound class comprising a Label and a DoubleSpinBox, combined in a CompoundBaseWidget (i.e. a Frame)

orientation widget layout ———— —————————- left: Label DoubleSpinBox

right: DoubleSpinBox Label

top: Label

DoubleSpinBox

bottom: DoubleSpinBox

Label

getValue() float[source]

get the value from the DoubleSpinBox

layoutDict = {'bottom': [(1, 0), (0, 0)], 'left': [(0, 0), (0, 1)], 'right': [(0, 1), (0, 0)], 'top': [(0, 0), (1, 0)]}
setCallback(callback)[source]

Set the callback for the doubleSpinBox

setValue(value: float)[source]

set the value in the DoubleSpinBox

property textFromValue

- None, immutable -

class ccpn.ui.gui.widgets.CompoundWidgets.EntryCompoundWidget(parent=None, mainWindow=None, showBorder=False, orientation='left', minimumWidths=None, maximumWidths=None, fixedWidths=None, labelText='', entryText='', callback=None, default=None, editable=True, sizeAdjustPolicy=None, compoundKwds={}, tipText=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.CompoundBaseWidget.CompoundBaseWidget

Compound class comprising a Label and a Entry widget, combined in a CompoundBaseWidget (i.e. a Frame)

orientation widget layout ———— ———————— left: Label Entry

right: Entry Label

top: Label

Entry

bottom: Entry

Label

getText()[source]

Convenience: Return text of Entry

layoutDict = {'bottom': [(1, 0), (0, 0)], 'left': [(0, 0), (0, 1)], 'right': [(0, 1), (0, 0)], 'top': [(0, 0), (1, 0)]}
setText(text)[source]

Convenience: set text of Entry

class ccpn.ui.gui.widgets.CompoundWidgets.InputPulldown(parent=None, callback=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.PulldownList.PulldownList

addNewItem(item)[source]
class ccpn.ui.gui.widgets.CompoundWidgets.LineEditPopup(parent=None, dataType=None, **kwds)[source]

Bases: PyQt5.QtWidgets.QDialog, ccpn.ui.gui.widgets.Base.Base

get()[source]
returnItem()[source]
set(text='')[source]
class ccpn.ui.gui.widgets.CompoundWidgets.ListCompoundWidget(parent=None, showBorder=False, orientation='left', minimumWidths=None, maximumWidths=None, fixedWidths=None, labelText='', texts=None, callback=None, defaults=None, uniqueList=True, objectName='', compoundKwds=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.CompoundBaseWidget.CompoundBaseWidget

Compound class comprising a Label, a PulldownList, and a ListWidget, combined in a CompoundBaseWidget (i.e.a Frame)

NB: can also be used as only a Label and a ListWidget by hiding the Pulldown:

myWidget.showPulldownList(False)

orientation widget layout ———— ———————— left: Label PullDown

ListWidget

centreLeft: PullDown

Label ListWidget

right: PullDown Label

ListWidget

centreRight: PullDown

ListWidget Label

top: Label

PullDown ListWidget

bottom: PullDown

ListWidget Label

horizontal: Label PullDown ListWidget

LIST_BORDER_COLOR = '#a9a9a9'
LIST_BORDER_WIDTH = 1
addPulldownItem(item)[source]

convenience: add pulldown item (text or index) to list

addText(text)[source]

Convenience: Add text to listWidget

getTexts()[source]

Convenience: Return list of texts in listWidget

layoutDict = {'bottom': [(2, 0), (0, 0), (1, 0)], 'centreLeft': [(1, 0), (0, 1), (1, 1)], 'centreRight': [(1, 1), (0, 0), (1, 0)], 'horizontal': [(0, 0), (0, 1), (0, 2)], 'left': [(0, 0), (0, 1), (1, 1)], 'right': [(0, 1), (0, 0), (1, 0)], 'top': [(0, 0), (1, 0), (2, 0)]}
minimumSizeHint(self) QSize[source]
removeTexts(texts)[source]

Convenience: Remove texts to listWidget

renameText(oldText, newText)[source]
setItems(list)[source]

set the list of items in the pulldown

setLabelText(label)[source]

Set the text for the list widget label

setTexts(ll: list = [])[source]
showPulldownList(show)[source]
class ccpn.ui.gui.widgets.CompoundWidgets.PulldownListCompoundWidget(parent=None, mainWindow=None, showBorder=False, orientation='left', minimumWidths=None, maximumWidths=None, fixedWidths=None, labelText='', texts=None, toolTips=None, callback=None, default=None, sizeAdjustPolicy=None, editable=False, compoundKwds=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.CompoundBaseWidget.CompoundBaseWidget

Compound class comprising a Label and a PulldownList, combined in a CompoundBaseWidget (i.e. a Frame)

orientation widget layout ———— ———————— left: Label PullDown

right: PullDown Label

top: Label

PullDown

bottom: PullDown

Label

SELECTTEXT = '> Select <'
getIndex()[source]

Convenience: Return selected text in Pulldown

getText()[source]

Convenience: Return selected text in Pulldown

getTexts()[source]
layoutDict = {'bottom': [(1, 0), (0, 0)], 'left': [(0, 0), (0, 1)], 'right': [(0, 1), (0, 0)], 'top': [(0, 0), (1, 0)]}
modifyTexts(texts)[source]

Modify the pulldown texts, retaining the current selection

select(item, blockSignals=False)[source]

Convenience: Set item in Pulldown; works with text or item

setCallback(callback)[source]

Set the callback for the doubleSpinBox

setIndex(index, blockSignals=False)[source]

Convenience: set item in Pulldown by index

setLabelText(value)[source]

Set the text for the label

class ccpn.ui.gui.widgets.CompoundWidgets.RadioButtonsCompoundWidget(parent=None, mainWindow=None, showBorder=False, orientation='left', minimumWidths=None, maximumWidths=None, fixedWidths=None, labelText='', texts=[], callback=None, selectedInd=0, editable=True, compoundKwds=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.CompoundBaseWidget.CompoundBaseWidget

Compound class comprising a Label and a RadioButtons box, combined in a CompoundBaseWidget (i.e. a Frame)

orientation widget layout ———— —————————- left: Label RadioButtons

right: RadioButtons Label

top: Label

RadioButtons

bottom: RadioButtons

Label

getByText(*args)[source]

Convenience: get the radioButtons selected text

getIndex()[source]

Convenience: get the radioButtons index

layoutDict = {'bottom': [(1, 0), (0, 0)], 'left': [(0, 0), (0, 1)], 'right': [(0, 1), (0, 0)], 'top': [(0, 0), (1, 0)]}
setByText(value, *args)[source]

Convenience: set the radioButtons selected text

setIndex(index)[source]

Convenience: set the radioButtons index

class ccpn.ui.gui.widgets.CompoundWidgets.ScientificSpinBoxCompoundWidget(parent=None, mainWindow=None, showBorder=False, orientation='left', minimumWidths=None, maximumWidths=None, fixedWidths=None, labelText='', value=None, range=(None, None), step=None, showButtons=True, decimals=None, callback=None, editable=False, compoundKwds=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.CompoundBaseWidget.CompoundBaseWidget

Compound class comprising a Label and a scientificSpinBox, combined in a CompoundBaseWidget (i.e. a Frame)

orientation widget layout ———— ————————————- left: Label ScientificSpinBox

right: ScientificSpinBox Label

top: Label

ScientificSpinBox

bottom: ScientificSpinBox

Label

getValue() float[source]

get the value from the scientificSpinBox

layoutDict = {'bottom': [(1, 0), (0, 0)], 'left': [(0, 0), (0, 1)], 'right': [(0, 1), (0, 0)], 'top': [(0, 0), (1, 0)]}
setCallback(callback)[source]

Set the callback for the scientificSpinBox

setValue(value: float)[source]

set the value in the scientificSpinBox

class ccpn.ui.gui.widgets.CompoundWidgets.SelectorWidget(parent=None, label='', data=None, callback=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Widget.Widget

getText()[source]

Convenience: Return selected text in Pulldown

select(item)[source]

Convenience: Set item in Pulldown; works with text or item

class ccpn.ui.gui.widgets.CompoundWidgets.SpinBoxCompoundWidget(parent=None, mainWindow=None, showBorder=False, orientation='left', minimumWidths=None, maximumWidths=None, fixedWidths=None, labelText='', value=None, range=(None, None), step=None, showButtons=True, decimals=None, callback=None, editable=False, compoundKwds=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.CompoundBaseWidget.CompoundBaseWidget

Compound class comprising a Label and an integer SpinBox, combined in a CompoundBaseWidget (i.e. a Frame)

orientation widget layout ———— ———————— left: Label SpinBox

right: SpinBox Label

top: Label

SpinBox

bottom: SpinBox

Label

getValue() float[source]

get the value from the SpinBox

layoutDict = {'bottom': [(1, 0), (0, 0)], 'left': [(0, 0), (0, 1)], 'right': [(0, 1), (0, 0)], 'top': [(0, 0), (1, 0)]}
setCallback(callback)[source]

Set the callback for the spinBox

setValue(value: float)[source]

set the value in the SpinBox

class ccpn.ui.gui.widgets.CompoundWidgets.TextEditorCompoundWidget(parent=None, mainWindow=None, showBorder=False, orientation='left', minimumWidths=None, maximumWidths=None, fixedWidths=None, labelText='', callback=None, default=None, editable=True, sizeAdjustPolicy=None, compoundKwds=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.CompoundBaseWidget.CompoundBaseWidget

Compound class comprising a Label and a Entry widget, combined in a CompoundBaseWidget (i.e. a Frame)

orientation widget layout ———— ———————— left: Label Entry

right: Entry Label

top: Label

Entry

bottom: Entry

Label

getText()[source]

Convenience: Return text of textEditor

layoutDict = {'bottom': [(1, 0), (0, 0)], 'left': [(0, 0), (0, 1)], 'right': [(0, 1), (0, 0)], 'top': [(0, 0), (1, 0)]}
setText(text)[source]

Convenience: set text of textEditor

ccpn.ui.gui.widgets.ConcentrationsWidget module

A widget to get concentration Values and concentrationUnits

class ccpn.ui.gui.widgets.ConcentrationsWidget.ConcentrationWidget(parent, names, mainWindow=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Frame.ScrollableFrame

getUnit()[source]
getValues()[source]
setUnit(unit)[source]
setValues(values)[source]

ccpn.ui.gui.widgets.Console module

Module Documentation here

class ccpn.ui.gui.widgets.Console.Console(parent=None, namespace=None, historyFile=None)[source]

Bases: pyqtgraph.console.Console.ConsoleWidget

runMacro()[source]

ccpn.ui.gui.widgets.CustomExportDialog module

Reimplementation of PyQtGraph

class ccpn.ui.gui.widgets.CustomExportDialog.CustomExportDialog(scene, titleName=None, exportType='Default')[source]

Bases: PyQt5.QtWidgets.QDialog

close(self) bool[source]
copyClicked()[source]
exportClicked()[source]
exportFormatChanged(item, prev)[source]
exportItemChanged(item, prev)[source]
show(self)[source]
updateFormatList()[source]
updateItemList(select=None)[source]
updateItemTree(item, treeItem, select=None)[source]
class ccpn.ui.gui.widgets.CustomExportDialog.CustomGLExportDialog(GLWidget, titleName=None, exportType='GL')[source]

Bases: PyQt5.QtWidgets.QDialog

close(self) bool[source]
copyClicked()[source]
exportClicked()[source]
exportFormatChanged(item, prev)[source]
exportItemChanged(item, prev)[source]
show(self)[source]
updateFormatList()[source]
updateItemList(select=None)[source]
updateItemTree(item, treeItem, select=None)[source]

ccpn.ui.gui.widgets.DataFrameTableExample module

class ccpn.ui.gui.widgets.DataFrameTableExample.PandasDataFrameGuiTable(parent, mainWindow, **kwds)[source]

Bases: ccpn.ui.gui.widgets.GuiTable.GuiTable

A GUI table for a flat Pandas DataFrame type (not a ccpn dataFrameObject).

Usage: dataFrame = pd.DataFrame() myTable = PandasDataFrameGuiTable() myTable.dataFrame = dataFrame

To update the table: myTable.dataFrame = dataFrame

OBJECT = 'object'
TABLE = 'table'
action(*args)[source]
actionCheckBox(data)[source]
build(dataFrame)[source]
className = '_PandasDataFrameGuiTable'
clean()[source]
property dataFrame

- None, mutable -

deleteObjFromTable()[source]
selection(*args)[source]
class ccpn.ui.gui.widgets.DataFrameTableExample.PandasTableModuleExample(mainWindow, name)[source]

Bases: ccpn.ui.gui.modules.CcpnModule.CcpnModule

This is example of CCPN module showing a Pandas DataFrame table.

className = 'MyModule'
property dataFrame

- None, mutable -

includeSettingsWidget = True
maxSettingsState = 2
settingsPosition = 'top'

ccpn.ui.gui.widgets.DateTime module

class ccpn.ui.gui.widgets.DateTime.DateTime(parent, **kwds)[source]

Bases: PyQt5.QtWidgets.QDateEdit, ccpn.ui.gui.widgets.Base.Base

ccpn.ui.gui.widgets.DialogButtonBox module

Module Documentation here

class ccpn.ui.gui.widgets.DialogButtonBox.DialogButtonBox(parent=None, buttons=None, callbacks=None, texts=None, tipTexts=None, icons=None, enabledStates=None, visibleStates=None, defaultButton=None, enableIcons=False, orientation='horizontal', **kwds)[source]

Bases: PyQt5.QtWidgets.QDialogButtonBox, ccpn.ui.gui.widgets.Base.Base

button(self, QDialogButtonBox.StandardButton) QPushButton[source]

ccpn.ui.gui.widgets.Dock module

class ccpn.ui.gui.widgets.Dock.CcpnDock(name)[source]

Bases: pyqtgraph.dockarea.Dock.Dock

closeDock()[source]
resizeEvent(self, QResizeEvent)[source]
class ccpn.ui.gui.widgets.Dock.CcpnDockLabel(*args)[source]

Bases: pyqtgraph.dockarea.Dock.DockLabel

mousePressEvent(self, QMouseEvent)[source]

ccpn.ui.gui.widgets.DoubleSlider module

class ccpn.ui.gui.widgets.DoubleSlider.BufferTillEnter[source]

Bases: PyQt5.QtCore.QObject

input(value)[source]
output
trigger()[source]
class ccpn.ui.gui.widgets.DoubleSlider.Centre(width=None, parent=None)[source]

Bases: ccpn.ui.gui.widgets.DoubleSlider.GraphicsItemBase, ccpn.ui.gui.widgets.DoubleSlider.Named

height()[source]
min_width()[source]
paint(self, QPainter, QStyleOptionGraphicsItem, widget: QWidget = None)[source]
setText(text)[source]
setWidth(width)[source]
width()[source]
class ccpn.ui.gui.widgets.DoubleSlider.ConvertToInt[source]

Bases: PyQt5.QtCore.QObject

input(arg)[source]
output
class ccpn.ui.gui.widgets.DoubleSlider.ConvertToStr[source]

Bases: PyQt5.QtCore.QObject

input(arg)[source]
output
class ccpn.ui.gui.widgets.DoubleSlider.DoubleRangeView[source]

Bases: PyQt5.QtWidgets.QGraphicsView

displayValues
leaveEvent(self, QEvent)[source]
maxValue
minValue
mouseDoubleClickEvent(self, QMouseEvent)[source]
mouseMoveEvent(self, QMouseEvent)[source]
mousePressEvent(self, QMouseEvent)[source]
mouseReleaseEvent(self, QMouseEvent)[source]
pageStep
range

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

rangeChanged
resizeEvent(self, QResizeEvent)[source]
setEnabled(self, bool)[source]
setMaxValue
setMinValue
setRange

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

setValueConverter(converter)[source]

takes a value an converts it for display :param converter: function taking a single value and returning a single value :return:

setValueFormatter(formatter)[source]

takes a value and formats it to a string for display

Parameters

formatter – function taking a single value and returning a single string

setValues(values)[source]
showEvent(self, QShowEvent)[source]
single_click_move(pos)[source]
sliderPressed
sliderReleased
values
valuesChanged
class ccpn.ui.gui.widgets.DoubleSlider.GraphicsItemBase(parent=None)[source]

Bases: PyQt5.QtWidgets.QGraphicsObject

boundingRect(self) QRectF[source]
penWidth()[source]
rect()[source]
sceneRect()[source]
setPenWidth(pen_width)[source]
class ccpn.ui.gui.widgets.DoubleSlider.GraphicsRoundedRectItem(*args, x_radius=0, y_radius=0, **kwargs)[source]

Bases: PyQt5.QtWidgets.QGraphicsRectItem, ccpn.ui.gui.widgets.DoubleSlider.Named

paint(self, QPainter, QStyleOptionGraphicsItem, widget: QWidget = None)[source]
shape(self) QPainterPath[source]
class ccpn.ui.gui.widgets.DoubleSlider.HandleItem(orientation=1, parent=None)[source]

Bases: ccpn.ui.gui.widgets.DoubleSlider.GraphicsItemBase, ccpn.ui.gui.widgets.DoubleSlider.Named

height()[source]
highlighted()[source]
paint(self, QPainter, QStyleOptionGraphicsItem, widget: QWidget = None)[source]
reference_position_scene()[source]
The position of the reference edge in scene space this is

the right edge for the LEFT handle the left edge of the RIGHT handle

Returns

float reference position in scene space

setHighlighted(highlighted)[source]
width()[source]
class ccpn.ui.gui.widgets.DoubleSlider.MyApplication(arg)[source]

Bases: PyQt5.QtWidgets.QApplication

class ccpn.ui.gui.widgets.DoubleSlider.MyLabel(text, parent=None)[source]

Bases: PyQt5.QtWidgets.QLabel

paintEvent(self, QPaintEvent)[source]
class ccpn.ui.gui.widgets.DoubleSlider.Named[source]

Bases: object

name()[source]
setName(name)[source]
class ccpn.ui.gui.widgets.DoubleSlider.PopoverButton(balloon_side=Side.BOTTOM, *args, **kwargs)[source]

Bases: PyQt5.QtWidgets.QToolButton

balloonSide
popover()[source]
setBalloonSide(side)[source]
class ccpn.ui.gui.widgets.DoubleSlider.SelectArgument(index)[source]

Bases: PyQt5.QtCore.QObject

input(*args)[source]
output
class ccpn.ui.gui.widgets.DoubleSlider.SetOneOf(index, target=None, instance=None)[source]

Bases: PyQt5.QtCore.QObject

input(value)[source]
output
class ccpn.ui.gui.widgets.DoubleSlider.Slider[source]

Bases: PyQt5.QtWidgets.QGraphicsItemGroup, ccpn.ui.gui.widgets.DoubleSlider.Named

INSIDE = 'inside'
OUTSIDE = 'outside'
SINGLE = 'single'
WAIT = 'wait'
static get_offset_to_inside(control_rect, view_rect)[source]
min_width()[source]
mouseMoveEvent(self, QGraphicsSceneMouseEvent)[source]
mousePressEvent(self, QGraphicsSceneMouseEvent)[source]
mouseReleaseEvent(self, QGraphicsSceneMouseEvent)[source]
move_into_scene()[source]
offset_handle(offset)[source]
rect()[source]
sceneRect()[source]
setHighlighted(highlighted)[source]
setPos(self, QPointF | QPoint)[source]
Slider.setPos(self, float, float) -> None
width()[source]
class ccpn.ui.gui.widgets.DoubleSlider.Track(*args, **kwargs)[source]

Bases: ccpn.ui.gui.widgets.DoubleSlider.GraphicsRoundedRectItem, ccpn.ui.gui.widgets.DoubleSlider.Named

paint(self, QPainter, QStyleOptionGraphicsItem, widget: QWidget = None)[source]
setEnabled(self, bool)[source]

ccpn.ui.gui.widgets.DoubleSpinbox module

Module Documentation here

class ccpn.ui.gui.widgets.DoubleSpinbox.DoubleSpinbox(parent, value=None, min=None, max=None, step=None, prefix=None, suffix=None, showButtons=True, decimals=None, callback=None, editable=True, locale=None, **kwds)[source]

Bases: PyQt5.QtWidgets.QDoubleSpinBox, ccpn.ui.gui.widgets.Base.Base

focusInEvent(self, QFocusEvent)[source]
get()[source]
keyPressEvent(self, QKeyEvent)[source]
keyReleaseEvent(self, QKeyEvent)[source]
returnPressed
set(value)[source]
setCallback(callback)[source]

Sets callback; disconnects if callback=None

setMinimumCharacters(value)[source]
setSelected()[source]
stepBy(self, int)[source]
textFromValue(v: float | int) str[source]

Subclass to remove extra zeroes

validate(self, str, int) Tuple[QValidator.State, str, int][source]
wheelChanged
wheelEvent(event: PyQt5.QtGui.QWheelEvent) None[source]

Process the wheelEvent for the doubleSpinBox

class ccpn.ui.gui.widgets.DoubleSpinbox.ScientificDoubleSpinBox(*args, **kwargs)[source]

Bases: ccpn.ui.gui.widgets.DoubleSpinbox.DoubleSpinbox

Constructs a spinbox in which the values can be set using Sci notation

formatFloat(value)[source]

Modified form of the ‘g’ format specifier.

stepBy(steps)[source]

Increment the current value. Step if 1/10th of the current rounded value * step Now defined by ‘step’ in kwargs, i.e., step=0.1, 0.01

textFromValue(value)[source]

Subclass to remove extra zeroes

validate(self, str, int) Tuple[QValidator.State, str, int][source]
valueFromText(text)[source]

Values in the spinbox are constrained to the correct sign if the min/max values are either both positive or both negative

ccpn.ui.gui.widgets.DoubleSpinbox.fexp(f)[source]

ccpn.ui.gui.widgets.DropBase module

Define routines for a dropable widget This module is subclassed by widgets.Base and should not be used directly

GWV April-2017: Drived from an earlier version of DropBase

class ccpn.ui.gui.widgets.DropBase.DropBase[source]

Bases: object

Class to implement drop and drag Callback signature on drop: dropEventCallback(dataDict)

DFS = 'dfs'
IDS = 'ids'
JSONDATA = 'ccpnmr-json'
MODELDATALIST = 'ccpnmr-model-datalist'
PIDS = 'pids'
TEXT = 'text'
URLS = 'urls'
dragEnterEvent(event)[source]
dragLeaveEvent(ev)[source]

Clear the overlays when leaving the widgetArea

dragMoveEvent(ev)[source]

drag move event that propagates through all the widgets

dropEvent(event)[source]

Catch dropEvent and dispatch to processing callback ‘Native’ treatment of CcpnModule instances

handleDragToMaximisedModule(ev)[source]
isDragToMaximisedModule(event)[source]
parseEvent(event) dict[source]

Interpret drop event; extract urls, text or JSONDATA dicts convert PIDS to Pid object’s return a dict with

  • event, source key,values pairs

  • (type, data) key,value pairs,

setDragEnterEventCallback(callback)[source]
setDragMoveEventCallback(callback)[source]
setDropEventCallback(callback)[source]

Set the callback function for drop event.

ccpn.ui.gui.widgets.Entry module

Module Documentation here

class ccpn.ui.gui.widgets.Entry.ArrayEntry(parent, text='', callback=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Entry.Entry

convertInput(array)[source]
convertText(text)[source]
class ccpn.ui.gui.widgets.Entry.Entry(parent, text='', callback=None, maxLength=1000, listener=None, stripEndWhitespace=True, editable=True, backgroundText='<default>', **kwds)[source]

Bases: PyQt5.QtWidgets.QLineEdit, ccpn.ui.gui.widgets.Base.Base

convertInput(value)[source]
convertText(text)[source]
get()[source]
getText()
set(value, doCallback=True)[source]
class ccpn.ui.gui.widgets.Entry.FloatArrayEntry(parent, text='', callback=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Entry.FloatEntry

convertInput(values)[source]
convertText(text)[source]
class ccpn.ui.gui.widgets.Entry.FloatEntry(parent, text=0.0, callback=None, minValue=- inf, maxValue=inf, decimals=4, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Entry.Entry

convertInput(value)[source]
convertText(text)[source]
decimals = 4
setRange(minValue=- 2147483647, maxValue=2147483647)[source]
class ccpn.ui.gui.widgets.Entry.IntArrayEntry(parent, text='', callback=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Entry.IntEntry

convertInput(values)[source]
convertText(text)[source]
class ccpn.ui.gui.widgets.Entry.IntEntry(parent, text=0, callback=None, minValue=- 2147483647, maxValue=2147483647, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Entry.Entry

convertInput(value)[source]
convertText(text)[source]
setRange(minValue=- 2147483647, maxValue=2147483647)[source]
class ccpn.ui.gui.widgets.Entry.LabelledEntry(parent, labelText, entryText='', callback=None, maxLength=32, tipText=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Frame.Frame

getEntry()[source]
getLabel()[source]
setEntry(text)[source]
setLabel(text)[source]
class ccpn.ui.gui.widgets.Entry.LabelledFloatEntry(parent, labelText, entryText='', callback=None, minValue=- 2147483647, maxValue=2147483647, decimals=4, tipText=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Entry.LabelledEntry

class ccpn.ui.gui.widgets.Entry.LabelledIntEntry(parent, labelText, entryText='', callback=None, minValue=- 2147483647, maxValue=2147483647, tipText=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Entry.LabelledEntry

class ccpn.ui.gui.widgets.Entry.RegExpEntry(parent, text='', callback=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Entry.Entry

ccpn.ui.gui.widgets.FileDialog module

Module Documentation here

class ccpn.ui.gui.widgets.FileDialog.AdminFileDialog(parent=None, acceptMode='open', selectFile=None, fileFilter=None, directory=None, useNative=None, _useDirectoryOnly=False, confirmOverwrite=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.FileDialog.FileDialogABC

class ccpn.ui.gui.widgets.FileDialog.ArchivesFileDialog(parent=None, acceptMode='open', selectFile=None, fileFilter=None, directory=None, useNative=None, _useDirectoryOnly=False, confirmOverwrite=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.FileDialog.FileDialogABC

class ccpn.ui.gui.widgets.FileDialog.AuxiliaryFileDialog(parent=None, acceptMode='open', selectFile=None, fileFilter=None, directory=None, useNative=None, _useDirectoryOnly=False, confirmOverwrite=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.FileDialog.FileDialogABC

class ccpn.ui.gui.widgets.FileDialog.BackupsFileDialog(parent=None, acceptMode='open', selectFile=None, fileFilter=None, directory=None, useNative=None, _useDirectoryOnly=False, confirmOverwrite=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.FileDialog.FileDialogABC

class ccpn.ui.gui.widgets.FileDialog.CcpnMacrosFileDialog(parent=None, acceptMode='open', selectFile=None, fileFilter=None, directory=None, useNative=None, _useDirectoryOnly=False, confirmOverwrite=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.FileDialog.FileDialogABC

class ccpn.ui.gui.widgets.FileDialog.ChemCompFileDialog(parent=None, acceptMode='open', selectFile=None, fileFilter=None, directory=None, useNative=None, _useDirectoryOnly=False, confirmOverwrite=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.FileDialog.FileDialogABC

class ccpn.ui.gui.widgets.FileDialog.DataFileDialog(parent=None, acceptMode='open', selectFile=None, fileFilter=None, directory=None, useNative=None, _useDirectoryOnly=False, confirmOverwrite=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.FileDialog.FileDialogABC

class ccpn.ui.gui.widgets.FileDialog.ExcelFileDialog(parent=None, acceptMode='open', selectFile=None, fileFilter=None, directory=None, useNative=None, _useDirectoryOnly=False, confirmOverwrite=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.FileDialog.FileDialogABC

class ccpn.ui.gui.widgets.FileDialog.ExecutablesFileDialog(parent=None, acceptMode='open', selectFile=None, fileFilter=None, directory=None, useNative=None, _useDirectoryOnly=False, confirmOverwrite=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.FileDialog.FileDialogABC

class ccpn.ui.gui.widgets.FileDialog.ExportFileDialog(parent=None, acceptMode='open', selectFile=None, fileFilter=None, directory=None, useNative=None, _useDirectoryOnly=False, confirmOverwrite=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.FileDialog.FileDialogABC

class ccpn.ui.gui.widgets.FileDialog.FileDialogABC(parent=None, acceptMode='open', selectFile=None, fileFilter=None, directory=None, useNative=None, _useDirectoryOnly=False, confirmOverwrite=True, **kwds)[source]

Bases: PyQt5.QtWidgets.QFileDialog

Class to implement open/save dialogs

accept()[source]

Update the current path and exit the dialog.

getCurrentWorkingPath()[source]
property initialPath

- None, mutable - The initial path that the dialog will be set to on opening. Path is stored between instances, and is unique to the subclassed type.

reject()[source]

Update the current path (if required) and exit the dialog.

restrictDirToFilter = (False,)
selectedFile()[source]

Return the first selected file.

selectedFiles()[source]

Return the list of selected files

class ccpn.ui.gui.widgets.FileDialog.LayoutsFileDialog(parent=None, acceptMode='open', selectFile=None, fileFilter=None, directory=None, useNative=None, _useDirectoryOnly=False, confirmOverwrite=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.FileDialog.FileDialogABC

class ccpn.ui.gui.widgets.FileDialog.LineButtonFileDialog(parent=None, fileMode='anyFile', dialogText=None, directory=None, fileFilter=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.FileDialog.FileDialogABC

Special class for a lineEdit button in pipelines

class ccpn.ui.gui.widgets.FileDialog.LineEditButtonDialog(parent, textDialog=None, textLineEdit=None, fileMode=None, fileFilter=None, directory=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Widget.Widget

get()[source]
setText(text)[source]
class ccpn.ui.gui.widgets.FileDialog.MacrosFileDialog(parent=None, acceptMode='open', selectFile=None, fileFilter=None, directory=None, useNative=None, _useDirectoryOnly=False, confirmOverwrite=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.FileDialog.FileDialogABC

class ccpn.ui.gui.widgets.FileDialog.NMRStarFileDialog(parent=None, acceptMode='open', selectFile=None, fileFilter=None, directory=None, useNative=None, _useDirectoryOnly=False, confirmOverwrite=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.FileDialog.FileDialogABC

class ccpn.ui.gui.widgets.FileDialog.NefFileDialog(parent=None, acceptMode='open', selectFile=None, fileFilter=None, directory=None, useNative=None, _useDirectoryOnly=False, confirmOverwrite=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.FileDialog.FileDialogABC

class ccpn.ui.gui.widgets.FileDialog.OtherFileDialog(parent=None, acceptMode='open', selectFile=None, fileFilter=None, directory=None, useNative=None, _useDirectoryOnly=False, confirmOverwrite=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.FileDialog.FileDialogABC

class ccpn.ui.gui.widgets.FileDialog.PDFFileDialog(parent=None, acceptMode='open', selectFile=None, fileFilter=None, directory=None, useNative=None, _useDirectoryOnly=False, confirmOverwrite=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.FileDialog.FileDialogABC

class ccpn.ui.gui.widgets.FileDialog.PipelineFileDialog(parent=None, acceptMode='open', selectFile=None, fileFilter=None, directory=None, useNative=None, _useDirectoryOnly=False, confirmOverwrite=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.FileDialog.FileDialogABC

class ccpn.ui.gui.widgets.FileDialog.PluginsFileDialog(parent=None, acceptMode='open', selectFile=None, fileFilter=None, directory=None, useNative=None, _useDirectoryOnly=False, confirmOverwrite=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.FileDialog.FileDialogABC

class ccpn.ui.gui.widgets.FileDialog.PreferencesFileDialog(parent=None, acceptMode='open', selectFile=None, fileFilter=None, directory=None, useNative=None, _useDirectoryOnly=False, confirmOverwrite=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.FileDialog.FileDialogABC

class ccpn.ui.gui.widgets.FileDialog.ProjectFileDialog(parent=None, acceptMode='open', selectFile=None, fileFilter=None, directory=None, useNative=None, _useDirectoryOnly=False, confirmOverwrite=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.FileDialog.FileDialogABC

class ccpn.ui.gui.widgets.FileDialog.ProjectSaveFileDialog(parent=None, acceptMode='open', selectFile=None, fileFilter=None, directory=None, useNative=None, _useDirectoryOnly=False, confirmOverwrite=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.FileDialog.FileDialogABC

class ccpn.ui.gui.widgets.FileDialog.SpectrumFileDialog(parent=None, acceptMode='open', selectFile=None, fileFilter=None, directory=None, useNative=None, _useDirectoryOnly=False, confirmOverwrite=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.FileDialog.FileDialogABC

class ccpn.ui.gui.widgets.FileDialog.TablesFileDialog(parent=None, acceptMode='open', selectFile=None, fileFilter=None, directory=None, useNative=None, _useDirectoryOnly=False, confirmOverwrite=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.FileDialog.FileDialogABC

ccpn.ui.gui.widgets.FillBetweenRegions module

class ccpn.ui.gui.widgets.FillBetweenRegions.FillBetweenRegions(curve1, curve2, brush=None, **kwds)[source]

Bases: pyqtgraph.graphicsItems.FillBetweenItem.FillBetweenItem

GraphicsItem filling the space between two PlotDataItems.

ccpn.ui.gui.widgets.FilteringPulldownList module

Module Documentation here

class ccpn.ui.gui.widgets.FilteringPulldownList.FilteringPulldownList(parent=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.PulldownList.PulldownList

onCompleterActivated(text)[source]

ccpn.ui.gui.widgets.Font module

Module Documentation here

class ccpn.ui.gui.widgets.Font.Font(fontName, size, bold=False, italic=False, underline=False, strikeout=False)[source]

Bases: PyQt5.QtGui.QFont

ccpn.ui.gui.widgets.Font.getFont(name='defaultFont', size='MEDIUM')[source]

Get the specified font from the fonts dict

ccpn.ui.gui.widgets.Font.getFontHeight(name='defaultFont', size='MEDIUM')[source]

Get the font height form the specified font

ccpn.ui.gui.widgets.Font.getTextDimensionsFromFont(name='defaultFont', size='MEDIUM', bold=False, italic=False, textList=None)[source]

Get the bounding box for the specified text

ccpn.ui.gui.widgets.Font.getWidgetFontHeight(name='defaultFont', size='MEDIUM', bold=False, italic=False)[source]

Get the font height form the specified font

ccpn.ui.gui.widgets.Font.setWidgetFont(widget, name='defaultFont', size='MEDIUM', bold=False, italic=False)[source]

Set the font in the specified widget

ccpn.ui.gui.widgets.Frame module

This module implemented a Frame and a ScrollableFrame

Frame(parent=None, showBorder=False, fShape=None, fShadow=None, **kwds)

NB: Until now: fShape and fShadow do not seem to alter the appearance on OSX

ScrollableFrame(parent=None, showBorder=False, fShape=None, fShadow=None,

minimumSizes=(50,50), scrollBarPolicies=(‘asNeeded’,’asNeeded’), **kwds)

From: http://pyqt.sourceforge.net/Docs/PyQt5/qframe.html#details

The QFrame class is the base class of widgets that can have a frame. More…

Inherits QWidget.

Inherited by QAbstractScrollArea, QLabel, QLCDNumber, QSplitter, QStackedWidget and QToolBox.

Types

enum Shadow { Plain, Raised, Sunken } enum Shape { NoFrame, Box, Panel, WinPanel, …, StyledPanel } enum StyleMask { Shadow_Mask, Shape_Mask } Methods

__init__ (self, QWidget parent = None, Qt.WindowFlags flags = 0) changeEvent (self, QEvent) drawFrame (self, QPainter) bool event (self, QEvent e) QRect frameRect (self) Shadow frameShadow (self) Shape frameShape (self) int frameStyle (self) int frameWidth (self) int lineWidth (self) int midLineWidth (self) paintEvent (self, QPaintEvent) setFrameRect (self, QRect) setFrameShadow (self, Shadow) setFrameShape (self, Shape) setFrameStyle (self, int) setLineWidth (self, int) setMidLineWidth (self, int) QSize sizeHint (self)

class ccpn.ui.gui.widgets.Frame.Frame(parent=None, showBorder=False, fShape=None, fShadow=None, setLayout=False, **kwds)[source]

Bases: PyQt5.QtWidgets.QFrame, ccpn.ui.gui.widgets.Base.Base

FRAME_DICT = {'box': 1, 'hLine': 4, 'noFrame': 0, 'panel': 2, 'plain': 16, 'raised': 32, 'styledPanel': 6, 'sunken': 48, 'vLine': 5}
class ccpn.ui.gui.widgets.Frame.OpenGLOverlayFrame(parent=None, showBorder=False, fShape=None, fShadow=None, setLayout=False, backgroundColour=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Frame.Frame

AUTOFILLBACKGROUND = False
paintEvent(ev)[source]

Paint the region of the frame to the desired background colour, required when overlaying a GL widget

resetColourTheme()[source]

Reset the colour theme

resizeEvent(ev) None[source]

Resize event to handle resizing of frames that overlay the OpenGL frame

class ccpn.ui.gui.widgets.Frame.ScrollOpenGLOverlayFrame(parent=None, setLayout=False, showBorder=False, fShape=None, fShadow=None, minimumSizes=(50, 50), scrollBarPolicies=('asNeeded', 'asNeeded'), margins=(0, 0, 0, 0), **kwds)[source]

Bases: ccpn.ui.gui.widgets.Frame.OpenGLOverlayFrame

A scrollable frame

property scrollArea

- None, immutable - Return the scrollbar widget; for external usage

setScrollBarPolicies(scrollBarPolicies=('asNeeded', 'asNeeded'))[source]

Set the scrollbar policy: always, never, asNeeded

class ccpn.ui.gui.widgets.Frame.ScrollableFrame(parent=None, setLayout=False, showBorder=False, fShape=None, fShadow=None, minimumSizes=(50, 50), scrollBarPolicies=('asNeeded', 'asNeeded'), margins=(0, 0, 0, 0), **kwds)[source]

Bases: ccpn.ui.gui.widgets.Frame.Frame

A scrollable frame

insertCornerWidget()[source]

Insert a corner widget into the target widget with the correct borders

property scrollArea

- None, immutable - Return the scrollbar widget; for external usage

setScrollBarPolicies(scrollBarPolicies=('asNeeded', 'asNeeded'))[source]

Set the scrollbar policy: always, never, asNeeded

ccpn.ui.gui.widgets.GLAxis module

Module Documentation here

class ccpn.ui.gui.widgets.GLAxis.Gui1dWidgetAxis(parent, spectrumDisplay=None, mainWindow=None, antiAlias=4, drawRightAxis=False, drawBottomAxis=False, fullHeightRightAxis=False, fullWidthBottomAxis=False)[source]

Bases: PyQt5.QtWidgets.QOpenGLWidget

AXISLOCKEDBUTTON = False
AXISLOCKEDBUTTONALLSTRIPS = False
AXIS_INSIDE = False
AXIS_LINE = 7
AXIS_MARGINBOTTOM = 25
AXIS_MARGINRIGHT = 80
AXIS_MOUSEYOFFSET = 32
AXIS_OFFSET = 3
INVERTXAXIS = True
INVERTYAXIS = True
SHOWSPECTRUMONPHASING = False
SPECTRUMXZOOM = 50.0
SPECTRUMYZOOM = 50.0
XAXES = ['[ppm]', '[Hz]', '[pnts]']
YAXES = ['']
YAXISUSEEFORMAT = True
between(val, l, r)[source]
buildAxisLabels(refresh=False)[source]
buildGrid()[source]

Build the grids for the mainGrid and the bottom/right axes

buildSpectra()[source]
disableTextClientState()[source]
disableTexture()[source]
drawAxisLabels()[source]
drawGrid()[source]
enableTextClientState()[source]
enableTexture()[source]
getCurrentCursorCoordinate()[source]
getSmallFont(transparent=False)[source]
glBlocking()[source]
highlightCurrentStrip(current)[source]
initialiseAxes(strip=None)[source]

setup the correct axis range and padding

initializeGL(self)[source]
is1D = True
mouseMoveEvent(self, QMouseEvent)[source]
mousePressEvent(self, QMouseEvent)[source]
mouseReleaseEvent(self, QMouseEvent)[source]
paintGL()[source]

Handle the GL painting

redrawAxes()[source]

Redraw the axes when switching strip arrangement

refreshDevicePixelRatio()[source]

refresh the devicePixelRatio for the viewports

rescale(rescaleOverlayText=True, rescaleMarksRulers=True, rescaleIntegralLists=True, rescaleRegions=True, rescaleSpectra=True, rescaleStaticHTraces=True, rescaleStaticVTraces=True, rescaleSpectrumLabels=True, rescaleLegend=True)[source]

Change to axes of the view, axis visibility, scale and rebuild matrices when necessary to improve display speed

resetRangeLimits(allLimits=True)[source]
Gui1dWidgetAxis.resizeGL(self, int, int)[source]
setAxisType(dimension)[source]

Set the current axis type for the axis widget 0 = X Axis type, 1 = Y Axis type Only the required axis is drawn and the widget dimensions are fixed in the other axis

setBackgroundColour(col, silent=False)[source]

set all background colours in the shaders :param col - vec4, 4 element list e.g.: [0.05, 0.05, 0.05, 1.0], very dark gray

sign(x)[source]
property tilePosition: Tuple[int, int]

- Tuple[int, int], mutable - Returns a tuple of the tile coordinates (from top-left) tilePosition = (x, y)

update(mode=PaintModes.PAINT_ALL)[source]

Update the glWidget with the correct refresh mode

updateVisibleSpectrumViews()[source]
wheelEvent(self, QWheelEvent)[source]
class ccpn.ui.gui.widgets.GLAxis.GuiNdWidgetAxis(parent, spectrumDisplay=None, mainWindow=None, antiAlias=4, drawRightAxis=False, drawBottomAxis=False, fullHeightRightAxis=False, fullWidthBottomAxis=False)[source]

Bases: ccpn.ui.gui.widgets.GLAxis.Gui1dWidgetAxis

Testing a widget that only contains a right axis

AXISLOCKEDBUTTON = True
AXISLOCKEDBUTTONALLSTRIPS = True
AXIS_INSIDE = False
AXIS_LINE = 7
AXIS_MARGINBOTTOM = 25
AXIS_MARGINRIGHT = 50
AXIS_MOUSEYOFFSET = 32
AXIS_OFFSET = 3
INVERTXAXIS = True
INVERTYAXIS = True
SHOWSPECTRUMONPHASING = True
SPECTRUMXZOOM = 50.0
SPECTRUMYZOOM = 50.0
XAXES = ['[ppm]', '[Hz]', '[pnts]']
YAXES = ['[ppm]', '[Hz]', '[pnts]']
YAXISUSEEFORMAT = False
is1D = False

ccpn.ui.gui.widgets.GLLinearRegionsPlot module

Module documentation here

class ccpn.ui.gui.widgets.GLLinearRegionsPlot.GLTargetButtonSpinBoxes(parent, application=None, orientation='v', GLWidget=None, values=None, step=None, decimals=None, colour=None, brush=None, movable=True, bounds=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Widget.Widget

destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)[source]
get()[source]
Returns

positions displayed on the boxes

setGLWidget(GLWidget)[source]
setValues(values)[source]

set the values of the spinboxes and update the GL widget :param values - list of [min, max]:

ccpn.ui.gui.widgets.GLWidgets module

Module Documentation here

class ccpn.ui.gui.widgets.GLWidgets.Gui1dWidget(strip=None, mainWindow=None, stripIDLabel=None)[source]

Bases: ccpn.ui.gui.lib.OpenGL.CcpnOpenGL.CcpnGLWidget

AXISLOCKEDBUTTON = True
AXISLOCKEDBUTTONALLSTRIPS = True
AXIS_MARGINRIGHT = 80
INVERTXAXIS = True
INVERTYAXIS = False
KEEPdrawSpectra()[source]
SHOWSPECTRUMONPHASING = False
SPECTRUMNEGCOLOUR = 'sliceColour'
SPECTRUMPOSCOLOUR = 'sliceColour'
SPECTRUMXZOOM = 100.0
SPECTRUMYZOOM = 1000000.0
YAXES = ['']
YAXISUSEEFORMAT = True
buildDiagonals()[source]

Build a list containing the diagonal and the spinningRate lines for the sidebands

buildSpectra()[source]

set the GL flags to build spectrum contour lists

drawAliasedLabels()[source]

Draw all the labels that require aliasing to multiple regions

drawAliasedSymbols()[source]

Draw all the symbols that require aliasing to multiple regions

drawBoundingBoxes()[source]

Draw all the bounding boxes

drawIntegralLabels()[source]

Draw all the integral labels

drawSpectra()[source]
getPeakPositionFromMouse(peak, lastStartCoordinate, cursorPosition=None)[source]

Get the centre position of the clicked 1d peak

initialiseTraces()[source]
is1D = True
property showSpectraOnPhasing

- None, mutable -

toggleShowSpectraOnPhasing()[source]
class ccpn.ui.gui.widgets.GLWidgets.GuiNdWidget(strip=None, mainWindow=None, stripIDLabel=None)[source]

Bases: ccpn.ui.gui.lib.OpenGL.CcpnOpenGL.CcpnGLWidget

AXIS_INSIDE = False
INVERTXAXIS = True
INVERTYAXIS = True
SPECTRUMNEGCOLOUR = 'negativeContourColour'
SPECTRUMPOSCOLOUR = 'positiveContourColour'
buildDiagonals()[source]
drawAliasedLabels()[source]

Draw all the labels that require aliasing to multiple regions

drawAliasedSymbols()[source]

Draw all the symbols that require aliasing to multiple regions

drawBoundingBoxes()[source]
drawIntegralLabels()[source]

Draw all the integral labels

drawSpectra()[source]
getPeakPositionFromMouse(peak, lastStartCoordinate, cursorPosition=None)[source]

Get the centre position of the clicked peak

initialiseTraces()[source]
is1D = False

ccpn.ui.gui.widgets.GroupBox module

Module Documentation here

class ccpn.ui.gui.widgets.GroupBox.GroupBox(parent=None, border=None, **kwds)[source]

Bases: PyQt5.QtWidgets.QGroupBox, ccpn.ui.gui.widgets.Base.Base

ccpn.ui.gui.widgets.GuiTable module

Module Documentation here

class ccpn.ui.gui.widgets.GuiTable.GuiTable(parent=None, mainWindow=None, dataFrameObject=None, actionCallback=None, selectionCallback=None, checkBoxCallback=None, _pulldownKwds=None, enableMouseMoveEvent=True, allowRowDragAndDrop=False, multiSelect=False, selectRows=True, numberRows=False, autoResize=False, enableExport=True, enableDelete=True, enableSearch=True, hideIndex=True, stretchLastSection=True, **kwds)[source]

Bases: pyqtgraph.widgets.TableWidget.TableWidget, ccpn.ui.gui.widgets.Base.Base

EXPANDERCOLUMN = 0
ICON_FILE = '/Users/ejb66/PycharmProjects/Git/AnalysisV3/src/python/ccpn/ui/gui/widgets/icons/editable.png'
ITEMKLASS

alias of ccpn.ui.gui.widgets.TableSorting.CcpnTableWidgetItem

MERGECOLUMN = 0
MINSORTCOLUMN = 0
PIDCOLUMN = 0
PRIMARYCOLUMN = 'Pid'
SPANCOLUMNS = ()
applySortToGroups = False
clearCurrentCallback()[source]

Clear the callback function for current object/list change

clearSelection()[source]

Clear the current selection in the table and remove objects from the current list

clearTable()[source]

remove all objects from the table

clearTableContents(dataFrameObject=None)[source]
property columnDefinitions

- None, immutable - return a ccpn ColumnClass obj if _dataFrameObject is set.

property columnTexts

- None, immutable - return a list of column texts.

property columns

- None, immutable - return a list of column objs.

deleteObjFromTable()[source]
dragEnterEvent(self, QDragEnterEvent)[source]
dragLeaveEvent(self, QDragLeaveEvent)[source]
dragMoveEvent(self, QDragMoveEvent)[source]
dropEvent(event)[source]

Extension to the dropEvent of DropBase. To setup this event in a module/table see the gui.lib.GuiNotifier.GuiNotifier class example: module.setGuiNotifier(table, [GuiNotifier.DROPEVENT], [DropBase.PIDS], callback=module.theCallback)

enableMultiColumnSort = False
enterEvent(self, QEvent)[source]
exportTableDialog(exportAll=True)[source]

export the contents of the table to a file The actual data values are exported, not the visible items which may be rounded due to the table settings

Parameters

exportAll – True/False - True implies export whole table - but in visible order False, export only the visible table

getCellToRows(cellItem, attribute)[source]

Get the list of objects which cellItem maps to for this table To be subclassed as required

getDataFrameFromList(table=None, buildList=None, colDefs=None)[source]

Return a Pandas dataFrame from an internal list of objects The columns are based on the ‘func’ functions in the columnDefinitions

Parameters
  • buildList

  • colDefs

Return pandas dataFrameObject

getDataFrameFromRows(table=None, dataFrame=None, colDefs=None)[source]

Return a Pandas dataFrame from the internal rows of an internal Pandas dataFrame The columns are based on the ‘func’ functions in the columnDefinitions

Parameters
  • buildList

  • colDefs

Return pandas dataFrame

getDataFromFrame(table, df, colDefs, columnsMap=None)[source]
getFirstObject()[source]
getHiddenColumns()[source]

get a list of currently hidden columns

getIndexList(classItems, attribute)[source]

Get the list of objects on which to before the indexing To be subclassed as required

getRightMouseItem()[source]
getSelectedObjects(fromSelection=None)[source]
Parameters

fromSelection

Returns

get a list of table objects. If the table has a header called pid, the object is a ccpn Core obj like Peak, otherwise is a Pandas series object corresponding to the selected row(s).

getSelectedRowAsDataFrame()[source]
getSelectedRows()[source]
handleItemChanged(item)[source]
hideDefaultColumns()[source]

If the table is empty then check visible headers against the last header hidden list

hideSearchWidget()[source]
highlightObjects(objectList, scrollToSelection=True)[source]

Highlight a list of objects in the table

initSearchWidget()[source]
keyPressEvent(event)[source]

Handle keyPress events on the table

leaveEvent(self, QEvent)[source]
mousePressEvent(event)[source]

handle mouse press events Clicking is handled on the mouse release

populateTable(rowObjects=None, columnDefs=None, selectedObjects=None)[source]

Populate the table with a set of objects to highlight, or keep current selection highlighted with the first item visible.

Use selectedObjects = [] to clear the selected items

Parameters

rowObjects – list of objects to set each row

pressingModifiers()[source]

Is the user clicking while holding a modifier

rawDataToDF()[source]
refreshHeaders()[source]
refreshTable()[source]
scrollToSelectedIndex()[source]
selectFirstRow(doCallback=True)[source]
selectIndex(idx, doCallback=True)[source]
selectLastRow()[source]
selectObjects(objList: list, setUpdatesEnabled: bool = False)[source]

Select the object in the table

setActionCallback(actionCallback)[source]
setCurrent()[source]

Set self to current.guiTable

setData(data)[source]

Set the data displayed in the table. Allowed formats are:

  • numpy arrays

  • numpy record arrays

  • metaarrays

  • list-of-lists [[1,2,3], [4,5,6]]

  • dict-of-lists {‘x’: [1,2,3], ‘y’: [4,5,6]}

  • list-of-dicts [{‘x’: 1, ‘y’: 4}, {‘x’: 2, ‘y’: 5}, …]

  • Pandas Dataframes

setDataFromSearchWidget(dataFrame)[source]

Set the data for the table from the search widget

setDefaultTableData()[source]

Populate an empty table data object

setHiddenColumns(texts, update=True)[source]

set a list of columns headers to be hidden from the table.

setRow(*args, **kwds)
setRowBackgroundColour(row, colour, columnList=None)[source]

Set the background colour for the row

Parameters
  • row – row to be coloured

  • colour – colour of type QtGui.Brush/QtGui.Color

  • columnList – None, or list of column numbers, out-of-range columns are ignored

Returns

setSelectionCallback(selectionCallback)[source]
setTableFromDataFrameObject(dataFrameObject, columnDefs=None)[source]

Populate the table from a Pandas dataFrame

setTableNotifiers(tableClass=None, rowClass=None, cellClassNames=None, tableName=None, rowName=None, className=None, changeFunc=None, updateFunc=None, tableSelection=None, pullDownWidget=None, callBackClass=None, selectCurrentCallBack=None, searchCallBack=None, moduleParent=namespace(className='notDefined', serial=0))[source]

Set a Notifier to call when an object is created/deleted/renamed/changed rename calls on name change calls on any other attribute

Parameters
  • pulldown (tableClass - class of table object, selected by) –

  • table (rowClass - class identified by a row in the) –

  • cellClassName) (cellClassNames - list of tuples (cellClass,) – class that affects row when changed

  • row (tableName - name of attribute for parent name of) –

  • cell (rowName - name of attribute for parent name of) –

  • changeFunc

  • updateFunc

  • tableSelection

  • pullDownWidget

Returns

setTimeDelay()[source]
showColumns(dataFrameObject)[source]
showSearchSettings()[source]

Display the search frame in the table

styleSheet = 'GuiTable {\n                        background-color: %(GUITABLE_BACKGROUND)s;\n                        alternate-background-color: %(GUITABLE_ALT_BACKGROUND)s;\n                        border: 2px solid %(BORDER_NOFOCUS)s;\n                        border-radius: 2px;\n                    }\n                    GuiTable::focus {\n                        background-color: %(GUITABLE_BACKGROUND)s;\n                        alternate-background-color: %(GUITABLE_ALT_BACKGROUND)s;\n                        border: 2px solid %(BORDER_FOCUS)s;\n                        border-radius: 2px;\n                    }\n                    GuiTable::item {\n                        padding: 2px;\n                        color: %(GUITABLE_ITEM_FOREGROUND)s;\n                    }\n                    GuiTable::item::selected {\n                        background-color: %(GUITABLE_SELECTED_BACKGROUND)s;\n                        color: %(GUITABLE_SELECTED_FOREGROUND)s;\n                    }\n                    '
tableToDataFrame(exportAll=True)[source]

Extract the table as a dataframe for later printing The actual data values are exported, not the visible items which may be rounded due to the table settings

Parameters

exportAll – True/False - True implies export whole table - but in visible order False, export only the visible table

unsetCurrent()[source]

Set self to current.guiTable

class ccpn.ui.gui.widgets.GuiTable.GuiTableDelegate(parent)[source]

Bases: PyQt5.QtWidgets.QStyledItemDelegate

handle the setting of data when editing the table

createEditor(self, QWidget, QStyleOptionViewItem, QModelIndex) QWidget[source]
setEditorData(widget, index) None[source]

populate the editor widget when the cell is edited

setModelData(widget, mode, index)[source]

Set the object to the new value :param widget - typically a lineedit handling the editing of the cell: :param mode - editing mode: :param index - QModelIndex of the cell:

class ccpn.ui.gui.widgets.GuiTable.GuiTableFrame(*args, **kwargs)[source]

Bases: ccpn.ui.gui.widgets.Frame.Frame

ccpn.ui.gui.widgets.GuiTable.dataFrameToCsv(dataFrame, path, *args)[source]
ccpn.ui.gui.widgets.GuiTable.dataFrameToExcel(dataFrame, path, sheet_name='Table', columns=None)[source]
ccpn.ui.gui.widgets.GuiTable.dataFrameToJson(dataFrame, path, *args)[source]
ccpn.ui.gui.widgets.GuiTable.dataFrameToTsv(dataFrame, path, *args)[source]
ccpn.ui.gui.widgets.GuiTable.exportTableDialog(dataFrame, columns=None, path='~/table.xlsx')[source]

Open the ExportDialog to export any dataFrame to different formats

ccpn.ui.gui.widgets.GuiTable.findExportFormats(path, dataFrame, sheet_name='Table', filterType=None, columns=None)[source]

ccpn.ui.gui.widgets.HLine module

class ccpn.ui.gui.widgets.HLine.HLine(parent=None, style='SolidLine', colour=2, height=10, lineWidth=2, divisor=3, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Widget.Widget

DASH_DOT_DOT_LINE = 'DashDotDotLine'
DASH_DOT_LINE = 'DashDotLine'
DASH_LINE = 'DashLine'
SOLID_LINE = 'SolidLine'
drawLine(qp, style=None, colour=None)[source]
paintEvent(self, QPaintEvent)[source]
styles = {'DashDotDotLine': 5, 'DashDotLine': 4, 'DashLine': 2, 'SolidLine': 1}
class ccpn.ui.gui.widgets.HLine.LabeledHLine(parent=None, height=30, text=None, bold=False, sides='both', style='SolidLine', colour=2, lineWidth=2, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Frame.Frame

A class to make a Frame with an Hline - Label - Hline

setText(text)[source]

Set the text of the widget

ccpn.ui.gui.widgets.HLine.main()[source]

ccpn.ui.gui.widgets.HighlightBox module

Module Documentation here

class ccpn.ui.gui.widgets.HighlightBox.HighlightBox(parent=None, style: str = 'SolidLine', colour: str | PyQt5.QtGui.QColor = 2, lineWidth: int = 2, showBorder=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Widget.Widget

Widget to put a selection box around a span of cells in a grid layout

DASH_DOT_DOT_LINE = 'DashDotDotLine'
DASH_DOT_LINE = 'DashDotLine'
DASH_LINE = 'DashLine'
SOLID_LINE = 'SolidLine'
paintEvent(self, QPaintEvent)[source]
property showBorder

- None, mutable - Get the visible state of the border without hiding the widget

styles = {'DashDotDotLine': 5, 'DashDotLine': 4, 'DashLine': 2, 'SolidLine': 1}
ccpn.ui.gui.widgets.HighlightBox.main()[source]

ccpn.ui.gui.widgets.Icon module

Module Documentation here

class ccpn.ui.gui.widgets.Icon.Icon(image=None, color=None, size=21)[source]

Bases: PyQt5.QtGui.QIcon

addFile(self, str, size: QSize = QSize(), mode: QIcon.Mode = QIcon.Normal, state: QIcon.State = QIcon.Off)[source]

ccpn.ui.gui.widgets.InputDialog module

Module Documentation here

ccpn.ui.gui.widgets.InputDialog.askFloat(title, prompt, initialValue=0.0, minValue=- 2147483647, maxValue=2147483647, decimals=6, parent=None)[source]
ccpn.ui.gui.widgets.InputDialog.askInteger(title, prompt, initialValue=0, minValue=- 2147483647, maxValue=2147483647, parent=None)[source]
ccpn.ui.gui.widgets.InputDialog.askPassword(title, prompt, parent=None)[source]
ccpn.ui.gui.widgets.InputDialog.askString(title, prompt, initialValue='', parent=None)[source]

ccpn.ui.gui.widgets.IpythonConsole module

Module Documentation here

class ccpn.ui.gui.widgets.IpythonConsole.IpythonConsole(mainWindow, namespace=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Widget.Widget

focusedIn
mouseMoved
setProject(project)[source]
writeConsoleCommand(command: str, **objectParameters)[source]

Set keyword:value objectParameters to point to the relevant objects, echo command in console, and set Undo

Example calls:

writeConsoleCommand(“application.newSpectrumDisplay(spectrum)”, spectrum=spectrumOrPid)

writeConsoleCommand(

“newAssignment = peak.assignDimension(axisCode=%s, value=[newNmrAtom]” % axisCode, peak=peakOrPid)

ccpn.ui.gui.widgets.Label module

Module Documentation here

class ccpn.ui.gui.widgets.Label.ActiveLabel(parent=None, mainWindow=None, text='', textColour=None, textSize=12, bold=False, margins=[2, 1, 2, 1], selectionCallback=None, actionCallback=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Label.Label

enterEvent(self, QEvent)[source]
leaveEvent(self, QEvent)[source]
mouseDoubleClickEvent(ev)[source]

Handle double click and call _actionCallback if set

mouseReleaseEvent(ev)[source]

Handle double click and call _selectionCallback if set

setActionCallback(callback=None)[source]

Sets callback on mouse double click

setEnterLeaveCallback(enterCallback, leaveCallback)[source]
setSelectionCallback(callback=None)[source]

Sets callback on mouse click

class ccpn.ui.gui.widgets.Label.Label(parent=None, text='', textColour=None, textSize=None, bold=False, italic=False, margins=[2, 1, 2, 1], icon=None, iconSize=(16, 16), **kwds)[source]

Bases: PyQt5.QtWidgets.QLabel, ccpn.ui.gui.widgets.Base.Base

get()[source]

get the label text

set(text='')[source]

set label text, applying translator

class ccpn.ui.gui.widgets.Label.VerticalLabel(parent=None, text='', textColour=None, textSize=12, bold=False, margins=[2, 1, 2, 1], orientation='horizontal', **kwds)[source]

Bases: pyqtgraph.widgets.VerticalLabel.VerticalLabel, ccpn.ui.gui.widgets.Base.Base

get()[source]

get the label text

set(text='')[source]

set label text, applying translator

ccpn.ui.gui.widgets.LegendItem module

Module Documentation Here

class ccpn.ui.gui.widgets.LegendItem.CustomItemSample(item, showLine)[source]

Bases: pyqtgraph.graphicsItems.LegendItem.ItemSample

paint(self, QPainter, QStyleOptionGraphicsItem, widget: QWidget = None)[source]
class ccpn.ui.gui.widgets.LegendItem.LegendItem(plot, size=None, offset=None)[source]

Bases: pyqtgraph.graphicsItems.LegendItem.LegendItem

addItem(item, name, showLine=True)[source]
clearLegend()[source]

Removes all items from the legend

paint(self, QPainter, QStyleOptionGraphicsItem, widget: QWidget = None)[source]
updateSize()[source]

ccpn.ui.gui.widgets.LineEdit module

Module Documentation here

class ccpn.ui.gui.widgets.LineEdit.FloatLineEdit(parent, text='', textAlignment='c', backgroundText=None, minimumWidth=100, textColor=None, editable=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.LineEdit.LineEdit

get()[source]
set(text='')[source]
class ccpn.ui.gui.widgets.LineEdit.LineEdit(parent, text='', textAlignment='c', backgroundText=None, minimumWidth=100, textColor=None, editable=True, **kwds)[source]

Bases: PyQt5.QtWidgets.QLineEdit, ccpn.ui.gui.widgets.Base.Base

get()[source]
set(text='')[source]
class ccpn.ui.gui.widgets.LineEdit.PasswordEdit(parent, text='', textAlignment='c', backgroundText=None, minimumWidth=100, textColor=None, editable=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.LineEdit.LineEdit

Subclass of LineEdit to handle passwords to be shown as **

ccpn.ui.gui.widgets.LinearRegionsPlot module

class ccpn.ui.gui.widgets.LinearRegionsPlot.LinearRegionsPlot(values=None, orientation='v', brush=None, colour=None, movable=True, bounds=None, **kwds)[source]

Bases: pyqtgraph.graphicsItems.LinearRegionItem.LinearRegionItem

Used for marking a horizontal or vertical region in plots. The region can be dragged and is bounded by lines which can be dragged individually.

setLines(values)[source]
class ccpn.ui.gui.widgets.LinearRegionsPlot.TargetButtonSpinBoxes(parent, application=None, orientation='v', plotWidget=None, values=None, step=None, colour=None, brush=None, movable=True, bounds=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Widget.Widget

destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)[source]
get()[source]
Returns

positions displayed on the boxes

setPlotWidget(plotWidget)[source]
setValues(values)[source]

ccpn.ui.gui.widgets.ListView module

Module Documentation here

class ccpn.ui.gui.widgets.ListView.ListView(parent=None, mainWindow=None, fitToContents=False, listViewContainer=None, maximumRows=200, headerHeight=None, minRowCount=None, multiSelect=False, **kwds)[source]

Bases: PyQt5.QtWidgets.QListView, ccpn.ui.gui.widgets.Base.Base

Class to implement a ListView

ListView can be set to show a maximum number of rows. Can also be minimised to the contents - this requires the container to be set.

Also advisable to set the sizePolicy of the container: e.g. listViewContainer.setSizePolicy(QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Ignored)

mouseMoveEvent(event: PyQt5.QtGui.QMouseEvent) None[source]

Create a mouse drag event with the selected items when dragging with the left button

mousePressEvent(event: PyQt5.QtGui.QMouseEvent) None[source]

Keep a list of the selected items when the left mouse button is pressed

resizeEvent(ev: PyQt5.QtGui.QResizeEvent) None[source]

Resize the listview to its contents

ccpn.ui.gui.widgets.ListWidget module

List widget

class ccpn.ui.gui.widgets.ListWidget.ListWidget(parent=None, objects=None, callback=None, rightMouseCallback=None, contextMenu=True, multiSelect=True, acceptDrops=False, sortOnDrop=False, allowDuplicates=False, copyDrop=True, infiniteHeight=False, minRowsVisible=4, emptyText=None, **kwds)[source]

Bases: PyQt5.QtWidgets.QListWidget, ccpn.ui.gui.widgets.Base.Base

addItem(self, QListWidgetItem)[source]
addItem(self, str) None
changed
clearSelection(self)[source]
cleared
contextCallback(remove=True)[source]
dragEnterEvent(self, QDragEnterEvent)[source]
dragMoveEvent(self, QDragMoveEvent)[source]
dropEvent(self, QDropEvent)[source]
dropped
getContextMenu()[source]
getItems()[source]
getObjects()[source]
getSelectedObjects()[source]
getSelectedTexts()[source]
getTexts()[source]
hideAllItems()[source]
minimumSizeHint(self) QSize[source]
mousePressEvent(self, QMouseEvent)[source]
paintEvent(self, QPaintEvent)[source]
raiseContextMenu(event)[source]

Raise the context menu and return the action clicked

removeItem()[source]
removeTexts(texts)[source]
renameItem(oldName, newName)[source]
scrollToFirstSelected()[source]
select(name)[source]
selectItems(names)[source]
selectObject(obj)[source]
selectObjects(objs)[source]
setContextMenu(menu)[source]
setObjects(objects, name='pid')[source]
setSelectContextMenu()[source]
setSelectDeleteContextMenu()[source]
setTexts(texts, clear=True)[source]
showAllItems()[source]
showItems(items, select=False)[source]

Shows specific items and hides the rest

sizeHint(self) QSize[source]
class ccpn.ui.gui.widgets.ListWidget.ListWidgetPair(parent=None, leftObjects=None, rightObjects=None, callback=None, rightMouseCallback=None, contextMenu=True, multiSelect=True, acceptDrops=True, showMoveArrows=False, showMoveText=False, leftLabel='Not included', rightLabel='Included', setLayout=True, copyDrop=False, objAttr='pid', **kwds)[source]

Bases: ccpn.ui.gui.widgets.Widget.Widget

Define a pair of listWidgets such that information can be copied from one side to the other and vise-versa

getLeftList()[source]
getRightList()[source]
setListObjects(left)[source]
class ccpn.ui.gui.widgets.ListWidget.ListWidgetSelector(parent=None, objects=None, callback=None, rightMouseCallback=None, contextMenu=True, multiSelect=True, acceptDrops=False, title='Copy Items', **kwds)[source]

Bases: ccpn.ui.gui.widgets.Frame.Frame

Define a pair of listWidgets such that information can be cpoied from one side to the other and vise-versa

getLeftList()[source]
getRightList()[source]
residueTypes = [('Alanine', 'ALA', 'A'), ('Arginine', 'ARG', 'R'), ('Asparagine', 'ASN', 'N'), ('Aspartic acid', 'ASP', 'D'), ('ASP/ASN ambiguous', 'ASX', 'B'), ('Cysteine', 'CYS', 'C'), ('Glutamine', 'GLN', 'Q'), ('Glutamic