Nesta página

QTimerEvent Class

A classe QTimerEvent contém parâmetros que descrevem um evento de temporizador. Mais...

Cabeçalho: #include <QTimerEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core
Herdado de: QEvent

Funções públicas

(since 6.8) QTimerEvent(Qt::TimerId timerId)
QTimerEvent(int timerId)
(since 6.8) Qt::TimerId id() const
(since 6.9) bool matches(const QBasicTimer &timer) const
int timerId() const

Funções protegidas

QTimerEvent(QTimerEvent &&)
QTimerEvent &operator=(QTimerEvent &&)
QTimerEvent &operator=(const QTimerEvent &other)

Descrição detalhada

Eventos de temporizador são enviados em intervalos regulares para objetos que iniciaram um ou mais temporizadores. Cada temporizador possui um identificador exclusivo. Um temporizador é iniciado com a função ` QObject::startTimer()`.

A classe ` QChronoTimer ` fornece uma interface de programação de alto nível que utiliza sinais em vez de eventos.

O manipulador de eventos ` QObject::timerEvent()` recebe eventos de temporizador.

Veja também QChronoTimer, QObject::timerEvent(), QObject::startTimer() e QObject::killTimer().

Documentação das funções de membro

[explicit, since 6.8] QTimerEvent::QTimerEvent(Qt::TimerId timerId)

Cria um objeto de evento de temporizador com o identificador do temporizador definido como “ timerId ”.

Esta função foi introduzida no Qt 6.8.

[explicit] QTimerEvent::QTimerEvent(int timerId)

Cria um objeto de evento de temporizador com o identificador do temporizador definido como timerId.

[protected delete] QTimerEvent::QTimerEvent(QTimerEvent &&)

Cria uma instância de ` QTimerEvent` por meio da função `move`. Essa função foi excluída.

[since 6.8] Qt::TimerId QTimerEvent::id() const

Retorna o ` Qt::TimerId ` do temporizador associado a este evento, que é o mesmo identificador retornado por ` QObject::startTimer()` convertido para ` Qt::TimerId`.

Essa função foi introduzida no Qt 6.8.

[noexcept, since 6.9] bool QTimerEvent::matches(const QBasicTimer &timer) const

Retorna ` true ` se este evento do temporizador e ` timer ` tiverem o mesmo ID; caso contrário, retorna ` false`.

Essa função foi introduzida no Qt 6.9.

int QTimerEvent::timerId() const

Retorna o identificador exclusivo do temporizador, que é o mesmo identificador retornado pela função ` QObject::startTimer()`.

[protected delete] QTimerEvent &QTimerEvent::operator=(QTimerEvent &&)

A função “Move-assigns” atribui “ other ” a esta instância de “ QTimerEvent ”. Essa função é excluída.

[noexcept protected default] QTimerEvent &QTimerEvent::operator=(const QTimerEvent &other)

Copia e atribui other a esta instância de QTimerEvent.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.