Class: DetailPanelItemEnumerableView

Inherits:
Shirka::Qt::TreeItemView show all
Defined in:
lib/troshka/detail_panel_item_enumerable/view.rb

Instance Attribute Summary

Attributes inherited from Shirka::View

#controller, #data, #label

Instance Method Summary collapse

Methods inherited from Shirka::Qt::TreeItemView

#id, #on_view_adding, #widget_class

Methods inherited from Shirka::View

#init, #initialize, #on_component_added, #on_view_added, #on_view_adding, #style, #widget, #widget_class

Methods included from Shirka::Eventalk

#add_watcher, #fire, #forward, #watch, #watchers

Constructor Details

This class inherits a constructor from Shirka::View

Instance Method Details

#build(widget) ⇒ Object



2
3
4
5
6
7
8
9
# File 'lib/troshka/detail_panel_item_enumerable/view.rb', line 2

def build(widget)
  index, value = data
  widget.setText 0, index.to_s
  
  widget.setText 1, "#{value.class} #{value.count} items"
  widget.setForeground 0, Qt::Brush.new(Qt::Color.new 128, 128, 128)
  widget.setForeground 1, Qt::Brush.new(Qt::Color.new 128, 128, 128)
end