KDDockWidgets API Documentation 2.0
Loading...
Searching...
No Matches
qtquick/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#include "Action.h"
13#include "core/Action_p.h"
14#include "core/Logging_p.h"
15#include "core/DockWidget.h"
16
17using namespace KDDockWidgets::QtQuick;
18
19Action::Action(Core::DockWidget *dw, const char *debugName)
20 : QObject(dw)
21 , KDDockWidgets::Core::Action(dw, debugName)
22{
23}
24
25Action::~Action() = default;
26
27void Action::setIcon(const KDDockWidgets::Icon &)
28{
29 KDDW_ERROR("Not implemented for QtQuick");
30}
31
32KDDockWidgets::Icon Action::icon() const
33{
34 KDDW_ERROR("Not implemented for QtQuick");
35 return {};
36}
37
39{
40 return QObject::blockSignals(b);
41}
42
43void Action::setChecked(bool checked)
44{
45 if (m_checked == checked)
46 return;
47
48 m_checked = checked;
49
50 if (!signalsBlocked()) {
51 KDDW_TRACE("Emitting Action::toggled({})", checked);
52
53 // For core/, which does not support Qt signals
54 d->toggled.emit(checked);
55
56 // For QML:
57 Q_EMIT toggled(checked);
58 }
59}
The DockWidget base-class. DockWidget and Core::DockWidget are only split in two so we can share some...
KDDockWidgets::Icon icon() const override
void setChecked(bool checked) override
void setIcon(const KDDockWidgets::Icon &) override
Action(Core::DockWidget *, const char *debugName="")
The DockWidget controller that's shared between QtWidgets and QtQuick frontends.
Class to abstract QAction, so code still works with QtQuick and Flutter.
Q_EMITQ_EMIT
bool blockSignals(bool block)
bool signalsBlocked() const const

© 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