本文整理匯總了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)
示例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)
示例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()
示例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()
示例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()))
示例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()))
示例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)
示例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)
示例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()
示例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()
示例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)