File indexing completed on 2024-05-05 04:39:18

0001 /*
0002     SPDX-FileCopyrightText: 2020 Friedrich W. H. Kossebau <kossebaukde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef KDEVCLAZY_CUSTOMCHECKSETCONFIGPROXYWIDGET_H
0008 #define KDEVCLAZY_CUSTOMCHECKSETCONFIGPROXYWIDGET_H
0009 
0010 #include <QWidget>
0011 
0012 namespace Clazy
0013 {
0014 
0015 /**
0016  * Dummy widget to integrate processing of the custom checks with KConfigDialogManager
0017  * It's only purpose is to be part of the config form widget hierarchy and by that being picked up
0018  * by KConfigDialogManager scanning widgets for those with kcfg_* object names, to use them for
0019  * reading & writing values of the matching items of the ConfigSkeleton.
0020  */
0021 class CustomCheckSetConfigProxyWidget : public QWidget
0022 {
0023     Q_OBJECT
0024 
0025     Q_PROPERTY(
0026         QString checks
0027         READ checks
0028         WRITE setChecks
0029         NOTIFY checksChanged
0030         USER true)
0031 
0032 public:
0033     explicit CustomCheckSetConfigProxyWidget(QWidget* parent = nullptr);
0034     ~CustomCheckSetConfigProxyWidget() override;
0035 
0036 public:
0037     QString checks() const;
0038 
0039     void setChecks(const QString& checks);
0040 
0041 Q_SIGNALS:
0042     void checksChanged(const QString& checks);
0043 
0044 private:
0045     QString m_checks;
0046 };
0047 
0048 }
0049 
0050 #endif