class MouseTimer

In the original C++ example the Mouse class inherited from both QObject and QGraphicsItem. As that isn't possible in Ruby, use a helper class 'MouseTimer' to periodically invoke the Mouse#timerEvent method.

Public Class Methods

new(mouse) click to toggle source
Calls superclass method
# File examples/graphicsview/collidingmice/mouse.rb, line 32
def initialize(mouse)
    super(nil)
    @mouse = mouse
end

Public Instance Methods

timerEvent(event) click to toggle source
# File examples/graphicsview/collidingmice/mouse.rb, line 37
def timerEvent(event)
    @mouse.timerEvent(event)
end