KDDockWidgets API Documentation 2.1
Loading...
Searching...
No Matches
qtquick/Action.h
Go to the documentation of this file.
1/*
2 This file is part of KDDockWidgets.
3
4 SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
5 Author: SĂ©rgio Martins <sergio.martins@kdab.com>
6
7 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
8
9 Contact KDAB at <info@kdab.com> for commercial licensing options.
10*/
11
12#pragma once
13
14#include "kddockwidgets/core/Action.h"
15
16namespace KDDockWidgets {
17
18namespace QtQuick {
19
20class DOCKS_EXPORT Action : public QObject, public KDDockWidgets::Core::Action
21{
22 Q_OBJECT
23public:
24 explicit Action(Core::DockWidget *, const char *debugName = "");
25 ~Action() override;
26
27 void setIcon(const KDDockWidgets::Icon &) override;
28 KDDockWidgets::Icon icon() const override;
29
30 void setText(const QString &text) override
31 {
32 m_text = text;
33 }
34
35 void setToolTip(const QString &text) override
36 {
37 m_toolTip = text;
38 }
39
40 QString toolTip() const override
41 {
42 return m_toolTip;
43 }
44
45 void setEnabled(bool enabled) override
46 {
47 m_enabled = enabled;
48 }
49
50 bool isChecked() const override
51 {
52 return m_checked;
53 }
54
55 void setChecked(bool checked) override;
56
57 bool isEnabled() const override
58 {
59 return m_enabled;
60 }
61
62 void toggle()
63 {
64 setChecked(!m_checked);
65 }
66
67 bool blockSignals(bool) override;
68
69Q_SIGNALS:
70 void toggled(bool);
71
72private:
73 QString m_text;
74 QString m_toolTip;
75
76 bool m_enabled = true;
77 bool m_checked = false;
78};
79
80}
81
82}
The DockWidget base-class. DockWidget and Core::DockWidget are only split in two so we can share some...
QString toolTip() const override
void setToolTip(const QString &text) override
void setEnabled(bool enabled) override
bool isChecked() const override
void setText(const QString &text) override
bool isEnabled() const override
Class to abstract QAction, so code still works with QtQuick and Flutter.

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDDockWidgets
Advanced Dock Widget Framework for Qt
https://www.kdab.com/development-resources/qt-tools/kddockwidgets/
Generated by doxygen 1.9.8