Akonadi Contacts

preferredlineeditwidget.h
1 /*
2  This file is part of Contact Editor.
3 
4  SPDX-FileCopyrightText: 2016-2021 Laurent Montel <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #pragma once
10 
11 #include <KLineEdit>
12 #include <QIcon>
13 class QAction;
14 namespace ContactEditor
15 {
16 class PreferredLineEditWidget : public KLineEdit
17 {
18  Q_OBJECT
19 public:
20  explicit PreferredLineEditWidget(QWidget *parent = nullptr);
21  ~PreferredLineEditWidget();
22 
23  Q_REQUIRED_RESULT bool preferred() const;
24 
25  void setPreferred(bool preferred);
26 
27 Q_SIGNALS:
28  void preferredChanged(QWidget *w);
29 
30 private:
31  void slotPreferredStatusChanged();
32  void updatePreferredIcon();
33  bool mPreferred = false;
34  QIcon mIconEnabled;
35  QIcon mIconDisabled;
36  QAction *mPreferredAction = nullptr;
37 };
38 }
Q_SIGNALSQ_SIGNALS
Q_OBJECTQ_OBJECT
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Wed Jun 23 2021 23:09:25 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.