File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -937,6 +937,18 @@ pub enum QJSValueSpecialValue {
937
937
}
938
938
939
939
impl QJSValue {
940
+ pub fn null ( ) -> Self {
941
+ cpp ! ( unsafe [ ] -> QJSValue as "QJSValue" {
942
+ return QJSValue ( QJSValue :: SpecialValue :: NullValue ) ;
943
+ } )
944
+ }
945
+
946
+ pub fn undefined ( ) -> Self {
947
+ cpp ! ( unsafe [ ] -> QJSValue as "QJSValue" {
948
+ return QJSValue ( QJSValue :: SpecialValue :: UndefinedValue ) ;
949
+ } )
950
+ }
951
+
940
952
pub fn is_bool ( & self ) -> bool {
941
953
cpp ! ( unsafe [ self as "const QJSValue *" ] -> bool as "bool" {
942
954
return self ->isBool( ) ;
@@ -1008,6 +1020,12 @@ impl QJSValue {
1008
1020
}
1009
1021
}
1010
1022
1023
+ impl Default for QJSValue {
1024
+ fn default ( ) -> Self {
1025
+ QJSValue :: undefined ( )
1026
+ }
1027
+ }
1028
+
1011
1029
impl From < QString > for QJSValue {
1012
1030
fn from ( a : QString ) -> QJSValue {
1013
1031
cpp ! ( unsafe [ a as "QString" ] -> QJSValue as "QJSValue" {
You can’t perform that action at this time.
0 commit comments