class DxfOutputDialog(OutputDialog): """Dialog for DXF format.""" format_name = "DXF" format_icon = "dxf.png" assembly_description = "The sketch of the parts will include in the file." frame_description = "There is only wire frame will be generated." def __init__(self, *args): """Type name: "DXF module".""" super(DxfOutputDialog, self).__init__(*args) # DXF version option version_label = QLabel("DXF version:", self) self.version_option = QComboBox(self) self.version_option.addItems( sorted((f"{name} - {DXF_VERSIONS_MAP[name]}" for name in DXF_VERSIONS), key=lambda v: v.split()[-1])) self.version_option.setCurrentIndex(self.version_option.count() - 1) self.version_option.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred) layout = QHBoxLayout() layout.addWidget(version_label) layout.addWidget(self.version_option) self.main_layout.insertLayout(3, layout) # Parts interval self.use_interval = QCheckBox("Parts interval:", self) self.use_interval.setCheckState(Qt.Checked) self.use_interval.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred) self.interval_option = QDoubleSpinBox(self) self.interval_option.setValue(10) self.use_interval.stateChanged.connect(self.interval_option.setEnabled) layout = QHBoxLayout() layout.addWidget(self.use_interval) layout.addWidget(self.interval_option) layout.addItem( QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Preferred)) self.assembly_layout.insertLayout(2, layout) def do(self, dir_str: QDir) -> bool: """Output types: + Boundary + Frame """ file_name = dir_str.filePath(_get_name(self.filename_edit) + '.dxf') if isfile(file_name) and self.warn_radio.isChecked(): self.exist_warning(file_name) return False version = self.version_option.currentText().split()[0] if self.frame_radio.isChecked(): # Frame dxf_frame(self.vpoints, self.v_to_slvs, version, file_name) elif self.assembly_radio.isChecked(): # Boundary dxf_boundary( self.vpoints, self.link_radius.value(), self.interval_option.value() if self.use_interval.isChecked() else 0., version, file_name) return True
class PluginListItem(QFrame): def __init__( self, package_name: str, version: str = '', url: str = '', summary: str = '', author: str = '', license: str = "UNKNOWN", *, plugin_name: str = None, parent: QWidget = None, enabled: bool = True, installed: bool = False, npe_version=1, ): super().__init__(parent) self.setup_ui(enabled) self.plugin_name.setText(package_name) self.package_name.setText(version) self.summary.setText(summary) self.package_author.setText(author) self.cancel_btn.setVisible(False) self.help_button.setText(trans._("Website")) self.help_button.setObjectName("help_button") if npe_version != 1: self._handle_npe2_plugin() if installed: self.enabled_checkbox.show() self.action_button.setText(trans._("uninstall")) self.action_button.setObjectName("remove_button") else: self.enabled_checkbox.hide() self.action_button.setText(trans._("install")) self.action_button.setObjectName("install_button") def _handle_npe2_plugin(self): npe2_icon = QLabel(self) icon = QColoredSVGIcon.from_resources('logo_silhouette') npe2_icon.setPixmap(icon.colored(color='#33F0FF').pixmap(20, 20)) self.row1.insertWidget(2, QLabel('npe2')) self.row1.insertWidget(2, npe2_icon) def _get_dialog(self) -> QDialog: p = self.parent() while not isinstance(p, QDialog) and p.parent(): p = p.parent() return p def set_busy(self, text: str, update: bool = False): self.item_status.setText(text) self.cancel_btn.setVisible(True) if not update: self.action_button.setVisible(False) else: self.update_btn.setVisible(False) def setup_ui(self, enabled=True): self.v_lay = QVBoxLayout(self) self.v_lay.setContentsMargins(-1, 6, -1, 6) self.v_lay.setSpacing(0) self.row1 = QHBoxLayout() self.row1.setSpacing(6) self.enabled_checkbox = QCheckBox(self) self.enabled_checkbox.setChecked(enabled) self.enabled_checkbox.stateChanged.connect(self._on_enabled_checkbox) self.enabled_checkbox.setToolTip(trans._("enable/disable")) sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.enabled_checkbox.sizePolicy().hasHeightForWidth()) self.enabled_checkbox.setSizePolicy(sizePolicy) self.enabled_checkbox.setMinimumSize(QSize(20, 0)) self.enabled_checkbox.setText("") self.row1.addWidget(self.enabled_checkbox) self.plugin_name = QLabel(self) sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.plugin_name.sizePolicy().hasHeightForWidth()) self.plugin_name.setSizePolicy(sizePolicy) font15 = QFont() font15.setPointSize(15) self.plugin_name.setFont(font15) self.row1.addWidget(self.plugin_name) icon = QColoredSVGIcon.from_resources("warning") self.warning_tooltip = QtToolTipLabel(self) # TODO: This color should come from the theme but the theme needs # to provide the right color. Default warning should be orange, not # red. Code example: # theme_name = get_settings().appearance.theme # napari.utils.theme.get_theme(theme_name, as_dict=False).warning.as_hex() self.warning_tooltip.setPixmap( icon.colored(color="#E3B617").pixmap(15, 15)) self.warning_tooltip.setVisible(False) self.row1.addWidget(self.warning_tooltip) self.item_status = QLabel(self) self.item_status.setObjectName("small_italic_text") self.item_status.setSizePolicy(sizePolicy) self.row1.addWidget(self.item_status) self.row1.addStretch() self.package_name = QLabel(self) self.package_name.setAlignment(Qt.AlignRight | Qt.AlignTrailing | Qt.AlignVCenter) self.row1.addWidget(self.package_name) self.cancel_btn = QPushButton("cancel", self) self.cancel_btn.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) self.cancel_btn.setObjectName("remove_button") self.row1.addWidget(self.cancel_btn) self.update_btn = QPushButton(self) self.update_btn.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) self.update_btn.setObjectName("install_button") self.row1.addWidget(self.update_btn) self.update_btn.setVisible(False) self.help_button = QPushButton(self) self.action_button = QPushButton(self) sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.action_button.sizePolicy().hasHeightForWidth()) self.help_button.setSizePolicy(sizePolicy) self.action_button.setSizePolicy(sizePolicy) self.row1.addWidget(self.help_button) self.row1.addWidget(self.action_button) self.v_lay.addLayout(self.row1) self.row2 = QHBoxLayout() self.error_indicator = QPushButton() self.error_indicator.setObjectName("warning_icon") self.error_indicator.setCursor(Qt.PointingHandCursor) self.error_indicator.hide() self.row2.addWidget(self.error_indicator) self.row2.setContentsMargins(-1, 4, 0, -1) self.summary = QElidingLabel(parent=self) sizePolicy = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.summary.sizePolicy().hasHeightForWidth()) self.summary.setSizePolicy(sizePolicy) self.summary.setObjectName("small_text") self.row2.addWidget(self.summary) self.package_author = QLabel(self) sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.package_author.sizePolicy().hasHeightForWidth()) self.package_author.setSizePolicy(sizePolicy) self.package_author.setObjectName("small_text") self.row2.addWidget(self.package_author) self.v_lay.addLayout(self.row2) def _on_enabled_checkbox(self, state: int): """Called with `state` when checkbox is clicked.""" enabled = bool(state) plugin_name = self.plugin_name.text() pm2 = PluginManager.instance() if plugin_name in pm2: pm2.enable(plugin_name) if state else pm2.disable(plugin_name) return for npe1_name, _, distname in plugin_manager.iter_available(): if distname and (distname == plugin_name): plugin_manager.set_blocked(npe1_name, not enabled) def show_warning(self, message: str = ""): """Show warning icon and tooltip.""" self.warning_tooltip.setVisible(bool(message)) self.warning_tooltip.setToolTip(message)
class PluginListItem(QFrame): def __init__( self, package_name: str, version: str = '', url: str = '', summary: str = '', author: str = '', license: str = "UNKNOWN", *, plugin_name: str = None, parent: QWidget = None, enabled: bool = True, installed: bool = False, npe_version=1, ): super().__init__(parent) self.setup_ui(enabled) self.plugin_name.setText(package_name) self.package_name.setText(version) self.summary.setText(summary) self.package_author.setText(author) self.cancel_btn.setVisible(False) self.help_button.setText(trans._("Website")) self.help_button.setObjectName("help_button") if npe_version != 1: self.enabled_checkbox.setEnabled(False) if installed: self.enabled_checkbox.show() self.action_button.setText(trans._("uninstall")) self.action_button.setObjectName("remove_button") else: self.enabled_checkbox.hide() self.action_button.setText(trans._("install")) self.action_button.setObjectName("install_button") def _get_dialog(self) -> QDialog: p = self.parent() while not isinstance(p, QDialog) and p.parent(): p = p.parent() return p def set_busy(self, text: str, update: bool = False): self.item_status.setText(text) self.cancel_btn.setVisible(True) if not update: self.action_button.setVisible(False) else: self.update_btn.setVisible(False) def setup_ui(self, enabled=True): self.v_lay = QVBoxLayout(self) self.v_lay.setContentsMargins(-1, 6, -1, 6) self.v_lay.setSpacing(0) self.row1 = QHBoxLayout() self.row1.setSpacing(6) self.enabled_checkbox = QCheckBox(self) self.enabled_checkbox.setChecked(enabled) self.enabled_checkbox.stateChanged.connect(self._on_enabled_checkbox) self.enabled_checkbox.setToolTip(trans._("enable/disable")) sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.enabled_checkbox.sizePolicy().hasHeightForWidth() ) self.enabled_checkbox.setSizePolicy(sizePolicy) self.enabled_checkbox.setMinimumSize(QSize(20, 0)) self.enabled_checkbox.setText("") self.row1.addWidget(self.enabled_checkbox) self.plugin_name = QLabel(self) sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.plugin_name.sizePolicy().hasHeightForWidth() ) self.plugin_name.setSizePolicy(sizePolicy) font15 = QFont() font15.setPointSize(15) self.plugin_name.setFont(font15) self.row1.addWidget(self.plugin_name) self.item_status = QLabel(self) self.item_status.setObjectName("small_italic_text") self.item_status.setSizePolicy(sizePolicy) self.row1.addWidget(self.item_status) self.row1.addStretch() self.package_name = QLabel(self) self.package_name.setAlignment( Qt.AlignRight | Qt.AlignTrailing | Qt.AlignVCenter ) self.row1.addWidget(self.package_name) self.cancel_btn = QPushButton("cancel", self) self.cancel_btn.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) self.cancel_btn.setObjectName("remove_button") self.row1.addWidget(self.cancel_btn) self.update_btn = QPushButton(self) self.update_btn.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) self.update_btn.setObjectName("install_button") self.row1.addWidget(self.update_btn) self.update_btn.setVisible(False) self.help_button = QPushButton(self) self.action_button = QPushButton(self) sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.action_button.sizePolicy().hasHeightForWidth() ) self.help_button.setSizePolicy(sizePolicy) self.action_button.setSizePolicy(sizePolicy) self.row1.addWidget(self.help_button) self.row1.addWidget(self.action_button) self.v_lay.addLayout(self.row1) self.row2 = QHBoxLayout() self.error_indicator = QPushButton() self.error_indicator.setObjectName("warning_icon") self.error_indicator.setCursor(Qt.PointingHandCursor) self.error_indicator.hide() self.row2.addWidget(self.error_indicator) self.row2.setContentsMargins(-1, 4, 0, -1) self.summary = QElidingLabel(parent=self) sizePolicy = QSizePolicy( QSizePolicy.MinimumExpanding, QSizePolicy.Preferred ) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.summary.sizePolicy().hasHeightForWidth() ) self.summary.setSizePolicy(sizePolicy) self.summary.setObjectName("small_text") self.row2.addWidget(self.summary) self.package_author = QLabel(self) sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.package_author.sizePolicy().hasHeightForWidth() ) self.package_author.setSizePolicy(sizePolicy) self.package_author.setObjectName("small_text") self.row2.addWidget(self.package_author) self.v_lay.addLayout(self.row2) def _on_enabled_checkbox(self, state: int): """Called with `state` when checkbox is clicked.""" enabled = bool(state) current_distname = self.plugin_name.text() for plugin_name, _, distname in plugin_manager.iter_available(): if distname and distname == current_distname: plugin_manager.set_blocked(plugin_name, not enabled)
class PluginListItem(QFrame): def __init__( self, package_name: str, version: str = '', url: str = '', summary: str = '', author: str = '', license: str = "UNKNOWN", *, plugin_name: str = None, parent: QWidget = None, enabled: bool = True, ): super().__init__(parent) self.setup_ui() if plugin_name: self.plugin_name.setText(plugin_name) self.package_name.setText(f"{package_name} {version}") self.summary.setText(summary) self.package_author.setText(author) self.action_button.setText(trans._("remove")) self.action_button.setObjectName("remove_button") self.enabled_checkbox.setChecked(enabled) if PluginError.get(plugin_name=plugin_name): def _show_error(): rep = QtPluginErrReporter(parent=self._get_dialog(), initial_plugin=plugin_name) rep.setWindowFlags(Qt.Sheet) close = QPushButton(trans._("close"), rep) rep.layout.addWidget(close) rep.plugin_combo.hide() close.clicked.connect(rep.close) rep.open() self.error_indicator.clicked.connect(_show_error) self.error_indicator.show() self.summary.setIndent(18) else: self.summary.setIndent(38) else: self.plugin_name.setText(package_name) self.package_name.setText(version) self.summary.setText(summary) self.package_author.setText(author) self.action_button.setText(trans._("install")) self.enabled_checkbox.hide() def _get_dialog(self) -> QDialog: p = self.parent() while not isinstance(p, QDialog) and p.parent(): p = p.parent() return p def setup_ui(self): self.v_lay = QVBoxLayout(self) self.v_lay.setContentsMargins(-1, 8, -1, 8) self.v_lay.setSpacing(0) self.row1 = QHBoxLayout() self.row1.setSpacing(8) self.enabled_checkbox = QCheckBox(self) self.enabled_checkbox.setChecked(True) self.enabled_checkbox.setDisabled(True) self.enabled_checkbox.setToolTip(trans._("enable/disable")) sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.enabled_checkbox.sizePolicy().hasHeightForWidth()) self.enabled_checkbox.setSizePolicy(sizePolicy) self.enabled_checkbox.setMinimumSize(QSize(20, 0)) self.enabled_checkbox.setText("") self.row1.addWidget(self.enabled_checkbox) self.plugin_name = QLabel(self) sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.plugin_name.sizePolicy().hasHeightForWidth()) self.plugin_name.setSizePolicy(sizePolicy) font16 = QFont() font16.setPointSize(16) self.plugin_name.setFont(font16) self.row1.addWidget(self.plugin_name) self.package_name = QLabel(self) self.package_name.setAlignment(Qt.AlignRight | Qt.AlignTrailing | Qt.AlignVCenter) self.row1.addWidget(self.package_name) self.action_button = QPushButton(self) sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.action_button.sizePolicy().hasHeightForWidth()) self.action_button.setSizePolicy(sizePolicy) self.row1.addWidget(self.action_button) self.v_lay.addLayout(self.row1) self.row2 = QHBoxLayout() self.error_indicator = QPushButton() self.error_indicator.setObjectName("warning_icon") self.error_indicator.setCursor(Qt.PointingHandCursor) self.error_indicator.hide() self.row2.addWidget(self.error_indicator) self.row2.setContentsMargins(-1, 4, 0, -1) self.summary = ElidingLabel(parent=self) sizePolicy = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.summary.sizePolicy().hasHeightForWidth()) self.summary.setSizePolicy(sizePolicy) self.summary.setObjectName("small_text") self.row2.addWidget(self.summary) self.package_author = QLabel(self) sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.package_author.sizePolicy().hasHeightForWidth()) self.package_author.setSizePolicy(sizePolicy) self.package_author.setObjectName("small_text") self.row2.addWidget(self.package_author) self.v_lay.addLayout(self.row2)
def _setupUi(self): # timeplot self.title_plot = QLabel('Total Dose Rate (γ + n) [µSv/h]', self, alignment=Qt.AlignCenter) self.title_plot.setStyleSheet( 'QLabel{font-size: 52pt; font-weight: bold;}') timespan = 30 * 60 # [s] self.timeplot = SiriusTimePlot(parent=self, background='w', show_tooltip=True) self.timeplot.timeSpan = timespan self.timeplot.bufferSize = 4 * 60 * 60 * 10 self.timeplot.autoRangeY = True self.timeplot.minYRange = 0.0 self.timeplot.showXGrid = True self.timeplot.showYGrid = True self.timeplot.maxRedrawRate = 2 color = QColor(30, 30, 30) self.timeplot.plotItem.getAxis('bottom').setPen(color) self.timeplot.plotItem.getAxis('bottom').setGrid(255) self.timeplot.plotItem.getAxis('bottom').setTextPen(color) self.timeplot.plotItem.getAxis('left').setPen(color) self.timeplot.plotItem.getAxis('left').setGrid(255) self.timeplot.plotItem.getAxis('left').setTextPen(color) self.timeplot.setLabel('left', text='Dose Rate [µSv/h]') self.timeplot.setObjectName('timeplot') self.timeplot.setStyleSheet( '#timeplot{min-width:12em; min-height: 10em;}') self.timeplot.bufferReset.connect(self._fill_refline) self.timeplot.timeSpanChanged.connect(self._fill_refline) t_end = Time.now() t_init = t_end - timespan widplot = QWidget() widplot.setSizePolicy(QSzPol.Expanding, QSzPol.Expanding) layplot = QGridLayout(widplot) layplot.setHorizontalSpacing(10) layplot.setVerticalSpacing(10) layplot.addWidget(self.title_plot, 0, 0) layplot.addWidget(self.timeplot, 1, 0) # panel self.title_grid = QLabel('Integrated Dose in 4h [µSv]', self, alignment=Qt.AlignCenter) self.title_grid.setStyleSheet( 'QLabel{font-size: 52pt; font-weight: bold;}') self.lb_warn = QLabel('Restart\nwindow') self.lb_warn.setStyleSheet('color: red; border: 0.1em solid red;') self.lb_warn.setVisible(False) laytitle = QHBoxLayout() laytitle.addWidget(self.title_grid, 6) laytitle.addWidget(self.lb_warn, 1) widgrid = QWidget() widgrid.setSizePolicy(QSzPol.Maximum, QSzPol.Expanding) self.pannel = widgrid laygrid = QGridLayout(widgrid) laygrid.setHorizontalSpacing(10) laygrid.setVerticalSpacing(10) colnum = 3 laygrid.addLayout(laytitle, 0, 0, 1, colnum) for i, mon in enumerate(self._mon_order): local = self._mon2locv[mon] color = self._colors[i] pvname = self._prefix + ('-' if self._prefix else '') pvname += 'RAD:' + mon + ':TotalDoseRate' row, col = i // colnum + 1, i % colnum coloro = QColor(color) if isinstance(color, str) \ else QColor(*color) self.timeplot.addYChannel(pvname, name=pvname, color=coloro, lineWidth=6) curve = self.timeplot.curveAtIndex(-1) self._curves[mon] = curve self.timeplot.fill_curve_with_archdata(self._curves[mon], pvname, t_init=t_init.get_iso8601(), t_end=t_end.get_iso8601()) cbx = QCheckBox(self) cbx.setChecked(True) cbx.stateChanged.connect(curve.setVisible) cbx.setSizePolicy(QSzPol.Maximum, QSzPol.Maximum) pal = cbx.palette() pal.setColor(QPalette.Base, coloro) pal.setColor(QPalette.Text, Qt.white) cbx.setPalette(pal) self._cb_show[mon] = cbx lbl = PyDMLabel(self, pvname + ':Dose') lbl.alarmSensitiveBorder = False lbl.setStyleSheet('QLabel{font-size: 52pt;}') lbl.showUnits = True self._pvs_labels[mon] = lbl frame = SiriusAlarmFrame(self, pvname + ':Dose') frame.add_widget(cbx) frame.add_widget(lbl) desc = QLabel(local, self, alignment=Qt.AlignCenter) desc.setSizePolicy(QSzPol.Preferred, QSzPol.Maximum) desc.setStyleSheet( 'QLabel{background-color:black; color:white;font-size:26pt;}') self._desc_labels[mon] = desc wid = QWidget() wid.setObjectName('wid') wid.setStyleSheet('#wid{border: 1px solid black; ' 'min-width: 7.5em; max-width: 7.5em;}') widlay = QVBoxLayout(wid) widlay.setSpacing(0) widlay.setContentsMargins(1, 1, 1, 1) widlay.addWidget(frame) widlay.addWidget(desc) laygrid.addWidget(wid, row, col) laygrid.setColumnStretch(0, 1) laygrid.setColumnStretch(1, 1) laygrid.setColumnStretch(2, 1) self.timeplot.addYChannel('Reference', color='black', lineWidth=6, lineStyle=Qt.DashLine) self.refline = self.timeplot.curveAtIndex(-1) self._fill_refline() lay = QGridLayout(self) lay.setSpacing(20) lay.addWidget(widplot, 0, 0) lay.addWidget(widgrid, 0, 1) self.setStyleSheet(""" PyDMLabel{ qproperty-alignment: AlignCenter; font-weight: bold; } QCheckBox::indicator { width: 0.7em; height: 0.7em; }""") self._timer = QTimer() self._timer.timeout.connect(self._update_graph_ref) self._timer.setInterval(2000) self._timer.start()