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  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

void setTopRow (int value)
void setLeftColumn (int value)
void setIsMainGrid (bool b)
virtual void reset (void)
virtual void recomputeAndDraw (void)
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 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)
virtual void traverseNextRow (void)
virtual void traverseNextColumn (void)
virtual void traversePrevRow (void)
virtual void traversePrevColumn (void)
bool editCell (int row, int col)
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)

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 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)
int visibleColumns (void)
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 (QVector< int > columns, QicsSortOrder order=Qics::Ascending, DataItemComparator func=0)
virtual void orderColumnsBy (QVector< int > rows, 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 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)

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 (void)
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)
virtual bool prepareToDraw (int row, int col, const QRect &rect, QPainter *painter)
bool setRepaintAll (bool set)
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 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)
void traverse (Qt::Orientation orient, bool forward)
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 *)
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)
virtual void drawGridLines (const QicsRegion &reg, QPainter *painter)
virtual const QicsDataItemcellValue (int row, int col) const
QicsICell computeCellPositions (const QRect &bounds, const QicsICell &start)
QicsCellDisplaycellDisplay (int row, int col) const

Protected Attributes

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 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
QicsGridInfomyInfo
QicsRegion myViewport
QicsPositionList myRowPositions
QicsPositionList myColumnPositions
QicsICellQVL myAlreadyDrawnCells
QicsRegionV myOverflows
QicsMainGridmyMainGrid
QicsCellmyCell
QicsRowmyRow
QicsColumnmyColumn


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::QicsCellOverflowBehavior [inherited]
 

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

  • Clip Cell contents are clipped at the edges of the cell
  • Overflow The grid will attempt to overflow into adjacent cells
  • ToolTip The full contents of the cell will be displayed in a tooltip when the mouse pointer is hovered over the cell

enum Qics::QicsCurrentCellStyle [inherited]
 

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

  • Spreadsheet The current cell will be drawn with a solid border and will always use the cell's background color.
  • NormalSelected The current cell will be drawn the same as all other selected cells. The border will be as specified in the cell's border properties, and the background will be the cell's selected color.

enum Qics::QicsGridCellClipping [inherited]
 

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

  • AllowPartial Shows as much of the text as possible
  • NoDisplayOnPartial Do not display text if it cannot fit in the cell
  • UseClippedSymbol Display a clipped symbol at the end of the partial text

enum Qics::QicsGridType [inherited]
 

Specifies a type of grid object.

  • TableGrid A grid used to display normal table data
  • RowHeaderGrid A grid used to display row header data
  • ColumnHeaderGrid A grid used to display column header data

enum Qics::QicsHeaderType [inherited]
 

Specifies the type of table header.

  • HeaderRow A row header
  • HeaderColumn A column header

enum Qics::QicsIndexType [inherited]
 

Specifies the type of table index.

  • RowIndex A row index
  • ColumnIndex A column index

enum Qics::QicsLineStyle [inherited]
 

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

  • None No line or border
  • Plain A simple, plain line or border
  • Raised A raised line (using shadows)
  • Sunken A sunken line (using shadows)

enum Qics::QicsRepaintBehavior [inherited]
 

Specifies the recalculation and repainting behavior of tables and grids.

  • RepaintOff Do not perform any drawing or dimension calculations
  • RepaintOn Draw as needed, keep all dimensions up to date
  • RepaintCalcOnly Do not draw, but keep all dimensions up to date

enum Qics::QicsScrollBarMode [inherited]
 

Specifies the various modes of QicsTable's scroll bars.

  • Auto QicsTable shows a scroll bar when the content is too large to fit and not otherwise.
  • AlwaysOff QicsTable never shows a scroll bar.
  • AlwaysOn QicsTable always shows a scroll bar.

enum Qics::QicsScrollDirection [inherited]
 

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

  • ScrollNone no scroll allowed
  • ScrollUp scrolling up on a certain number of rows
  • ScrollDown scrolling down on a certain number of rows
  • ScrollLeft scrolling left on a certain number of columns
  • ScrollRight scrolling right on a certain number of columns
  • ScrollToRow scrolling up or down to a certain row
  • ScrollToColumn scrolling left or right to a certain column

enum Qics::QicsSelectionPolicy [inherited]
 

Denotes the selection policy for the table.

  • SelectNone no selection allowed
  • SelectSingle single cell selection
  • SelectionMultiple multiple cell selection (including non-contiguous regions)
  • SelectSingleRow selecting a cell selects the entire row, only one row can be selected
  • SelectMultipleRow selecting a cell selects the entire row, multiple rows can be selected

enum Qics::QicsSortMode [inherited]
 

Denotes the sort algorithm which is used

  • QicsStableSort Used non distructive, stable sort algorithm
  • QicsQuickSort Default quick sort algorithm.

enum Qics::QicsSortOrder [inherited]
 

Specifies whenever ordering should be ascending or descending.

  • Ascending Ascending order
  • Descending Descending order

enum Qics::QicsTableDisplayOption [inherited]
 

Specifies a printing display policy for elements of the table

  • DisplayNever Do not display the element when printing
  • DisplayAlways Always display the element when printing
  • DisplayFirstPage Display the element only when printing the first page of the table

enum Qics::QicsTraversalKeyEditBehavior [inherited]
 

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

  • TraverseWithinCell Traversal keys move the text cursor within the edited cell.
  • TraverseBetweenCells Traversal keys move the current cell highlight between cells in the table.


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

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 QicsScreenGrid::bottomRow void   )  const [inline]
 

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

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.

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()

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.

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.

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

This signal is emitted when cell edit ended.

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

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

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()

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.

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

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

virtual void QicsScreenGrid::computeLastPage void   )  [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.

QicsICell QicsScreenGrid::currentCell void   )  const [inline]
 

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.

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.

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()

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

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

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.

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.

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.

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

Returns whether the grid allows editing.

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.

bool QicsScreenGrid::editCurrentCell void   )  [slot]
 

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

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

Internal ovelload

Reimplemented in QicsTableGrid.

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.

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.

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

Returns the grid info object associated with 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.

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()

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

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

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

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

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.

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.

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

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

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

int QicsScreenGrid::leftColumn void   )  const [inline]
 

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

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

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

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

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

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.

virtual void QicsScreenGrid::orderColumnsBy 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 void QicsScreenGrid::orderRowsBy 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::paintEvent QPaintEvent *  ev  )  [protected, virtual]
 

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

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

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.

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()

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

Causes a layout computation and a redraw.

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.

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 void   )  [virtual, slot]
 

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

This method will redraw the entire 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 void QicsScreenGrid::reset void   )  [virtual, slot]
 

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

Reimplemented in QicsHeaderGrid, and QicsTableGrid.

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::resetAndDraw void   )  [virtual, slot]
 

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

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.

int QicsScreenGrid::rightColumn void   )  const [inline]
 

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

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.

void QicsScreenGrid::scrollDown int  num  ) 
 

Request that the table scroll down num rows.

void QicsScreenGrid::scrollLeft int  num  ) 
 

Request that the table scroll left num columns.

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::scrollRight int  num  ) 
 

Request that the table scroll right num columns.

void QicsScreenGrid::scrollUp int  num  ) 
 

Request that the table scroll up num rows.

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::setCurrentCell const QicsICell cell  )  [inline, protected]
 

Sets the grid's current cell

void QicsScreenGrid::setEditable bool  b  )  [slot]
 

Sets whether the grid allows editing.

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

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

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

void QicsScreenGrid::setVisibleColumns int  num  )  [slot]
 

Sets the number of visible columns in the grid.

void QicsScreenGrid::setVisibleRows int  num  )  [slot]
 

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

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

Start a drag operation with drag mode mode.

Reimplemented in QicsHeaderGrid.

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.

int QicsScreenGrid::topRow void   )  const [inline]
 

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

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

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.

void QicsScreenGrid::traverse QicsScrollDirection  dir  )  [slot]
 

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

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

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

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

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

virtual void QicsScreenGrid::traverseNextColumn void   )  [virtual, slot]
 

Moves current cell to the next column when it reaches the end of row.

virtual void QicsScreenGrid::traverseNextRow void   )  [virtual, slot]
 

Moves current cell to the next row when it reaches the end of column.

virtual void QicsScreenGrid::traversePrevColumn void   )  [virtual, slot]
 

Moves current cell to the previous column when it reaches the beginning of row( SHIFT + ENTER is pressed ).

virtual void QicsScreenGrid::traversePrevRow void   )  [virtual, slot]
 

Moves current cell to the previous row when it reaches the beginning of column( SHIFT + TAB is pressed ).

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

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

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

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

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

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

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

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

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.

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

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

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

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

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

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

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

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

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.

void QicsScreenGrid::uneditRequest  )  [signal]
 

This signal is emitted when traversed to other cell.

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.

int QicsScreenGrid::visibleColumns void   ) 
 

Returns the number of visible columns in the grid.

int QicsScreenGrid::visibleRows void   ) 
 

Returns the number of visible rows in the grid.


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.