Safari
Safari

Reputation: 11965

C++ pthread and Qt

I have a question about C++ pthread and Qt.

I have not yet developed my code.. I have a architetture (c++ class with pthread) that implement a Logic of my application.

I would to use Qt about the UI.

Can I have some problem with c++, pthread and Qt? I would to create a Qt ui-form into a pthread run..

Upvotes: 1

Views: 1178

Answers (1)

Zlatomir
Zlatomir

Reputation: 7044

As long as you keep the ui related code on the main thread you should be fine (as far as i know Qt threads are built upon pthread), but anyway you can take a look into Qt's documentation for multithreading (both QThread and concurrency namespace) and you might find that it's easier to use and easier to get messages between threads (example get the progress of the background worker) and also there is a lot of helper functionality that might make your code easier to write and easier to read after (stuff like QThreadPool, QMutexLocker or QReadWriteLock).

Upvotes: 1

Related Questions