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


Python QCoreApplication.processEvents方法代码示例

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


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

示例1: update_cache

# 需要导入模块: from PyQt5.Qt import QCoreApplication [as 别名]
# 或者: from PyQt5.Qt.QCoreApplication import processEvents [as 别名]
    def update_cache(self, parent=None, timeout=10, force=False,
            suppress_progress=False):
        if self.lock.acquire(False):
            try:
                update_thread = CacheUpdateThread(self.cache, self.seralize_books, timeout)
                if not suppress_progress:
                    progress = CacheProgressDialog(parent)
                    progress.set_message(_('Updating MobileRead book cache...'))

                    update_thread.total_changed.connect(progress.set_total)
                    update_thread.update_progress.connect(progress.set_progress)
                    update_thread.update_details.connect(progress.set_details)
                    progress.rejected.connect(update_thread.abort)

                    progress.open()
                    update_thread.start()
                    while update_thread.is_alive() and not progress.canceled:
                        QCoreApplication.processEvents()

                    if progress.isVisible():
                        progress.accept()
                    return not progress.canceled
                else:
                    update_thread.start()
            finally:
                self.lock.release()
开发者ID:JimmXinu,项目名称:calibre,代码行数:28,代码来源:mobileread_plugin.py

示例2: start_import_data

# 需要导入模块: from PyQt5.Qt import QCoreApplication [as 别名]
# 或者: from PyQt5.Qt.QCoreApplication import processEvents [as 别名]
    def start_import_data(self):
        config = self.getCurrentConfig()
        dest_dir = config.get('hdf5', 'dir')
        if not os.path.exists(dest_dir) or not os.path.isdir(dest_dir):
            print("错误:", '指定的目标数据存放目录不存在!')
            sys.exit(-1)
            #return

        if config.getboolean('tdx', 'enable') \
            and (not os.path.exists(config['tdx']['dir']
                 or os.path.isdir(config['tdx']['dir']))):
            print("错误:", "请确认通达信安装目录是否正确!")
            sys.exit(-1)
            #return

        self.import_running = True

        print("正在启动任务....")
        QCoreApplication.processEvents()

        if config.getboolean('tdx', 'enable'):
            self.hdf5_import_thread = UseTdxImportToH5Thread(config)
        else:
            self.hdf5_import_thread = UsePytdxImportToH5Thread(config)

        self.hdf5_import_thread.message.connect(self.on_message_from_thread)
        self.hdf5_import_thread.start()

        self.escape_time = 0.0
        self.escape_time_thread = EscapetimeThread()
        self.escape_time_thread.message.connect(self.on_message_from_thread)
        self.escape_time_thread.start()
开发者ID:fasiondog,项目名称:hikyuu,代码行数:34,代码来源:importdata.py

示例3: show_shutdown_message

# 需要导入模块: from PyQt5.Qt import QCoreApplication [as 别名]
# 或者: from PyQt5.Qt.QCoreApplication import processEvents [as 别名]
 def show_shutdown_message(self, message):
     smw = self.shutdown_message_widget
     smw.setVisible(True)
     txt = smw.text()
     txt += '\n' + message
     smw.setText(txt)
     # Force processing the events needed to show the message
     QCoreApplication.processEvents()
开发者ID:TeddyHartanto,项目名称:calibre,代码行数:10,代码来源:layout.py

示例4: show_shutdown_message

# 需要导入模块: from PyQt5.Qt import QCoreApplication [as 别名]
# 或者: from PyQt5.Qt.QCoreApplication import processEvents [as 别名]
 def show_shutdown_message(self, message=''):
     smw = self.shutdown_message_widget
     smw.setGeometry(0, 0, self.width(), self.height())
     smw.setVisible(True)
     smw.raise_()
     smw.setText(_('<h2>Shutting down</h2><div>') + message)
     # Force processing the events needed to show the message
     QCoreApplication.processEvents()
开发者ID:AEliu,项目名称:calibre,代码行数:10,代码来源:layout.py

示例5: chapter_rendered

# 需要导入模块: from PyQt5.Qt import QCoreApplication [as 别名]
# 或者: from PyQt5.Qt.QCoreApplication import processEvents [as 别名]
 def chapter_rendered(self, num):
     if num > 0:
         self.progress_bar.setMinimum(0)
         self.progress_bar.setMaximum(num)
         self.progress_bar.setValue(0)
         self.progress_label.setText('Laying out '+ self.document_title)
     else:
         self.progress_bar.setValue(self.progress_bar.value()+1)
     QCoreApplication.processEvents()
开发者ID:JimmXinu,项目名称:calibre,代码行数:11,代码来源:main.py

示例6: check_library

# 需要导入模块: from PyQt5.Qt import QCoreApplication [as 别名]
# 或者: from PyQt5.Qt.QCoreApplication import processEvents [as 别名]
    def check_library(self):
        from calibre.gui2.dialogs.check_library import CheckLibraryDialog, DBCheck

        self.gui.library_view.save_state()
        m = self.gui.library_view.model()
        m.stop_metadata_backup()
        db = m.db
        db.prefs.disable_setting = True

        d = DBCheck(self.gui, db)
        d.start()
        try:
            d.conn.close()
        except:
            pass
        d.break_cycles()
        self.gui.library_moved(db.library_path, call_close=not d.closed_orig_conn)
        if d.rejected:
            return
        if d.error is None:
            if not question_dialog(
                self.gui,
                _("Success"),
                _(
                    "Found no errors in your calibre library database."
                    " Do you want calibre to check if the files in your "
                    " library match the information in the database?"
                ),
            ):
                return
        else:
            return error_dialog(
                self.gui,
                _("Failed"),
                _("Database integrity check failed, click Show details" " for details."),
                show=True,
                det_msg=d.error[1],
            )

        self.gui.status_bar.show_message(_("Starting library scan, this may take a while"))
        try:
            QCoreApplication.processEvents()
            d = CheckLibraryDialog(self.gui, m.db)

            if not d.do_exec():
                info_dialog(
                    self.gui,
                    _("No problems found"),
                    _("The files in your library match the information " "in the database."),
                    show=True,
                )
        finally:
            self.gui.status_bar.clear_message()
开发者ID:Ralnoc,项目名称:calibre,代码行数:55,代码来源:choose_library.py

示例7: downloadOpdsCatalog

# 需要导入模块: from PyQt5.Qt import QCoreApplication [as 别名]
# 或者: from PyQt5.Qt.QCoreApplication import processEvents [as 别名]
 def downloadOpdsCatalog(self, gui, opdsCatalogUrl):
     print "downloading catalog: %s" % opdsCatalogUrl
     opdsCatalogFeed = parse(opdsCatalogUrl)
     self.books = self.makeMetadataFromParsedOpds(opdsCatalogFeed.entries)
     self.filterBooks()
     QCoreApplication.processEvents()
     nextUrl = self.findNextUrl(opdsCatalogFeed.feed)
     while nextUrl is not None:
         nextFeed = parse(nextUrl)
         self.books = self.books + self.makeMetadataFromParsedOpds(nextFeed.entries)
         self.filterBooks()
         QCoreApplication.processEvents()
         nextUrl = self.findNextUrl(nextFeed.feed)
开发者ID:sbobovyc,项目名称:opds-reader,代码行数:15,代码来源:model.py


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