X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fprop%2Fenum.hpp;h=8050bcdf0f0897acea109125ad36d3a8651e2365;hb=292b6ebc37281a28982e5d9e43471d9b3eab1d8f;hp=7b7fcc5dc73329a7e0289276762f48959066c789;hpb=2acdb232d6bb452cfdfaea3ef5218fb4da592329;p=pulseview.git diff --git a/pv/prop/enum.hpp b/pv/prop/enum.hpp index 7b7fcc5d..8050bcdf 100644 --- a/pv/prop/enum.hpp +++ b/pv/prop/enum.hpp @@ -14,12 +14,11 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * along with this program; if not, see . */ -#ifndef PULSEVIEW_PV_PROP_ENUM_H -#define PULSEVIEW_PV_PROP_ENUM_H +#ifndef PULSEVIEW_PV_PROP_ENUM_HPP +#define PULSEVIEW_PV_PROP_ENUM_HPP #include #include @@ -28,37 +27,50 @@ #include +using std::pair; +using std::vector; + Q_DECLARE_METATYPE(Glib::VariantBase); class QComboBox; +class QLabel; +class QSlider; namespace pv { namespace prop { class Enum : public Property { - Q_OBJECT; + Q_OBJECT public: - Enum(QString name, std::vector > values, + Enum(QString name, QString desc, + vector > values, Getter getter, Setter setter); - virtual ~Enum(); + virtual ~Enum() = default; QWidget* get_widget(QWidget *parent, bool auto_commit); + void update_widget(); void commit(); private Q_SLOTS: - void on_current_item_changed(int); + void on_current_index_changed(int); + void on_value_changed(int); private: - const std::vector< std::pair > values_; + const vector< pair > values_; + bool is_range_; QComboBox *selector_; + + QWidget *slider_layout_widget_; + QSlider *slider_; + QLabel *slider_label_; }; -} // prop -} // pv +} // namespace prop +} // namespace pv -#endif // PULSEVIEW_PV_PROP_ENUM_H +#endif // PULSEVIEW_PV_PROP_ENUM_HPP