If you want to use signal/slots to communicate from the GUI to the worker thread then you'll need a QThread that runs an event loop.
You start by creating a QObject subclass that has the receiver slot and that slot does the database query.
You create an instance of QThread and an instance of this new class and then use moveToThread() to make it run in the worker thread.
The slot then gets invoked in the context of the worker thread.
Cheers
_
Bookmarks