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



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

#firstObject



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

def first
  self.at(0)
end

#lastObject



126
127
128
# File 'lib/qtext/extensions.rb', line 126

def last
  self.at(count-1)
end

#sizeObject

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