1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3#ifndef QTIMER_P_H
4#define QTIMER_P_H
5//
6// W A R N I N G
7// -------------
8//
9// This file is not part of the Qt API. It exists for the convenience
10// of the Qt translation tools. This header file may change from version
11// to version without notice, or even be removed.
12//
13// We mean it.
14//
15#include "qobject_p.h"
16#include "qproperty_p.h"
17#include "qtimer.h"
18
19QT_BEGIN_NAMESPACE
20
21class QTimerPrivate : public QObjectPrivate
22{
23 Q_DECLARE_PUBLIC(QTimer)
24public:
25 static constexpr int INV_TIMER = -1; // invalid timer id
26
27 void setInterval(int msec) { q_func()->setInterval(msec); }
28 bool isActiveActualCalculation() const { return id >= 0; }
29
30 int id = INV_TIMER;
31 Q_OBJECT_COMPAT_PROPERTY_WITH_ARGS(QTimerPrivate, int, inter, &QTimerPrivate::setInterval, 0)
32 Q_OBJECT_BINDABLE_PROPERTY_WITH_ARGS(QTimerPrivate, bool, single, false)
33 Q_OBJECT_BINDABLE_PROPERTY_WITH_ARGS(QTimerPrivate, Qt::TimerType, type, Qt::CoarseTimer)
34 Q_OBJECT_COMPUTED_PROPERTY(QTimerPrivate, bool, isActiveData,
35 &QTimerPrivate::isActiveActualCalculation)
36};
37
38QT_END_NAMESPACE
39#endif // QTIMER_P_H
40

source code of qtbase/src/corelib/kernel/qtimer_p.h