I have a Thread, which opens a database and emits a signal. The main idea is to check if the database is still there and valid. If the database is offline (MYSQL), QSqldatabase is trying for about 3 seconds to connect.
Now the problem: If I want to close the thread (Because UI Window got closed) and the database isn't reachable, I'll need to wait until the connection test is done, before I can close my thread and afterwards the UI.
So the UI can freeze, because it's waiting for the thread to close, which is busy with testing the connection.
Is there a possibility to abort a thread immediately? (I'm using Qt Concurrent::run).