* 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 <http://www.gnu.org/licenses/>.
*/
-#include <assert.h>
+#include <cassert>
#include <QCheckBox>
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)
{
}
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<Glib::Variant<bool>>(
variant).get();
check_box_ = new QCheckBox(name(), parent);
+ check_box_->setToolTip(desc());
check_box_->setCheckState(value ? Qt::Checked : Qt::Unchecked);
if (auto_commit)
commit();
}
-} // prop
-} // pv
+} // namespace prop
+} // namespace pv