本文整理汇总了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)