1/*
2 This file is part of the KDE libraries
3 SPDX-FileCopyrightText: 1999 Reginald Stadlbauer <reggie@kde.org>
4 SPDX-FileCopyrightText: 1999 Simon Hausmann <hausmann@kde.org>
5 SPDX-FileCopyrightText: 2000 Nicolas Hadacek <haadcek@kde.org>
6 SPDX-FileCopyrightText: 2000 Kurt Granroth <granroth@kde.org>
7 SPDX-FileCopyrightText: 2000 Michael Koch <koch@kde.org>
8 SPDX-FileCopyrightText: 2001 Holger Freyther <freyther@kde.org>
9 SPDX-FileCopyrightText: 2002 Ellis Whitehead <ellis@kde.org>
10 SPDX-FileCopyrightText: 2002 Joseph Wenninger <jowenn@kde.org>
11 SPDX-FileCopyrightText: 2003 Andras Mantia <amantia@kde.org>
12 SPDX-FileCopyrightText: 2005-2006 Hamish Rodda <rodda@kde.org>
13
14 SPDX-License-Identifier: LGPL-2.0-only
15*/
16
17#ifndef KTOGGLEACTION_P_H
18#define KTOGGLEACTION_P_H
19
20#include "kguiitem.h"
21#include "ktoggleaction.h"
22
23class KToggleActionPrivate
24{
25 Q_DECLARE_PUBLIC(KToggleAction)
26
27public:
28 explicit KToggleActionPrivate(KToggleAction *qq)
29 : q_ptr(qq)
30 {
31 }
32
33 virtual ~KToggleActionPrivate()
34 {
35 delete checkedGuiItem;
36 }
37
38 void init()
39 {
40 Q_Q(KToggleAction);
41
42 q->setCheckable(true);
43 QObject::connect(sender: q, signal: &QAction::toggled, context: q, slot: &KToggleAction::slotToggled);
44 }
45
46 KToggleAction *const q_ptr;
47 KGuiItem *checkedGuiItem = nullptr;
48};
49
50#endif
51

source code of kwidgetsaddons/src/ktoggleaction_p.h