From 808d31267a18392f4761b0711d4d2dce058222f6 Mon Sep 17 00:00:00 2001 From: Ayush Singh Date: Mon, 14 Mar 2022 02:21:50 +0530 Subject: [PATCH] Add isNull() wrapper for QVariant --- qttypes/src/qtcore/qvariant.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/qttypes/src/qtcore/qvariant.rs b/qttypes/src/qtcore/qvariant.rs index c35fb598..e6bd0641 100644 --- a/qttypes/src/qtcore/qvariant.rs +++ b/qttypes/src/qtcore/qvariant.rs @@ -48,6 +48,15 @@ impl QVariant { }) } + /// Wrapper around [`isNull()`][method] method. + /// + /// [method]: https://doc.qt.io/qt-5/qvariant.html#isNull + pub fn is_null(&self) -> bool { + cpp!(unsafe [self as "const QVariant*"] -> bool as "bool" { + return self->isNull(); + }) + } + // FIXME: do more wrappers }