Class: Qt::Enum

Inherits:
Object show all
Defined in:
lib/qt/qtruby4.rb

Overview

If a C++ enum was converted to an ordinary ruby Integer, the name of the type is lost. The enum type name is needed for overloaded method resolution when two methods differ only by an enum type.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(n, type) ⇒ Enum

Returns a new instance of Enum.



1945
1946
1947
1948
1949
# File 'lib/qt/qtruby4.rb', line 1945

def initialize(n, type)
	super() 
	@value = n 
	@type = type
end

Instance Attribute Details

#typeObject

Returns the value of attribute type.



1944
1945
1946
# File 'lib/qt/qtruby4.rb', line 1944

def type
  @type
end

#valueObject

Returns the value of attribute value.



1944
1945
1946
# File 'lib/qt/qtruby4.rb', line 1944

def value
  @value
end

Instance Method Details

#%(n) ⇒ Object



1963
1964
1965
# File 'lib/qt/qtruby4.rb', line 1963

def %(n) 
	return @value % n.to_i
end

#&(n) ⇒ Object



1973
1974
1975
# File 'lib/qt/qtruby4.rb', line 1973

def &(n) 
	return Enum.new(@value & n.to_i, @type)
end

#*(n) ⇒ Object



1957
1958
1959
# File 'lib/qt/qtruby4.rb', line 1957

def *(n) 
	return @value * n.to_i
end

#**(n) ⇒ Object



1966
1967
1968
# File 'lib/qt/qtruby4.rb', line 1966

def **(n) 
	return @value ** n.to_i
end

#+(n) ⇒ Object



1951
1952
1953
# File 'lib/qt/qtruby4.rb', line 1951

def +(n) 
	return @value + n.to_i
end

#-(n) ⇒ Object



1954
1955
1956
# File 'lib/qt/qtruby4.rb', line 1954

def -(n) 
	return @value - n.to_i
end

#/(n) ⇒ Object



1960
1961
1962
# File 'lib/qt/qtruby4.rb', line 1960

def /(n) 
	return @value / n.to_i
end

#<(n) ⇒ Object



1982
1983
1984
# File 'lib/qt/qtruby4.rb', line 1982

def <(n) 
	return @value < n.to_i
end

#<<(n) ⇒ Object



1994
1995
1996
# File 'lib/qt/qtruby4.rb', line 1994

def <<(n) 
	return Enum.new(@value << n.to_i, @type)
end

#<=(n) ⇒ Object



1985
1986
1987
# File 'lib/qt/qtruby4.rb', line 1985

def <=(n) 
	return @value <= n.to_i
end

#==(n) ⇒ Object



2001
# File 'lib/qt/qtruby4.rb', line 2001

def ==(n) return @value == n.to_i end

#>(n) ⇒ Object



1988
1989
1990
# File 'lib/qt/qtruby4.rb', line 1988

def >(n) 
	return @value > n.to_i
end

#>=(n) ⇒ Object



1991
1992
1993
# File 'lib/qt/qtruby4.rb', line 1991

def >=(n) 
	return @value >= n.to_i
end

#>>(n) ⇒ Object



1997
1998
1999
# File 'lib/qt/qtruby4.rb', line 1997

def >>(n) 
	return Enum.new(@value >> n.to_i, @type)
end

#^(n) ⇒ Object



1976
1977
1978
# File 'lib/qt/qtruby4.rb', line 1976

def ^(n) 
	return Enum.new(@value ^ n.to_i, @type)
end

#coerce(n) ⇒ Object



2007
2008
2009
# File 'lib/qt/qtruby4.rb', line 2007

def coerce(n)
	[n, @value]
end

#inspectObject



2011
2012
2013
# File 'lib/qt/qtruby4.rb', line 2011

def inspect
	to_s
end

#pretty_print(pp) ⇒ Object



2015
2016
2017
# File 'lib/qt/qtruby4.rb', line 2015

def pretty_print(pp)
	pp.text "#<%s:0x%8.8x @type=%s, @value=%d>" % [self.class.name, object_id, type, value]
end

#to_fObject



2004
# File 'lib/qt/qtruby4.rb', line 2004

def to_f() return @value.to_f end

#to_iObject



2002
# File 'lib/qt/qtruby4.rb', line 2002

def to_i() return @value end

#to_sObject



2005
# File 'lib/qt/qtruby4.rb', line 2005

def to_s() return @value.to_s end

#|(n) ⇒ Object



1970
1971
1972
# File 'lib/qt/qtruby4.rb', line 1970

def |(n) 
	return Enum.new(@value | n.to_i, @type)
end

#~Object



1979
1980
1981
# File 'lib/qt/qtruby4.rb', line 1979

def ~() 
	return ~ @value
end