Class: Qt::TreeWidgetItem

Inherits:
Base show all
Includes:
Enumerable
Defined in:
lib/Qt/qtruby4.rb

Instance Method Summary collapse

Methods inherited from Base

#%, #&, #*, #**, #+, #-, #-@, #/, #<, #<<, #<=, #==, #>, #>=, #>>, #QCOMPARE, #QEXPECT_FAIL, #QFAIL, #QSKIP, #QTEST, #QVERIFY, #QVERIFY2, #QWARN, #^, ancestors, #is_a?, #methods, private_slots, #protected_methods, #public_methods, q_classinfo, q_signal, q_slot, signals, #singleton_methods, slots, #|, #~

Constructor Details

#initialize(*args) ⇒ TreeWidgetItem

Returns a new instance of TreeWidgetItem.



2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
# File 'lib/Qt/qtruby4.rb', line 2109

def initialize(*args)
	# There is not way to distinguish between the copy constructor
	# QTreeWidgetItem (const QTreeWidgetItem & other) 
	# and
	# QTreeWidgetItem (QTreeWidgetItem * parent, const QStringList & strings, int type = Type)
	# when the latter has a single argument. So force the second variant to be called
	if args.length == 1 && args[0].kind_of?(Qt::TreeWidgetItem)
		super(args[0], Qt::TreeWidgetItem::Type)
	else
		super(*args)
	end
end

Instance Method Details

#clone(*args) ⇒ Object



2143
2144
2145
# File 'lib/Qt/qtruby4.rb', line 2143

def clone(*args)
	Qt::TreeWidgetItem.new(self)
end

#eachObject



2151
2152
2153
2154
2155
2156
2157
# File 'lib/Qt/qtruby4.rb', line 2151

def each
	it = Qt::TreeWidgetItemIterator.new(self)
	while it.current
		yield it.current
		it += 1
	end
end

#inspectObject



2122
2123
2124
2125
2126
2127
2128
2129
2130
# File 'lib/Qt/qtruby4.rb', line 2122

def inspect
	str = super
	str.sub!(/>$/, "")
	str << " parent=%s," % parent unless parent.nil?
	for i in 0..(columnCount - 1)
		str << " text%d='%s'," % [i, self.text(i)]
	end
	str.sub!(/,?$/, ">")
end

#pretty_print(pp) ⇒ Object



2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
# File 'lib/Qt/qtruby4.rb', line 2132

def pretty_print(pp)
	str = to_s
	str.sub!(/>$/, "")
	str << " parent=%s," % parent unless parent.nil?
	for i in 0..(columnCount - 1)
		str << " text%d='%s'," % [i, self.text(i)]
	end
	str.sub!(/,?$/, ">")
	pp.text str
end

#type(*args) ⇒ Object



2147
2148
2149
# File 'lib/Qt/qtruby4.rb', line 2147

def type(*args)
	method_missing(:type, *args)
end