pqCheckBoxPixMaps.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 #ifndef pqCheckBoxPixMaps_h
5 #define pqCheckBoxPixMaps_h
6 
7 #include "pqWidgetsModule.h"
8 #include <QObject>
9 #include <QPixmap>
10 
11 class QWidget;
12 
17 class PQWIDGETS_EXPORT pqCheckBoxPixMaps : public QObject
18 {
19  Q_OBJECT
20  typedef QObject Superclass;
21 
22 public:
26  pqCheckBoxPixMaps(QWidget* parent);
27 
31  QPixmap getPixmap(Qt::CheckState state, bool active) const;
32  QPixmap getPixmap(int state, bool active) const
33  {
34  return this->getPixmap(static_cast<Qt::CheckState>(state), active);
35  }
36 
37 private:
38  Q_DISABLE_COPY(pqCheckBoxPixMaps)
39 
40  enum PixmapStateIndex
41  {
42  Checked = 0,
43  PartiallyChecked = 1,
44  UnChecked = 2,
45 
46  // All active states in lower half
47  Checked_Active = 3,
48  PartiallyChecked_Active = 4,
49  UnChecked_Active = 5,
50 
51  PixmapCount = 6
52  };
53  QPixmap Pixmaps[6];
54 };
55 
56 #endif
#define PQWIDGETS_EXPORT
pqCheckBoxPixMaps is a helper class that can used to create pixmaps for checkboxs in various states...
QPixmap getPixmap(int state, bool active) const