Пример #1
0
 LoopReference(QEventLoopPrivate *d, QMutexLocker &locker) : d(d), locker(locker), exceptionCaught(true)
 {
     d->inExec = true;
     d->exit = false;
     ++d->threadData->loopLevel;
     d->threadData->eventLoops.push(d->q_func());
     locker.unlock();
 }
Пример #2
0
 ~LoopReference()
 {
     if (exceptionCaught) {
         qWarning("Qt has caught an exception thrown from an event handler. Throwing\n"
                  "exceptions from an event handler is not supported in Qt. You must\n"
                  "reimplement QApplication::notify() and catch all exceptions there.\n");
     }
     locker.relock();
     QEventLoop *eventLoop = d->threadData->eventLoops.pop();
     Q_ASSERT_X(eventLoop == d->q_func(), "QEventLoop::exec()", "internal error");
     Q_UNUSED(eventLoop); // --release warning
     d->inExec = false;
     --d->threadData->loopLevel;
 }
Пример #3
0
 ~LoopReference()
 {
     if (exceptionCaught) {
         qWarning("Qt has caught an exception thrown from an event handler. Throwing\n"
                  "exceptions from an event handler is not supported in Qt.\n"
                  "You must not let any exception whatsoever propagate through Qt code.\n"
                  "If that is not possible, in Qt 5 you must at least reimplement\n"
                  "QCoreApplication::notify() and catch all exceptions there.\n");
     }
     locker.relock();
     QEventLoop *eventLoop = d->threadData->eventLoops.pop();
     Q_ASSERT_X(eventLoop == d->q_func(), "QEventLoop::exec()", "internal error");
     Q_UNUSED(eventLoop); // --release warning
     d->inExec = false;
     --d->threadData->loopLevel;
 }