return form;
}
+QString Binding::print_gvariant(GVariant *const gvar)
+{
+ QString s;
+
+ if (g_variant_is_of_type(gvar, G_VARIANT_TYPE("s")))
+ s = QString::fromUtf8(g_variant_get_string(gvar, NULL));
+ else
+ {
+ gchar *const text = g_variant_print(gvar, FALSE);
+ s = QString::fromUtf8(text);
+ g_free(text);
+ }
+
+ return s;
+}
+
} // binding
} // prop
} // pv
#ifndef PULSEVIEW_PV_PROP_BINDING_BINDING_H
#define PULSEVIEW_PV_PROP_BINDING_BINDING_H
+#include <glib.h>
+
#include <vector>
#include <boost/shared_ptr.hpp>
+#include <QString>
+
class QFormLayout;
class QWidget;
QWidget* get_property_form(QWidget *parent,
bool auto_commit = false) const;
+ static QString print_gvariant(GVariant *const gvar);
+
protected:
std::vector< boost::shared_ptr<Property> > _properties;
};
#ifndef PULSEVIEW_PV_PROP_BINDING_DECODEROPTIONS_H
#define PULSEVIEW_PV_PROP_BINDING_DECODEROPTIONS_H
-#include <glib.h>
-
#include "binding.h"
namespace pv {
bind(&device::DevInst::set_config, _dev_inst, _group, key, _1))));
}
-QString DeviceOptions::print_gvariant(GVariant *const gvar)
-{
- QString s;
-
- if (g_variant_is_of_type(gvar, G_VARIANT_TYPE("s")))
- s = QString::fromUtf8(g_variant_get_string(gvar, NULL));
- else
- {
- gchar *const text = g_variant_print(gvar, FALSE);
- s = QString::fromUtf8(text);
- g_free(text);
- }
-
- return s;
-}
-
QString DeviceOptions::print_timebase(GVariant *const gvar)
{
uint64_t p, q;
void bind_int(const QString &name, int key, QString suffix,
boost::optional< std::pair<int64_t, int64_t> > range);
- static QString print_gvariant(GVariant *const gvar);
-
static QString print_timebase(GVariant *const gvar);
static QString print_vdiv(GVariant *const gvar);
static QString print_voltage_threshold(GVariant *const gvar);