Class: Qt::ItemSelection
- Includes:
- Enumerable
- Defined in:
- lib/qtext/extensions.rb
Instance Method Summary collapse
-
#each(&block) ⇒ Object
Iterate through SelectionRange instances in this selection.
- #first ⇒ Object
- #last ⇒ Object
-
#size ⇒ Object
can’t alias this because it doesn’t work with Qt bindings.
Instance Method Details
#each(&block) ⇒ Object
Iterate through SelectionRange instances in this selection
106 107 108 109 110 111 112 113 |
# File 'lib/qtext/extensions.rb', line 106 def each( &block ) index = 0 max = self.count while index < max yield( self.at( index ) ) index += 1 end end |
#first ⇒ Object
118 119 120 |
# File 'lib/qtext/extensions.rb', line 118 def first self.at(0) end |
#last ⇒ Object
122 123 124 |
# File 'lib/qtext/extensions.rb', line 122 def last self.at(count-1) end |
#size ⇒ Object
can’t alias this because it doesn’t work with Qt bindings
116 |
# File 'lib/qtext/extensions.rb', line 116 def size; self.count; end |