Class: MetaBuilder::Qt4MB::IntegerInputWidget

Inherits:
Qt::SpinBox
  • Object
show all
Defined in:
lib/MetaBuilder/Qt4/Parameters/numbers.rb

Overview

A spinbox to choose Integers.

Instance Method Summary collapse

Constructor Details

#initialize(parent, type) ⇒ IntegerInputWidget

Creates a Generic widget. type is the ParameterType child instance for whom we should do conversion.



46
47
48
49
50
51
52
# File 'lib/MetaBuilder/Qt4/Parameters/numbers.rb', line 46

def initialize(parent, type)
  super(parent)
  @type = type
  connect(self, SIGNAL('valueChanged(int)'),
          SIGNAL('value_changed()'))
  set_range(-(2**30), 2**30)
end

Instance Method Details

#textObject



54
55
56
# File 'lib/MetaBuilder/Qt4/Parameters/numbers.rb', line 54

def text
  return @type.type_to_string(value)
end

#text=(t) ⇒ Object



58
59
60
# File 'lib/MetaBuilder/Qt4/Parameters/numbers.rb', line 58

def text=(t)
  self.value=(@type.string_to_type(t))
end