qthread

How to correctly lock Qthreads in pyqt5 using Python3

…衆ロ難τιáo~ 提交于 2021-02-10 06:29:09
问题 I am relatively new to python, but was able to get a reasonably useful program to run to crunch a lot of data. I am able to run it over multiple sets of data sequentially using another python script to call the program serially, but I wanted to create a GUI and use multithreading to allow others to use it without knowing all the ins and outs of programming. I created the GUI successfully, and can feed data bidirectionally using signals and slots. What I am having trouble with is creating

PySide: method is not executed in thread context if method is invoked via lambda

佐手、 提交于 2021-02-08 10:21:22
问题 I have a Worker object and use its method moveToThread to put it in a thread. Now i call its work method: If I invoke the method directly, it is executed in the thread its object is living in If I invoke the method using lambda, the method is executed in the main thread Example: from PySide.QtCore import * from PySide.QtGui import * import sys class Worker(QObject): def __init__(self): super().__init__() def work(self): print(self.thread().currentThread()) class Example(QWidget): def __init__

GUI Freezing with QThreading and QProcess

回眸只為那壹抹淺笑 提交于 2021-02-08 07:39:40
问题 I'm attempting to write some software that will process large amounts of images collected from some crystallography experiments. The data process involves the following steps: User Input to determine the number of images to batch together. A directory containing the images is selected, and the total number of images is calculated. A nested for loop is used to batch images together, and construct a command and arguments for each batch which is processed using a batch file. The following code

creating new thread using Qthread-Qt5

蹲街弑〆低调 提交于 2021-02-07 07:52:24
问题 I am trying to create a new thread gpsthread which should run in the back ground, and store the value. class gpsthread: public QThread{ Q_OBJECT private:nrega_status_t status2; public: explicit gpsthread(QObject *parent = 0):QThread(parent) { // QTimer *t = new QTimer(this); // connect(t, SIGNAL(timeout()), this, SLOT(processgps())); // t->start(10000); } void run(){ qDebug()<<"inside gps thread\n"; QTimer *t = new QTimer(this); connect(t, SIGNAL(timeout()), this, SLOT(processgps())); t-

Python Qt - How to insert items in Table widget from another Thread?

喜欢而已 提交于 2021-01-29 14:30:46
问题 I want to insert text items from a Worker Qthread to a QTableWidget UI in Main thread ?. I want to know the Syntax to create the signal in Main thread , so I can insert the text as well as the row and column from Worker thread by sending via signal class Example(QWidget): def __init__(self): super().__init__() self.myclass2 = myclass2() self.myclass2.start() self.initUI() def initUI(self): self.setGeometry(300, 300, 300, 220) self.setWindowTitle('Icon') self.setWindowIcon(QIcon('web.png'))

Need advice to keep GUI responsive

我只是一个虾纸丫 提交于 2021-01-29 13:31:13
问题 Basically, what I have is a GUI with some QLineEdits, a "search button" and a table. You hit the button and a class called DataGrabber searches a database for data, processes them, returns a list with dictionaries with which the table is filled, accordingly. These searches can take a while and I need to keep my GUI responsive. Also, I want the statusbar message to change as long as the search is going on (something like "Searching." -> "Searching.." -> "Searching...", the functionality is not

PyQt5 Gui Thread to worker Thread signal/Slot

浪尽此生 提交于 2021-01-29 01:51:07
问题 I am trying to make a simple communication between a worker thread, in this case it is called WorkToDo via the PyQt5 Signals and Slots mechanism. I can reliably send data from the Worker to the Gui thread via this mechanism, but I cannot do the same to the gui thread. From my research I have found that this is due to the fact that I have overridden the run function with my own logic. My question, is there any way to manually handle the execution of signals in the worker thread? Is there a

PyQt5 Gui Thread to worker Thread signal/Slot

给你一囗甜甜゛ 提交于 2021-01-29 01:47:38
问题 I am trying to make a simple communication between a worker thread, in this case it is called WorkToDo via the PyQt5 Signals and Slots mechanism. I can reliably send data from the Worker to the Gui thread via this mechanism, but I cannot do the same to the gui thread. From my research I have found that this is due to the fact that I have overridden the run function with my own logic. My question, is there any way to manually handle the execution of signals in the worker thread? Is there a

PyQt5 Gui Thread to worker Thread signal/Slot

烈酒焚心 提交于 2021-01-29 01:47:30
问题 I am trying to make a simple communication between a worker thread, in this case it is called WorkToDo via the PyQt5 Signals and Slots mechanism. I can reliably send data from the Worker to the Gui thread via this mechanism, but I cannot do the same to the gui thread. From my research I have found that this is due to the fact that I have overridden the run function with my own logic. My question, is there any way to manually handle the execution of signals in the worker thread? Is there a

pyqtgraph ImageView Freezes when multithreaded

为君一笑 提交于 2021-01-28 04:09:45
问题 I have multiple cameras that are hooked up wirelessly via wifi and I'm trying to stream the data to a client, which displays the streams on a GUI. My issue is that the pyqtgraph ImageItems seem to stop repainting after about 30 seconds, or if I click out of the window, or if I adjust the controls on one of the images. After that, I can manage to get the images to repaint by resizing the window, but that's kind of tedious. I thought maybe pyqtgraph wasn't threadsafe, but I don't even know if I