I have a CLI application that I'm expanding to have a user interface to aid in, well, usability, and am using Qt-4.8.3.
The application connects to an IRC server, and each connection resides in its own thread receiving data. A parser, running in a different thread, then processes the data and reacts accordingly - creating a channel, adding a user, etc.
I've been looking through the documentation and just can't decide (or really see) what would be the most useful method to update the UI in my instance - should I create a class inheriting from QThread and run that, do some trickery with QFuture and QtConcurrent, create a custom struct and pass it populated to the UI thread, use a customEvent(), or is there a better way overall? Code legibility and performance are top requirements.
The code I have at the moment runs perfectly, but naturally creating a new QWidget inside the parser thread instantly breaks with the notification that it's not the UI thread.
There is only a single class (at the moment, which inherits QObject and provides signals + slots capability) that I'm using to run exec on the QApplication, and also holds the creation functions for the server, channel, user, etc.
I can post some code if needed, but there's a lot of it, and I'm not sure it would really be relevant.