Patches: Browse | Submit New | Admin

[#7729] A module functrion for qVariantFromValue

Date:
2007-01-10 13:43
Priority:
3
Submitted By:
Vincent Fourmond (fourmond)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
A module functrion for qVariantFromValue

Detailed description
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...)

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
qvariant-from-value.diff Make qVariantFromValue a Qt module function Download

Changes:

Field Old Value Date By
File Added1107: qvariant-from-value.diff2007-01-10 13:43fourmond