pqColorOverlay.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 
5 #ifndef pqColorOverlay_h
6 #define pqColorOverlay_h
7 
8 #include "pqComponentsModule.h"
9 #include <QWidget>
10 
16 class PQCOMPONENTS_EXPORT pqColorOverlay : public QWidget
17 {
18  Q_OBJECT
19  Q_PROPERTY(QColor rgb READ rgb WRITE setRgb)
20  Q_PROPERTY(int opacity READ opacity WRITE setOpacity)
21 
22 public:
23  pqColorOverlay(QWidget* parent = nullptr);
24 
26 
30  QColor rgb() const;
31  void setRgb(int r, int g, int b);
32  void setRgb(QColor Rgb);
34 
36 
40  int opacity() const;
41  void setOpacity(int opacity);
43 
44 protected:
45  void paintEvent(QPaintEvent*) override;
46 
47 private:
48  QColor Rgba = Qt::white;
49 };
50 
51 #endif
#define PQCOMPONENTS_EXPORT
pqColorOverlay defines a widget with a uniform color and an opacity.
#define const
Definition: zconf.h:238