1/*
2 SPDX-FileCopyrightText: 2020 Kevin Ottens <kevin.ottens@enioka.com>
3 SPDX-FileCopyrightText: 2020 Cyril Rossi <cyril.rossi@enioka.com>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#ifndef SETTINGSHIGHLIGHTERPRIVATE_H
9#define SETTINGSHIGHLIGHTERPRIVATE_H
10
11#include <QPointer>
12#include <QQmlParserStatus>
13#include <QQuickItem>
14
15class SettingHighlighterPrivate : public QObject, public QQmlParserStatus
16{
17 Q_OBJECT
18 QML_ELEMENT
19 Q_PROPERTY(QQuickItem *target READ target WRITE setTarget NOTIFY targetChanged)
20 Q_PROPERTY(bool highlight READ highlight WRITE setHighlight NOTIFY highlightChanged)
21 Q_PROPERTY(bool defaultIndicatorVisible READ defaultIndicatorVisible WRITE setDefaultIndicatorVisible NOTIFY defaultIndicatorVisibleChanged)
22 Q_INTERFACES(QQmlParserStatus)
23public:
24 using QObject::QObject;
25
26 QQuickItem *target() const;
27 void setTarget(QQuickItem *target);
28
29 bool highlight() const;
30 void setHighlight(bool highlight);
31
32 bool defaultIndicatorVisible() const;
33 void setDefaultIndicatorVisible(bool enabled);
34
35Q_SIGNALS:
36 void targetChanged();
37 void highlightChanged();
38 void defaultIndicatorVisibleChanged(bool enabled);
39
40private Q_SLOTS:
41 void updateTarget();
42
43private:
44 void classBegin() override
45 {
46 }
47 void componentComplete() override;
48
49 bool m_isComponentComplete = false;
50
51 QPointer<QQuickItem> m_target = nullptr;
52 QPointer<QQuickItem> m_styleTarget = nullptr;
53 bool m_highlight = false;
54 bool m_enabled = false;
55};
56
57#endif
58

source code of kcmutils/src/qml/settinghighlighterprivate.h