pyFAI.gui.widgets package

pyFAI.gui.widgets.AdvancedComboBox module

class pyFAI.gui.widgets.AdvancedComboBox.AdvancedComboBox(parent=None)

Bases: PyQt5.QtWidgets.QComboBox

ComboBox with other features

  • Provide a way to custom the displayed when using table view model.

  • Allow to disable hardcoded update of currentIndex.

__init__(parent=None)

Initialize self. See help(type(self)) for accurate signature.

initStyleOption(option)
Parameters

option (qt.QStyleOptionComboBox) – Option to initialize

paintEvent(event)
Parameters

event (qt.QPaintEvent) – Qt event

setDisplayedDataCallback(callback)

Set a callback to custom the displayed text and icon of the displayed selected item.

This was designed to be used with setModel, in case the cell to display is not part of the model provided.

Only qt.Qt.DisplayRole and qt.Qt.DecorationRole are supported.

def displayedData(widget, row, role=qt.Qt.DisplayRole):
    if role == qt.Qt.DisplayRole:
        model = widget.model()
        index0 = model.index(row, 0)
        index1 = model.index(row, 1)
        text = index0.data() + " " + index1.data()
        return text
    elif role == qt.Qt.DecorationRole:
        return None
    return None
comboBox = AdvancedComboBox()
comboBox.setModel(model)
comboBox.setDisplayedDataCallback(displayedData)
Parameters

callback (Callable(int,QVariant)) – Callback a-la Qt abstract model data. Called with the row index and the role to update the text and the icon of the displayed item.

setModel(self, QAbstractItemModel)
setUpdateCurrentIndexEnabled(enable)

Allow to disable the default behaviour of the QComboBox which update the current index to 0 when the model crow from an empty state.

pyFAI.gui.widgets.AdvancedSpinBox module

class pyFAI.gui.widgets.AdvancedSpinBox.AdvancedSpinBox(parent=None)

Bases: PyQt5.QtWidgets.QSpinBox

A spin box with a little more custom behaviour.

__init__(parent=None)

Initialize self. See help(type(self)) for accurate signature.

eventFilter(widget, event)
Parameters
  • widget (qt.QWidget) – The widget receiving this event

  • event (qt.QEvent) – Event received by the widget

mouseWheelEnabled()

True if the mouse wheel is used to changed the value contained by the spin box.

Return type

bool

setMouseWheelEnabled(isWheelEnabled)

Change the behaviour of the mouse wheel with the value.

Parameters

isWheelEnabled (bool) – If True the mouse wheel can be used to edit the value contained into the spin box.

pyFAI.gui.widgets.CalibrantPreview module

pyFAI.gui.widgets.CalibrantSelector module

class pyFAI.gui.widgets.CalibrantSelector.CalibrantSelector(parent=None)

Bases: PyQt5.QtWidgets.QComboBox

__init__(parent=None)

Initialize self. See help(type(self)) for accurate signature.

findCalibrant(calibrant)

Returns the first index containing the requested calibrant. Else return -1

model(self) → QAbstractItemModel
setFileLoadable(isFileLoadable)
setModel(self, QAbstractItemModel)
sigLoadFileRequested

pyFAI.gui.widgets.ChoiceToolButton module

class pyFAI.gui.widgets.ChoiceToolButton.ChoiceToolButton(parent=None)

Bases: PyQt5.QtWidgets.QToolButton

ToolButton providing a set of actions to select.

The action is only triggered when the button is clicked.

The method addDefaultAction() is used to define new actions that can be selected.

__init__(parent=None)

Initialize self. See help(type(self)) for accurate signature.

addDefaultAction(action)

Add an action that can be selected to set the default action displayed by the tool button.

Parameters

action (qt.QAction) – An action to execute when selected on the menu and then clicked.

Return type

qt.QAction

Returns

An action triggered when the provided action is selected.

defaultAction()

Returns the default selected action.

setDefaultAction(action)

Set the default action.

Reimplement the default behaviour to avoid to add this action to the list of available actions.

setWaiting(isWaiting)

Enable a waiting state.

Parameters

isWaiting (bool) – If true switch the widget to waiting state

pyFAI.gui.widgets.ColoredCheckBox module

class pyFAI.gui.widgets.ColoredCheckBox.ColoredCheckBox(parent=None)

Bases: PyQt5.QtWidgets.QCheckBox

Check box with an explict API to change the background color of the indicator.

__init__(parent=None)

Initialize self. See help(type(self)) for accurate signature.

boxColor()
paintEvent(self, QPaintEvent)
setBoxColor(color)

pyFAI.gui.widgets.DetectorLabel module

class pyFAI.gui.widgets.DetectorLabel.DetectorLabel(parent=None)

Bases: PyQt5.QtWidgets.QLabel

Readonly line display

__init__(parent=None)

Initialize self. See help(type(self)) for accurate signature.

detector()
detectorModel()
dragEnterEvent(self, QDragEnterEvent)
dropEvent(self, QDropEvent)
setDetector(detector)
setDetectorModel(model)

pyFAI.gui.widgets.DetectorModel module

class pyFAI.gui.widgets.DetectorModel.AllDetectorModel(parent)

Bases: PyQt5.QtGui.QStandardItemModel

CLASS_ROLE = 256
MANUFACTURER_ROLE = 258
MODEL_ROLE = 257
__init__(parent)

Initialize self. See help(type(self)) for accurate signature.

indexFromDetector(detector, manufacturer)
class pyFAI.gui.widgets.DetectorModel.DetectorFilter(parent)

Bases: PyQt5.QtCore.QSortFilterProxyModel

__init__(parent)

Initialize self. See help(type(self)) for accurate signature.

filterAcceptsRow(self, int, QModelIndex) → bool
indexFromDetector(detector, manufacturer)
setManufacturerFilter(manufacturer)

pyFAI.gui.widgets.DetectorSelector module

class pyFAI.gui.widgets.DetectorSelector.DetectorSelector(parent=None)

Bases: PyQt5.QtWidgets.QComboBox

__init__(parent=None)

Initialize self. See help(type(self)) for accurate signature.

findDetectorClass(detectorClass)

Returns the first index containing the requested detector. Else return -1

model(self) → QAbstractItemModel
setManufacturerFilter(manufacturer)
setModel(self, QAbstractItemModel)

pyFAI.gui.widgets.FileEdit module

class pyFAI.gui.widgets.FileEdit.FileEdit(parent=None)

Bases: PyQt5.QtWidgets.QLineEdit

QLineEdit connected to a DataModel containing a file or nothing.

It allows to edit a float value which can be nonified (by the use of an empty string).

__init__(parent=None)

Initialize self. See help(type(self)) for accurate signature.

applyedWhenFocusOut

Apply the current edited value to the widget when it lose the focus. By default the previous value is displayed.

dragEnterEvent(self, QDragEnterEvent)
dropEvent(self, QDropEvent)
event(self, QEvent) → bool
focusInEvent(self, QFocusEvent)
isApplyedWhenFocusOut()
keyPressEvent(self, QKeyEvent)
model()
setApplyedWhenFocusOut(isApplyed)
setModel(model)
sigValueAccepted

Emitted when a file was accepted.

In case the value is still the same, no signal is sent from the DataModel, but this signal is emitted.

pyFAI.gui.widgets.FitParamView module

pyFAI.gui.widgets.GeometryHistoryComboBox module

pyFAI.gui.widgets.GeometryLabel module

class pyFAI.gui.widgets.GeometryLabel.GeometryLabel(parent=None)

Bases: silx.gui.widgets.ElidedLabel.ElidedLabel

Label displaying a specific OpenCL device.

__init__(parent=None)

Initialize self. See help(type(self)) for accurate signature.

geometryModel()

Returns the geometry model

Return type

Union[None,GeometryModel]

setGeometryModel(geometryModel)

Set the geometry to display.

Parameters

geometryModel (GeometryModel) – A geometry.

pyFAI.gui.widgets.LoadImageToolButton module

pyFAI.gui.widgets.MethodLabel module

class pyFAI.gui.widgets.MethodLabel.MethodLabel(parent=None)

Bases: PyQt5.QtWidgets.QLabel

Readonly line display

__init__(parent=None)

Initialize self. See help(type(self)) for accurate signature.

labelTemplate()
method()
Return type

Union[None,method_registry.Method]

methodAvailability()
setLabelTemplate(template)

Set the template used to format the label

Parameters

template (str) – The template used to format the label

setMethod(method)
setMethodAvailability(availability)

Display or not in the widget if the method is available or not.

Parameters

availability (bool) – Display in the widget if the method is available or not.

pyFAI.gui.widgets.MonitorNameEdit module

class pyFAI.gui.widgets.MonitorNameEdit.MonitorNameEdit

Bases: PyQt5.QtWidgets.QLineEdit

QLineEdit specialied to select a monitor name from HDF5 file.

dragEnterEvent(self, QDragEnterEvent)
dropEvent(self, QDropEvent)

pyFAI.gui.widgets.OpenClDeviceLabel module

class pyFAI.gui.widgets.OpenClDeviceLabel.OpenClDeviceLabel(parent=None)

Bases: PyQt5.QtWidgets.QLabel

Label displaying a specific OpenCL device.

__init__(parent=None)

Initialize self. See help(type(self)) for accurate signature.

device()

Returns the selected OpenCL device.

A device can be identified as a string like ‘any’, ‘cpu’ or ‘gpu’ or a tuple containing the platform index and the device index.

Return type

Union[None,str,Tuple[int,int]]

Raises

ValueError – If no devices are selected

setDevice(device)

Select an OpenCL device displayed on this dialog.

A device can be identified as a string like ‘any’, ‘cpu’ or ‘gpu’ or a tuple containing the platform index and the device index.

If this device is available on this platform is is selected in the list. Else it is selected as a custom indexes.

Parameters

device (Union[None,str,Tuple[int,int]]) – A device.

pyFAI.gui.widgets.QuantityEdit module

pyFAI.gui.widgets.QuantityLabel module

pyFAI.gui.widgets.UnitLabel module

pyFAI.gui.widgets.UnitSelector module

class pyFAI.gui.widgets.UnitSelector.UnitSelector(parent=None)

Bases: PyQt5.QtWidgets.QComboBox

__init__(parent=None)

Initialize self. See help(type(self)) for accurate signature.

findUnit(unit)

Returns the first index containing the requested detector. Else return -1

model(self) → QAbstractItemModel
setModel(self, QAbstractItemModel)
setShortNameDisplay(shortName)
setUnits(units)
units()

pyFAI.gui.widgets.WorkerConfigurator module

Module contents

Module containing generic widgets