range_list_selection.hpp
Go to the documentation of this file.
1 #ifndef RAM_QT_GUIS_MODIFY_WIDGETS_RANGE_LIST_SELECTION_HPP
2 #define RAM_QT_GUIS_MODIFY_WIDGETS_RANGE_LIST_SELECTION_HPP
3 
4 #include <mutex>
5 
6 #include <QCheckBox>
7 #include <QDialogButtonBox>
8 #include <QHBoxLayout>
9 #include <QLabel>
10 #include <QMessageBox>
11 #include <QPushButton>
12 #include <QScrollArea>
13 #include <QSpinBox>
14 #include <QTabWidget>
15 #include <QVBoxLayout>
16 #include <QWidget>
17 
18 namespace ram_qt_guis
19 {
20 class ModifyRangeListSelection : public QWidget
21 {
22 Q_OBJECT
23  public:
24  ModifyRangeListSelection(QVBoxLayout* layout,
25  const QString help_string = "",
26  const unsigned min_val = 0,
27  const unsigned max_val = 0,
28  std::vector<unsigned> locked = std::vector<unsigned>());
29 
30  virtual ~ModifyRangeListSelection();
32  std::vector<unsigned> getSelection();
33  QDialogButtonBox *button_box_;
34 
35 Q_SIGNALS:
36  void selectionChanged(std::vector<unsigned> selection);
37 
38 protected Q_SLOTS:
39  void tweakRangeMin();
40  void tweakRangeMax();
42  void addButton();
43  void removeButton();
44  void invertButton();
45  void selectAll();
46  void selectNone();
47 
48 private:
49  bool checkRange();
50 
51  QVBoxLayout *layout_;
52  QSpinBox *min_box_;
53  QSpinBox *max_box_;
54  QPushButton *add_button_;
55  QPushButton *remove_button_;
56  QPushButton *invert_button_;
57  QPushButton *all_button_;
58  QPushButton *none_button_;
59 
60  const QString help_string_;
61  const unsigned min_val_;
62  const unsigned max_val_;
63  std::recursive_mutex selection_mutex_;
64  std::vector<unsigned> selection_;
65  std::vector<QCheckBox *> checkboxes;
66 };
67 
68 }
69 
70 #endif
ModifyRangeListSelection(QVBoxLayout *layout, const QString help_string="", const unsigned min_val=0, const unsigned max_val=0, std::vector< unsigned > locked=std::vector< unsigned >())
void selectionChanged(std::vector< unsigned > selection)


ram_qt_guis
Author(s): Victor Lamoine - Institut Maupertuis
autogenerated on Mon Jun 10 2019 14:50:11