ICS

QicsTable Documentation Set

QicsScreenGrid Class Reference

Base widget class for on-screen grids. More...

#include <QicsScreenGrid.h>

Inherits QFrame, and QicsGrid.

Inherited by QicsHeaderGrid, and QicsTableGrid.

List of all members.

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 Slots

void setTopRow (int value)
void setLeftColumn (int value)
void setIsMainGrid (bool b)
virtual void reset (void)
virtual void recomputeAndDraw (QicsIndexType indexType=Qics::RowAndColumnIndex)
virtual void recomputeAndDraw (QicsIndexType indexType, int startIndex, int endIndex)
virtual void resetAndDraw (void)
virtual void resetAndDraw (int position, int num_items_added_removed, Qics::QicsIndexType row_or_col)
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)
virtual void handleGridPropertyChange (QicsGridStyle::QicsGridStyleProperty prop)
void drawHeaderResizeBar (int idx, int pos, QicsHeaderType type)
void traverse (QicsScrollDirection dir)
virtual bool traverseToCell (int row, int col, bool select_cell=true)
virtual bool canTraverseToCell (int row, int col)
virtual bool traverseToBeginningOfTable (void)
virtual bool traverseToEndOfTable (void)
virtual bool traverseToBeginningOfRow (void)
virtual bool traverseToEndOfRow (void)
virtual bool traverseToEndOfColumn (void)
virtual bool traverseToBeginningOfColumn (void)
virtual bool traverseLeft (void)
virtual bool traverseRight (void)
virtual bool traverseUp (void)
virtual bool traverseDown (void)
virtual bool traversePageUp (void)
virtual bool traversePageDown (void)
bool editCell (int row, int col)
virtual bool editCurrentCell (void)
void uneditCurrentCell (void)
bool editable (void) const
void setEditable (bool b)

Signals

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 cellEditStarted (int row, int col)
void cellEditEnded (int row, int col)
void focusNextPrevGridRequest (const QicsScreenGrid *, bool next)
void hideResizeBarRequest ()
void wideKeyPressed (QKeyEvent *event)

Public Member Functions

 QicsScreenGrid (QWidget *w, QicsGridInfo &info, int top_row=0, int left_column=0)
virtual ~QicsScreenGrid ()
bool isMainGrid (void) const
void setViewport (const QicsRegion &reg)
virtual QSize sizeHint () const
virtual QSize minimumSizeHint () const
int lastPageStartRow (void)
int lastPageStartColumn (void)
int topRow (void) const
int bottomRow (void) const
int fullyVisibleBottomRow (void)
int leftColumn (void) const
int rightColumn (void) const
int fullyVisibleRightColumn (void)
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)
int visibleColumns (void)
virtual bool requestCellOverflow (const QicsRegion &cur_area, const QRect &cur_rect, QicsRegion &new_area, QRect &new_rect)
virtual QicsICell currentCell (void) const
QString tooltipText (const QicsICell &cell) const
virtual void orderRowsBy (const QVector< int > &columns, QicsSortOrder order=Qics::Ascending, DataItemComparator func=0)
virtual void orderColumnsBy (const QVector< int > &rows, QicsSortOrder order=Qics::Ascending, DataItemComparator func=0)
virtual bool handleTraversalKeys (QKeyEvent *ke)
virtual bool isFrozen ()
bool focusNextWidget ()
bool focusPreviousWidget ()
bool selectOnTraverse ()
void setSelectOnTraverse (bool select)
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 QicsRegion currentViewport (void) const
virtual void acceptCellOverflow (QicsRegion &area)
int modelColumnIndex (int column) const
int modelRowIndex (int row) const
void dumpPositions (void) const

Protected Slots

void handleRowsChanges (int num, int start_position)
void handleColumnsChanges (int num, int start_position)
void hideResizeBar ()
virtual void timerScrollingEvent ()

Protected Member Functions

virtual void dropEvent (QDropEvent *event)
virtual void dragEnterEvent (QDragEnterEvent *event)
virtual void dropAt (QDropEvent *event, const QicsICell &cell)
virtual bool event (QEvent *event)
void setCurrentCell (const QicsICell &cell)
virtual void layout (void)
virtual void computeCellPositions (QicsIndexType indexType=Qics::RowAndColumnIndex)
virtual void paintEvent (QPaintEvent *ev)
virtual void paintRegion (const QRect &rect, QPainter *painter)
virtual QRect paintRegion (const QicsRegion &region, QPainter *painter)
virtual QRect drawCell (int row, int col, int x, int y, bool look_for_overflower, QPainter *painter, bool drawBorderOnly)
virtual bool prepareToDraw (int row, int col, const QRect &rect, QPainter *painter)
bool setRepaintAll (bool set)
virtual void extendSelection (int, int)
virtual void computeLastPage (QicsIndexType indexType=Qics::RowAndColumnIndex)
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 keyPressEvent (QKeyEvent *ke)
virtual void keyReleaseEvent (QKeyEvent *ke)
virtual void handleMousePressEvent (const QicsICell &cell, QMouseEvent *m)
virtual void handleMouseReleaseEvent (const QicsICell &cell, QMouseEvent *m)
virtual void handleMouseDoubleClickEvent (const QicsICell &cell, QMouseEvent *m)
virtual void handleMouseMoveEvent (const QicsICell &cell, QMouseEvent *m)
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)
bool doTraverseHorizontal (bool leftwards)
bool doTraverseVertical (bool upwards)
bool doTraverseCellVertical (int row, bool upwards)
bool doTraverseCellHorizontal (int col, bool leftwards)
virtual void selectCell (int, int)
void placeEntryWidget (void)
virtual void prepareDrag (const QicsICell &cell, Qt::DropAction mode)
virtual void startDrag (Qt::DropAction mode)
virtual void finishDrag (Qt::DropAction mode, bool remove, QWidget *target)
QMimeData * dragObject (Qt::DropAction mode)
virtual bool canDropAt (QDragMoveEvent *event, const QicsICell &cell) const
virtual void emitMouseSignals (const QicsICell &, QMouseEvent *)
virtual void doScrollTraverse ()
bool doCheckScrollUp (QMouseEvent *m)
bool doCheckScrollDown (QMouseEvent *m)
bool doCheckScrollLeft (QMouseEvent *m)
bool doCheckScrollRight (QMouseEvent *m)
QicsDataModeldataModel (void) const
QicsStyleManager & styleManager (void) const
QicsDimensionManager & dimensionManager (void) const
QicsMappedDimensionManagermappedDM (void) const
QicsSelectionManagerselectionManager (void) const
virtual QRect drawRegion (const QicsRegion &region, QPainter *painter, bool drawCellBordersOnly)
virtual void drawGridLines (const QicsRegion &reg, QPainter *painter)
virtual const QicsDataItemcellValue (int row, int col) const
QicsICell computeCellPositions (const QRect &bounds, const QicsICell &start, QicsIndexType indexType=Qics::RowAndColumnIndex)
QicsCellDisplaycellDisplay (int row, int col) const
virtual const QRect boundRect () const

Protected Attributes

int myReqVisibleRows
int myReqVisibleColumns
int myLastResizeLinePosition
QicsIndexType myNeedsRecomputeCellsFlag
QicsIndexType myNeedsRecomputeLastPageFlag
bool myNeedsRepaintFlag
int myLastPageStartRow
int myLastPageStartColumn
QicsICellV myCellsToNotify
bool myHeightFixed
bool myWidthFixed
QicsCellDisplaymyEditingCurrentCell
QicsICell myEditingCell
 Cell that now is editing.
QicsICell myUneditCell
bool myEditable
bool myPlacingEntryWidgetFlag
QicsICell myPressedCell
QicsICellmyDragCell
bool myIsMainGrid
QPixmap * imageBuffer
bool repaintAll
bool myGridInPaintEvent
bool initialRepaint
bool myForceSkipPaintEvent
Qt::DropAction myDropAction
QRubberBand * myResizeLine
int myLastPressedKey
bool mySelectOnTraverse
QTimer * timerScrolling
QicsICell cellToScroll
int scrollDirec
int speedOfScroll
QicsGridInfomyInfo
QicsRegion myViewport
QicsPositionList myRowPositions
QicsPositionList myColumnPositions
QicsICellQVL myAlreadyDrawnCells
QicsRegionV myOverflows
QicsMainGridmyMainGrid
QicsCellmyCell
QicsRowmyRow
QicsColumnmyColumn
int myTopRow
int myLeftColumn
int myBottomRow
int myFullyVisibleBottomRow
int myRightColumn
int myFullyVisibleRightColumn
int myExSelLeft
int myExSelRight
int myExSelTop
int myExSelBottom
int myTraversalRow
int myTraversalColumn

Friends

class QicsKeyboardManager


Detailed Description

Base widget class for on-screen grids.

QicsScreenGrid is the base widget class for all on-screen grids. It uses the layout and drawing routines from its superclass, QicsGrid. QicsScreenGrid also provides the infrastructure for cell traversal, cell editing, and drag and drop.

Most users of the QicsTable product should not need to create or modify QicsScreenGrid objects directly. The QicsTable widget automatically creates the necessary grid objects when needed. One instance where a user may need to modify a grid is to change the mouse and/or keyboard behavior of the grids.

QicsScreenGrid does not specify any user interaction semantics. It is the responsibility of subclasses to handle user interaction, such as mouse and keyboard events on its window.


Member Enumeration Documentation

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]

Specifies the various modes of QicsTable's scroll bars.

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.


Constructor & Destructor Documentation

QicsScreenGrid::QicsScreenGrid ( QWidget *  w,
QicsGridInfo info,
int  top_row = 0,
int  left_column = 0 
)

Constructor for the class.

Parameters:
w the parent of this widget
info used for style and dimension information, as well as the associated data model.
top_row initial top row to display in the grid
left_column initial left column to display in the grid

virtual QicsScreenGrid::~QicsScreenGrid (  )  [virtual]

The destructor


Member Function Documentation

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

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.

int QicsScreenGrid::lastPageStartRow ( void   ) 

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   ) 

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]

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

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

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

int QicsScreenGrid::fullyVisibleBottomRow ( void   ) 

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

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

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

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

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

int QicsScreenGrid::fullyVisibleRightColumn ( void   ) 

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

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

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

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

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  ) 

Request that the table scroll left num columns.

void QicsScreenGrid::scrollRight ( int  num  ) 

Request that the table scroll right num columns.

void QicsScreenGrid::scrollUp ( int  num  ) 

Request that the table scroll up num rows.

void QicsScreenGrid::scrollDown ( int  num  ) 

Request that the table scroll down num rows.

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

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]

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  ) 

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  ) 

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   ) 

Returns the number of visible rows in the grid.

int QicsScreenGrid::visibleColumns ( void   ) 

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]

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.

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

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

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 ( const QVector< int > &  columns,
QicsSortOrder  order = Qics::Ascending,
DataItemComparator  func = 0 
) [virtual]

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

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

Reimplemented from QicsGrid.

virtual void QicsScreenGrid::orderColumnsBy ( const QVector< int > &  rows,
QicsSortOrder  order = Qics::Ascending,
DataItemComparator  func = 0 
) [virtual]

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

Reimplemented from QicsGrid.

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

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.

virtual bool QicsScreenGrid::isFrozen (  )  [inline, virtual]

Returns true is grid is frozen otherwise returns false;

bool QicsScreenGrid::focusNextWidget (  ) 

Focus next widget in focus chain.

bool QicsScreenGrid::focusPreviousWidget (  ) 

Focus previous widget in focus chain.

bool QicsScreenGrid::selectOnTraverse (  ) 

Should cell be selected on traversing

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

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]

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]

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

virtual void QicsScreenGrid::reset ( void   )  [virtual, slot]

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

Reimplemented in QicsHeaderGrid, and QicsTableGrid.

virtual void QicsScreenGrid::recomputeAndDraw ( QicsIndexType  indexType = Qics::RowAndColumnIndex  )  [virtual, slot]

Causes a layout computation and a redraw.

virtual void QicsScreenGrid::recomputeAndDraw ( QicsIndexType  indexType,
int  startIndex,
int  endIndex 
) [virtual, slot]

Causes a layout computation and a redraw.

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

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

virtual void QicsScreenGrid::resetAndDraw ( int  position,
int  num_items_added_removed,
Qics::QicsIndexType  row_or_col 
) [virtual, slot]

Causes a reset of the grid wiget, a layout computation and a redraw if it needed.

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

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]

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]

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]

Sets the number of visible rows in the grid. function sets value independently of scroll bar.

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

Sets the number of visible columns in the grid.

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

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.

virtual void QicsScreenGrid::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 in QicsHeaderGrid, and QicsTableGrid.

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

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]

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

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

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.

Reimplemented in QicsHeaderGrid.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

virtual bool QicsScreenGrid::traversePageUp ( void   )  [virtual, slot]

Moves the current cell to one page up.

virtual bool QicsScreenGrid::traversePageDown ( void   )  [virtual, slot]

Moves the current cell to one page down.

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

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

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

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

Reimplemented in QicsHeaderGrid.

void QicsScreenGrid::uneditCurrentCell ( void   )  [slot]

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]

Returns whether the grid allows editing.

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

Sets whether the grid allows editing.

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

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

Reimplemented in QicsHeaderGrid, and QicsTableGrid.

virtual void QicsScreenGrid::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 in QicsHeaderGrid, and QicsTableGrid.

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

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]

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]

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]

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]

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]

This signal is emitted when traversed to other cell.

void QicsScreenGrid::cellEditStarted ( int  row,
int  col 
) [signal]

This signal is emitted when cell edit just've been started.

void QicsScreenGrid::cellEditEnded ( int  row,
int  col 
) [signal]

This signal is emitted when cell edit ended.

void QicsScreenGrid::wideKeyPressed ( QKeyEvent *  event  )  [signal]

Signals when table-wide control key was pressed.

Since:
2.2

Reimplemented in QicsHeaderGrid.

virtual bool QicsScreenGrid::event ( QEvent *  event  )  [protected, virtual]

Internal overload

Reimplemented in QicsTableGrid.

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

Sets the grid's current cell

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

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

virtual void QicsScreenGrid::computeCellPositions ( QicsIndexType  indexType = Qics::RowAndColumnIndex  )  [protected, virtual]

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

virtual void QicsScreenGrid::paintEvent ( QPaintEvent *  ev  )  [protected, virtual]

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

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

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 QRect QicsScreenGrid::paintRegion ( const QicsRegion region,
QPainter *  painter 
) [protected, virtual]

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::computeLastPage ( QicsIndexType  indexType = Qics::RowAndColumnIndex  )  [protected, virtual]

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]

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]

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]

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]

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]

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::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 in QicsHeaderGrid.

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

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

virtual void QicsScreenGrid::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 in QicsHeaderGrid, and QicsTableGrid.

virtual void QicsScreenGrid::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 in QicsHeaderGrid, and QicsTableGrid.

virtual void QicsScreenGrid::handleMouseDoubleClickEvent ( const QicsICell cell,
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 in QicsHeaderGrid, and QicsTableGrid.

virtual void QicsScreenGrid::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 in QicsHeaderGrid, and QicsTableGrid.

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

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]

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]

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

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

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

virtual void QicsScreenGrid::selectCell ( int  ,
int   
) [inline, 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 in QicsHeaderGrid, and QicsTableGrid.

void QicsScreenGrid::placeEntryWidget ( void   )  [protected]

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,
Qt::DropAction  mode 
) [protected, virtual]

Prepare for a drag operation from cell cell.

virtual void QicsScreenGrid::startDrag ( Qt::DropAction  mode  )  [protected, virtual]

Start a drag operation with drag mode mode.

Reimplemented in QicsHeaderGrid.

virtual void QicsScreenGrid::finishDrag ( Qt::DropAction  mode,
bool  remove,
QWidget *  target 
) [protected, virtual]

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.

QMimeData* QicsScreenGrid::dragObject ( Qt::DropAction  mode  )  [protected]

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

virtual bool QicsScreenGrid::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 in QicsHeaderGrid, and QicsTableGrid.

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 QicsRegion QicsGrid::currentViewport ( void   )  const [virtual, inherited]

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 in QicsHeaderGrid.

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


Member Data Documentation

QicsICell QicsScreenGrid::myEditingCell [protected]

Cell that now is editing.


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.