MetalGUI¶
- class MetalGUI(design: QDesign | None = None)[source]¶
Qiskit Metal Main GUI.
This class extends the QMainWindowBaseHandler class.
The GUI can be controlled by the user using the mouse and keyboard or API for full control.
- Parameters:
QMainWindowBase (QMainWindowBase) – Base window
design (QDesign, optional) – Pass in the design that the GUI should handle. Defaults to None.
Attributes
- axes¶
Returns the axes.
- canvas¶
Get access to the canvas that handles the figure and axes, and their main functions.
- Returns:
The canvas
- Return type:
- figure¶
Return axis to the figure of the canvas.
- path_stylesheets¶
Returns the path to the stylesheet.
Methods
- clear_settings()¶
Clear the settings that get saved each time the main window is closed.
This will reset the window layout to the default.
- create_log_handler(name_toshow: str, logger: Logger)¶
Creates a log handler.
- Parameters:
name_toshow (str) – Display name
logger (logging.Logger) – The logger
- Returns:
A LogHandler_for_QTextLog
- Return type:
LogHandler_for_QTextLog
- dockLibrary_filter_onChanged(text)[source]¶
Text changed event for filter_text_design :param text: Text typed in the filter box.
- edit_component(name: str)[source]¶
Set the component to be examined by the component widget.
- Parameters:
name (str) – Name of component to exmaine.
- elements_lineEdit_2_onChanged(text)[source]¶
Text changed event for QGeometry/Layer text box :param text: Text typed in the filter box.
- elements_lineEdit_onChanged(text)[source]¶
Text changed event for QGeometry/Component text box :param text: Text typed in the filter box.
- filter_text_design_onChanged(text)[source]¶
Text changed event for filter_text_design :param text: Text typed in the filter box.
- get_axes(num: int | None = None)[source]¶
Return access to the canvas axes. If num is specified, returns the n-th axis.
- Parameters:
num (int, optional) – If num is specified, returns the n-th axis. Defaults to None.
- Returns:
Of the canvas
- Return type:
List[Axes] or Axes
- gui_create_build_log_window(_=None)[source]¶
Creates a separate window that displays the recent successful/fails of all components for the design.
- Parameters:
_ (object, optional) – Default parameters for slot - used to call from action
- highlight_components(component_names: List[str])[source]¶
Hihglight a list of components.
- Parameters:
component_names (List[str]) – List of component names to highlight
- load_stylesheet(path=None)¶
Load and set stylesheet for the main gui.
- Parameters:
path (str) – Path to stylesheet or its name. Can be: ‘default’, ‘qdarkstyle’ or None. qdarkstyle requires >>> pip install qdarkstyle
- Returns:
False if failure, otherwise nothing
- Return type:
bool
- Raises:
ImportError – Import failure
- rebuild(autoscale: bool = False)[source]¶
Rebuild all components in the design from scratch and refresh the gui.
- refresh()[source]¶
Refreshes everything. Overkill in general.
Refreshes the design names in the gui
Refreshes the table models
Replots everything
Warning
This does not rebuild the components. For that, call rebuild.
- save_file()¶
Save file. Called on exit.
- Raises:
NotImplementedError – Function not written
- screenshot(name='shot', type_='png', display=True, disp_ops=None)¶
Alias for get_screenshot().
- set_design(design: QDesign)[source]¶
Core function to set a new design.
- Parameters:
design (QDesign) – A qiskit metal design, such as a planar one. The design contains all components and elements
- set_font_size(font_size: int)¶
Set font size of the applicaiton globally in points.
- Parameters:
font_size (int) – New font size
- show()¶
Show the main window.
- style_window()¶
Styles the window.