binding: Add description tooltips to almost all binding types.
authorUwe Hermann <uwe@hermann-uwe.de>
Wed, 29 Mar 2017 23:11:11 +0000 (01:11 +0200)
committerUwe Hermann <uwe@hermann-uwe.de>
Thu, 30 Mar 2017 18:03:21 +0000 (20:03 +0200)
This can be the description of an option of an input/output module,
for example.

pv/binding/binding.cpp

index 00399c1db212ced92570957d45a3e0e984adf73d..ae4f2943bdfe988a9dc6e82af5337525c317c04f 100644 (file)
@@ -20,6 +20,7 @@
 #include <cassert>
 
 #include <QFormLayout>
+#include <QLabel>
 
 #include <pv/prop/property.hpp>
 
@@ -55,10 +56,13 @@ void Binding::add_properties_to_form(QFormLayout *layout,
 
                QWidget *const widget = p->get_widget(layout->parentWidget(),
                        auto_commit);
-               if (p->labeled_widget())
+               if (p->labeled_widget()) {
                        layout->addRow(widget);
-               else
-                       layout->addRow(p->name(), widget);
+               } else {
+                       auto *lbl = new QLabel(p->name());
+                       lbl->setToolTip(p->desc());
+                       layout->addRow(lbl, widget);
+               }
        }
 }