Class: Qt::TreeWidgetItem

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

Instance Method Summary collapse

Methods inherited from Base

#%, #&, #*, #**, #+, #-, #-@, #/, #<, #<<, #<=, #==, #>, #>=, #>>, #^, #methods, #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.



1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
# File 'lib/qt/qtruby4.rb', line 1609

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



1643
1644
1645
# File 'lib/qt/qtruby4.rb', line 1643

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

#eachObject



1651
1652
1653
1654
1655
1656
1657
# File 'lib/qt/qtruby4.rb', line 1651

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

#inspectObject



1622
1623
1624
1625
1626
1627
1628
1629
1630
# File 'lib/qt/qtruby4.rb', line 1622

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



1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
# File 'lib/qt/qtruby4.rb', line 1632

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



1647
1648
1649
# File 'lib/qt/qtruby4.rb', line 1647

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