PyDMEmbeddedDisplay

class pydm.widgets.embedded_display.PyDMEmbeddedDisplay(parent=None)[source]

Bases: QFrame, PyDMPrimitiveWidget

A QFrame capable of rendering a PyDM Display

Parameters:

parent (QWidget) – The parent widget for the Label

connect()[source]

Establish the connection between the embedded widget and the channels associated with it.

create_context_menu(pos: QPoint) _QMenu[source]

Create the right-click context menu for this embedded widget based on the location of the mouse click

disconnect()[source]

Disconnects the embedded widget from the channels associated with it.

disconnectWhenHidden

Disconnect from PVs when this widget is not visible.

Return type:

bool

property embedded_widget

The embedded widget being displayed.

Return type:

QWidget

filename

Filename of the display to embed.

Return type:

str

If True, any symlinks in the path to filename (including the base path of the parent display) will be followed, so that it will always use the canonical path. If False (default), the file will be searched without canonicalizing the path beforehand.

Note that it will not work on Windows if you’re using a Python version prior to 3.8.

Return type:

bool

hideEvent(e)[source]

Hide events are sent to widgets that become invisible on the screen.

Parameters:

event (QHideEvent) –

loadWhenShown

If True, only load and display the file once the PyDMEmbeddedDisplayWidget is visible on screen. This is very useful if you have many different PyDMEmbeddedWidgets in different tabs of a QTabBar or PyDMTabBar: only the tab that the user is looking at will be loaded, which can greatly speed up the launch time of a display.

If this property is changed from ‘True’ to ‘False’, and the file has not been loaded yet, it will be loaded immediately.

Return type:

bool

macros

JSON-formatted string containing macro variables to pass to the embedded file.

Return type:

str

minimumSizeHint()[source]

This holds the recommended minimum size for the widget.

Return type:

QSize

open_display_in_new_window() None[source]

Open the embedded display in a new window

open_file(force=False)[source]

Opens the widget specified in the widget’s filename property.

Returns:

display

Return type:

QWidget

parsed_macros()[source]

Dictionary containing the key value pair for each macro specified.

Return type:

dict

set_macros_and_filename(new_filename, new_macros)[source]

A method to change both macros and the filename of an embedded display. the method takes in a Filename of the display to embed and a JSON-formatted string containing macro variables to pass to the embedded file.

Parameters:
  • new_macros (str) –

  • new_filename (str) –

showEvent(e)[source]

Show events are sent to widgets that become visible on the screen.

Parameters:

event (QShowEvent) –

show_context_menu(pos: QPoint) None[source]

Display the right-click context menu for this embedded widget at the location of the mouse click

sizeHint()[source]

This holds the recommended size for the widget.

Return type:

QSize

sizePolicy()[source]

This holds the sizePolicy for the widget.

Return type:

QSize

Note

See QFrame Documentation for all inherited properties and methods.