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.



2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
# File 'lib/Qt/qtruby4.rb', line 2186

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



2220
2221
2222
# File 'lib/Qt/qtruby4.rb', line 2220

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

#eachObject



2228
2229
2230
2231
2232
2233
2234
# File 'lib/Qt/qtruby4.rb', line 2228

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

#inspectObject



2199
2200
2201
2202
2203
2204
2205
2206
2207
# File 'lib/Qt/qtruby4.rb', line 2199

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



2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
# File 'lib/Qt/qtruby4.rb', line 2209

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



2224
2225
2226
# File 'lib/Qt/qtruby4.rb', line 2224

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