Python PyQt5.QtCore.QMutex() Examples

The following are 21 code examples for showing how to use PyQt5.QtCore.QMutex(). These examples are extracted from open source projects. 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 check out the related API usage on the sidebar.

You may also want to check out all available functions/classes of the module PyQt5.QtCore , or try the search function .

Example 1
Project: detection   Author: xsyann   File: detection.py    License: GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, mw):
        super(MediaThread, self).__init__(mw)
        self.mw = mw
        self.stopped = False
        self.capture = None
        self.nextFrame = False
        self.mutex = QtCore.QMutex()
        self.mode = None 
Example 2
Project: dash-masternode-tool   Author: Bertrand256   File: wnd_utils.py    License: MIT License 5 votes vote down vote up
def fun_call_signalled(self, fun_to_call, args, kwargs, mutex):
        """
        Function-event executed in the main thread as a result of emiting signal fun_call_signal from BG threads.
        :param fun_to_call: ref to a function which is to be called
        :param args: args passed to the function fun_to_call
        :param mutex: mutex object (QMutex) which is used in the calling thread to wait until
            function 'fun_to_call' terminates; calling mutex.unlock() will signal that
        :return: return value from fun_to_call
        """
        try:
            self.fun_call_ret_value = fun_to_call(*args, **kwargs)
        except Exception as e:
            self.fun_call_exception = e
        finally:
            mutex.unlock() 
Example 3
Project: pychemqt   Author: jjgomera   File: thread.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent=None):
        super(Evaluate, self).__init__(parent)
        self.mutex = QMutex() 
Example 4
Project: IDAFuzzy   Author: Ga-ryo   File: ida_fuzzy.py    License: MIT License 5 votes vote down vote up
def __init__(self, parent=None):
        super(FuzzySearchThread, self).__init__(parent)
        self.stopped = False
        self.mutex = QtCore.QMutex()
        self.terminate_event = threading.Event() 
Example 5
Project: lanzou-gui   Author: rachpt   File: share.py    License: MIT License 5 votes vote down vote up
def __init__(self, parent=None):
        super(GetSharedInfo, self).__init__(parent)
        self._disk = None
        self.share_url = ""
        self.pwd = ""
        self.is_file = ""
        self.is_folder = ""
        self._mutex = QMutex()
        self._is_work = False
        self._pat = r"(https?://(\w[-\w]*\.)?lanzou[six].com/[bi]?[A-Za-z0-9]+)[^0-9a-z]*([a-z0-9]+)?" 
Example 6
Project: lanzou-gui   Author: rachpt   File: update.py    License: MIT License 5 votes vote down vote up
def __init__(self, parent=None):
        super(CheckUpdateWorker, self).__init__(parent)
        self._ver = ''
        self._manual = False
        self._mutex = QMutex()
        self._is_work = False
        self._folder_id = None
        self._api = 'https://api.github.com/repos/rachpt/lanzou-gui/releases/latest'
        self._api_mirror = 'https://gitee.com/api/v5/repos/rachpt/lanzou-gui/releases/latest' 
Example 7
Project: lanzou-gui   Author: rachpt   File: recovery.py    License: MIT License 5 votes vote down vote up
def __init__(self, parent=None):
        super(GetRecListsWorker, self).__init__(parent)
        self._disk = None
        self._mutex = QMutex()
        self._is_work = False
        self._folder_id = None 
Example 8
Project: lanzou-gui   Author: rachpt   File: recovery.py    License: MIT License 5 votes vote down vote up
def __init__(self, parent=None):
        super(RecManipulator, self).__init__(parent)
        self._disk = None
        self._mutex = QMutex()
        self._is_work = False
        self._action = None
        self._folders = []
        self._files= [] 
Example 9
Project: lanzou-gui   Author: rachpt   File: down.py    License: MIT License 5 votes vote down vote up
def __init__(self, disk, task, parent=None):
        super(Downloader, self).__init__(parent)
        self._disk = disk
        self._task = task
        self._stopped = True
        self._mutex = QMutex() 
Example 10
Project: lanzou-gui   Author: rachpt   File: refresh.py    License: MIT License 5 votes vote down vote up
def __init__(self, parent=None):
        super(ListRefresher, self).__init__(parent)
        self._disk = None
        self._fid = -1
        self.r_files = True
        self.r_folders = True
        self.r_path = True
        self._mutex = QMutex()
        self._is_work = False 
Example 11
Project: lanzou-gui   Author: rachpt   File: pwd.py    License: MIT License 5 votes vote down vote up
def __init__(self, parent=None):
        super(SetPwdWorker, self).__init__(parent)
        self._disk = None
        self.infos = []
        self._work_id = -1
        self._mutex = QMutex()
        self._is_work = False 
Example 12
Project: lanzou-gui   Author: rachpt   File: desc.py    License: MIT License 5 votes vote down vote up
def __init__(self, parent=None):
        super(DescPwdFetcher, self).__init__(parent)
        self._disk = None
        self.infos = None
        self.download = False
        self.dl_path = ""
        self._mutex = QMutex()
        self._is_work = False 
Example 13
Project: lanzou-gui   Author: rachpt   File: rename.py    License: MIT License 5 votes vote down vote up
def __init__(self, parent=None):
        super(RenameMkdirWorker, self).__init__(parent)
        self._disk = None
        self._work_id = -1
        self._folder_list = None
        self.infos = None
        self._mutex = QMutex()
        self._is_work = False 
Example 14
Project: lanzou-gui   Author: rachpt   File: rm.py    License: MIT License 5 votes vote down vote up
def __init__(self, parent=None):
        super(RemoveFilesWorker, self).__init__(parent)
        self._disk = None
        self.infos = None
        self._mutex = QMutex()
        self._is_work = False 
Example 15
Project: lanzou-gui   Author: rachpt   File: folders.py    License: MIT License 5 votes vote down vote up
def __init__(self, parent=None):
        super(GetAllFoldersWorker, self).__init__(parent)
        self._disk = None
        self.org_infos = None
        self._mutex = QMutex()
        self._is_work = False
        self.move_infos = None 
Example 16
Project: lanzou-gui   Author: rachpt   File: login.py    License: MIT License 5 votes vote down vote up
def __init__(self, parent=None):
        super(LogoutWorker, self).__init__(parent)
        self._disk = None
        self.update_ui = True
        self._mutex = QMutex()
        self._is_work = False 
Example 17
Project: lanzou-gui   Author: rachpt   File: upload.py    License: MIT License 5 votes vote down vote up
def __init__(self, parent=None):
        super(UploadWorker, self).__init__(parent)
        self._disk = None
        self._tasks = {}
        self._mutex = QMutex()
        self._is_work = False
        self._url = ""
        self._task = None
        self._allow_big_file = False 
Example 18
Project: PyQt   Author: PyQt5   File: WakeupThread.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        super(Thread, self).__init__(*args, **kwargs)
        self._isPause = False
        self._value = 0
        self.cond = QWaitCondition()
        self.mutex = QMutex() 
Example 19
Project: CodeAtlasSublime   Author: league1991   File: codescene.py    License: Eclipse Public License 1.0 5 votes vote down vote up
def __init__(self):
		super(RecursiveLock, self).__init__(QtCore.QMutex.Recursive) 
Example 20
Project: harvesters_gui   Author: genicam   File: pyqt5.py    License: Apache License 2.0 4 votes vote down vote up
def __init__(self, *, vsync=True, logger=None):
        #
        self._logger = logger or get_logger(name='harvesters')

        #
        super().__init__()

        #
        self._mutex = QMutex()

        profile = True if 'HARVESTER_PROFILE' in os.environ else False
        self._harvester_core = HarvesterCore(
            profile=profile, logger=self._logger
        )
        self._ia = None  # Image Acquirer

        #
        self._widget_canvas = Canvas2D(vsync=vsync)
        self._widget_canvas.create_native()
        self._widget_canvas.native.setParent(self)

        #
        self._action_stop_image_acquisition = None

        #
        self._observer_widgets = []

        #
        self._widget_device_list = None
        self._widget_status_bar = None
        self._widget_main = None
        self._widget_about = None
        self._widget_attribute_controller = None

        #
        self._signal_update_statistics.connect(self.update_statistics)
        self._signal_stop_image_acquisition.connect(self._stop_image_acquisition)
        self._thread_statistics_measurement = _PyQtThread(
            parent=self, mutex=self._mutex,
            worker=self._worker_update_statistics,
            update_cycle_us=250000
        )

        #
        self._initialize_widgets()

        #
        for o in self._observer_widgets:
            o.update() 
Example 21
Project: pychemqt   Author: jjgomera   File: UI_unitConverter.py    License: GNU General Public License v3.0 4 votes vote down vote up
def __init__(self, unidad, valor=None, parent=None):
        """
        unidad: unidades class
        valor: optional value to show
        """
        super(UI_conversorUnidades, self).__init__(parent)
        self.setWindowTitle(unidad.__title__)
        self.mutex = QtCore.QMutex()

        self.unidad = unidad
        if unidad.__tooltip__:
            self.tooltip = unidad.__tooltip__
        else:
            self.tooltip = unidad.__text__
        self.value = self.unidad(valor)

        lyt = QtWidgets.QGridLayout(self)
        self.tabla = QtWidgets.QTableWidget()
        self.tabla.setRowCount(len(unidad.__text__))
        self.tabla.setColumnCount(1)
        self.tabla.setItemDelegateForColumn(0, CellEditor(self))
        self.tabla.horizontalHeader().setVisible(False)
        self.tabla.horizontalHeader().setStretchLastSection(True)
        self.tabla.setMaximumHeight(len(unidad.__text__)*24+4)

        for i, txt in enumerate(unidad.__text__):
            item = QtWidgets.QTableWidgetItem(txt)
            self.tabla.setVerticalHeaderItem(i, item)
            self.tabla.setRowHeight(i, 24)
            self.tabla.setItem(i, 0, QtWidgets.QTableWidgetItem(""))
            self.tabla.item(i, 0).setTextAlignment(
                QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
        for i, tip in enumerate(self.tooltip):
            self.tabla.item(i, 0).setToolTip(tip)
        self.tabla.cellChanged.connect(self.update)
        lyt.addWidget(self.tabla, 2, 1)

        self.buttonBox = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Cancel | QtWidgets.QDialogButtonBox.Ok)
        self.buttonBox.setCenterButtons(True)
        self.buttonBox.accepted.connect(self.accept)
        self.buttonBox.rejected.connect(self.reject)
        lyt.addWidget(self.buttonBox, 3, 0, 1, 3)

        if valor:
            self.fill(self.value)