class RobotHead

Constants

Type

Public Class Methods

new(parent) click to toggle source
Calls superclass method RobotPart.new
# File examples/graphicsview/dragdroprobot/robot.rb, line 66
def initialize(parent)
    super(parent)
end

Public Instance Methods

boundingRect() click to toggle source
# File examples/graphicsview/dragdroprobot/robot.rb, line 70
def boundingRect
    return Qt::RectF.new(-15, -50, 30, 50)
end
paint(painter, option, widget) click to toggle source
# File examples/graphicsview/dragdroprobot/robot.rb, line 74
def paint(painter, option, widget)
    if @pixmap.null?
        painter.brush = Qt::Brush.new(@dragOver ? @color.light(130) : @color)
        painter.drawRoundRect(-10, -30, 20, 30)
        painter.brush = Qt::Brush.new(Qt::white)
        painter.drawEllipse(-7, -3 - 20, 7, 7)
        painter.drawEllipse(0, -3 - 20, 7, 7)
        painter.brush = Qt::Brush.new(Qt::black)
        painter.drawEllipse(-5, -1 - 20, 2, 2)
        painter.drawEllipse(2, -1 - 20, 2, 2)
        painter.pen = Qt::Pen.new(Qt::Brush.new(Qt::black), 2)
        painter.brush = Qt::NoBrush
        painter.drawArc(-6, -2 - 20, 12, 15, 190 * 16, 160 * 16)
    else
        painter.scale(0.2272, 0.2824)
        painter.drawPixmap(Qt::PointF.new(-15 * 4.4, -50 * 3.54), @pixmap)
    end
end
type() click to toggle source
# File examples/graphicsview/dragdroprobot/robot.rb, line 93
def type()
    return Type
end