If this is definitely safe than you can add an assert:
```c++
Q_ASSERT(QThread::currentThread() != qApp->thread());
```