ICS

QicsTable Documentation Set

QicsHeaderGrid Class Reference

Header object for the QicsTable. More...

#include <QicsHeaderGrid.h>

Inherits QicsScreenGrid.

List of all members.

Public Types

typedef QicsHeaderGrid *(*) Foundry (QWidget *w, QicsGridInfo &info, QicsHeaderType type)
typedef QicsHeaderGrid *(*) FoundryWithKey (QWidget *w, QicsGridInfo &info, QicsHeaderType type, void *key)
enum  QicsSortMode { QicsStableSort = 0, QicsQuickSort }
enum  QicsCellOverflowBehavior { Clip = 0, Overflow, ToolTip }
enum  QicsCurrentCellStyle { Spreadsheet = 0, NormalSelected }
enum  QicsGridCellClipping { AllowPartial = 0, NoDisplayOnPartial, UseClippedSymbol }
enum  QicsGridType { TableGrid = 0, RowHeaderGrid, ColumnHeaderGrid }
enum  QicsHeaderType { RowHeader = 0, ColumnHeader }
enum  QicsIndexType { RowIndex, ColumnIndex }
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, ScrollDown, ScrollLeft,
  ScrollRight, ScrollToRow, ScrollToColumn
}
enum  QicsSelectionPolicy {
  SelectNone = 0, SelectSingle, SelectMultiple, SelectSingleRow,
  SelectMultipleRow
}
enum  QicsSelectionType {
  SelectionNone = 0, SelectionBegin, SelectionDrag, SelectionEnd,
  SelectionExtend, SelectionAdd
}
enum  QicsSortOrder { Ascending = 0, Descending }
enum  QicsTableDisplayOption { DisplayNever = 0, DisplayAlways, DisplayFirstPage }
enum  QicsTraversalKeyEditBehavior { TraverseWithinCell = 0, TraverseBetweenCells }

Public Slots

virtual void handleGridPropertyChange (QicsGridStyle::QicsGridStyleProperty prop)
void setTopRow (int value)
void setLeftColumn (int value)
void setIsMainGrid (bool b)
virtual void recomputeAndDraw (void)
virtual void resetAndDraw (void)
virtual void redraw (void)
virtual void redraw (QicsRegion region)
virtual void redraw (QicsSpan span)
void setVisibleRows (int num)
void setVisibleColumns (int num)
virtual void handleCellPropertyChange (QicsRegion region, QicsCellStyle::QicsCellStyleProperty prop, bool visual_coords)
void drawHeaderResizeBar (int idx, int pos, QicsHeaderType type)
void traverse (QicsScrollDirection dir)
virtual bool traverseToCell (int row, int col, bool select_cell=true)
virtual void traverseToBeginningOfTable (void)
virtual void traverseToEndOfTable (void)
virtual void traverseToBeginningOfRow (void)
virtual void traverseToEndOfRow (void)
virtual void traverseToEndOfColumn (void)
virtual void traverseToBeginningOfColumn (void)
virtual void traverseLeft (void)
virtual void traverseRight (void)
virtual void traverseUp (void)
virtual void traverseDown (void)
bool editCell (int row, int col)
bool editCurrentCell (void)
void uneditCurrentCell (void)
bool editable (void) const
void setEditable (bool b)

Signals

void sizeChange (int idx, int old_size, int new_size, QicsHeaderType type)
void resizeInProgress (int idx, int position, QicsHeaderType type)
void gripDoubleClicked (int idx, int button, QicsHeaderType type)
void pressed (int row, int col, int button, const QPoint &pos)
void clicked (int row, int col, int button, const QPoint &pos)
void doubleClicked (int row, int col, int button, const QPoint &pos)
void scrollRequest (QicsScrollDirection direction, int num)
void newBoundsInfo ()
void uneditRequest ()
void dragFinished (const QicsICell *dragCell, QDropEvent::Action mode, bool isMainGrid)

Public Member Functions

 QicsHeaderGrid (QWidget *w, QicsGridInfo &info, QicsHeaderType type)
virtual ~QicsHeaderGrid ()
QicsHeaderType type (void) const
virtual QicsRegion currentViewport (void) const
int gripThreshold (void) const
void setGripThreshold (int gt)
void setIsFrozenHeader (bool flag)
bool isMainGrid (void) const
void setViewport (const QicsRegion &reg)
virtual QSize minimumSizeHint () const
int lastPageStartRow (void)
int lastPageStartColumn (void)
int topRow (void) const
int bottomRow (void) const
int leftColumn (void) const
int rightColumn (void) const
QicsICell cellAt (int x, int y, bool nearest) const
int rowAt (int y, bool nearest) const
int columnAt (int x, bool nearest) const
void scrollLeft (int num)
void scrollRight (int num)
void scrollUp (int num)
void scrollDown (int num)
bool isHeightFixed (void) const
bool isWidthFixed (void) const
void fixHeightToViewport (bool set)
void fixWidthToViewport (bool set)
int visibleRows (void) const
int visibleColumns (void) const
virtual bool requestCellOverflow (const QicsRegion &cur_area, const QRect &cur_rect, QicsRegion &new_area, QRect &new_rect)
QicsICell currentCell (void) const
QString tooltipText (const QicsICell &cell) const
virtual void orderRowsBy (int column, QicsSortOrder order=Qics::Ascending, DataItemComparator func=0)
virtual void orderColumnsBy (int row, QicsSortOrder order=Qics::Ascending, DataItemComparator func=0)
virtual bool handleTraversalKeys (QKeyEvent *ke)
QicsGridInfogridInfo (void) const
virtual QicsRegion viewport (void) const
bool isCellValid (int row, int col) const
QRect cellDimensions (int row, int col, bool with_spans) const
QRect cellDimensions (const QicsICell &cell, bool with_spans) const
virtual void acceptCellOverflow (QicsRegion &area)
int modelColumnIndex (int column) const
int modelRowIndex (int row) const
void dumpPositions (void) const

Static Public Member Functions

static QicsHeaderGridcreateGrid (QWidget *w, QicsGridInfo &info, QicsHeaderType type)

Protected Slots

void handleRowsChanges (int num, int start_position)
void handleColumnsChanges (int num, int start_position)

Protected Member Functions

virtual QSize sizeHint (void) const
virtual void handleMousePressEvent (const QicsICell &cell, QMouseEvent *m)
virtual void handleMouseReleaseEvent (const QicsICell &cell, QMouseEvent *m)
virtual void handleMouseMoveEvent (const QicsICell &cell, QMouseEvent *m)
virtual void handleMouseDoubleClickEvent (const QicsICell &, QMouseEvent *m)
virtual void emitMouseSignals (const QicsICell &, QMouseEvent *)
virtual void keyPressEvent (QKeyEvent *ke)
void dragMoveEvent (QDragMoveEvent *event)
virtual bool canDropAt (QDragMoveEvent *event, const QicsICell &cell) const
virtual void dropAt (QDropEvent *event, const QicsICell &cell)
bool isWithinResizeThreshold (int x, int y, int *in_cell, int *close_cell) const
bool setResizeCursor (QMouseEvent *m)
void handleCellResize (QMouseEvent *m)
void finishResize (void)
virtual void selectCell (int row, int col)
void beginSelection (int row, int col)
void endSelection (int row, int col)
void extendSelection (int row, int col)
void addSelection (int row, int col)
void clearSelection (void)
void dragSelection (QMouseEvent *m)
void reportSelection (int row, int col, QicsSelectionType stype)
void startDrag (QDragObject::DragMode mode)
void reset ()
void traverse (Qt::Orientation orient, bool forward)
virtual void dropEvent (QDropEvent *event)
void setCurrentCell (const QicsICell &cell)
virtual void layout (void)
virtual void computeCellPositions (void)
QicsICell computeCellPositions (const QRect &bounds, const QicsICell &start)
virtual void drawContents (QPainter *painter)
virtual void paintRegion (const QRect &rect, QPainter *painter)
virtual void paintRegion (const QicsRegion &region, QPainter *painter)
virtual void drawCell (int row, int col, int x, int y, bool look_for_overflower, QPainter *painter)
virtual bool prepareToDraw (int row, int col, const QRect &rect, QPainter *painter)
virtual void computeLastPage (void)
virtual void resizeEvent (QResizeEvent *r)
virtual void mousePressEvent (QMouseEvent *m)
virtual void mouseReleaseEvent (QMouseEvent *m)
virtual void mouseDoubleClickEvent (QMouseEvent *m)
virtual void mouseMoveEvent (QMouseEvent *m)
virtual void keyReleaseEvent (QKeyEvent *ke)
virtual void handleKeyPressEvent (const QicsICell &cell, QKeyEvent *k)
virtual void handleKeyReleaseEvent (const QicsICell &cell, QKeyEvent *k)
bool isCellVisible (int row, int col) const
void makeCellFullyVisible (int row, int col)
void updateViewport (void)
void updateLineWidth (void)
void updateFrameStyle (void)
void placeEntryWidget (void)
virtual void prepareDrag (const QicsICell &cell)
virtual void finishDrag (QDragObject::DragMode mode, bool remove, QWidget *target)
QDragObject * dragObject (QDragObject::DragMode mode)
QicsDataModeldataModel (void) const
QicsStyleManagerstyleManager (void) const
QicsDimensionManagerdimensionManager (void) const
QicsMappedDimensionManagermappedDM (void) const
QicsSelectionManagerselectionManager (void) const
virtual void drawRegion (const QicsRegion &region, QPainter *painter)
virtual void drawGridLines (const QicsRegion &reg, QPainter *painter)
virtual const QicsDataItemcellValue (int row, int col) const
QicsCellDisplaycellDisplay (int row, int col) const

Protected Attributes

QicsHeaderType myType
int myGripThreshold
bool myMouseInGrip
bool myDoingResize
bool myDoingSelectionFlag
int myExpandingCell
int myExpandingCellSize
int myExpandingCellStartPosition
int myExpandingCellCurrentPosition
int myAnchorIndex
int mySelectionIndex
bool myIsFrozenHeader
QicsGridToolTip * myGridToolTip
int myTopRow
int myLeftColumn
int myBottomRow
int myRightColumn
int myReqVisibleRows
int myReqVisibleColumns
int myLastResizeLinePosition
bool myNeedsRecomputeCellsFlag
bool myNeedsRecomputeLastPageFlag
bool myNeedsRepaintFlag
int myLastPageStartRow
int myLastPageStartColumn
QicsICellV myCellsToNotify
bool myHeightFixed
bool myWidthFixed
int myTraversalRow
int myTraversalColumn
QicsCellDisplaymyEditingCurrentCell
QicsICell myUneditCell
bool myEditable
bool myPlacingEntryWidgetFlag
QicsICell myPressedCell
QicsICellmyDragCell
bool myIsMainGrid
QicsGridInfomyInfo
QicsRegion myViewport
QicsPositionList myRowPositions
QicsPositionList myColumnPositions
QicsICellQVL myAlreadyDrawnCells
QicsRegionV myOverflows
QicsMainGridmyMainGrid
QicsCellmyCell
QicsRowmyRow
QicsColumnmyColumn


Detailed Description

Header object for the QicsTable.

QicsHeaderGrid is a widget used internally by the QicsTable widget. The headerGrid widget is responsible for laying out the header cells based on the size of the widget and based on various properties that are stored in the QicsStyleManager. The headerGrid does not actually draw anyting, rather it determines where each cell should be drawn and calls the appropriate cell display object for the actual display of the widget.

The headerGrid widget is also largely responsible for managing user interaction with the table. The headerGrid handles mouse and keyboard events on its window, and performs the appropriate action (selection and traversal, primarily).


Member Typedef Documentation

typedef QicsHeaderGrid*(*) QicsHeaderGrid::Foundry(QWidget *w, QicsGridInfo &info, QicsHeaderType type)

Foundry method to create new instances of QicsHeaderGrid (or a subclass of QicsHeaderGrid). Subclasses of QicsHeaderGrid should implement a similar method. Methods of this type can be passed to a QicsTable constructor in order to create custom grids.

typedef QicsHeaderGrid*(*) QicsHeaderGrid::FoundryWithKey(QWidget *w, QicsGridInfo &info, QicsHeaderType type, void *key)

Internal foundry method to create new instances of QicsHeaderGrid (or a subclass of QicsHeaderGrid). Methods of this type can be passed to a QicsTable constructor in order to create custom grids. A pointer to a previously provided "key" is passed as a parameter. This typedef is not exposed as part of the public API. It has been added because it's necessary for the Python bindings.


Member Enumeration Documentation

enum Qics::QicsSortMode [inherited]

Denotes the sort algorithm wich used

Enumerator:
QicsStableSort 
QicsQuickSort 

enum Qics::QicsCellOverflowBehavior [inherited]

Denotes the behavior of grids when handling cells whose contents cannot be displayed in the boundaries of the cell.

Enumerator:
Clip 
Overflow 
ToolTip 

enum Qics::QicsCurrentCellStyle [inherited]

Denotes the visual style that the current cell of the table will be drawn with.

Enumerator:
Spreadsheet 
NormalSelected 

enum Qics::QicsGridCellClipping [inherited]

Denotes the policy for displaying text that is too long to fit in its cell

Enumerator:
AllowPartial 
NoDisplayOnPartial 
UseClippedSymbol 

enum Qics::QicsGridType [inherited]

Specifies a type of grid object.

Enumerator:
TableGrid 
RowHeaderGrid 
ColumnHeaderGrid 

enum Qics::QicsHeaderType [inherited]

Specifies the type of table header.

Enumerator:
RowHeader 
ColumnHeader 

enum Qics::QicsIndexType [inherited]

Specifies the type of table index.

Enumerator:
RowIndex 
ColumnIndex 

enum Qics::QicsLineStyle [inherited]

Denotes the style of lines and borders in the table widget.

Enumerator:
None 
Plain 
Raised 
Sunken 

enum Qics::QicsRepaintBehavior [inherited]

Specifies the recalculation and repainting behavior of tables and grids.

Enumerator:
RepaintOff 
RepaintOn 
RepaintCalcOnly 

enum Qics::QicsScrollBarMode [inherited]

Specifies the various modes of QicsTable's scroll bars.

Enumerator:
Auto 
AlwaysOff 
AlwaysOn 

enum Qics::QicsScrollDirection [inherited]

Denotes a direction for scrolling operations, or that an absolute scroll should occur.

Enumerator:
ScrollNone 
ScrollUp 
ScrollDown 
ScrollLeft 
ScrollRight 
ScrollToRow 
ScrollToColumn 

enum Qics::QicsSelectionPolicy [inherited]

Denotes the selection policy for the table.

Enumerator:
SelectNone 
SelectSingle 
SelectMultiple 
SelectSingleRow 
SelectMultipleRow 

enum Qics::QicsSelectionType [inherited]

Enumerator:
SelectionNone 
SelectionBegin 
SelectionDrag 
SelectionEnd 
SelectionExtend 
SelectionAdd 

enum Qics::QicsSortOrder [inherited]

Specifies if ordering should be ascending or descending.

Enumerator:
Ascending 
Descending 

enum Qics::QicsTableDisplayOption [inherited]

Specifies a printing display policy for elements of the table

Enumerator:
DisplayNever 
DisplayAlways 
DisplayFirstPage 

enum Qics::QicsTraversalKeyEditBehavior [inherited]

Specifies the behavior of the traversal keys (left, right, up, down, etc) while editing a cell.

Enumerator:
TraverseWithinCell 
TraverseBetweenCells 


Constructor & Destructor Documentation

QicsHeaderGrid::QicsHeaderGrid ( QWidget *  w,
QicsGridInfo info,
QicsHeaderType  type 
)

virtual QicsHeaderGrid::~QicsHeaderGrid (  )  [virtual]

The destructor (virtual, in case we subclass later).


Member Function Documentation

QicsHeaderType QicsHeaderGrid::type ( void   )  const [inline]

Returns the type of this headerGrid object.

virtual QicsRegion QicsHeaderGrid::currentViewport ( void   )  const [virtual]

Computes the intersection of the data model dimensions and the viewport dimensions. Because the current viewport can contain values that greater than the number of rows and columns in the data model, it is often necessary for the grid to determine the current viewport.

Reimplemented from QicsGrid.

int QicsHeaderGrid::gripThreshold ( void   )  const [inline]

Returns the maximum distance (in pixels) that the cursor can be away from a cell margin and still be able to resize a row/column.

void QicsHeaderGrid::setGripThreshold ( int  gt  )  [inline]

Sets the maximum distance (in pixels) that the cursor can be away from a cell margin and still be able to resize a row/column.

void QicsHeaderGrid::setIsFrozenHeader ( bool  flag  )  [inline]

Sets current header grid property myIsFrozenHeader to true if it belongs frozen part of table. See the "myIsFrozenHeader" property for details.

static QicsHeaderGrid* QicsHeaderGrid::createGrid ( QWidget *  w,
QicsGridInfo info,
QicsHeaderType  type 
) [static]

Foundry method to create new instances of QicsHeaderGrid. Subclasses of QicsHeaderGrid should implement a similar method. Methods of this type can be passed to a QicsTable constructor in order to create custom grids.

void QicsHeaderGrid::sizeChange ( int  idx,
int  old_size,
int  new_size,
QicsHeaderType  type 
) [signal]

Signals when the user has finished resizing a row or column.

Parameters:
idx the index of the row or column that was resized
old_size the old height/width of the row/column
new_size the new height/width of the row/column
type row or column header

void QicsHeaderGrid::resizeInProgress ( int  idx,
int  position,
QicsHeaderType  type 
) [signal]

Signals when the user is in the process of interactively resizing a cell by dragging the mouse.

Parameters:
idx the index of the row or column that is being resized
position the X (if a column header) or Y (if a row header) location of the cursor in the grid
type row or column header

void QicsHeaderGrid::gripDoubleClicked ( int  idx,
int  button,
QicsHeaderType  type 
) [signal]

Signals when the user double clicks in the "grip" area between two cells.

Parameters:
idx the index of the row or column to the top/left of the grip that was double clicked in
button the button that was clicked
type row or column header

virtual void QicsHeaderGrid::handleGridPropertyChange ( QicsGridStyle::QicsGridStyleProperty  prop  )  [virtual, slot]

Slot for the QicsStyleManager object to use to signal a change of grid property prop in the table.

This method may cause both a layout computation and a redraw of the grid.

Reimplemented from QicsScreenGrid.

virtual QSize QicsHeaderGrid::sizeHint ( void   )  const [protected, virtual]

Reimplemented from QicsScreenGrid.

virtual void QicsHeaderGrid::handleMousePressEvent ( const QicsICell cell,
QMouseEvent *  m 
) [protected, virtual]

Custom mouse press event handler. This method is intended to be reimplemented in subclasses to provide the desired user interaction. Note that cell may not be valid (i.e. the event may have taken place outside the grid).

See also:
mousePressEventHandler()

Reimplemented from QicsScreenGrid.

virtual void QicsHeaderGrid::handleMouseReleaseEvent ( const QicsICell cell,
QMouseEvent *  m 
) [protected, virtual]

Custom mouse release event handler. This method is intended to be reimplemented in subclasses to provide the desired user interaction. Note that cell may not be valid (i.e. the event may have taken place outside the grid).

See also:
mouseReleaseEventHandler()

Reimplemented from QicsScreenGrid.

virtual void QicsHeaderGrid::handleMouseMoveEvent ( const QicsICell cell,
QMouseEvent *  m 
) [protected, virtual]

Custom mouse movement event handler. This method is intended to be reimplemented in subclasses to provide the desired user interaction.

See also:
mouseMoveEventHandler()

Reimplemented from QicsScreenGrid.

virtual void QicsHeaderGrid::handleMouseDoubleClickEvent ( const QicsICell ,
QMouseEvent *  m 
) [protected, virtual]

Custom mouse double click event handler. This method is intended to be reimplemented in subclasses to provide the desired user interaction. Note that cell may not be valid (i.e. the event may have taken place outside the grid).

See also:
mouseDoubleClickEventHandler()

Reimplemented from QicsScreenGrid.

virtual void QicsHeaderGrid::emitMouseSignals ( const QicsICell ,
QMouseEvent *   
) [protected, virtual]

This method needs to disallow signals clicked() pressed() and doubleClicked() when mouse is over the resizing area of headers.

Reimplemented from QicsScreenGrid.

virtual void QicsHeaderGrid::keyPressEvent ( QKeyEvent *  ke  )  [protected, virtual]

The grid widget's key press event handler. If the grid has a current cell, this handler first trys to handle the key press as a traversal command. If the key pressed was not a traversal command, the cell display object of the current cell is called to let it handle the event. If the event is not handled, handleKeyPressEvent() is called.

Reimplemented from QicsScreenGrid.

void QicsHeaderGrid::dragMoveEvent ( QDragMoveEvent *  event  )  [protected]

virtual bool QicsHeaderGrid::canDropAt ( QDragMoveEvent *  event,
const QicsICell cell 
) const [protected, virtual]

Returns true if the dragged object specified in event can be accepted by the grid in cell cell.

Reimplemented from QicsScreenGrid.

virtual void QicsHeaderGrid::dropAt ( QDropEvent *  event,
const QicsICell cell 
) [protected, virtual]

Called from dropEvent to actually do the drop processing. The default behavior is to ignore the drop. Subclasses should override this method if they want to accept drops.

Reimplemented from QicsScreenGrid.

bool QicsHeaderGrid::isWithinResizeThreshold ( int  x,
int  y,
int *  in_cell,
int *  close_cell 
) const [protected]

Determines if the major axis position of the pointer (pos ) is within the grip threshold allowance.

bool QicsHeaderGrid::setResizeCursor ( QMouseEvent *  m  )  [protected]

Set or unset the headerGrid's resize cursor based on the position of the mouse cursor. Returns true if the resize cursor was set.

void QicsHeaderGrid::handleCellResize ( QMouseEvent *  m  )  [protected]

Handle the "middle" (drag) of a cell resize operation

void QicsHeaderGrid::finishResize ( void   )  [protected]

Handles the end of a cell resize operation

virtual void QicsHeaderGrid::selectCell ( int  row,
int  col 
) [protected, virtual]

Select cell (row, col ). In this class, this method is a no-op. It is intended that subclasses will reimplement this method based on the selection paradigm for the class.

Reimplemented from QicsScreenGrid.

void QicsHeaderGrid::beginSelection ( int  row,
int  col 
) [protected]

Perform the beginning of a user-intiated selection.

void QicsHeaderGrid::endSelection ( int  row,
int  col 
) [protected]

Perform the end of a user-intiated selection.

void QicsHeaderGrid::extendSelection ( int  row,
int  col 
) [protected]

Extend a user-intiated selection.

void QicsHeaderGrid::addSelection ( int  row,
int  col 
) [protected]

Add a new cell to a user-intiated selection.

void QicsHeaderGrid::clearSelection ( void   )  [protected]

Clear a user-intiated selection.

void QicsHeaderGrid::dragSelection ( QMouseEvent *  m  )  [protected]

Handle an in-progress selection drag

void QicsHeaderGrid::reportSelection ( int  row,
int  col,
QicsSelectionType  stype 
) [protected]

Report an action of a user-intiated selection.

void QicsHeaderGrid::startDrag ( QDragObject::DragMode  mode  )  [protected, virtual]

Start a drag operation with drag mode mode.

Reimplemented from QicsScreenGrid.

void QicsHeaderGrid::reset (  )  [protected, virtual]

Reset any internal state (selections, editing, etc) for the grid

Reimplemented from QicsScreenGrid.

bool QicsScreenGrid::isMainGrid ( void   )  const [inline, inherited]

void QicsScreenGrid::setViewport ( const QicsRegion reg  )  [virtual, inherited]

Restricts the grid to show a subset of the data model values. reg specifies an area of the table that is allowed to be displayed.

Reimplemented from QicsGrid.

virtual QSize QicsScreenGrid::minimumSizeHint (  )  const [virtual, inherited]

int QicsScreenGrid::lastPageStartRow ( void   )  [inherited]

Returns the index of the row that would be displayed at the top of the grid if the last displayable cell was placed at the bottom right of the grid. This value is used by the QicsTable to set the appropriate values on the table's scrollbars.

int QicsScreenGrid::lastPageStartColumn ( void   )  [inherited]

Returns the index of the column that would be displayed at the left of the grid if the last displayable cell was placed at the bottom right of the grid. This value is used by the QicsTable to set the appropriate values on the table's scrollbars.

int QicsScreenGrid::topRow ( void   )  const [inline, inherited]

Returns the index of the row that is currently displayed at the top of the grid widget.

int QicsScreenGrid::bottomRow ( void   )  const [inline, inherited]

Returns the index of the row that is currently displayed at the bottom of the grid widget.

int QicsScreenGrid::leftColumn ( void   )  const [inline, inherited]

Returns the index of the leftmost column that is currently displayed in the grid widget.

int QicsScreenGrid::rightColumn ( void   )  const [inline, inherited]

Returns the index of the rightmost column that is currently displayed in the grid widget.

QicsICell QicsScreenGrid::cellAt ( int  x,
int  y,
bool  nearest 
) const [inherited]

Computes row and column values (given the current topRow and leftColumn) for the window coordinates (x, y ), and returns those values as a QicsICell. If the coordinates do not correspond to a cell, behavior is dependent on the value of nearest. If nearest is true, this method will return the nearest cell to the coordinates. If it is false, it will return an invalid cell.

See also:
rowAt()

columnAt()

int QicsScreenGrid::rowAt ( int  y,
bool  nearest 
) const [inherited]

Returns a row index (given the current topRow and leftColumn) for the window coordinate y. If the coordinate does not correspond to a cell, behavior is dependent on the value of nearest. If nearest is true, this method will return the nearest row to the coordinate. If it is false, it will return -1.

int QicsScreenGrid::columnAt ( int  x,
bool  nearest 
) const [inherited]

Returns a column index (given the current topRow and leftColumn) for the window coordinate x. If the coordinate does not correspond to a cell, behavior is dependent on the value of nearest. If nearest is true, this method will return the nearest row to the coordinate. If it is false, it will return -1.

void QicsScreenGrid::scrollLeft ( int  num  )  [inherited]

Request that the table scroll left num columns.

void QicsScreenGrid::scrollRight ( int  num  )  [inherited]

Request that the table scroll right num columns.

void QicsScreenGrid::scrollUp ( int  num  )  [inherited]

Request that the table scroll up num rows.

void QicsScreenGrid::scrollDown ( int  num  )  [inherited]

Request that the table scroll down num rows.

bool QicsScreenGrid::isHeightFixed ( void   )  const [inline, inherited]

Returns true if the grid has a fixed height corresponding to the height of the viewport (i.e. it cannot scroll vertically), false otherwise.

bool QicsScreenGrid::isWidthFixed ( void   )  const [inline, inherited]

Returns true if the grid has a fixed width corresponding to the width of the viewport (i.e. it cannot scroll horizontally), false otherwise.

void QicsScreenGrid::fixHeightToViewport ( bool  set  )  [inherited]

If set is true, fixes the height of the grid to the height of the viewport (i.e. it cannot scroll). If set is false, the grid is not fixed and may scroll vertically. This is commonly used when using a grid to show frozen rows.

void QicsScreenGrid::fixWidthToViewport ( bool  set  )  [inherited]

If set is true, fixes the width of the grid to the width of the viewport (i.e. it cannot scroll). If set is false, the grid is not fixed and may scroll horizontally. This is commonly used when using a grid to show frozen columns.

int QicsScreenGrid::visibleRows ( void   )  const [inherited]

Returns the number of visible rows in the grid.

int QicsScreenGrid::visibleColumns ( void   )  const [inherited]

Returns the number of visible columns in the grid.

virtual bool QicsScreenGrid::requestCellOverflow ( const QicsRegion cur_area,
const QRect &  cur_rect,
QicsRegion new_area,
QRect &  new_rect 
) [virtual, inherited]

This method should be called only by QicsCellDisplay objects when trying to draw a cell. If the contents of the cell are too large to fit in the cell, the cell display object may ask to overflow into the next cell.

Parameters:
cur_area the visual coordinates of the cell.
cur_rect the current screen coordinates of the region.
new_area the region we are allowed to draw into.
new_rect the screen coordinates of that region.
Returns:
true if the overflow is allowed (new_area and new_rect are filled in), or false if the overflow is not allowed.

Reimplemented from QicsGrid.

QicsICell QicsScreenGrid::currentCell ( void   )  const [inline, inherited]

Returns the current cell of the grid widget. Note that if there is no current cell (i.e. the user has not selected a cell), the returned cell will be invalid.

QString QicsScreenGrid::tooltipText ( const QicsICell cell  )  const [inherited]

Returns the text that should be displayed in a tooltip when the user hovers the mouse pointer over this cell. This method will return an empty string if the grid property CellOverflowBehavior is not set to ToolTip.

virtual void QicsScreenGrid::orderRowsBy ( int  column,
QicsSortOrder  order = Qics::Ascending,
DataItemComparator  func = 0 
) [virtual, inherited]

Reorder the presentation of the rows of a data model based on a column. Note that the data model itself is not changed, only the presentation order shown in this grid and its slaves.

Parameters:
column the column to sort on
order sort direction
func user defined comparator function.

Reimplemented from QicsGrid.

virtual void QicsScreenGrid::orderColumnsBy ( int  row,
QicsSortOrder  order = Qics::Ascending,
DataItemComparator  func = 0 
) [virtual, inherited]

Reorder the presentation of the columns of the data model based on a row. See orderRowsBy for usage description.

Reimplemented from QicsGrid.

virtual bool QicsScreenGrid::handleTraversalKeys ( QKeyEvent *  ke  )  [virtual, inherited]

If the key event in ke corresponds to a traversal action, this method performs the appropriate traversal action and returns true. If the key event does not correspond to a traversal action, this method returns false.

void QicsScreenGrid::setTopRow ( int  value  )  [slot, inherited]

Sets the top row that will be displayed in the grid.

This method causes a layout computation and a redraw.

void QicsScreenGrid::setLeftColumn ( int  value  )  [slot, inherited]

Sets the left column that will be displayed in the grid.

This method causes a layout computation and a redraw.

void QicsScreenGrid::setIsMainGrid ( bool  b  )  [inline, slot, inherited]

Sets whether this grid is the main grid of the table.

virtual void QicsScreenGrid::recomputeAndDraw ( void   )  [virtual, slot, inherited]

Causes a layout computation and a redraw.

virtual void QicsScreenGrid::resetAndDraw ( void   )  [virtual, slot, inherited]

Causes a complete reset of the grid wiget, a layout computation and a redraw.

virtual void QicsScreenGrid::redraw ( void   )  [virtual, slot, inherited]

Causes a redraw of the grid, but not a layout computation.

This method will redraw the entire grid.

virtual void QicsScreenGrid::redraw ( QicsRegion  region  )  [virtual, slot, inherited]

Causes a redraw of the grid, but not a layout computation.

This method will redraw only the portion of the grid specified in region.

virtual void QicsScreenGrid::redraw ( QicsSpan  span  )  [virtual, slot, inherited]

Causes a redraw of the grid, but not a layout computation.

This method will redraw only the portion of the grid specified in span.

void QicsScreenGrid::setVisibleRows ( int  num  )  [slot, inherited]

Sets the number of visible rows in the grid.

void QicsScreenGrid::setVisibleColumns ( int  num  )  [slot, inherited]

Sets the number of visible columns in the grid.

virtual void QicsScreenGrid::handleCellPropertyChange ( QicsRegion  region,
QicsCellStyle::QicsCellStyleProperty  prop,
bool  visual_coords 
) [virtual, slot, inherited]

Slot for the QicsStyleManager object to use to signal a change of cell property prop in the table. Cells in the specified region have been changed.

This method may cause both a layout computation and a redraw of the grid.

void QicsScreenGrid::drawHeaderResizeBar ( int  idx,
int  pos,
QicsHeaderType  type 
) [slot, inherited]

Draws a resizing bar for row/column idx of a header of type type. The resizing bar is drawn at x/y value pos.

void QicsScreenGrid::traverse ( QicsScrollDirection  dir  )  [slot, inherited]

Slot for various QicsTable subwidgets to use to request a traversal in a certain direction.

void QicsScreenGrid::traverse ( Qt::Orientation  orient,
bool  forward 
) [protected, inherited]

Traverses in a manner indicated by orient, in the direction indicated by forward. For example, traverse(Qt::Vertical, true) traverses down, while traverse(Qt::Horizontal, false) traverses left.

virtual bool QicsScreenGrid::traverseToCell ( int  row,
int  col,
bool  select_cell = true 
) [virtual, slot, inherited]

Traverse to cell (row, col ). This will cause the specified cell to become visible in the grid, if it is not already. If select_cell is true, the cell will become the sole contents of the selection list.

virtual void QicsScreenGrid::traverseToBeginningOfTable ( void   )  [virtual, slot, inherited]

Moves the current cell to the top-left cell in the grid's current viewport.

virtual void QicsScreenGrid::traverseToEndOfTable ( void   )  [virtual, slot, inherited]

Moves the current cell to the bottom-right cell in the grid's current viewport.

virtual void QicsScreenGrid::traverseToBeginningOfRow ( void   )  [virtual, slot, inherited]

Moves the current cell to the leftmost cell of the current row in the grid's current viewport.

virtual void QicsScreenGrid::traverseToEndOfRow ( void   )  [virtual, slot, inherited]

Moves the current cell to the rightmost cell of the current row in the grid's current viewport.

virtual void QicsScreenGrid::traverseToEndOfColumn ( void   )  [virtual, slot, inherited]

Moves the current cell to the bottommost cell of the current column in the grid's current viewport.

virtual void QicsScreenGrid::traverseToBeginningOfColumn ( void   )  [virtual, slot, inherited]

Moves the current cell to the upmost cell of the current column in the grid's current viewport.

virtual void QicsScreenGrid::traverseLeft ( void   )  [virtual, slot, inherited]

Moves the current cell to the nearest cell to the left of the current cell that is enabled.

virtual void QicsScreenGrid::traverseRight ( void   )  [virtual, slot, inherited]

Moves the current cell to the nearest cell to the right of the current cell that is enabled.

virtual void QicsScreenGrid::traverseUp ( void   )  [virtual, slot, inherited]

Moves the current cell to the nearest cell above the current cell that is enabled.

virtual void QicsScreenGrid::traverseDown ( void   )  [virtual, slot, inherited]

Moves the current cell to the nearest cell below the current cell that is enabled.

bool QicsScreenGrid::editCell ( int  row,
int  col 
) [slot, inherited]

Slot for various QicsTable subwidgets to use to request that the grid should cause the cell (row, col ) to be edited.

bool QicsScreenGrid::editCurrentCell ( void   )  [slot, inherited]

Slot for various QicsTable subwidgets to use to request that the grid should cause the current cell to be edited.

void QicsScreenGrid::uneditCurrentCell ( void   )  [slot, inherited]

Slot for various QicsTable subwidgets to use to request that the grid should cause the current cell to not be able to be edited.

bool QicsScreenGrid::editable ( void   )  const [inline, slot, inherited]

Returns whether the grid allows editing.

void QicsScreenGrid::setEditable ( bool  b  )  [slot, inherited]

Sets whether the grid allows editing.

void QicsScreenGrid::handleRowsChanges ( int  num,
int  start_position 
) [protected, slot, inherited]

void QicsScreenGrid::handleColumnsChanges ( int  num,
int  start_position 
) [protected, slot, inherited]

virtual void QicsScreenGrid::dropEvent ( QDropEvent *  event  )  [protected, virtual, inherited]

Get the drop event, convert the position to a cell and call dropAt. Subclasses may override this if they want to do special processing

void QicsScreenGrid::pressed ( int  row,
int  col,
int  button,
const QPoint &  pos 
) [signal, inherited]

This signal is emitted when the user presses a mouse button in the grid. The indices of the cell, the button that was pressed, and the position of the mouse pointer in the grid are passed as parameters.

See also:
clicked(), doubleClicked()

void QicsScreenGrid::clicked ( int  row,
int  col,
int  button,
const QPoint &  pos 
) [signal, inherited]

This signal is emitted when the user clicks (presses and releases in the same cell) a mouse button in the grid. The indices of the cell, the button that was pressed, and the position of the mouse pointer in the grid are passed as parameters.

See also:
pressed(), doubleClicked()

void QicsScreenGrid::doubleClicked ( int  row,
int  col,
int  button,
const QPoint &  pos 
) [signal, inherited]

This signal is emitted when the user double clicks a mouse button in the grid. The indices of the cell, the button that was pressed, and the position of the mouse pointer in the grid are passed as parameters.

See also:
clicked()

void QicsScreenGrid::scrollRequest ( QicsScrollDirection  direction,
int  num 
) [signal, inherited]

This signal is emitted when the grid wishes to request a scroll in direction direction for num number of rows or columns.

void QicsScreenGrid::newBoundsInfo (  )  [signal, inherited]

This signal is emitted when the grid recomputes its last page information. The QicsTable widget receives this signal and should set the scrollbar min and max values appropriately.

void QicsScreenGrid::uneditRequest (  )  [signal, inherited]

This signal is emitted when traversed to other cell.

void QicsScreenGrid::dragFinished ( const QicsICell dragCell,
QDropEvent::Action  mode,
bool  isMainGrid 
) [signal, inherited]

This signal is emitted whenever a dragging finished

void QicsScreenGrid::setCurrentCell ( const QicsICell cell  )  [inline, protected, inherited]

Sets the grid's current cell

virtual void QicsScreenGrid::layout ( void   )  [protected, virtual, inherited]

Performs any needed layout operations (computing cell positions and/or last page information).

virtual void QicsScreenGrid::computeCellPositions ( void   )  [protected, virtual, inherited]

Computes cell positions based on QFrame::contentsRect and the current top, left cell.

QicsICell QicsGrid::computeCellPositions ( const QRect &  bounds,
const QicsICell start 
) [protected, inherited]

virtual void QicsScreenGrid::drawContents ( QPainter *  painter  )  [protected, virtual, inherited]

Draws the contents of the grid widget within the grid's frame border.

virtual void QicsScreenGrid::paintRegion ( const QRect &  rect,
QPainter *  painter 
) [protected, virtual, inherited]

Repaints the portion of the grid specified by rect that is currently visible. If painter is non-zero, it will be used to draw the grid.

virtual void QicsScreenGrid::paintRegion ( const QicsRegion region,
QPainter *  painter 
) [protected, virtual, inherited]

Repaints the portion of the grid specified by region that is currently visible. If painter is non-zero, it will be used to draw the grid.

virtual void QicsScreenGrid::drawCell ( int  row,
int  col,
int  x,
int  y,
bool  look_for_overflower,
QPainter *  painter 
) [protected, virtual, inherited]

Reimplemented from QicsGrid.

virtual bool QicsScreenGrid::prepareToDraw ( int  row,
int  col,
const QRect &  rect,
QPainter *  painter 
) [protected, virtual, inherited]

Reimplemented from QicsGrid.

virtual void QicsScreenGrid::computeLastPage ( void   )  [protected, virtual, inherited]

Computes how many rows and columns would be displayed if the bottom-right cell was in the bottom-right spot on the grid. This information will be used by the table to set the correct values on the scrollbars.

virtual void QicsScreenGrid::resizeEvent ( QResizeEvent *  r  )  [protected, virtual, inherited]

The grid widget's resize event handler. It will cause a layout computation and a redraw of the entire grid.

virtual void QicsScreenGrid::mousePressEvent ( QMouseEvent *  m  )  [protected, virtual, inherited]

The grid widget's mouse press event handler. If the event took place in a valid cell, this handler first calls the cell display object of the appropriate cell to let it handle this event. If the event is not handled, handleMousePressEvent() is called. In all valid cases, the pressed() signal is emitted.

virtual void QicsScreenGrid::mouseReleaseEvent ( QMouseEvent *  m  )  [protected, virtual, inherited]

The grid widget's mouse release event handler. If the event took place in a valid cell, this handler first calls the cell display object of the appropriate cell to let it handle this event. If the event is not handled, handleMouseReleaseEvent() is called. In all valid cases, the clicked() signal is emitted if the button was released in the same cell in which it was originally pressed.

virtual void QicsScreenGrid::mouseDoubleClickEvent ( QMouseEvent *  m  )  [protected, virtual, inherited]

The grid widget's mouse double click event handler. If the event took place in a valid cell, this handler first calls the cell display object of the appropriate cell to let it handle this event. If the event is not handled, handleMousePressEvent() is called. In all valid cases, the doubleClicked() signal is emitted.

virtual void QicsScreenGrid::mouseMoveEvent ( QMouseEvent *  m  )  [protected, virtual, inherited]

The grid widget's mouse movement event handler. If the event took place in a valid cell, this handler first calls the cell display object of the appropriate cell to let it handle this event. If the event is not handled, handleMouseMoveEvent() is called.

virtual void QicsScreenGrid::keyReleaseEvent ( QKeyEvent *  ke  )  [protected, virtual, inherited]

The grid widget's key release event handler. If the grid has a current cell, handleKeyPressEvent() is called.

virtual void QicsScreenGrid::handleKeyPressEvent ( const QicsICell cell,
QKeyEvent *  k 
) [protected, virtual, inherited]

Custom key press event handler. This method is intended to be reimplemented in subclasses to provide the desired user interaction.

See also:
keyPressEventHandler()

virtual void QicsScreenGrid::handleKeyReleaseEvent ( const QicsICell cell,
QKeyEvent *  k 
) [protected, virtual, inherited]

Custom key release event handler. This method is intended to be reimplemented in subclasses to provide the desired user interaction.

See also:
keyReleaseEventHandler()

bool QicsScreenGrid::isCellVisible ( int  row,
int  col 
) const [protected, inherited]

Returns true if the cell (row, col ) is currently visible in the grid, false otherwise.

void QicsScreenGrid::makeCellFullyVisible ( int  row,
int  col 
) [protected, inherited]

Scrolls the grid (if necessary) so that cell (row, col ) is completely visible.

void QicsScreenGrid::updateViewport ( void   )  [protected, inherited]

void QicsScreenGrid::updateLineWidth ( void   )  [protected, inherited]

void QicsScreenGrid::updateFrameStyle ( void   )  [protected, inherited]

void QicsScreenGrid::placeEntryWidget ( void   )  [protected, inherited]

Place the current entry widget in the correct position on the grid. Called after a grid layout has been performed.

virtual void QicsScreenGrid::prepareDrag ( const QicsICell cell  )  [protected, virtual, inherited]

Prepare for a drag operation from cell cell.

virtual void QicsScreenGrid::finishDrag ( QDragObject::DragMode  mode,
bool  remove,
QWidget *  target 
) [protected, virtual, inherited]

Finish a drag operation begun with drag mode mode. If remove is true and target is a widget with the same parent as this grid, the dragged selection is cleared.

QDragObject* QicsScreenGrid::dragObject ( QDragObject::DragMode  mode  )  [protected, inherited]

Returns the drag object to be used in a drag operation with mode mode.

QicsGridInfo& QicsGrid::gridInfo ( void   )  const [inline, inherited]

Returns the grid info object associated with the grid.

virtual QicsRegion QicsGrid::viewport ( void   )  const [virtual, inherited]

Returns the current viewport of the grid. The viewport specifies an area of the table that is allowed to be displayed.

bool QicsGrid::isCellValid ( int  row,
int  col 
) const [inherited]

Returns true if the cell (row, col ) is within the current viewport, false otherwise.

See also:
currentViewport

QRect QicsGrid::cellDimensions ( int  row,
int  col,
bool  with_spans 
) const [inherited]

Returns a rectangle specifying the current location and dimension of cell (row, col ). If with_spans is true, the cell dimension will include any cells that this cell spans. If the cell is not currently on the screen, the rectangle will be invalid.

QRect QicsGrid::cellDimensions ( const QicsICell cell,
bool  with_spans 
) const [inline, inherited]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

virtual void QicsGrid::acceptCellOverflow ( QicsRegion area  )  [virtual, inherited]

This method should be called only by QicsCellDisplay objects when trying to draw a cell. If, after calling QicsGrid::requestCellOverflow, the cell display object wishes to accept the proposed overflow region, the cell display object should call this method.

int QicsGrid::modelColumnIndex ( int  column  )  const [inherited]

Returns the physical column index into the data model for a given visual column

int QicsGrid::modelRowIndex ( int  row  )  const [inherited]

Returns the physical row index into the data model for a given visual row

void QicsGrid::dumpPositions ( void   )  const [inherited]

QicsDataModel* QicsGrid::dataModel ( void   )  const [inline, protected, inherited]

QicsStyleManager& QicsGrid::styleManager ( void   )  const [inline, protected, inherited]

QicsDimensionManager& QicsGrid::dimensionManager ( void   )  const [inline, protected, inherited]

QicsMappedDimensionManager& QicsGrid::mappedDM ( void   )  const [inline, protected, inherited]

QicsSelectionManager& QicsGrid::selectionManager ( void   )  const [inline, protected, inherited]

virtual void QicsGrid::drawRegion ( const QicsRegion region,
QPainter *  painter 
) [protected, virtual, inherited]

virtual void QicsGrid::drawGridLines ( const QicsRegion reg,
QPainter *  painter 
) [protected, virtual, inherited]

virtual const QicsDataItem* QicsGrid::cellValue ( int  row,
int  col 
) const [protected, virtual, inherited]

QicsCellDisplay* QicsGrid::cellDisplay ( int  row,
int  col 
) const [protected, inherited]


Member Data Documentation

QicsHeaderType QicsHeaderGrid::myType [protected]

int QicsHeaderGrid::myGripThreshold [protected]

bool QicsHeaderGrid::myMouseInGrip [protected]

bool QicsHeaderGrid::myDoingResize [protected]

bool QicsHeaderGrid::myDoingSelectionFlag [protected]

int QicsHeaderGrid::myExpandingCell [protected]

int QicsHeaderGrid::myExpandingCellSize [protected]

int QicsHeaderGrid::myExpandingCellStartPosition [protected]

int QicsHeaderGrid::myExpandingCellCurrentPosition [protected]

int QicsHeaderGrid::myAnchorIndex [protected]

int QicsHeaderGrid::mySelectionIndex [protected]

bool QicsHeaderGrid::myIsFrozenHeader [protected]

QicsGridToolTip* QicsScreenGrid::myGridToolTip [protected, inherited]

int QicsScreenGrid::myTopRow [protected, inherited]

int QicsScreenGrid::myLeftColumn [protected, inherited]

int QicsScreenGrid::myBottomRow [protected, inherited]

int QicsScreenGrid::myRightColumn [protected, inherited]

int QicsScreenGrid::myReqVisibleRows [protected, inherited]

int QicsScreenGrid::myReqVisibleColumns [protected, inherited]

int QicsScreenGrid::myLastResizeLinePosition [protected, inherited]

bool QicsScreenGrid::myNeedsRecomputeCellsFlag [protected, inherited]

bool QicsScreenGrid::myNeedsRecomputeLastPageFlag [protected, inherited]

bool QicsScreenGrid::myNeedsRepaintFlag [protected, inherited]

int QicsScreenGrid::myLastPageStartRow [protected, inherited]

int QicsScreenGrid::myLastPageStartColumn [protected, inherited]

QicsICellV QicsScreenGrid::myCellsToNotify [protected, inherited]

bool QicsScreenGrid::myHeightFixed [protected, inherited]

bool QicsScreenGrid::myWidthFixed [protected, inherited]

int QicsScreenGrid::myTraversalRow [protected, inherited]

int QicsScreenGrid::myTraversalColumn [protected, inherited]

QicsCellDisplay* QicsScreenGrid::myEditingCurrentCell [protected, inherited]

QicsICell QicsScreenGrid::myUneditCell [protected, inherited]

bool QicsScreenGrid::myEditable [protected, inherited]

bool QicsScreenGrid::myPlacingEntryWidgetFlag [protected, inherited]

QicsICell QicsScreenGrid::myPressedCell [protected, inherited]

QicsICell* QicsScreenGrid::myDragCell [protected, inherited]

bool QicsScreenGrid::myIsMainGrid [protected, inherited]

QicsGridInfo& QicsGrid::myInfo [protected, inherited]

QicsRegion QicsGrid::myViewport [protected, inherited]

QicsPositionList QicsGrid::myRowPositions [protected, inherited]

QicsPositionList QicsGrid::myColumnPositions [protected, inherited]

QicsICellQVL QicsGrid::myAlreadyDrawnCells [protected, inherited]

QicsRegionV QicsGrid::myOverflows [protected, inherited]

QicsMainGrid* QicsGrid::myMainGrid [protected, inherited]

QicsCell* QicsGrid::myCell [protected, inherited]

QicsRow* QicsGrid::myRow [protected, inherited]

QicsColumn* QicsGrid::myColumn [protected, inherited]


The documentation for this class was generated from the following file:

All trademarks and copyrights on this page are properties of their respective owners.
The rest is copyright 1999-2006 Integrated Computer Solutions, Inc.