#include <QicsCellRegion.h>
Inherits Qics.
Inherited by QicsCellRegionHeader, and QicsCellRegionTable.
Public Types | |
| enum | QicsWideKeyAction { Del_DeleteSelected, CtrlA_SelectAll } |
| enum | QicsBoxBorders { TopBorder = 1, BottomBorder = 2, LeftBorder = 4, RightBorder = 8, AllBorders = 1+2+4+8 } |
| enum | QicsCopyPolicy { CopyData = 1, CopyAttributes = 2, CopyDimensions = 4, CopySpans = 8, CopyAll = 1+2+4+8 } |
| enum | QicsClearPolicy { ClearData = 1, ClearAttributes = 2, ClearSpans = 4, ClearAll = 1+2+4 } |
| enum | QicsSortMode { QicsStableSort = 0, QicsQuickSort } |
| enum | QicsCellOverflowBehavior { Clip = 0, Overflow, ToolTip } |
| enum | QicsCurrentCellStyle { Spreadsheet = 0, NormalSelected } |
| enum | QicsSelectionStyle { Normal = 0, Exclusive } |
| enum | QicsGridCellClipping { AllowPartial = 0, NoDisplayOnPartial, UseClippedSymbol } |
| enum | QicsGridType { TableGrid = 0, RowHeaderGrid, ColumnHeaderGrid } |
| enum | QicsHeaderType { RowHeader = 0, ColumnHeader } |
| enum | QicsIndexType { NoIndex = 0, RowIndex, ColumnIndex, RowAndColumnIndex } |
| enum | QicsLineStyle { None = 0, Plain, Raised, Sunken } |
| enum | QicsRepaintBehavior { RepaintOff = 0, RepaintOn = 1, RepaintCalcOnly = 2 } |
| enum | QicsScrollBarMode { Auto = 0, AlwaysOff, AlwaysOn } |
| enum | QicsScrollDirection { ScrollNone = 0, ScrollUp = 1, ScrollDown = 2, ScrollLeft = 4, ScrollRight = 8, ScrollToRow = 16, ScrollToColumn = 32 } |
| enum | QicsSelectionPolicy { SelectNone = 0, SelectSingle, SelectMultiple, SelectSingleRow, SelectMultipleRow } |
| enum | QicsSelectionType { SelectionNone = 0, SelectionBegin, SelectionDrag, SelectionEnd, SelectionExtend, SelectionAdd, SelectionReplace } |
| enum | QicsSortOrder { Ascending = 0, Descending } |
| enum | QicsTableDisplayOption { DisplayNever = 0, DisplayAlways, DisplayFirstPage } |
| enum | QicsTraversalKeyEditBehavior { TraverseWithinCell = 0, TraverseBetweenCells } |
| enum | QicsCurrentCellDraggingPolicy { DragCurrent = 0, DragSelection } |
Public Member Functions | |
| void | setRegionAttr (QicsCellStyle::QicsCellStyleProperty prop, const void *val) |
| void | updateFontInRegion () |
| void | setColors (const QColor &fc=QColor(), const QColor &bc=QColor(), const QColor &sfc=QColor(), const QColor &sbc=QColor()) |
| void | setForegroundColor (const QColor &color) |
| void | setBackgroundColor (const QColor &color) |
| void | setSelectedForegroundColor (const QColor &color) |
| void | setSelectedBackgroundColor (const QColor &color) |
| void | setEditForegroundColor (const QColor &color) |
| void | setEditBackgroundColor (const QColor &color) |
| void | setAlignment (int align) |
| void | setTextFlags (int flags) |
| void | setEnabled (bool b) |
| void | setReadOnly (bool b) |
| void | setCanAcceptDrops (bool b) |
| void | setAutoRecognition (bool b) |
| void | setMaxLength (int value) |
| void | setMargin (int value) |
| void | setPixmapSpacing (int value) |
| void | setBorderWidth (int value) |
| virtual void | setFont (const QFont &font, bool updateCellSizes=true)=0 |
| void | setFontAttribute (QicsCellStyle::QicsCellStyleProperty prop, bool value, bool updateCellSizes=true) |
| void | setFontSize (int size, bool updateCellSizes=true) |
| void | setFontWeight (int weight, bool updateCellSizes=true) |
| void | setFontStretch (int factor, bool updateCellSizes=true) |
| void | setFontFamily (const QString &family, bool updateCellSizes=true) |
| void | setCursor (const QCursor &cursor) |
| void | setTopBorderPen (const QPen &pen) |
| void | setBottomBorderPen (const QPen &pen) |
| void | setLeftBorderPen (const QPen &pen) |
| void | setRightBorderPen (const QPen &pen) |
| void | setBoxPen (const QPen &pen, QicsBoxBorders borders=AllBorders) |
| void | setDisplayer (QicsCellDisplay *d) |
| void | setFormatter (QicsDataItemFormatter *df) |
| void | setValidator (QValidator *v) |
| void | setPasteValidator (QicsPasteValidator *v) |
Protected Member Functions | |
| QicsCellRegion (int begin_row, int begin_col, int end_row, int end_col) | |
| QicsCellRegion (const QicsRegion ®ion) | |
| QicsCellRegion () | |
| virtual void | updateFontInRegion (const QicsRegion ®ion)=0 |
| virtual void | setRegionAttr (const QicsRegion ®ion, QicsCellStyle::QicsCellStyleProperty prop, const void *val) |
| virtual QPalette | palette ()=0 |
| virtual QicsCell & | cellRef (int r, int c)=0 |
Protected Attributes | |
| QicsRegion | myRegion |
| QicsGridType | myGridType |
| QicsStyleManager * | mySM |
| QicsDimensionManager * | myDM |
| QVector< int > | modelRows |
| QVector< int > | modelCols |
| bool | myInitCoords |
QicsCellRegion object can be obtained from table or header object using corresponding QicsTable::cellRegionRef() of QicsHeader::cellRegionRef() methods. Then it is possible to set new attributes for this region by calling appropriate QicsCellRegion's methods.
Example of usage:
table->cellRegionRef(4,10,100,200).setBackgroundColor(Qt::yellow);
QicsCellRegion provides a wide set of methods that allow to change attributes of rectangular region of cells by one call. These methods are optimized for high performance and convenience. Especially effective when using with external attribute controller; see QicsAbstractAttributeController class.
enum Qics::QicsWideKeyAction [inherited] |
Denotes global key actions available for the table grid.
enum Qics::QicsBoxBorders [inherited] |
Denotes the box borders of cell region.
enum Qics::QicsCopyPolicy [inherited] |
Denotes the copying policy during copy/paste and drag/drop operations.
enum Qics::QicsClearPolicy [inherited] |
Denotes the clearing policy during cut and delete operations.
enum Qics::QicsSortMode [inherited] |
Denotes the sort algorithm which is used.
enum Qics::QicsCellOverflowBehavior [inherited] |
Denotes the behavior of grids when handling cells whose contents cannot be displayed in the boundaries of the cell.
enum Qics::QicsCurrentCellStyle [inherited] |
Denotes the visual style that the current cell of the table will be drawn with.
enum Qics::QicsSelectionStyle [inherited] |
enum Qics::QicsGridCellClipping [inherited] |
Denotes the policy for displaying text that is too long to fit in its cell.
enum Qics::QicsGridType [inherited] |
Specifies a type of grid object.
enum Qics::QicsHeaderType [inherited] |
Specifies the type of table header.
enum Qics::QicsIndexType [inherited] |
Specifies the type of table index.
enum Qics::QicsLineStyle [inherited] |
Denotes the style of lines and borders in the table widget.
enum Qics::QicsRepaintBehavior [inherited] |
Specifies the recalculation and repainting behavior of tables and grids.
enum Qics::QicsScrollBarMode [inherited] |
enum Qics::QicsScrollDirection [inherited] |
Denotes a direction for scrolling operations, or that an absolute scroll should occur.
enum Qics::QicsSelectionPolicy [inherited] |
Denotes the selection policy for the table.
enum Qics::QicsSortOrder [inherited] |
Specifies whenever ordering should be ascending or descending.
enum Qics::QicsTableDisplayOption [inherited] |
Specifies a printing display policy for elements of the table.
enum Qics::QicsTraversalKeyEditBehavior [inherited] |
Specifies the behavior of the traversal keys. (left, right, up, down, etc) while editing a cell.
enum Qics::QicsCurrentCellDraggingPolicy [inherited] |
Specifies the behavior of drag&drop operations when it has began from current cell.
| QicsCellRegion::QicsCellRegion | ( | int | begin_row, | |
| int | begin_col, | |||
| int | end_row, | |||
| int | end_col | |||
| ) | [protected] |
Constructs a new cell region object. The region extends from row begin_row, column begin_col to row end_row, column end_col.
| QicsCellRegion::QicsCellRegion | ( | const QicsRegion & | region | ) | [protected] |
Constructs a new cell region object from /a region.
| QicsCellRegion::QicsCellRegion | ( | ) | [inline, protected] |
Constructs a new invalid cell region object.
| void QicsCellRegion::setRegionAttr | ( | QicsCellStyle::QicsCellStyleProperty | prop, | |
| const void * | val | |||
| ) | [inline] |
Sets value val of attribute named prop in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after attributes are set.
This method is provided for convenience and results in much more faster setting of cell attributes than calling appropriate methods for every cell explicitly.
In general, you should probably use this method very rarely - as there are more specialized methods for setting attributes of region of cell like setColors(), setAlignment(), setFont() etc.
| void QicsCellRegion::updateFontInRegion | ( | ) | [inline] |
Updates font of dimension manager in rectangular region of cells.
| void QicsCellRegion::setColors | ( | const QColor & | fc = QColor(), |
|
| const QColor & | bc = QColor(), |
|||
| const QColor & | sfc = QColor(), |
|||
| const QColor & | sbc = QColor() | |||
| ) |
Sets foreground (fc), background (bc), selected foreground (sfc), and selected background (sbc) colors in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
Non-valid (default constructed) color values will be set to defaults.
This method is provided for convenience and results in much more faster setting of colors than calling appropriate methods for every cell explicitly.
If you want to set particular colors and do not affect others, use more specialized methods: setForegroundColor(), setBackgroundColor(), setSelectedForegroundColor(), setSelectedBackgroundColor(), setEditForegroundColor(), setEditBackgroundColor().
| void QicsCellRegion::setForegroundColor | ( | const QColor & | color | ) |
Sets foreground color to color in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
If region or color are invalid, nothing happens.
This method is provided for convenience and results in much more faster setting of color than calling appropriate methods for every cell explicitly.
| void QicsCellRegion::setBackgroundColor | ( | const QColor & | color | ) |
Sets background color to color in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
If region or color are invalid, nothing happens.
This method is provided for convenience and results in much more faster setting of color than calling appropriate methods for every cell explicitly.
| void QicsCellRegion::setSelectedForegroundColor | ( | const QColor & | color | ) |
Sets selected foreground color to color in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
If region or color are invalid, nothing happens.
This method is provided for convenience and results in much more faster setting of color than calling appropriate methods for every cell explicitly.
| void QicsCellRegion::setSelectedBackgroundColor | ( | const QColor & | color | ) |
Sets selected background color to color in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
If region or color are invalid, nothing happens.
This method is provided for convenience and results in much more faster setting of color than calling appropriate methods for every cell explicitly.
| void QicsCellRegion::setEditForegroundColor | ( | const QColor & | color | ) |
Sets edit foreground color to color in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
If region or color are invalid, nothing happens.
This method is provided for convenience and results in much more faster setting of color than calling appropriate methods for every cell explicitly.
| void QicsCellRegion::setEditBackgroundColor | ( | const QColor & | color | ) |
Sets edit background color to color in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
If region or color are invalid, nothing happens.
This method is provided for convenience and results in much more faster setting of color than calling appropriate methods for every cell explicitly.
| void QicsCellRegion::setAlignment | ( | int | align | ) | [inline] |
Sets text alignment to align in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
This method is provided for convenience and results in much more faster setting of alignment than calling QicsCell::setAlignment() for every cell explicitly.
| void QicsCellRegion::setTextFlags | ( | int | flags | ) | [inline] |
Sets text flags to flags in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
This method is provided for convenience and results in much more faster setting of text flags than calling QicsCell::setTextFlags() for every cell explicitly.
| void QicsCellRegion::setEnabled | ( | bool | b | ) | [inline] |
Sets enable state to b in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
This method is provided for convenience and results in much more faster setting of enable state than calling QicsCell::setEnabled() for every cell explicitly.
| void QicsCellRegion::setReadOnly | ( | bool | b | ) | [inline] |
Sets read-only state to b in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
This method is provided for convenience and results in much more faster setting of read-only state than calling QicsCell::setReadOnly() for every cell explicitly.
| void QicsCellRegion::setCanAcceptDrops | ( | bool | b | ) | [inline] |
Sets drop acception to b in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
This method is provided for convenience and results in much more faster setting of drop acception than calling QicsCell::setCanAcceptDrops() for every cell explicitly.
| void QicsCellRegion::setAutoRecognition | ( | bool | b | ) | [inline] |
Sets auto recognition to b in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
This method is provided for convenience and results in much more faster setting of auto recognition than calling QicsCell::setAutoRecognition() for every cell explicitly.
| void QicsCellRegion::setMaxLength | ( | int | value | ) | [inline] |
Sets maximum cell value length to value in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
This method is provided for convenience and results in much more faster setting of maximum cell value length than calling QicsCell::setMaxLength() for every cell explicitly.
| void QicsCellRegion::setMargin | ( | int | value | ) | [inline] |
Sets cell margin to value in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
This method is provided for convenience and results in much more faster setting of cell margin than calling QicsCell::setMargin() for every cell explicitly.
| void QicsCellRegion::setPixmapSpacing | ( | int | value | ) | [inline] |
Sets pixmap spacing to value in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
This method is provided for convenience and results in much more faster setting of pixmap spacing than calling QicsCell::setPixmapSpacing() for every cell explicitly.
| void QicsCellRegion::setBorderWidth | ( | int | value | ) | [inline] |
Sets cell border width to value in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
This method is provided for convenience and results in much more faster setting of cell border width than calling QicsCell::setBorderWidth() for every cell explicitly.
| virtual void QicsCellRegion::setFont | ( | const QFont & | font, | |
| bool | updateCellSizes = true | |||
| ) | [pure virtual] |
Sets cell font to font in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
If updateCellSizes is set to true, then dimensions of cells will be updated to match new font value.
This method is provided for convenience and results in much more faster setting of cell font than calling QicsCell::setFont() for every cell explicitly.
There are a couple of more specialized methods which allow to set individual font attributes without changing other ones. See setFontAttribute(), setFontSize(), setFontWeight(), setFontStretch() and setFontFamily().
| void QicsCellRegion::setFontAttribute | ( | QicsCellStyle::QicsCellStyleProperty | prop, | |
| bool | value, | |||
| bool | updateCellSizes = true | |||
| ) |
Sets boolean font attribute prop to value in rectangular region of cells in the grid. Other font attributes remain unchanged. The following attributes can be set with this method:
If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
If updateCellSizes is set to true, then dimensions of cells will be updated to match new font value.
This method is provided for convenience and results in much more faster setting of font attribute than calling QicsCell::setFont() for every cell explicitly.
| void QicsCellRegion::setFontSize | ( | int | size, | |
| bool | updateCellSizes = true | |||
| ) |
Sets font size to size in rectangular region of cells in the grid. Other font properties remain unchanged. Size is given in points (see QFont::setPointSize()).
If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
If updateCellSizes is set to true, then dimensions of cells will be updated to match new font value.
This method is provided for convenience and results in much more faster setting of font size than calling QicsCell::setFont() for every cell explicitly.
| void QicsCellRegion::setFontWeight | ( | int | weight, | |
| bool | updateCellSizes = true | |||
| ) |
Sets font weight to weight in rectangular region of cells in the grid. Other font properties remain unchanged. Weight is given according to QFont::Weight enumeration (see QFont::setWeight()).
If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
If updateCellSizes is set to true, then dimensions of cells will be updated to match new font value.
This method is provided for convenience and results in much more faster setting of font weight than calling QicsCell::setFont() for every cell explicitly.
| void QicsCellRegion::setFontStretch | ( | int | factor, | |
| bool | updateCellSizes = true | |||
| ) |
Sets font stretch factor to factor in rectangular region of cells in the grid. Other font properties remain unchanged. Stretch factor is given according to QFont::Stretch enumeration (see QFont::setStretch()).
If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
If updateCellSizes is set to true, then dimensions of cells will be updated to match new font value.
This method is provided for convenience and results in much more faster setting of font factor than calling QicsCell::setFont() for every cell explicitly.
| void QicsCellRegion::setFontFamily | ( | const QString & | family, | |
| bool | updateCellSizes = true | |||
| ) |
Sets font family to family in rectangular region of cells in the grid. Other font properties remain unchanged. Family is given according to QFont::setFamily() parameters.
If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
If updateCellSizes is set to true, then dimensions of cells will be updated to match new font value.
This method is provided for convenience and results in much more faster setting of font family than calling QicsCell::setFont() for every cell explicitly.
| void QicsCellRegion::setCursor | ( | const QCursor & | cursor | ) | [inline] |
Sets mouse cursor to cursor in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
This method is provided for convenience and results in much more faster setting of cursor than calling QicsCell::setCursor() for every cell explicitly.
| void QicsCellRegion::setTopBorderPen | ( | const QPen & | pen | ) | [inline] |
Sets top border pen to pen in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
This method is provided for convenience and results in much more faster setting of pen than calling QicsCell::setTopBorderPen() for every cell explicitly.
To set a pen for several borders around the region, see setBoxPen().
| void QicsCellRegion::setBottomBorderPen | ( | const QPen & | pen | ) | [inline] |
Sets bottom border pen to pen in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
This method is provided for convenience and results in much more faster setting of pen than calling QicsCell::setBottomBorderPen() for every cell explicitly.
To set a pen for several borders around the region, see setBoxPen().
| void QicsCellRegion::setLeftBorderPen | ( | const QPen & | pen | ) | [inline] |
Sets left border pen to pen in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
This method is provided for convenience and results in much more faster setting of pen than calling QicsCell::setLeftBorderPen() for every cell explicitly.
To set a pen for several borders around the region, see setBoxPen().
| void QicsCellRegion::setRightBorderPen | ( | const QPen & | pen | ) | [inline] |
Sets right border pen to pen in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
This method is provided for convenience and results in much more faster setting of pen than calling QicsCell::setRightBorderPen() for every cell explicitly.
To set a pen for several borders around the region, see setBoxPen().
| void QicsCellRegion::setBoxPen | ( | const QPen & | pen, | |
| QicsBoxBorders | borders = AllBorders | |||
| ) |
Sets border pen to pen in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
The main difference of methods like setRightBorderPen() and others is that those methods are setting pen for EVERY cell in the region. setBoxPen() allows to draw a box AROUND the region. It automatically decides which cells should be updated with a pen value, using combination of borders. By default, it is set to QicsBoxBorders::All, which results in making closed rectangle around the region.
This method is provided for convenience and results in much more faster setting of pen than setting pen for every cell explicitly.
| void QicsCellRegion::setDisplayer | ( | QicsCellDisplay * | d | ) | [inline] |
Sets cell display object to d in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
This method is provided for convenience and results in much more faster setting of QicsCellDisplay object than calling QicsCell::setDisplayer() for every cell explicitly.
| void QicsCellRegion::setFormatter | ( | QicsDataItemFormatter * | df | ) | [inline] |
Sets formatter object to df in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
This method is provided for convenience and results in much more faster setting of QicsDataItemFormatter object than calling QicsCell::setFormatter() for every cell explicitly.
| void QicsCellRegion::setValidator | ( | QValidator * | v | ) | [inline] |
Sets cell validator object to v in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
This method is provided for convenience and results in much more faster setting of QValidator object than calling QicsCell::setValidator() for every cell explicitly.
| void QicsCellRegion::setPasteValidator | ( | QicsPasteValidator * | v | ) | [inline] |
Sets paste validator object to v in rectangular region of cells in the grid. If repaint behavior is Qics::QicsRepaintOn, then the grid will be redrawn automatically after colors are set.
This method is provided for convenience and results in much more faster setting of QicsPasteValidator object than calling QicsCell::setPasteValidator() for every cell explicitly.