This can fail if e.g. gvalue is of type G_TYPE_STRING and type
is 'i', i.e. G_VARIANT_TYPE_INT32. It will also fail for any GObject.GType
(including e.g. G_TYPE_OBJECT and G_TYPE_BOXED derived-types) not
in the table above.
Note that if gvalue is of type G_TYPE_VARIANT and its value is
null, the empty GLib.Variant instance (never null) for type is
returned (e.g. 0 for scalar types, the empty string for string types,
'/' for object path types, the empty array for any array type and so on).
Converts a GObject.Value to a GLib.Variant of the type indicated by the
typeparameter.The conversion is using the following rules:
G_TYPE_STRING: 's', 'o', 'g' or 'ay'G_TYPE_STRV: 'as', 'ao' or 'aay'G_TYPE_BOOLEAN: 'b'G_TYPE_UCHAR: 'y'G_TYPE_INT: 'i', 'n'G_TYPE_UINT: 'u', 'q'G_TYPE_INT64: 'x'G_TYPE_UINT64: 't'G_TYPE_DOUBLE: 'd'G_TYPE_VARIANT: Any GLib.VariantTypeThis can fail if e.g.
gvalueis of typeG_TYPE_STRINGandtypeis 'i', i.e.G_VARIANT_TYPE_INT32. It will also fail for any GObject.GType (including e.g.G_TYPE_OBJECTandG_TYPE_BOXEDderived-types) not in the table above.Note that if
gvalueis of typeG_TYPE_VARIANTand its value isnull, the empty GLib.Variant instance (nevernull) fortypeis returned (e.g. 0 for scalar types, the empty string for string types, '/' for object path types, the empty array for any array type and so on).See the
g_dbus_gvariant_to_gvalue()function for how to convert a GLib.Variant to a GObject.Value.