Class: Qt::ComboBox
- Defined in:
- lib/cosmos/tools/table_manager/table_manager.rb,
lib/cosmos/gui/qt.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#clearItems ⇒ Object
Helper method to remove all items from a ComboBox.
- #each ⇒ Object
-
#setCurrentText(arg) ⇒ Object
Helper method to set the current item using a text String instead of the index.
-
#text ⇒ Object
Alias currentText as text to make it more compatible with LineEdit which uses text.
- #wheelEvent(param) ⇒ Object
Instance Method Details
#clearItems ⇒ Object
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 |
#each ⇒ Object
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 |
#text ⇒ Object
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 |