当前位置: 首页>>代码示例>>Python>>正文


Python BaseWidget.__init__方法代码示例

本文整理汇总了Python中gui.BaseComponents.BaseWidget.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python BaseWidget.__init__方法的具体用法?Python BaseWidget.__init__怎么用?Python BaseWidget.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gui.BaseComponents.BaseWidget的用法示例。


在下文中一共展示了BaseWidget.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import __init__ [as 别名]
    def __init__(self, *args):
        """Main init"""

        BaseWidget.__init__(self, *args)

        # Internal values -----------------------------------------------------
        self.graphics_initialized = None
        self.value_label_list = []

        # Properties (name, type, default value, comment)----------------------
        self.add_property(
            "maxPlotPoints", "integer", 100, comment="Maximal number of plot points"
        )

        # Signals -------------------------------------------------------------

        # Slots ---------------------------------------------------------------

        # Graphic elements ----------------------------------------------------

        # Layout --------------------------------------------------------------
        self.main_vlayout = QtImport.QVBoxLayout(self)
        self.main_vlayout.setSpacing(1)
        self.main_vlayout.setContentsMargins(2, 2, 2, 2)

        # SizePolicies --------------------------------------------------------

        # Other ---------------------------------------------------------------
        self.setToolTip("Main information about the beamline")
开发者ID:mxcube,项目名称:mxcube,代码行数:31,代码来源:MachineInfoBrick.py

示例2: __init__

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import __init__ [as 别名]
    def __init__(self, *args):

        BaseWidget.__init__(self, *args)

        # Internal variables --------------------------------------------------

        # Properties ----------------------------------------------------------
        self.add_property("useImageTracking", "boolean", True)

        # Signals ------------------------------------------------------------

        # Slots ---------------------------------------------------------------
        self.define_slot("populate_dc_parameter_widget", ({}))

        # Graphic elements ----------------------------------------------------
        self.tool_box = QtImport.QToolBox(self)
        self.parameters_widget = DCParametersWidget(self, "parameters_widget")
        self.results_static_view = QtImport.QTextBrowser(self.tool_box)
        self.image_tracking_widget = ImageTrackingWidget(self.tool_box)
        self.advance_results_widget = AdvancedResultsWidget(self.tool_box)
        self.snapshot_widget = SnapshotWidget(self)

        self.tool_box.addItem(self.parameters_widget, "Parameters")
        self.tool_box.addItem(self.image_tracking_widget, "Results - ADXV control")
        self.tool_box.addItem(self.results_static_view, "Results - Summary")
        self.tool_box.addItem(
            self.advance_results_widget, "Results - Parallel processing"
        )

        # Layout --------------------------------------------------------------
        _main_vlayout = QtImport.QHBoxLayout(self)
        _main_vlayout.addWidget(self.tool_box)
        _main_vlayout.addWidget(self.snapshot_widget)
开发者ID:mxcube,项目名称:mxcube,代码行数:35,代码来源:DCParametersBrick.py

示例3: __init__

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import __init__ [as 别名]
    def __init__(self, *args):
        BaseWidget.__init__(self, *args)

        # Internal values -----------------------------------------------------
        self.target_menu = None
        self.image_scale_list = []

        # Properties ----------------------------------------------------------
        self.add_property(
            "targetMenu", "combo", ("menuBar", "toolBar", "both"), "menuBar"
        )
        self.add_property("beamDefiner", "boolean", False)

        # Signals ------------------------------------------------------------

        # Slots ---------------------------------------------------------------

        # Graphic elements ----------------------------------------------------
        self.tools_menu = None
        self.measure_distance_action = None
        self.measure_angle_action = None
        self.measure_area_action = None
        self.define_beam_action = None
        self.move_beam_mark_manual_action = None
        self.move_beam_mark_auto_action = None
        self.display_beam_size_action = None
        self.display_grid_action = None
        self.magnification_action = None
        self.image_scale_menu = None
开发者ID:mxcube,项目名称:mxcube,代码行数:31,代码来源:GraphicsToolsBrick.py

示例4: __init__

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import __init__ [as 别名]
    def __init__(self, *args):

        BaseWidget.__init__(self, *args)

        # Hardware objects ----------------------------------------------------

        # Internal values -----------------------------------------------------
        self.max_log_lines = -1
        self.test_mode = False

        # Properties ----------------------------------------------------------
        self.add_property("maxLogLines", "integer", -1)

        # Signals -------------------------------------------------------------

        # Slots ---------------------------------------------------------------

        # Graphic elements ----------------------------------------------------
        self._status_bar_widget = LogBarWidget(self)

        # Layout --------------------------------------------------------------
        _main_hlayout = QtImport.QHBoxLayout(self)
        _main_hlayout.addWidget(self._status_bar_widget)
        _main_hlayout.setSpacing(0)
        _main_hlayout.setContentsMargins(2, 2, 2, 2)

        # SizePolicies --------------------------------------------------------

        # Qt signal/slot connections ------------------------------------------

        # Other ---------------------------------------------------------------
        GUILogHandler.GUILogHandler().register(self)
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:34,代码来源:LogBarBrick.py

示例5: __init__

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import __init__ [as 别名]
    def __init__(self, *args):
        BaseWidget.__init__(self, *args)

        # Hardware objects ----------------------------------------------------

        # Internal values -----------------------------------------------------

        # Properties ----------------------------------------------------------

        # Signals -------------------------------------------------------------

        # Slots ---------------------------------------------------------------
        self.define_slot("populate_advanced_widget", ({}))

        # Graphic elements ----------------------------------------------------
        self.tool_box = QtImport.QToolBox(self)
        self.parameters_widget = AdvancedParametersWidget(self)
        self.results_widget = AdvancedResultsWidget(self)

        self.line_parameters_widget = AdvancedParametersWidget(self)
        self.line_results_widget = AdvancedResultsWidget(self)
        self.snapshot_widget = SnapshotWidget(self)

        self.tool_box.addItem(self.parameters_widget, "2D Heat map: Parameters")
        self.tool_box.addItem(self.results_widget, "2D Heat map: Results")
        self.tool_box.addItem(self.line_parameters_widget, "Line scan: Parameters")
        self.tool_box.addItem(self.line_results_widget, "Line scan: Results")

        # Layout --------------------------------------------------------------
        _main_vlayout = QtImport.QHBoxLayout(self)
        _main_vlayout.addWidget(self.tool_box)
        _main_vlayout.addWidget(self.snapshot_widget)
开发者ID:mxcube,项目名称:mxcube,代码行数:34,代码来源:AdvancedBrick.py

示例6: __init__

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import __init__ [as 别名]
    def __init__(self, *args):
        BaseWidget.__init__(self, *args)

        # Hardware objects ----------------------------------------------------

        # Internal values -----------------------------------------------------
        self.use_dialog = False

        # Properties ----------------------------------------------------------
        self.add_property("mnemonicList", "string", "")

        # Signals ------------------------------------------------------------

        # Slots ---------------------------------------------------------------

        # Graphic elements ----------------------------------------------------
        self.progress_type_label = QtImport.QLabel("", self)
        self.progress_bar = QtImport.QProgressBar(self)
        # $self.progress_bar.setCenterIndicator(True)
        self.progress_bar.setMinimum(0)

        main_layout = QtImport.QVBoxLayout(self)
        main_layout.addWidget(self.progress_type_label)
        main_layout.addWidget(self.progress_bar)
        main_layout.setContentsMargins(2, 2, 2, 2)
        main_layout.setSpacing(2)
        self.setEnabled(False)

        new_palette = QtImport.QPalette()
        new_palette.setColor(QtImport.QPalette.Highlight, Colors.DARK_GREEN)
        self.progress_bar.setPalette(new_palette)
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:33,代码来源:ProgressBarBrick.py

示例7: __init__

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import __init__ [as 别名]
    def __init__(self, *args):

        BaseWidget.__init__(self, *args)

        # Internal variables --------------------------------------------------

        # Properties ----------------------------------------------------------

        # Signals ------------------------------------------------------------

        # Slots ---------------------------------------------------------------

        # Graphic elements ----------------------------------------------------
        _main_groupbox = QtImport.QGroupBox("Detector status", self)
        self.status_label = QtImport.QLabel("<b>unknown status</b>", _main_groupbox)
        self.frame_rate_label = QtImport.QLabel("   Frame rate     : ", _main_groupbox)
        self.temperature_label = QtImport.QLabel("   Temperature:", _main_groupbox)
        self.humidity_label = QtImport.QLabel("   Humidity:     ", _main_groupbox)

        # Layout --------------------------------------------------------------
        _main_groupbox_vlayout = QtImport.QVBoxLayout(_main_groupbox)
        _main_groupbox_vlayout.addWidget(self.status_label)
        _main_groupbox_vlayout.addWidget(self.frame_rate_label)
        _main_groupbox_vlayout.addWidget(self.temperature_label)
        _main_groupbox_vlayout.addWidget(self.humidity_label)
        _main_groupbox_vlayout.setSpacing(2)
        _main_groupbox_vlayout.setContentsMargins(4, 4, 4, 4)

        main_layout = QtImport.QVBoxLayout(self)
        main_layout.addWidget(_main_groupbox)
        main_layout.setSpacing(0)
        main_layout.setContentsMargins(0, 0, 0, 0)

        # SizePolicies -------------------------------------------------------

        # Qt signal/slot connections ------------------------------------------

        # Other ---------------------------------------------------------------
        Colors.set_widget_color(
            self.status_label, DetectorStatusBrick.DETECTOR_STATES["uninitialized"]
        )
        Colors.set_widget_color(
            self.temperature_label, DetectorStatusBrick.STATES["unknown"]
        )
        Colors.set_widget_color(
            self.humidity_label, DetectorStatusBrick.STATES["unknown"]
        )
        Colors.set_widget_color(self.frame_rate_label, DetectorStatusBrick.STATES["OK"])

        self.status_label.setMinimumHeight(20)
        self.status_label.setAlignment(QtImport.Qt.AlignCenter)
        self.temperature_label.setMinimumHeight(20)
        self.humidity_label.setMinimumHeight(20)
        self.frame_rate_label.setMinimumHeight(20)

        self.connect(api.detector, "temperatureChanged", self.temperature_changed)
        self.connect(api.detector, "humidityChanged", self.humidity_changed)
        self.connect(api.detector, "statusChanged", self.status_changed)
        self.connect(api.detector, "frameRateChanged", self.frame_rate_changed)
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:61,代码来源:DetectorStatusBrick.py

示例8: __init__

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import __init__ [as 别名]
    def __init__(self, *args):
        BaseWidget.__init__(self, *args)

        # Hardware objects ----------------------------------------------------
        self.beam_info_hwobj = None

        # Internal values -----------------------------------------------------

        # Properties ----------------------------------------------------------
        self.add_property("formatString", "formatString", "#.#")

        # Signals ------------------------------------------------------------

        # Slots ---------------------------------------------------------------

        # Graphic elements ----------------------------------------------------
        self.main_gbox = QtImport.QGroupBox("Beam size", self)
        hor_label = QtImport.QLabel("Horizontal:", self.main_gbox)
        self.hor_size_ledit = QtImport.QLineEdit(self.main_gbox)
        self.hor_size_ledit.setMaximumWidth(120)
        self.hor_size_ledit.setEnabled(False)
        self.hor_size_ledit.setAlignment(QtImport.Qt.AlignRight)

        ver_label = QtImport.QLabel("Vertical:", self.main_gbox)
        self.ver_size_ledit = QtImport.QLineEdit(self.main_gbox)
        self.ver_size_ledit.setMaximumWidth(120)
        self.ver_size_ledit.setEnabled(False)
        self.ver_size_ledit.setAlignment(QtImport.Qt.AlignRight)

        bold_font = self.hor_size_ledit.font()
        bold_font.setBold(True)
        self.hor_size_ledit.setFont(bold_font)
        self.ver_size_ledit.setFont(bold_font)

        # Layout --------------------------------------------------------------
        _main_gbox_gridlayout = QtImport.QGridLayout(self.main_gbox)
        _main_gbox_gridlayout.addWidget(hor_label, 0, 0)
        _main_gbox_gridlayout.addWidget(self.hor_size_ledit, 0, 1)
        _main_gbox_gridlayout.addWidget(ver_label, 1, 0)
        _main_gbox_gridlayout.addWidget(self.ver_size_ledit, 1, 1)
        _main_gbox_gridlayout.setRowStretch(2, 10)
        _main_gbox_gridlayout.setSpacing(2)
        _main_gbox_gridlayout.setContentsMargins(0, 0, 0, 0)

        _main_vlayout = QtImport.QVBoxLayout(self)
        _main_vlayout.addWidget(self.main_gbox)
        _main_vlayout.setSpacing(0)
        _main_vlayout.setContentsMargins(2, 2, 2, 2)

        # SizePolicies --------------------------------------------------------

        # Qt signal/slot connections ------------------------------------------

        # Other ---------------------------------------------------------------

        self.connect(api.beam_info, "beamInfoChanged", self.beam_info_changed)
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:58,代码来源:BeamSizeBrick.py

示例9: __init__

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import __init__ [as 别名]
    def __init__(self, *args):

        BaseWidget.__init__(self, *args)

        # Hardware objects ----------------------------------------------------

        # Internal values -----------------------------------------------------
        self.motor_hwobj_list = []
        self.motor_widget_list = []
        self.motor_widget_labels = []
        self.predefined_positions_list = []
        self.positions = None

        # Properties ----------------------------------------------------------
        self.add_property("mnemonic", "string", "")
        self.add_property("labels", "string", "")
        self.add_property("moveButtonIcons", "string", "")
        self.add_property("alignment", "combo", ("vertical", "horizontal"), "vertical")
        self.add_property("defaultSteps", "string", "")
        self.add_property("defaultDeltas", "string", "")
        self.add_property("defaultDecimals", "string", "")
        self.add_property("predefinedPositions", "string", "")
        self.add_property("showMoveButtons", "boolean", True)
        self.add_property("showSlider", "boolean", False)
        self.add_property("showStop", "boolean", True)
        self.add_property("showStep", "boolean", True)
        self.add_property("showEnableButtons", "boolean", False)
        self.add_property("inExpertMode", "boolean", False)

        # Signals -------------------------------------------------------------

        # Slots ---------------------------------------------------------------

        # Graphic elements ----------------------------------------------------
        self.main_group_box = QtImport.QGroupBox(self)
        self.enable_motors_buttons = QtImport.QPushButton("Enable", self.main_group_box)
        self.disable_motors_buttons = QtImport.QPushButton("Disable", self.main_group_box)

        # Layout --------------------------------------------------------------
        if self["alignment"] == "horizontal":
            self.main_groupbox_hlayout = QtImport.QHBoxLayout(self.main_group_box)
        else:
            self.main_groupbox_hlayout = QtImport.QVBoxLayout(self.main_group_box)
        self.main_groupbox_hlayout.setSpacing(2)
        self.main_groupbox_hlayout.setContentsMargins(0, 0, 0, 0)

        self.main_hlayout = QtImport.QHBoxLayout(self)
        self.main_hlayout.addWidget(self.main_group_box)
        self.main_hlayout.setSpacing(2)
        self.main_hlayout.setContentsMargins(2, 2, 2, 2)

        # Size Policy ---------------------------------------------------------

        # Qt signal/slot connections ------------------------------------------
        self.enable_motors_buttons.clicked.connect(self.enable_motors)
        self.disable_motors_buttons.clicked.connect(self.disable_motors)
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:58,代码来源:MultipleMotorsBrick.py

示例10: __init__

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import __init__ [as 别名]
    def __init__(self, *args):
        BaseWidget.__init__(self, *args)

        self.dc_group_widget = DCGroupWidget(self)

        _main_vlayout = QtImport.QVBoxLayout(self)
        _main_vlayout.addWidget(self.dc_group_widget)

        # Qt-Slots
        self.define_slot("populate_dc_group_widget", ({}))
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:12,代码来源:DCGBrick.py

示例11: __init__

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import __init__ [as 别名]
    def __init__(self, *args):
        BaseWidget.__init__(self, *args)

        # Hardware objects ----------------------------------------------------
        self.motor_hwobj = None

        # Internal values -----------------------------------------------------

        self.positions = None

        # Properties ----------------------------------------------------------
        self.add_property("label", "string", "")
        self.add_property("mnemonic", "string", "")
        self.add_property("icons", "string", "")
        self.add_property("showMoveButtons", "boolean", True)

        # Signals -------------------------------------------------------------

        # Slots ---------------------------------------------------------------
        self.define_slot("setEnabled", ())

        # Graphic elements ----------------------------------------------------
        _main_gbox = QtImport.QGroupBox(self)
        self.label = QtImport.QLabel("motor:", _main_gbox)
        self.positions_combo = QtImport.QComboBox(self)
        self.previous_position_button = QtImport.QPushButton(_main_gbox)
        self.next_position_button = QtImport.QPushButton(_main_gbox)

        # Layout --------------------------------------------------------------
        _main_gbox_hlayout = QtImport.QHBoxLayout(_main_gbox)
        _main_gbox_hlayout.addWidget(self.label)
        _main_gbox_hlayout.addWidget(self.positions_combo)
        _main_gbox_hlayout.addWidget(self.previous_position_button)
        _main_gbox_hlayout.addWidget(self.next_position_button)
        _main_gbox_hlayout.setSpacing(2)
        _main_gbox_hlayout.setContentsMargins(2, 2, 2, 2)

        _main_hlayout = QtImport.QHBoxLayout(self)
        _main_hlayout.addWidget(_main_gbox)
        _main_hlayout.setSpacing(0)
        _main_hlayout.setContentsMargins(0, 0, 0, 0)
        # Size Policy ---------------------------------------------------------

        # Qt signal/slot connections ------------------------------------------
        self.positions_combo.activated.connect(self.position_selected)
        self.previous_position_button.clicked.connect(self.select_previous_position)
        self.next_position_button.clicked.connect(self.select_next_position)

        # Other ---------------------------------------------------------------
        self.positions_combo.setFixedHeight(27)
        self.positions_combo.setToolTip("Moves the motor to a predefined position")
        self.previous_position_button.setIcon(Icons.load_icon("Minus2"))
        self.previous_position_button.setFixedSize(27, 27)
        self.next_position_button.setIcon(Icons.load_icon("Plus2"))
        self.next_position_button.setFixedSize(27, 27)
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:57,代码来源:MotorPredefPosBrick.py

示例12: __init__

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import __init__ [as 别名]
    def __init__(self, *args):
        BaseWidget.__init__(self, *args)

        # Properties ----------------------------------------------------------
        self.add_property("hwobj_shutter", "string", "")

        # Signals -------------------------------------------------------------

        # Slots ---------------------------------------------------------------

        # Hardware objects ----------------------------------------------------
        self.shutter_hwobj = None

        # Internal values -----------------------------------------------------

        # Graphic elements ----------------------------------------------------
        self.main_groupbox = QtImport.QGroupBox("Shutter", self)
        self.main_groupbox.setAlignment(QtImport.Qt.AlignCenter)
        self.state_label = QtImport.QLabel("<b>unknown</b>", self.main_groupbox)
        self.state_label.setAlignment(QtImport.Qt.AlignCenter)
        self.state_label.setFixedHeight(24)
        Colors.set_widget_color(self.state_label, Colors.LIGHT_GRAY)
        _button_widget = QtImport.QWidget(self.main_groupbox)

        self.open_button = QtImport.QPushButton(
            Icons.load_icon("ShutterOpen"), "Open", _button_widget
        )
        self.close_button = QtImport.QPushButton(
            Icons.load_icon("ShutterClose"), "Close", _button_widget
        )

        # Layout --------------------------------------------------------------
        _button_widget_hlayout = QtImport.QHBoxLayout(_button_widget)
        _button_widget_hlayout.addWidget(self.open_button)
        _button_widget_hlayout.addWidget(self.close_button)
        _button_widget_hlayout.setSpacing(2)
        _button_widget_hlayout.setContentsMargins(0, 0, 0, 0)

        _main_gbox_vlayout = QtImport.QVBoxLayout(self.main_groupbox)
        _main_gbox_vlayout.addWidget(self.state_label)
        _main_gbox_vlayout.addWidget(_button_widget)
        _main_gbox_vlayout.setSpacing(2)
        _main_gbox_vlayout.setContentsMargins(2, 2, 2, 2)

        _main_vlayout = QtImport.QVBoxLayout(self)
        _main_vlayout.addWidget(self.main_groupbox)
        _main_vlayout.setSpacing(0)
        _main_vlayout.setContentsMargins(0, 0, 0, 0)

        # SizePolicies --------------------------------------------------------

        # Qt signal/slot connections ------------------------------------------
        self.open_button.clicked.connect(self.open_button_clicked)
        self.close_button.clicked.connect(self.close_button_clicked)
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:56,代码来源:ShutterBrick.py

示例13: __init__

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import __init__ [as 别名]
    def __init__(self, *args):
        BaseWidget.__init__(self, *args)

        self.define_slot("populate_xrf_widget", ({}))

        self.xrf_spectrum_widget = XRFSpectrumParametersWidget(self)

        _main_vlayout = QtImport.QVBoxLayout(self)
        _main_vlayout.addWidget(self.xrf_spectrum_widget)
        _main_vlayout.setSpacing(0)
        _main_vlayout.setContentsMargins(0, 0, 0, 0)
开发者ID:mxcube,项目名称:mxcube,代码行数:13,代码来源:XRFSpectrumParametersBrick.py

示例14: __init__

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import __init__ [as 别名]
    def __init__(self, *args):
        BaseWidget.__init__(self, *args)

        # Layout
        self.energy_scan_widget = EnergyScanParametersWidget(self)

        _main_vlayout = QtImport.QVBoxLayout(self)
        _main_vlayout.addWidget(self.energy_scan_widget)

        # Qt-Slots
        self.define_slot("populate_parameter_widget", ({}))
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:13,代码来源:EnergyScanParametersBrick.py

示例15: __init__

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import __init__ [as 别名]
    def __init__(self, *args):

        BaseWidget.__init__(self, *args)

        # Hardware objects ----------------------------------------------------

        # Internal variables --------------------------------------------------

        # Properties ----------------------------------------------------------
        self.add_property("formatString", "formatString", "###.##")

        # Signals ------------------------------------------------------------

        # Slots ---------------------------------------------------------------

        # Graphic elements ----------------------------------------------------
        self.group_box = QtImport.QGroupBox("Transmission", self)
        current_label = QtImport.QLabel("Current:", self.group_box)
        current_label.setFixedWidth(75)
        self.transmission_ledit = QtImport.QLineEdit(self.group_box)
        self.transmission_ledit.setReadOnly(True)
        set_to_label = QtImport.QLabel("Set to:", self.group_box)
        self.new_value_ledit = QtImport.QLineEdit(self.group_box)

        # Layout --------------------------------------------------------------
        _group_box_gridlayout = QtImport.QGridLayout(self.group_box)
        _group_box_gridlayout.addWidget(current_label, 0, 0)
        _group_box_gridlayout.addWidget(self.transmission_ledit, 0, 1)
        _group_box_gridlayout.addWidget(set_to_label, 1, 0)
        _group_box_gridlayout.addWidget(self.new_value_ledit, 1, 1)
        _group_box_gridlayout.setSpacing(0)
        _group_box_gridlayout.setContentsMargins(1, 1, 1, 1)

        _main_vlayout = QtImport.QVBoxLayout(self)
        _main_vlayout.setSpacing(0)
        _main_vlayout.setContentsMargins(0, 0, 2, 2)
        _main_vlayout.addWidget(self.group_box)

        # SizePolicies --------------------------------------------------------

        # Qt signal/slot connections ------------------------------------------
        self.new_value_ledit.returnPressed.connect(self.current_value_changed)
        self.new_value_ledit.textChanged.connect(self.input_field_changed)

        # Other ---------------------------------------------------------------
        Colors.set_widget_color(
            self.new_value_ledit, Colors.LINE_EDIT_ACTIVE, QtImport.QPalette.Base
        )
        self.new_value_validator = QtImport.QDoubleValidator(
            0, 100, 2, self.new_value_ledit
        )
        self.new_value_ledit.setToolTip("Transmission limits 0 : 100 %")

        self.instance_synchronize("transmission_ledit", "new_value_ledit")
开发者ID:mxcube,项目名称:mxcube,代码行数:56,代码来源:AttenuatorsBrick.py


注:本文中的gui.BaseComponents.BaseWidget.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。