Class: Qt::ItemSelection

Inherits:
Object show all
Includes:
Enumerable
Defined in:
lib/qtext/extensions.rb

Instance Method Summary collapse

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

#firstObject



118
119
120
# File 'lib/qtext/extensions.rb', line 118

def first
  self.at(0)
end

#lastObject



122
123
124
# File 'lib/qtext/extensions.rb', line 122

def last
  self.at(count-1)
end

#sizeObject

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