The widgets.misc sub-package#

Package with miscellaneous individual QWidgets.

class pydidas.widgets.misc.LineEditWithIcon(icon=None, **kwargs)#

Bases: QLineEdit

A QLineEdit with an added icon.

Parameters:
  • parent (QWidget, optional) – The Qt parent widget. The default is None.

  • **kwargs (Any supported Qt arguments) – Any arguments which have an associated setArgName method in Qt can be defined at creation.

class pydidas.widgets.misc.PointsForBeamcenterWidget(plot, parent=None, **kwargs)#

Bases: QWidget, CreateWidgetsMixIn, ParameterWidgetsMixIn

A widget to display a list of points in an associated plot.

add_point_to_table(xpos: float, ypos: float)#

Add a newly selected point to the table.

Parameters:
  • xpos (float) – The x position.

  • ypos (float) – The y position

process_new_font_metrics(char_width: float, char_height: float)#

Adjust the widget’s width based on the font metrics.

Parameters:
  • char_width (float) – The font width in pixels.

  • char_height (float) – The font height in pixels.

class pydidas.widgets.misc.ReadOnlyTextWidget(parent: None | QWidget = None, **kwargs: dict)#

Bases: PydidasWidgetMixin, QTextEdit

A QTextEdit widget with some layout settings in setup and a more advanced setText.

Parameters:
  • parent (QWidget, optional) – The Qt parent widget. The default is None.

  • **kwargs (Any supported Qt arguments) – Any arguments which have an associated setArgName method in Qt can be used at creation.

reprint()#

Reprint the latest text with the updated font settings.

setText(text: str, title: str = '')#

Set the widget’s text.

Parameters:
  • text (str) – The text to be displayed.

  • title (str, optional) – The title. If None, no title will be printed. The default is None.

set_text_from_dict(text_dict: dict, title: str = '', one_line_entries: bool = False, indent: int = 4)#

Set the widget’s text.

This widget accepts both a single text entry and a list of entries for the text. A list of entries will be converted to a single text according to a <key: entry> scheme.

Parameters:
  • text_dict (dict) – The dictionnary of the text to be displayed. The dictionary will be processed with keys as item titles and values as corresponding items.

  • title (str, optional) – The title. If None, no title will be printed. The default is None.

  • one_line_entries (bool, optional) – Flag to force printing of keys and entries in one line instead of two lines with an indent. The default is False.

  • indent (int, optional) – The indent depth for list entries. The default is 4.

class pydidas.widgets.misc.SelectImageFrameWidget(*input_params: tuple[Parameter, ...], **kwargs: dict)#

Bases: WidgetWithParameterCollection

A widget which allows to select an image from a file.

Parameters:
  • *input_params (tuple[Parameter, ...]) – Parameters passed to the widget to handle the frame references.

  • **kwargs (dict) –

    Supported keyword arguments are;

    parentUnion[None, QWidget], optional

    The parent widget. The default is None.

    import_referenceUnion[None, str], optional

    The reference for the file dialogue to store persistent settings. If None, only the

open_image_dialog()#

Open the image selected through the filename.

process_new_filename_input(filename: Path | str)#

Process the input of a new filename in the Parameter widget.

Parameters:

filename (str) – The filename.

restore_param_widgets()#

Restore the hdf5 parameter keys from the Parameters.

class pydidas.widgets.misc.ShowIntegrationRoiParamsWidget(**kwargs: dict)#

Bases: WidgetWithParameterCollection

A widget which allows to show the Parameters for the integration region.

The Parameter widgets are created for an associated plugin which is not owned by this widget.

clear_plugin_widgets()#

Clear the plugin_container widget to create new widgets.

create_widgets_for_axis(plugin: BasePlugin, axis: Literal['rad', 'azi'])#

Create the widgets for the given axis.

Parameters:
  • plugin (pydidas.plugins.BasePlugin) – The plugin for which widgets shall be created.

  • axis (Literal["rad", "azi"]) – The axis name.

toggle_enable(enabled: bool)#

Toggle the selection mode and enable/disable the Parameter widgets.

Parameters:

enabled (bool) – Editing enabled flag.