Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquickioscursorflashtimer.cpp
Go to the documentation of this file.
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
5#include <QtGui/qguiapplication.h>
6#include <QtGui/qstylehints.h>
7
9
14
16{
17 return m_visible;
18}
19
21{
22 if (m_visible == visible)
23 return;
24 m_visible = visible;
26}
27
29{
30 return m_cursorPosition;
31}
32
34{
35 if (m_cursorPosition == cursorPosition)
36 return;
37 m_cursorPosition = cursorPosition;
39 start();
40}
41
43{
44 return m_running;
45}
46
48{
49 if (running == m_running)
50 return;
51 m_running = running;
52 emit runningChanged(m_running);
53 if (!running) {
54 stop();
55 setVisible(false);
56 } else {
57 start();
58 }
59}
60
62{
63 stop();
64 m_timer = startTimer(QGuiApplication::styleHints()->cursorFlashTime() / 2);
65}
66
68{
69 killTimer(m_timer);
70 m_timer = 0;
71}
72
74{
75 if (event->timerId() == m_timer)
77}
78
static QStyleHints * styleHints()
Returns the application's style hints.
\inmodule QtCore
Definition qobject.h:103
int startTimer(int interval, Qt::TimerType timerType=Qt::CoarseTimer)
This is an overloaded function that will start a timer of type timerType and a timeout of interval mi...
Definition qobject.cpp:1817
void killTimer(int id)
Kills the timer with timer identifier, id.
Definition qobject.cpp:1912
void runningChanged(bool running)
void setCursorPosition(int cursorPosition)
void timerEvent(QTimerEvent *event) override
This event handler can be reimplemented in a subclass to receive timer events for the object.
QQuickIOSCursorFlashTimer(QObject *parent=nullptr)
\inmodule QtCore
Definition qcoreevent.h:366
Combined button and popup list for selecting options.
static Q_CONSTINIT QBasicAtomicInt running
struct _cl_event * event
#define emit