Class: Shirka::Qt::ListItemController

Inherits:
Controller
  • Object
show all
Defined in:
lib/shirka/qt/list_item/controller.rb

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

Constructor Details

This class inherits a constructor from Shirka::Controller

Instance Method Details

#idObject



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_clickedObject



26
27
# File 'lib/shirka/qt/list_item/controller.rb', line 26

def on_double_clicked
end

#viewObject



14
15
16
# File 'lib/shirka/qt/list_item/controller.rb', line 14

def view
  @view ||= view_class.new self, @text
end

#view_classObject



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