File indexing completed on 2024-04-28 03:59:15

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 1999 Reginald Stadlbauer <reggie@kde.org>
0004     SPDX-FileCopyrightText: 1999 Simon Hausmann <hausmann@kde.org>
0005     SPDX-FileCopyrightText: 2000 Nicolas Hadacek <haadcek@kde.org>
0006     SPDX-FileCopyrightText: 2000 Kurt Granroth <granroth@kde.org>
0007     SPDX-FileCopyrightText: 2000 Michael Koch <koch@kde.org>
0008     SPDX-FileCopyrightText: 2001 Holger Freyther <freyther@kde.org>
0009     SPDX-FileCopyrightText: 2002 Ellis Whitehead <ellis@kde.org>
0010     SPDX-FileCopyrightText: 2002 Joseph Wenninger <jowenn@kde.org>
0011     SPDX-FileCopyrightText: 2003 Andras Mantia <amantia@kde.org>
0012     SPDX-FileCopyrightText: 2005-2006 Hamish Rodda <rodda@kde.org>
0013 
0014     SPDX-License-Identifier: LGPL-2.0-only
0015 */
0016 
0017 #ifndef KTOGGLEACTION_P_H
0018 #define KTOGGLEACTION_P_H
0019 
0020 #include "kguiitem.h"
0021 #include "ktoggleaction.h"
0022 
0023 class KToggleActionPrivate
0024 {
0025     Q_DECLARE_PUBLIC(KToggleAction)
0026 
0027 public:
0028     explicit KToggleActionPrivate(KToggleAction *qq)
0029         : q_ptr(qq)
0030     {
0031     }
0032 
0033     virtual ~KToggleActionPrivate()
0034     {
0035         delete checkedGuiItem;
0036     }
0037 
0038     void init()
0039     {
0040         Q_Q(KToggleAction);
0041 
0042         q->setCheckable(true);
0043         QObject::connect(q, &QAction::toggled, q, &KToggleAction::slotToggled);
0044     }
0045 
0046     KToggleAction *const q_ptr;
0047     KGuiItem *checkedGuiItem = nullptr;
0048 };
0049 
0050 #endif