Python PyQt5.QtCore.QThreadPool() Examples

The following are 11 code examples of PyQt5.QtCore.QThreadPool(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module PyQt5.QtCore , or try the search function .
Example #1
Source File: abstract_main_window.py    From peakonly with MIT License 6 votes vote down vote up
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) 
Example #2
Source File: gallery.py    From CvStudio with MIT License 6 votes vote down vote up
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) 
Example #3
Source File: tab_media.py    From CvStudio with MIT License 6 votes vote down vote up
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() 
Example #4
Source File: tab_datasets.py    From CvStudio with MIT License 6 votes vote down vote up
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() 
Example #5
Source File: executor_daemon.py    From Pythonic with GNU General Public License v3.0 6 votes vote down vote up
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())) 
Example #6
Source File: executor.py    From Pythonic with GNU General Public License v3.0 6 votes vote down vote up
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())) 
Example #7
Source File: quick.py    From quick with GNU General Public License v3.0 6 votes vote down vote up
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) 
Example #8
Source File: DownloadRunner.py    From DownloaderForReddit with GNU General Public License v3.0 5 votes vote down vote up
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) 
Example #9
Source File: model_wizard.py    From CvStudio with MIT License 5 votes vote down vote up
def __init__(self, parent=None):
        super(DatasetPicker, self).__init__(parent)
        self.setCursor(QtCore.Qt.PointingHandCursor)
        self._thread_pool = QThreadPool()
        self.load() 
Example #10
Source File: tab_models.py    From CvStudio with MIT License 5 votes vote down vote up
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() 
Example #11
Source File: filehandler.py    From Grabber with GNU General Public License v3.0 5 votes vote down vote up
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)