Class: Qt::ComboBox

Inherits:
Object show all
Defined in:
lib/cosmos/tools/table_manager/table_manager.rb,
lib/cosmos/gui/qt.rb

Direct Known Subclasses

Cosmos::ComboboxWidget

Instance Method Summary collapse

Instance Method Details

#clearItemsObject

Helper method to remove all items from a ComboBox



535
536
537
538
539
# File 'lib/cosmos/gui/qt.rb', line 535

def clearItems
  (0...count).to_a.reverse.each do |index|
    removeItem(index)
  end
end

#eachObject



551
552
553
554
555
# File 'lib/cosmos/gui/qt.rb', line 551

def each
  (0...count).each do |index|
    yield self.itemText(index), self.itemData(index)
  end
end

#setCurrentText(arg) ⇒ Object

Helper method to set the current item using a text String instead of the index



547
548
549
# File 'lib/cosmos/gui/qt.rb', line 547

def setCurrentText(arg)
  setCurrentIndex(findText(arg.to_s))
end

#textObject

Alias currentText as text to make it more compatible with LineEdit which uses text



542
543
544
# File 'lib/cosmos/gui/qt.rb', line 542

def text
  currentText
end

#wheelEvent(param) ⇒ Object



21
22
23
# File 'lib/cosmos/tools/table_manager/table_manager.rb', line 21

def wheelEvent(param)
  self.nativeParentWidget.wheelEvent(param)
end