Reader small image

You're reading from  Computer Vision with OpenCV 3 and Qt5

Product typeBook
Published inJan 2018
Reading LevelIntermediate
PublisherPackt
ISBN-139781788472395
Edition1st Edition
Languages
Right arrow
Author (1)
Amin Ahmadi Tazehkandi
Amin Ahmadi Tazehkandi
author image
Amin Ahmadi Tazehkandi

Amin Ahmadi Tazehkandi is an Iranian author, developer, and a computer vision expert.Amin Ahmadi Tazehkandi is an Iranian author, developer, and a computer vision expert. He completed his computer software engineering studies in Iran and has worked for numerous software and industrial companies around the world.
Read more about Amin Ahmadi Tazehkandi

Right arrow

Low-level multithreading using QThread


In this section, we will learn how to use QThread and its classes to create multithreaded applications. We will go through this by creating an example project, which processes and displays the input and output from a video source using a separate thread. This helps leave the GUI thread (main thread) free and responsive while more intensive processes are handled with the second thread. As it was mentioned earlier, we will focus mostly on the use cases common to computer vision and GUI development; however, the same (or a very similar) approach can be applied to any multithreading problem.

We will use this example project to implement multithreading using two different approaches available in Qt for working with QThread classes. First, subclassing and overriding the run method, and second, using the moveToThread function available in all Qt objects, or, in other words, QObject subclasses.

Subclassing QThread

Let's start by creating an example Qt Widgets...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Computer Vision with OpenCV 3 and Qt5
Published in: Jan 2018Publisher: PacktISBN-13: 9781788472395

Author (1)

author image
Amin Ahmadi Tazehkandi

Amin Ahmadi Tazehkandi is an Iranian author, developer, and a computer vision expert.Amin Ahmadi Tazehkandi is an Iranian author, developer, and a computer vision expert. He completed his computer software engineering studies in Iran and has worked for numerous software and industrial companies around the world.
Read more about Amin Ahmadi Tazehkandi