Module: ListLike::ClassMethods

Defined in:
lib/rui/toolkits/qtbase/qt.rb

Instance Method Summary collapse

Instance Method Details

#from_a(parent, array) ⇒ Object

Create a list from an array of pairs (text, data) The data for each item can be retrieved using the item’s get method. Note that if an array element is not a pair, its value will be used both for the text and for the data.

For example: list.current_item.get



377
378
379
380
381
# File 'lib/rui/toolkits/qtbase/qt.rb', line 377

def from_a(parent, array)
  list = new(parent)
  list.reset_from_a(array)
  list
end