]> sigrok.org Git - pulseview.git/blobdiff - pv/prop/int.hpp
Session: Fix issue #67 by improving error handling
[pulseview.git] / pv / prop / int.hpp
index 92d7c62c93f9748c816b7c00fe5a1ec678f18cee..1f6a64ca503fddf069090f9c9e03e2eaa44b2bc6 100644 (file)
@@ -26,6 +26,8 @@
 
 #include "property.hpp"
 
+using std::pair;
+
 class QSpinBox;
 
 namespace pv {
@@ -33,16 +35,17 @@ namespace prop {
 
 class Int : public Property
 {
-       Q_OBJECT;
+       Q_OBJECT
 
 public:
-       Int(QString name, QString suffix,
-               boost::optional< std::pair<int64_t, int64_t> > range,
-               Getter getter, Setter setter);
+       Int(QString name, QString desc, QString suffix,
+               boost::optional< pair<int64_t, int64_t> > range,
+               Getter getter, Setter setter, QString special_value_text = "");
 
        virtual ~Int() = default;
 
        QWidget* get_widget(QWidget *parent, bool auto_commit);
+       void update_widget();
 
        void commit();
 
@@ -50,14 +53,14 @@ private Q_SLOTS:
        void on_value_changed(int);
 
 private:
-       const QString suffix_;
-       const boost::optional< std::pair<int64_t, int64_t> > range_;
+       const QString suffix_, special_value_text_;
+       const boost::optional< pair<int64_t, int64_t> > range_;
 
        Glib::VariantBase value_;
        QSpinBox *spin_box_;
 };
 
-} // prop
-} // pv
+}  // namespace prop
+}  // namespace pv
 
 #endif // PULSEVIEW_PV_PROP_INT_HPP