X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fprop%2Fint.cpp;h=3f29951b3d997b7b5b8a299fd34c3a0bf0d6db40;hp=ce6a040d633c00c1a2583ba6fe9fc85f443f136c;hb=46ebcd3f6f85092a9eb6401f6f56cee8fa08131a;hpb=bae42c1d8a6fbe65e412d56edecdd4b354908339 diff --git a/pv/prop/int.cpp b/pv/prop/int.cpp index ce6a040d..3f29951b 100644 --- a/pv/prop/int.cpp +++ b/pv/prop/int.cpp @@ -20,8 +20,11 @@ #include #include +#include #include +#include + #include "int.hpp" using boost::optional; @@ -56,7 +59,12 @@ QWidget* Int::get_widget(QWidget *parent, bool auto_commit) if (!getter_) return nullptr; - value_ = getter_(); + try { + value_ = getter_(); + } catch (const sigrok::Error &e) { + qWarning() << tr("Querying config key %1 resulted in %2").arg(name_, e.what()); + return nullptr; + } GVariant *value = value_.gobj(); if (!value) @@ -114,7 +122,13 @@ void Int::update_widget() if (!spin_box_) return; - value_ = getter_(); + try { + value_ = getter_(); + } catch (const sigrok::Error &e) { + qWarning() << tr("Querying config key %1 resulted in %2").arg(name_, e.what()); + return; + } + GVariant *value = value_.gobj(); assert(value);