KDDockWidgets API Documentation
2.0
Loading...
Searching...
No Matches
source
src
qtwidgets
qtwidgets/Action.cpp
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
13
#include "Action_p.h"
14
#include "core/Action_p.h"
15
#include "core/Logging_p.h"
16
17
using namespace
KDDockWidgets::QtWidgets
;
18
19
Action::Action(
Core::DockWidget
*dw,
const
char
*debugName)
20
: Core::Action(dw, debugName)
21
{
22
setCheckable(
true
);
23
connect
(
this
, &
QAction::toggled
,
this
, [
this
](
bool
checked) {
24
if
(m_lastCheckedState != checked) {
25
m_lastCheckedState = checked;
26
if
(!signalsBlocked()) {
27
KDDW_TRACE(
"Action::toggled({}) ; dw={} ; {}"
, checked, (
void
* )d->dockWidget, d->debugName);
28
d->toggled.emit(checked);
29
}
30
}
31
});
32
}
33
34
Action::~Action() =
default
;
35
36
void
Action::setIcon(
const
KDDockWidgets::Icon &icon)
37
{
38
QAction::setIcon
(icon);
39
}
40
41
KDDockWidgets::Icon Action::icon()
const
42
{
43
return
QAction::icon
();
44
}
45
46
void
Action::setText(
const
QString
&text)
47
{
48
QAction::setText
(text);
49
}
50
51
void
Action::setToolTip(
const
QString
&text)
52
{
53
QAction::setToolTip
(text);
54
}
55
56
QString
Action::toolTip()
const
57
{
58
return
QAction::toolTip
();
59
}
60
61
void
Action::setEnabled(
bool
enabled)
62
{
63
QAction::setEnabled
(enabled);
64
}
65
66
bool
Action::isEnabled()
const
67
{
68
return
QAction::isEnabled
();
69
}
70
71
bool
Action::isChecked()
const
72
{
73
return
QAction::isChecked
();
74
}
75
76
void
Action::setChecked(
bool
checked)
77
{
78
QAction::setChecked
(checked);
79
}
80
81
bool
Action::blockSignals(
bool
b)
82
{
83
return
QAction::blockSignals
(b);
84
}
85
86
#ifdef DOCKS_DEVELOPER_MODE
87
void
Action::trigger()
88
{
89
QAction::trigger
();
90
}
91
#endif
KDDockWidgets::Core::DockWidget
The DockWidget base-class. DockWidget and Core::DockWidget are only split in two so we can share some...
Definition
core/DockWidget.h:60
KDDockWidgets::QtWidgets
Definition
core/MainWindow.h:32
QCoro::connect
void connect(T &&future, QObjectSubclass *context, Callback func)
Definition
qcorotask.h:721
QAction::isChecked
bool isChecked() const const
QAction::setEnabled
void setEnabled(bool)
QAction::setIcon
void setIcon(const QIcon &icon)
QAction::setText
void setText(const QString &text)
QAction::toggled
void toggled(bool checked)
QAction::setToolTip
void setToolTip(const QString &tip)
QAction::trigger
void trigger()
QObject::blockSignals
bool blockSignals(bool block)
QString
© 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