ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
gradientcombobox.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <QComboBox>
11 
12 #include "../qPCL.h"
13 
14 class QListWidgetItem;
15 namespace Widgets {
16 
17 class GradientComboBoxPrivate;
18 class QPCL_ENGINE_LIB_API GradientComboBox : public QComboBox {
19  Q_OBJECT
20 public:
21  explicit GradientComboBox(QWidget* parent = nullptr);
23 
24  void setCurrentIndex(int index);
25  int currentIndex() const;
26 
27  QString currentName() const;
28  QColor currentColor1() const;
29  QColor currentColor2() const;
30 
31  static QPair<QColor, QColor> colorPair(int index);
32 
33  void showPopup();
34  void hidePopup();
35 
36 signals:
37  void colorsChanged(const QString& name,
38  const QColor& clr1,
39  const QColor& clr2);
40 
41 protected:
42  void paintEvent(QPaintEvent* e);
43  void resizeEvent(QResizeEvent* e);
44  QSize minimumSizeHint() const;
45 
46 private slots:
47  void onActivated(int index);
48 
49 private:
50  GradientComboBoxPrivate* d_ptr;
51  Q_DISABLE_COPY(GradientComboBox)
52 };
53 
54 } // namespace Widgets
std::string name
#define slots
#define signals
void colorsChanged(const QString &name, const QColor &clr1, const QColor &clr2)
const double * e
#define QPCL_ENGINE_LIB_API
Definition: qPCL.h:15