File indexing completed on 2024-05-12 05:46:31

0001 /* This file is part of KDevelop
0002 
0003    Copyright 2020 Friedrich W. H. Kossebau <kossebaukde.org>
0004 
0005    This program is free software; you can redistribute it and/or
0006    modify it under the terms of the GNU General Public
0007    License as published by the Free Software Foundation; either
0008    version 2 of the License, or (at your option) any later version.
0009 
0010    This program is distributed in the hope that it will be useful,
0011    but WITHOUT ANY WARRANTY; without even the implied warranty of
0012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0013    General Public License for more details.
0014 
0015    You should have received a copy of the GNU General Public License
0016    along with this program; see the file COPYING.  If not, write to
0017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0018    Boston, MA 02110-1301, USA.
0019 */
0020 
0021 #ifndef CLANGTIDY_CUSTOMCHECKSETCONFIGPROXYWIDGET_H
0022 #define CLANGTIDY_CUSTOMCHECKSETCONFIGPROXYWIDGET_H
0023 
0024 #include <QWidget>
0025 
0026 namespace ClangTidy
0027 {
0028 
0029 /**
0030  * Dummy widget to integrate processing of the custom checks with KConfigDialogManager
0031  * It's only purpose is to be part of the config form widget hierarchy and by that being picked up
0032  * by KConfigDialogManager scanning widgets for those with kcfg_* object names, to use them for
0033  * reading & writing values of the matching items of the ConfigSkeleton.
0034  */
0035 class CustomCheckSetConfigProxyWidget : public QWidget
0036 {
0037     Q_OBJECT
0038 
0039     Q_PROPERTY(
0040         QString checks
0041         READ checks
0042         WRITE setChecks
0043         NOTIFY checksChanged
0044         USER true)
0045 
0046 public:
0047     explicit CustomCheckSetConfigProxyWidget(QWidget* parent = nullptr);
0048     ~CustomCheckSetConfigProxyWidget() override;
0049 
0050 public:
0051     QString checks() const;
0052 
0053     void setChecks(const QString& checks);
0054 
0055 Q_SIGNALS:
0056     void checksChanged(const QString& checks);
0057 
0058 private:
0059     QString m_checks;
0060 };
0061 
0062 }
0063 
0064 #endif