If it is your school task then we cannot interfere with it, we can only give you hints regarding the use of Qt. I can only suggest to divide your code into classes -- one for the producer, one for the consumer and one for management and user-interface. Then it should be much easier for you to comprehend what is where. If using std::thread is not an explicit requirement then you might want to switch to using QThread.
Bookmarks