KGuiAddons 5.109.0
kcursorsaver.h
1/*
2 SPDX-License-Identifier: LGPL-2.0-or-later
3 SPDX-FileCopyrightText: 2003 Marc Mutz <mutz@kde.org>
4 SPDX-FileCopyrightText: 2020 Laurent Montel <montel@kde.org>
5*/
6
7#ifndef KCURSORSAVER_H
8#define KCURSORSAVER_H
9#include <kguiaddons_export.h>
10
11#include <QCursor>
12
13class KCursorSaverPrivate;
14
29class KGUIADDONS_EXPORT KCursorSaver
30{
31public:
33 explicit KCursorSaver(Qt::CursorShape shape);
34
37
40
43
44 KCursorSaver &operator=(KCursorSaver &&other);
45
46private:
47 KCursorSaver(KCursorSaver &other) = delete;
48 void operator=(const KCursorSaver &rhs) = delete;
49 KCursorSaverPrivate *const d;
50};
51
52#endif
Class to temporarily set a mouse cursor and restore the previous one on destruction.
Definition kcursorsaver.h:30
~KCursorSaver()
restore the cursor
KCursorSaver(KCursorSaver &&other)
Move-constructs a KCursorSaver from other.
void restoreCursor()
call this to explicitly restore the cursor
KCursorSaver(Qt::CursorShape shape)
Creates a KCursorSaver, setting the mouse cursor to shape.