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


Python uic.loadUi函数代码示例

本文整理汇总了Python中qtpy.uic.loadUi函数的典型用法代码示例。如果您正苦于以下问题:Python loadUi函数的具体用法?Python loadUi怎么用?Python loadUi使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: initUI

    def initUI(self):

        plugin_path = os.path.dirname(os.path.abspath(__file__))
        ui_dir = os.path.join(plugin_path, "ui")
        ui_path = os.path.join(ui_dir, 'general_cutout_tool.ui')
        loadUi(ui_path, self)
        self.statusBar().showMessage("Waiting for user input")

        self.progress_bar = self.progressBar
        self.status_bar = self.statusBar
        self.progressBar.reset()
        self.save_path_display.setDisabled(True)

        self.start_button.clicked.connect(self.call_main)
        self.target_browse_button.clicked.connect(self.get_target_path)
        self.change_save_button.clicked.connect(self.custom_path)
        self.image_browse_button.clicked.connect(self.get_img_path)
        self.target_user_input.textChanged.connect(self.update_save)
        self.preview_button.clicked.connect(self.call_peview)

        self.x_user_input.setText(self.cutout_x_size_default)
        self.y_user_input.setText(self.cutout_y_size_default)
        self.x_user_input.selectAll()
        self.y_user_input.selectAll()

        self.show()
开发者ID:spacetelescope,项目名称:mosviz,代码行数:26,代码来源:cutout_tool.py

示例2: __init__

    def __init__(self):
        super().__init__()
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_threadwidget.ui')

        # Load it
        uic.loadUi(ui_file, self)
开发者ID:Ulm-IQO,项目名称:qudi,代码行数:7,代码来源:threadwidget.py

示例3: initUI

    def initUI(self):
        """
        Set up user interface by loading the .ui file
        and configuring items in the GUI.
        """
        plugin_path = os.path.dirname(os.path.abspath(__file__))
        ui_dir = os.path.join(plugin_path, "ui")
        ui_path = os.path.join(ui_dir, 'table_generator.ui')
        loadUi(ui_path, self)

        self.setWindowTitle(self.title)
        self.statusBar().showMessage("Waiting for user input")

        #Set up no cutout option
        self.no_cutout_radio.setChecked(True)
        self._no_cutout_radio_toggled()

        #Set up radio buttons
        self.no_cutout_radio.toggled.connect(self._no_cutout_radio_toggled)
        self.add_cutout_radio.toggled.connect(self._add_cutout_radio_toggled)

        #Set up click buttons
        self.spectra_browse_button.clicked.connect(self.get_spec_path)
        self.add_cutout_button.clicked.connect(self.get_cutout_path)
        self.make_cutouts_button.clicked.connect(self.call_cutout)
        self.default_filename_button.clicked.connect(self.default_filename)
        self.generate_table_button.clicked.connect(self.call_main)
        self.change_save_path_button.clicked.connect(self.change_save_path)

        #Set up defaults
        self.default_filename()
        self.default_save_dir()

        self.show()
开发者ID:spacetelescope,项目名称:mosviz,代码行数:34,代码来源:nirspec_table_ui.py

示例4: __init__

    def __init__(self, parent=None, *args, **kwargs):
        super().__init__(parent=parent, *args, **kwargs)

        self.model_items = None

        self._smoothing_thread = None  # Worker thread

        self.kernel = None  # One of the sub-dicts in KERNEL_REGISTRY
        self.function = None  # function from `~specutils.manipulation.smoothing`
        self.data = None  # Current `~specviz.core.items.DataItem`
        self.size = None  # Current kernel size
        self._already_loaded = False

        #
        # Do the first-time loading and initialization of the GUI
        #
        loadUi(os.path.abspath(
            os.path.join(os.path.dirname(__file__),
                         ".", "smoothing.ui")), self)

        self.smooth_button.clicked.connect(self.accept)
        self.cancel_button.clicked.connect(self.close)
        self.data_combo.currentIndexChanged.connect(self._on_data_change)

        for key in KERNEL_REGISTRY:
            kernel = KERNEL_REGISTRY[key]
            self.kernel_combo.addItem(kernel["name"], key)
        self.kernel_combo.currentIndexChanged.connect(self._on_kernel_change)

        # Add integer validator to size input field
        self.size_input.setValidator(QIntValidator())
开发者ID:nmearl,项目名称:specviz,代码行数:31,代码来源:smoothing_dialog.py

示例5: __init__

    def __init__(self, loadfile=None):
        """ Create the Manager Window.
        """
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_config_window.ui')
        self.log = logging.getLogger(__name__)

        # Load it
        super().__init__()
        uic.loadUi(ui_file, self)

        self.mods = dict()
        self.globalsection = OrderedDict()
        self.currentFile = ''

        # palette
        self.colors = {
            'hardware': palette.c2,
            'logic': palette.c1,
            'gui': palette.c4,
            '': palette.c3
        }

        # init
        self.setupUi()
        self.show()

        if loadfile is not None:
            self.loadConfigFile(loadfile)
开发者ID:tobiasgehring,项目名称:qudi,代码行数:30,代码来源:__main__.py

示例6: __init__

    def __init__(self):
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_odmr_settings.ui')

        # Load it
        super(ODMRSettingDialog, self).__init__()
        uic.loadUi(ui_file, self)
开发者ID:tobiasgehring,项目名称:qudi,代码行数:8,代码来源:odmrgui.py

示例7: __init__

    def __init__(self):
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_reorient_roi_dialog.ui')

        # Load it
        super(ReorientRoiDialog, self).__init__()
        uic.loadUi(ui_file, self)
开发者ID:a-stark,项目名称:qudi,代码行数:8,代码来源:poimangui.py

示例8: __init__

    def __init__(self):
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_console_settings.ui')

        # Load it
        super().__init__()
        uic.loadUi(ui_file, self)
开发者ID:a-stark,项目名称:qudi,代码行数:8,代码来源:managergui.py

示例9: __init__

    def __init__(self, **kwargs):
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_slow_counter.ui')

        # Load it
        super().__init__(**kwargs)
        uic.loadUi(ui_file, self)
        self.show()
开发者ID:Ulm-IQO,项目名称:qudi,代码行数:9,代码来源:countergui.py

示例10: __init__

    def __init__(self):
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_laser.ui')

        # Load it
        super().__init__()
        uic.loadUi(ui_file, self)
        self.show()
开发者ID:a-stark,项目名称:qudi,代码行数:9,代码来源:laser.py

示例11: __init__

    def __init__(self):
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_nuclear_operations_gui.ui')

        # Load it
        super(NuclearOperationsMainWindow, self).__init__()
        uic.loadUi(ui_file, self)
        self.show()
开发者ID:Ulm-IQO,项目名称:qudi,代码行数:9,代码来源:nuclear_operations.py

示例12: __init__

    def __init__(self):
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_gated_counter_gui.ui')

        # Load it
        super(GatedCounterMainWindow, self).__init__()
        uic.loadUi(ui_file, self)
        self.show()
开发者ID:Ulm-IQO,项目名称:qudi,代码行数:9,代码来源:gated_counter_gui.py

示例13: __init__

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        # Load the ui file and attach it to this instance
        loadUi(os.path.join(os.path.dirname(__file__),
                            "ui", "export_size.ui"), self)

        # Add some simple validators to the text boxes
        self.height_line_edit.setValidator(QIntValidator())
        self.width_line_edit.setValidator(QIntValidator())
开发者ID:nmearl,项目名称:specviz,代码行数:10,代码来源:custom.py

示例14: __init__

    def __init__(self):
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_pulsed_extraction_external_gui.ui')

        # Load it
        super(PulsedExtractionExternalMainWindow, self).__init__()

        uic.loadUi(ui_file, self)
        self.show()
开发者ID:tobiasgehring,项目名称:qudi,代码行数:10,代码来源:pulsed_extraction_external_gui.py

示例15: __init__

    def __init__(self, manager=None, **kwargs):
        """Creates the log widget.

        @param object parent: Qt parent object for log widet

        """
        super().__init__(**kwargs)
        self._manager = manager
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_logwidget.ui')

        # Load it
        uic.loadUi(ui_file, self)

        self.logLength = 1000

        # Set up data model and visibility filter
        self.model = LogModel()
        self.filtermodel = LogFilter()
        self.filtermodel.setSourceModel(self.model)
        self.output.setModel(self.filtermodel)

        # set up able view properties
        # setResizeMode is deprecated in Qt5 (and therefore not available
        # in pyqt5
        if qtpy.PYQT4 or qtpy.PYSIDE:
            self.output.horizontalHeader().setResizeMode(
                0, QtWidgets.QHeaderView.Interactive)
            self.output.horizontalHeader().setResizeMode(
                1, QtWidgets.QHeaderView.ResizeToContents)
            self.output.horizontalHeader().setResizeMode(
                2, QtWidgets.QHeaderView.ResizeToContents)
            self.output.horizontalHeader().setResizeMode(
                3, QtWidgets.QHeaderView.ResizeToContents)
            self.output.verticalHeader().setResizeMode(
                QtWidgets.QHeaderView.ResizeToContents)
        else:
            self.output.horizontalHeader().setSectionResizeMode(
                0, QtWidgets.QHeaderView.Interactive)
            self.output.horizontalHeader().setSectionResizeMode(
                1, QtWidgets.QHeaderView.ResizeToContents)
            self.output.horizontalHeader().setSectionResizeMode(
                2, QtWidgets.QHeaderView.ResizeToContents)
            self.output.horizontalHeader().setSectionResizeMode(
                3, QtWidgets.QHeaderView.ResizeToContents)
            self.output.verticalHeader().setSectionResizeMode(
                QtWidgets.QHeaderView.ResizeToContents)
        self.output.setTextElideMode(QtCore.Qt.ElideRight)
        self.output.setItemDelegate(AutoToolTipDelegate(self.output))

        # connect signals
        self.sigDisplayEntry.connect(self.displayEntry,
                                     QtCore.Qt.QueuedConnection)
        self.sigAddEntry.connect(self.addEntry, QtCore.Qt.QueuedConnection)
        self.filterTree.itemChanged.connect(self.setCheckStates)
开发者ID:Ulm-IQO,项目名称:qudi,代码行数:55,代码来源:logwidget.py


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