當前位置: 首頁>>代碼示例>>Python>>正文


Python QtCore.QThreadPool方法代碼示例

本文整理匯總了Python中PyQt5.QtCore.QThreadPool方法的典型用法代碼示例。如果您正苦於以下問題:Python QtCore.QThreadPool方法的具體用法?Python QtCore.QThreadPool怎麽用?Python QtCore.QThreadPool使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PyQt5.QtCore的用法示例。


在下文中一共展示了QtCore.QThreadPool方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import QThreadPool [as 別名]
def __init__(self):
        super().__init__()

        self._thread_pool = QtCore.QThreadPool()
        self._pb_list = ProgressBarsList(self)

        self._list_of_files = FileListWidget()

        self._list_of_features = FeatureListWidget()
        self._feature_parameters = None

        self._figure = plt.figure()
        self._ax = self._figure.add_subplot(111)  # plot here
        self._ax.set_xlabel('Retention time [min]')
        self._ax.set_ylabel('Intensity')
        self._ax.ticklabel_format(axis='y', scilimits=(0, 0))
        self._label2line = dict()  # a label (aka line name) to plotted line
        self._canvas = FigureCanvas(self._figure)
        self._toolbar = NavigationToolbar(self._canvas, self) 
開發者ID:Arseha,項目名稱:peakonly,代碼行數:21,代碼來源:abstract_main_window.py

示例2: __init__

# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import QThreadPool [as 別名]
def __init__(self, parent=None):
        super(Gallery, self).__init__(parent)
        self.setupUi(self)
        self.setup_toolbar()
        self.setup_paginator()
        self._items: [] = []
        self._pages = []
        self._page_size = 50
        self._curr_page = 0
        self._thread_pool = QThreadPool()
        self.setAcceptDrops(True)
        self.center_widget = None
        self.center_layout = None
        self._content_type = "Images"
        self._tag = None
        self._actions = []
        self._loading_dialog = QLoadingDialog(parent=self) 
開發者ID:haruiz,項目名稱:CvStudio,代碼行數:19,代碼來源:gallery.py

示例3: __init__

# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import QThreadPool [as 別名]
def __init__(self, ds, parent=None):
        super(MediaTabWidget, self).__init__(parent)
        self.media_grid = Gallery()
        self.media_grid.filesDropped.connect(self.gallery_files_dropped_slot)
        self.media_grid.doubleClicked.connect(self.gallery_card_double_click_slot)
        delete_action = GalleryAction(gui.get_icon("delete.png"), name="delete", tooltip="delete image")
        edit_action = GalleryAction(gui.get_icon("annotations.png"), name="edit", tooltip="edit annotations")
        # view_action=GalleryAction(gui.get_icon("search.png"),name="view")
        self.media_grid.actions = [delete_action, edit_action]
        self.media_grid.cardActionClicked.connect(self.card_action_clicked_slot)
        self.setLayout(QVBoxLayout())
        self.layout().setContentsMargins(0, 0, 0, 0)
        self.layout().addWidget(self.media_grid)
        self._thread_pool = QThreadPool()
        self._loading_dialog = QLoadingDialog()
        self._ds_dao = DatasetDao()
        self._ds: DatasetVO = ds
        self.load() 
開發者ID:haruiz,項目名稱:CvStudio,代碼行數:20,代碼來源:tab_media.py

示例4: __init__

# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import QThreadPool [as 別名]
def __init__(self, parent=None):
        super(DatasetTabWidget, self).__init__(parent)
        self.setCursor(QtCore.Qt.PointingHandCursor)
        self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
        self.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
        self.data_grid = DatasetGridWidget()
        self.data_grid.new_dataset_action_signal.connect(self.btn_new_dataset_on_slot)
        self.data_grid.delete_dataset_action_signal.connect(self.btn_delete_dataset_on_slot)
        self.data_grid.refresh_dataset_action_signal.connect(self.refresh_dataset_action_slot)
        self.data_grid.edit_dataset_action_signal.connect(self.edit_dataset_action_slot)
        self.data_grid.open_dataset_action_signal.connect(self.open_dataset_action_slot)
        self.data_grid.download_anno_action_signal.connect(self.download_annot_action_slot)
        self.data_grid.import_anno_action_signal.connect(self.import_annot_action_slot)

        self.setWidget(self.data_grid)
        self.setWidgetResizable(True)
        self.thread_pool = QThreadPool()
        self.loading_dialog = QLoadingDialog()
        self._ds_dao = DatasetDao()
        self._labels_dao = LabelDao()
        self._annot_dao = AnnotaDao()
        self.load() 
開發者ID:haruiz,項目名稱:CvStudio,代碼行數:24,代碼來源:tab_datasets.py

示例5: __init__

# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import QThreadPool [as 別名]
def __init__(self, grid, number):
        super().__init__()
        logging.debug('__init__() called on GridOperator')

        #grid: 3D-array [grid][row][col]
        # here is is only 2D: [row][col]
        #grid[0][row][column] = (function, config, self_sync)

        self.grid = grid
        self.number = number # grid number [0 .. 4]
        self.stop_flag = False
        self.fastpath = False # fastpath is active when debug is diasbled
        self.retry_counter = 0
        self.delay = 0
        self.threadpool = QThreadPool()
        self.b_debug_window = False
        self.pending_return = []
        self.pid_register = []
        self.exec_pending.connect(self.checkPending)
        logging.debug('__init__() GridOperator, threadCount: {}'.format(
            self.threadpool.maxThreadCount())) 
開發者ID:hANSIc99,項目名稱:Pythonic,代碼行數:23,代碼來源:executor_daemon.py

示例6: __init__

# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import QThreadPool [as 別名]
def __init__(self, grid, number):
        super().__init__()
        logging.debug('__init__() called on GridOperator')
        self.grid = grid
        self.number = number # number of workingarea [0-4]
        self.stop_flag = False
        self.fastpath = False # fastpath is active when debug is diasbled
        self.retry_counter = 0
        self.delay = 0
        self.threadpool = QThreadPool()
        self.b_debug_window = False
        self.pending_return = []
        self.pid_register = []
        self.exec_pending.connect(self.checkPending)
        logging.debug('__init__() GridOperator, threadCount: {}'.format(
            self.threadpool.maxThreadCount())) 
開發者ID:hANSIc99,項目名稱:Pythonic,代碼行數:18,代碼來源:executor.py

示例7: __init__

# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import QThreadPool [as 別名]
def __init__(self, func, run_exit, new_thread, output='gui', left=10, top=10,
            width=400, height=140):
        """
        Parameters
        ----------
        output : str
            'gui': [default] redirect screen output to the gui
            'term': do nothing
        """
        super().__init__()
        self.new_thread = new_thread
        self.title = func.name
        self.func = func
        self.initUI(run_exit, QtCore.QRect(left, top, width, height))
        self.threadpool = QtCore.QThreadPool()
        self.outputEdit = self.initOutput(output) 
開發者ID:szsdk,項目名稱:quick,代碼行數:18,代碼來源:quick.py

示例8: __init__

# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import QThreadPool [as 別名]
def __init__(self, queue, thread_limit):
        """
        Class that spawns the separate download threads.  This is a separate class so it can be moved to its own thread
        and run simultaneously with post extraction.

        :param queue: The download queue in which extracted content is placed
        """
        super().__init__()
        self.logger = logging.getLogger('DownloaderForReddit.%s' % __name__)
        self.queue = queue
        self.download_count = 0
        self.run = True

        self.download_pool = QThreadPool()
        self.download_pool.setMaxThreadCount(thread_limit) 
開發者ID:MalloyDelacroix,項目名稱:DownloaderForReddit,代碼行數:17,代碼來源:DownloadRunner.py

示例9: __init__

# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import QThreadPool [as 別名]
def __init__(self, parent=None):
        super(DatasetPicker, self).__init__(parent)
        self.setCursor(QtCore.Qt.PointingHandCursor)
        self._thread_pool = QThreadPool()
        self.load() 
開發者ID:haruiz,項目名稱:CvStudio,代碼行數:7,代碼來源:model_wizard.py

示例10: __init__

# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import QThreadPool [as 別名]
def __init__(self, parent=None):
        super(ModelsTabWidget, self).__init__(parent)
        self.setCursor(QtCore.Qt.PointingHandCursor)
        self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
        self.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
        self.data_grid = ModelsGridWidget()
        self.data_grid.new_item_action.connect(self.data_grid_new_item_action_slot)
        self.setWidget(self.data_grid)
        self.setWidgetResizable(True)
        self._thread_pool = QThreadPool()
        self._loading_dialog = QLoadingDialog()
        self.load() 
開發者ID:haruiz,項目名稱:CvStudio,代碼行數:14,代碼來源:tab_models.py

示例11: __init__

# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import QThreadPool [as 別名]
def __init__(self, settings_path='settings.json', profiles_path='profiles.json'):

        self.profile_path = profiles_path
        self.settings_path = settings_path
        self.work_dir = os.getcwd().replace('\\', '/')

        self.force_save = False

        self.threadpool = QThreadPool()
        self.threadpool.setMaxThreadCount(1) 
開發者ID:Thomasedv,項目名稱:Grabber,代碼行數:12,代碼來源:filehandler.py


注:本文中的PyQt5.QtCore.QThreadPool方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。