VAPOR3 3.9.4
ParamsMenuItems.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4#include <cassert>
5#include <QAction>
6
7namespace VAPoR {
8class ParamsBase;
9}
10
11// ******************************
12// ParamsMenuItem
13// ******************************
14
17
18class ParamsMenuItem : public QAction {
19 Q_OBJECT
20
21public:
22 ParamsMenuItem(QObject *parent, const std::string &tag, const std::string &label = "");
23 virtual void Update(VAPoR::ParamsBase *p) = 0;
24
25protected:
27 std::string _tag;
28 std::string _label;
29};
30
31// ******************************
32// ParamsCheckboxMenuItem
33// ******************************
34
36 Q_OBJECT
37
38public:
39 ParamsCheckboxMenuItem(QObject *parent, const std::string &tag, const std::string &label = "");
41
42private slots:
43 void wasToggled(bool b);
44};
45
46// ******************************
47// ParamsDropdownMenuItem
48// ******************************
49
51 Q_OBJECT
52
53 std::vector<int> _itemValues;
54 std::vector<QAction *> _items;
55
56public:
57 ParamsDropdownMenuItem(QObject *parent, const std::string &tag, const std::vector<std::string> &items, const std::vector<int> &itemValues = {}, const std::string &label = "");
59
60private:
61 void _selectIndex(int index);
62 int _getValueForIndex(int index) const;
63 int _getIndexForValue(int value) const;
64
65private slots:
66 void itemSelected();
67};
void Update(VAPoR::ParamsBase *p)
ParamsCheckboxMenuItem(QObject *parent, const std::string &tag, const std::string &label="")
ParamsDropdownMenuItem(QObject *parent, const std::string &tag, const std::vector< std::string > &items, const std::vector< int > &itemValues={}, const std::string &label="")
void Update(VAPoR::ParamsBase *p)
ParamsMenuItem(QObject *parent, const std::string &tag, const std::string &label="")
std::string _tag
VAPoR::ParamsBase * _params
virtual void Update(VAPoR::ParamsBase *p)=0
std::string _label
Nodes with state in Xml tree representation.
Definition: ParamsBase.h:50