swift
ticklabel.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2013 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #ifndef SWIFT_GUI_TICKLABEL_H
7 #define SWIFT_GUI_TICKLABEL_H
8 
9 #include <QLabel>
10 #include <QObject>
11 #include <QPixmap>
12 #include <QString>
13 
14 #include "gui/swiftguiexport.h"
15 #include "misc/icons.h"
16 
17 namespace swift::gui
18 {
20  class SWIFT_GUI_EXPORT CTickLabel : public QLabel
21  {
22  Q_OBJECT
23 
24  public:
26  explicit CTickLabel(QWidget *parent = nullptr);
27 
29  void setTicked(bool ticked);
30 
32  void setToolTips(const QString &ticked, const QString &unticked);
33 
34  signals:
36  void tickChanged(bool ticked);
37 
38  private:
39  bool m_isPixmapTicked = false;
40  QString m_toolTipTicked = "on";
41  QString m_toolTipUnticked = "off";
42  QPixmap m_pixmapTicked = swift::misc::CIcons::tick16();
43  QPixmap m_pixmapUnticked = swift::misc::CIcons::cross16();
44 
46  void setLabel();
47  };
48 } // namespace swift::gui
49 
50 #endif // SWIFT_GUI_TICKLABEL_H
Representing a ticked or crossed icon.
Definition: ticklabel.h:21
void tickChanged(bool ticked)
Changed ticked state.
static const QPixmap & cross16()
Cross.
static const QPixmap & tick16()
Tick.
GUI related classes.
#define SWIFT_GUI_EXPORT
Export a class or function from the library.