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
110 111 112 113 114 115 116 117 |
# File 'lib/qtext/extensions.rb', line 110 def each( &block ) index = 0 max = self.count while index < max yield( self.at( index ) ) index += 1 end end |
#first ⇒ Object
122 123 124 |
# File 'lib/qtext/extensions.rb', line 122 def first self.at(0) end |
#last ⇒ Object
126 127 128 |
# File 'lib/qtext/extensions.rb', line 126 def last self.at(count-1) end |
#size ⇒ Object
can’t alias this because it doesn’t work with Qt bindings
120 |
# File 'lib/qtext/extensions.rb', line 120 def size; self.count; end |