Class: Shirka::Qt::ListItemController
Instance Attribute Summary
Attributes inherited from Controller
#app, #components, #data, #parent
Instance Method Summary
collapse
Methods inherited from Controller
#add_component, #add_item, #initialize, #item_controller_class, #on_component_added
Methods included from Eventalk
#add_watcher, #fire, #forward, #watch, #watchers
Instance Method Details
#id ⇒ Object
18
19
20
|
# File 'lib/shirka/qt/list_item/controller.rb', line 18
def id
view.id
end
|
#init(data) ⇒ Object
5
6
7
|
# File 'lib/shirka/qt/list_item/controller.rb', line 5
def init(data)
@text = data.to_s
end
|
#on_component_adding(data = nil) ⇒ Object
22
23
24
|
# File 'lib/shirka/qt/list_item/controller.rb', line 22
def on_component_adding(data=nil)
parent.on_component_added self, id
end
|
#on_double_clicked ⇒ Object
26
27
|
# File 'lib/shirka/qt/list_item/controller.rb', line 26
def on_double_clicked
end
|
#view ⇒ Object
14
15
16
|
# File 'lib/shirka/qt/list_item/controller.rb', line 14
def view
@view ||= view_class.new self, @text
end
|
#view_class ⇒ Object
9
10
11
12
|
# File 'lib/shirka/qt/list_item/controller.rb', line 9
def view_class
name = self.class.to_s.sub(/Controller$/, 'View')
Object.const_get name rescue ::Shirka::Qt::ListItemView
end
|