Method: ObjectTableModel#initialize
- Defined in:
- lib/qtext/object_table_model.rb
#initialize(args = {}) ⇒ ObjectTableModel
args can contain the following:
-
:parent => the Qt::Object that is the parent of this class.
-
:headers => array of either symbols representing the attribute on the elements of the data collection, or Header instances.
-
:data => array of objects, with attributes corresponding to the headers
-
:collection is an alias for :data
81 82 83 84 85 86 |
# File 'lib/qtext/object_table_model.rb', line 81 def initialize( args = {} ) super( args[:parent] ) @parent = args[:parent] @collection = args[:data] || args[:collection] || [] set_headers( args[:headers] ) end |