Issue correct warnings with QObject::startTimer()
These are not specific to QTimer Change-Id: Idcffab51a3277413889a727afa1cf7ce15171ec9 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This commit is contained in:
parent
bec8d2e089
commit
c3c1faafe6
@ -1484,12 +1484,12 @@ int QObject::startTimer(int interval, Qt::TimerType timerType)
|
|||||||
Q_D(QObject);
|
Q_D(QObject);
|
||||||
|
|
||||||
if (interval < 0) {
|
if (interval < 0) {
|
||||||
qWarning("QObject::startTimer: QTimer cannot have a negative interval");
|
qWarning("QObject::startTimer: Timers cannot have negative intervals");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!d->threadData->eventDispatcher.load()) {
|
if (!d->threadData->eventDispatcher.load()) {
|
||||||
qWarning("QObject::startTimer: QTimer can only be used with threads started with QThread");
|
qWarning("QObject::startTimer: Timers can only be used with threads started with QThread");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int timerId = d->threadData->eventDispatcher.load()->registerTimer(interval, timerType, this);
|
int timerId = d->threadData->eventDispatcher.load()->registerTimer(interval, timerType, this);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user