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_list(text_list: list[str, str], title: str | None = None)#

Set the widget’s text from a list of entries.

Each entry in the list is a tuple with the first element being the type of the entry (header, section, subsection) and the second element being the value. The type will determine the formatting of the entry.

Parameters:
  • text_list (list[str, str]) – The list of the type keys and /text entries to be displayed. The list will be processed with type keys used for formatting the entries.

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

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.