Hello.
1)I have a class (doesn't work with gui), where I have slot for connect to the database(PSQL)
2)next i create new threadCode:
MyClass * cl = new MyClass;
Code:
myclass->moveToThread(thread); thread->start(); .. emit connectToDB(); ...
3)next make query in gui-class or myclass;
4)
why query.exec() return true with correct data in gui-thread and another thread?Quote:
Threads and the SQL Module
A connection can only be used from within the thread that created it. Moving connections between threads or creating queries from a different thread is not supported.