class PreviewLabel

Public Class Methods

new(parent = nil) click to toggle source
Calls superclass method
# File examples/painting/fontsampler/previewlabel.rb, line 28
def initialize(parent = nil)
    super(parent)
end

Public Instance Methods

paintEvent(event) click to toggle source
# File examples/painting/fontsampler/previewlabel.rb, line 32
def paintEvent(event)
    painter = Qt::Painter.new
    painter.begin(self)
    painter.fillRect(event.rect(), Qt::Color.new(224,224,224))
    painter.drawPixmap(0, 0, @pixmap) if @pixmap
    painter.end()
end
pixmap=(pixmap) click to toggle source
# File examples/painting/fontsampler/previewlabel.rb, line 40
def pixmap=(pixmap)
    @pixmap = pixmap
end