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


Python BaseWidget.set_run_mode方法代码示例

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


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

示例1: finalize

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import set_run_mode [as 别名]
    def finalize(self):
        """Finalize gui load"""

        BaseWidget.set_run_mode(False)  # call .stop() for each brick

        self.hardware_repository.close()

        QtImport.QApplication.sendPostedEvents()
        QtImport.QApplication.processEvents()

        self.save_size()
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:13,代码来源:GUISupervisor.py

示例2: execute

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import set_run_mode [as 别名]
    def execute(self, config):
        """Start in execution mode"""
        self.splash_screen.set_message("Executing configuration...")
        self.splash_screen.set_progress_value(90)
        self.display()

        main_window = None

        if len(self.windows) > 0:
            main_window = self.windows[0]
            main_window.configuration = config
            QtImport.QApplication.setActiveWindow(main_window)
            if self.no_border:
                main_window.move(0, 0)
                width = QtImport.QApplication.desktop().width()
                height = QtImport.QApplication.desktop().height()
                main_window.resize(QtImport.QSize(width, height))

            # make connections
            widgets_dict = dict(
                [
                    (
                        isinstance(w.objectName, collections.Callable)
                        and str(w.objectName())
                        or None,
                        w,
                    )
                    for w in QtImport.QApplication.allWidgets()
                ]
            )

            def make_connections(items_list):
                """Creates connections"""

                for item in items_list:
                    try:
                        sender = widgets_dict[item["name"]]
                    except KeyError:
                        logging.getLogger().error(
                            "Could not find receiver widget %s" % item["name"]
                        )
                    else:
                        for connection in item["connections"]:
                            _receiver = (
                                connection["receiver"] or connection["receiverWindow"]
                            )
                            try:
                                receiver = widgets_dict[_receiver]
                            except KeyError:
                                logging.getLogger().error(
                                    "Could not find " + "receiver widget %s", _receiver
                                )
                            else:
                                try:
                                    slot = getattr(receiver, connection["slot"])
                                    # etattr(sender, connection["signal"]).connect(slot)
                                except AttributeError:
                                    logging.getLogger().error(
                                        "No slot '%s' " % connection["slot"]
                                        + "in receiver %s" % _receiver
                                    )
                                else:
                                    getattr(sender, connection["signal"]).connect(slot)
                                    # sender.connect(sender,
                                    #    QtCore.SIGNAL(connection["signal"]),
                                    #    slot)
                    make_connections(item["children"])

            self.splash_screen.set_progress_value(95)
            self.splash_screen.set_message("Connecting bricks...")
            make_connections(config.windows_list)

            # set run mode for every brick
            self.splash_screen.set_progress_value(100)
            self.splash_screen.set_message("Setting run mode...")
            BaseWidget.set_run_mode(True)

            if self.show_maximized:
                main_window.showMaximized()
            else:
                main_window.show()

            for window in self.windows:
                if window._show:
                    window.show()

        if BaseWidget._menubar:
            BaseWidget._menubar.set_exp_mode(False)

        return main_window
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:92,代码来源:GUISupervisor.py


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