X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fprop%2Fbool.cpp;h=0dd1c50f10698702a2397ea604b27d6c285ab230;hp=e3e0ebd50e86151408b14fe7420167a2e2db054a;hb=b5940cf0ef30b3519389da8c8768aee4d4424415;hpb=2acdb232d6bb452cfdfaea3ef5218fb4da592329 diff --git a/pv/prop/bool.cpp b/pv/prop/bool.cpp index e3e0ebd5..0dd1c50f 100644 --- a/pv/prop/bool.cpp +++ b/pv/prop/bool.cpp @@ -14,11 +14,10 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * along with this program; if not, see . */ -#include +#include #include @@ -27,13 +26,9 @@ namespace pv { namespace prop { -Bool::Bool(QString name, Getter getter, Setter setter) : - Property(name, getter, setter), - check_box_(NULL) -{ -} - -Bool::~Bool() +Bool::Bool(QString name, QString desc, Getter getter, Setter setter) : + Property(name, desc, getter, setter), + check_box_(nullptr) { } @@ -43,16 +38,17 @@ QWidget* Bool::get_widget(QWidget *parent, bool auto_commit) return check_box_; if (!getter_) - return NULL; + return nullptr; Glib::VariantBase variant = getter_(); if (!variant.gobj()) - return NULL; + return nullptr; bool value = Glib::VariantBase::cast_dynamic>( variant).get(); check_box_ = new QCheckBox(name(), parent); + check_box_->setToolTip(desc()); check_box_->setCheckState(value ? Qt::Checked : Qt::Unchecked); if (auto_commit) @@ -83,5 +79,5 @@ void Bool::on_state_changed(int) commit(); } -} // prop -} // pv +} // namespace prop +} // namespace pv