qVariantFromValue should also be a Qt module function, as it doesn't actually care about the exact value of self. This
would allow constructs such as
class Object
# Easy conversion from any value to Qt::Variant
def to_variant
return Qt::qVariantFromValue(self)
end
end
Then, it would just be necessary to write
stuff.to_variant
instead of
Qt::Variant.new(stuff)
of
qVariantFromValue(stuff)
What do you think ? (the attached patch should do the trick - not much to do anyway...) |