Qt
6.x
The Qt SDK
Loading...
Searching...
No Matches
timers.cpp
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4
#include <QTimer>
5
6
class
Foo
:
public
QObject
7
{
8
public
:
9
Foo
();
10
};
11
12
Foo::Foo
()
13
{
15
QTimer
*
timer
=
new
QTimer
(
this
);
17
connect
(
timer
, &
QTimer::timeout
,
this
, &Foo::updateCaption);
19
timer
->
start
(1000);
21
23
QTimer::singleShot
(200,
this
, &Foo::updateCaption);
25
26
{
27
// ZERO-CASE
29
QTimer
*
timer
=
new
QTimer
(
this
);
31
connect
(
timer
, &
QTimer::timeout
,
this
, &Foo::processOneThing);
33
timer
->
start
();
35
}
36
}
37
38
int
main
()
39
{
40
41
}
Foo::Foo
Foo()
Definition
timers.cpp:12
QObject
\inmodule QtCore
Definition
qobject.h:90
QTimer
\inmodule QtCore
Definition
qtimer.h:20
QTimer::start
void start(int msec)
Starts or restarts the timer with a timeout interval of msec milliseconds.
Definition
qtimer.cpp:208
QTimer::singleShot
bool singleShot
whether the timer is a single-shot timer
Definition
qtimer.h:22
QTimer::timeout
void timeout(QPrivateSignal)
This signal is emitted when the timer times out.
Foo
[0]
Definition
doc_src_qplugin.cpp:6
connect
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)
timer
QTimer * timer
[3]
Definition
src_corelib_kernel_qobject.cpp:23
main
int main()
Definition
timers.cpp:38
qtbase
src
corelib
doc
snippets
timers
timers.cpp
Generated by
1.9.7