Because Qt::Variant.new( obj ) is a PITA to type
10 11 12 13 14 15 16 17 18
# File 'lib/qtext/extensions.rb', line 10 def to_variant begin Qt::Variant.fromValue( self ) rescue Exception => e puts e.backtrace.join( "\n" ) puts "error converting #{self.inspect} to variant: #{e.message}" nil.to_variant end end