En esta página

QTimerEvent Class

La clase QTimerEvent contiene parámetros que describen un evento de temporizador. Más...

Cabecera: #include <QTimerEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core
Hereda: QEvent

Funciones 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

Descripción Detallada

Los eventos de temporizador se envían a intervalos regulares a los objetos que han iniciado uno o más temporizadores. Cada temporizador tiene un identificador único. Un temporizador se inicia con QObject::startTimer().

La clase QChronoTimer proporciona una interfaz de programación de alto nivel que utiliza señales en lugar de eventos.

El manejador de eventos QObject::timerEvent() recibe los eventos del temporizador.

Véase también QChronoTimer, QObject::timerEvent(), QObject::startTimer(), y QObject::killTimer().

Documentación de funciones miembro

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

Construye un objeto de evento de temporizador con el identificador de temporizador establecido en timerId.

Esta función se introdujo en Qt 6.8.

[explicit] QTimerEvent::QTimerEvent(int timerId)

Construye un objeto de evento de temporizador con el identificador de temporizador establecido en timerId.

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

Devuelve el Qt::TimerId del temporizador asociado a este evento, que es el mismo identificador devuelto por QObject::startTimer() cast to Qt::TimerId.

Esta función se introdujo en Qt 6.8.

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

Devuelve true si este evento de temporizador y timer tienen el mismo ID, en caso contrario devuelve false.

Esta función se introdujo en Qt 6.9.

int QTimerEvent::timerId() const

Devuelve el identificador único del temporizador, que es el mismo identificador que devuelve QObject::startTimer().

© 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.