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



573
574
575
576
577
# File 'lib/cosmos/gui/qt.rb', line 573

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

#eachObject



589
590
591
592
593
# File 'lib/cosmos/gui/qt.rb', line 589

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



585
586
587
# File 'lib/cosmos/gui/qt.rb', line 585

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

#textObject

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



580
581
582
# File 'lib/cosmos/gui/qt.rb', line 580

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