X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fprop%2Fint.cpp;h=3f29951b3d997b7b5b8a299fd34c3a0bf0d6db40;hb=af33d4cbacc745f4473f5c0f4fa1f9ebb8d84d0a;hp=ce6a040d633c00c1a2583ba6fe9fc85f443f136c;hpb=dbed5609ae31cdfc3e9db10f3ab91b7607c08372;p=pulseview.git 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);