Class: Qt::Variant

Inherits:
Object show all
Defined in:
lib/rui/toolkits/qtbase/qt.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_ruby(x) ⇒ Object

Convert any marshallable ruby object into a QVariant.



18
19
20
# File 'lib/rui/toolkits/qtbase/qt.rb', line 18

def self.from_ruby(x)
  new(Marshal.dump(x))
end

Instance Method Details

#to_rubyObject

Extract the ruby object contained in a QVariant.



25
26
27
28
# File 'lib/rui/toolkits/qtbase/qt.rb', line 25

def to_ruby
  str = toString
  Marshal.load(str) if str
end