Friday, July 31, 2009

Qt::Enum

Most of QtRuby classes have basic classes of Qt. But Qt::Enum is QtRuby original class. Its behavior is almost same with Qt::Integer. And we can use it like as C++ enum.
require 'Qt4'

class Suits < Qt::Object
Heart = Qt::Enum.new(0, self)
Clover = Qt::Enum.new(1, self)
Diamond = Qt::Enum.new(2, self)
Spade = Qt::Enum.new(3, self)
end

No comments:

Post a Comment