ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvCustomLabelsWidget.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 #ifndef ECV_CUSTOM_LABELS_WIDGET_H
9 #define ECV_CUSTOM_LABELS_WIDGET_H
10 
11 #include <QList>
12 #include <QPair>
13 #include <QWidget>
14 
15 class QTableWidget;
16 class QPushButton;
17 
23 class ecvCustomLabelsWidget : public QWidget {
24  Q_OBJECT
25 
26 public:
27  explicit ecvCustomLabelsWidget(QWidget* parent = nullptr);
29 
30  QList<QPair<double, QString>> getLabels() const;
31  void setLabels(const QList<QPair<double, QString>>& labels);
32  void clearLabels();
33 
34 private slots:
35  void onAddButtonClicked();
36  void onRemoveButtonClicked();
37 
38 private:
39  void setupUI();
40 
41  QTableWidget* m_table;
42  QPushButton* m_addButton;
43  QPushButton* m_removeButton;
44 };
45 
46 #endif // ECV_CUSTOM_LABELS_WIDGET_H
#define slots
ParaView-style Custom Labels Editor Widget.
~ecvCustomLabelsWidget() override
void setLabels(const QList< QPair< double, QString >> &labels)
ecvCustomLabelsWidget(QWidget *parent=nullptr)
QList< QPair< double, QString > > getLabels() const