Questions tagged [qthread]

QThread is a threading class provided by the cross-platform Qt framework.

As of Qt 4.3, the default QThread object executes an event loop in his run() method. Thus, it is discouraged to subclass QThread for concurrent execution. Instead all operations which are required to be executed concurrently should be encapsulated into one or more QObject with signals and slots as a mechanism to communicate data. These objects can then be "moved" to the Qthread object.

This allow concurrent programming without the need for a lock, a condition variable, or a semaphore

Helpful links:

Frequently Asked Questions About QThread:

1528 questions
-1
votes
1 answer

Python PyQt5 load Image for QPushButton on QThread

So I have this UI that loads ALOT of buttons, all with Images, problem is, it takes WAY to long, so I tried putting it into a QThread, I had it working, but there was no speed difference, so I tried a different solution, but now the Thread wont…
JareBear
  • 467
  • 9
  • 27
-1
votes
1 answer

Why is this thread slot not getting called?

Two.h #ifndef TWO_H #define TWO_H #include #include #include #include class Two : public QObject { Q_OBJECT private: QTimer abc; public: QString m_xyz; Two(); signals: void emitThisSignal(…
Aquarius_Girl
  • 21,790
  • 65
  • 230
  • 411
-1
votes
1 answer

Cannot create children for a parent that is in a different thread qt c++

I am trying to run a separate thread from the main thread where mqttclient is initialised and moved to a new thread. Previously there were problems of signal slot. Which i resumed by creating a separate class (mqtthandler) running from main thread…
Mandeep
  • 335
  • 3
  • 13
-1
votes
1 answer

How to fetch value from a CLASS(ShowVideo) to use in second CLASS(ImageViewer) (according to my program) by using PyQt5 QThread

I am trying to retrieve the value of x i.e is a counter from class ShowVideo and to display the counter in a button in ImageViewer class. Video is running perfectly, but I m not getting the logic on how to show counter when video starts running. All…
-1
votes
1 answer

Multiple camera feeds not working with PyQt5 threading:

I have a data collection software that requires camera feeds from two different camera sources one is a Brio webcam & the other one is an IP webcam connected via USB tethering. Now when I edited the code for streaming two multiple videos it was…
-1
votes
1 answer

Error connecting Worker Thread signal with MainWindow slot (Qt5)

I want to write a simple Application which launches a thread to do some computations. The worker thread should periodically send signals to the MainWindow to inform it about the current state of progress. In order to implement the worker thread, I…
Mantabit
  • 269
  • 1
  • 4
  • 14
-1
votes
1 answer

GUI lag issue when using thread

This is the code i'm using now the issue is when i press on the pushbutton the thread is starting and the value in line edit is updating. but it slows down the GUI overall. I am learning QThread so implemented this code and facing difficulties in…
harsha
  • 25
  • 4
-1
votes
1 answer

No event loop is runing on this thread

I am creating a new thread to separate the UI interface from the data processing logic., but for reasons completely unfathomable to me, when I build and run my app , the app promptly crashes with the exception: File "capnp/lib/capnp.pyx", line…
TonnyLiu
  • 3
  • 2
-1
votes
1 answer

Closing and opening QSerialPort from another thread

I am working on an application that requires communication with serial port. I am using the blocking mater example provided by QT. The problem is, I need to be able to Close and Open the port as I have another program that needs to sometimes to…
DEKKER
  • 877
  • 6
  • 19
-1
votes
2 answers

deallocate objects that live in a thread that has just ended, by connecting the finished() signal to QObject::deleteLater()

From: http://doc.qt.io/qt-5/qthread.html#details From Qt 4.8 onwards, it is possible to deallocate objects that live in a thread that has just ended, by connecting the finished() signal to QObject::deleteLater(). Does this mean if I connect…
Aquarius_Girl
  • 21,790
  • 65
  • 230
  • 411
-1
votes
1 answer

Connect signals from worker class to controller class - QThreads

Header: #ifndef CONTROLLER_THREAD #define CONTROLLER_THREAD #include class Worker : public QObject { Q_OBJECT public: Worker(); ~Worker(); private slots: void calculateImage(); signals: void imageReady(); }; class…
Aquarius_Girl
  • 21,790
  • 65
  • 230
  • 411
-1
votes
2 answers

Slot is not detected when QPushbutton is released

I am currently making a main menu for a game, but when the button is clicked it does not seem to call the relevant slot (The button does not do anything). I have tried to move the button to a thread to ensure that nothing is keeping it from running…
AO1114
  • 3
  • 3
-1
votes
1 answer

PyQt5 - how to avoid crashing gui while updating progresssbar in a multi-threading setting (Qthread)?

I am new in multi threading. The video file I use work fine and the progress-bar at the start shows a percent in progress-bar. When I want to change the progress-bar value continuously for example the current cpu usage value the below code keeps…
-1
votes
1 answer

SIGSEGV error with QtThread on deleting QSGNode

I am working on a Qt app which runs on android & iOS. Scenario: Calling delete on a pointer causes my app to crash sometimes gives me the following error on Android. Fatal signal 11 (SIGSEGV), code 1, fault addr 0x3c in tid 7134 (QtThread) This is…
TheWaterProgrammer
  • 7,055
  • 12
  • 70
  • 159
-1
votes
1 answer

Acess violation error in PyQt5

I am really new to programming and I recently had to do a GUI with PyQt. Basicly what it does is reading reading some data coming from an Arduino on the serial port and updates a graph every 100 values sent by the Arduino. There is also a log…
Simon
  • 3
  • 2
1 2 3
99
100