Class: Clevic::SelectionRange

Inherits:
Object
  • Object
show all
Defined in:
lib/clevic/swing/selection_model.rb

Overview

QItemSelectionRange contains information about a range of selected items in a model. A range of items is a contiguous array of model items, extending to cover a number of adjacent rows and columns with a common parent item; this can be visualized as a two-dimensional block of cells in a table

file:///usr/share/doc/qt-4.6.2/html/qitemselectionrange.html#details

Instance Method Summary collapse

Constructor Details

#initialize(row_range, column_range) ⇒ SelectionRange

row_range and column_range are Range objects



13
14
15
16
# File 'lib/clevic/swing/selection_model.rb', line 13

def initialize( row_range, column_range )
  @row_range = row_range
  @column_range = column_range
end

Instance Method Details

#bottom_rightObject



30
31
32
# File 'lib/clevic/swing/selection_model.rb', line 30

def bottom_right
  SwingTableIndex.new( nil, @row_range.last, @column_range.last )
end

#heightObject



18
19
20
# File 'lib/clevic/swing/selection_model.rb', line 18

def height
  @row_range.distance
end

#top_leftObject



26
27
28
# File 'lib/clevic/swing/selection_model.rb', line 26

def top_left
  SwingTableIndex.new( nil, @row_range.first, @column_range.first )
end

#widthObject



22
23
24
# File 'lib/clevic/swing/selection_model.rb', line 22

def width
  @column_range.distance
end