#include <QicsDateTimeCellDisplay.h>
Inherits QDateTimeEdit, and QicsMovableEntryWidgetCellDisplay.
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 | QicsSelectCurrentCellPolicy { Follow = 0, Static } |
| enum | QicsFillHandleEventType { FillHandlePressed = 0, FillHandleReleased, FillHandleDoubleClicked, FillHandleDragged } |
| 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 } |
| enum | QicsCellWidthMode { ChangeOnlyHeight = 0, ChangeHeightWidth } |
| enum | QicsCellDecorationStyle { Flat = 0, Styled = 1 } |
Public Member Functions | |
| QicsDateTimeCellDisplay (QWidget *parent=0) | |
| virtual void | displayCell (QicsGrid *grid, int row, int col, const QicsDataItem *itm, QRect &rect, QPainter *painter) |
| virtual void | startEdit (QicsScreenGrid *, int row, int col, const QicsDataItem *itm) |
| QString | cellDisplayName () const |
| virtual QWidget * | widget () |
| virtual bool | isEmpty (QicsGridInfo *, int, int, const QicsDataItem *) const |
| virtual QSize | sizeHint (QicsGrid *grid, int row, int col, const QicsDataItem *itm) |
| virtual bool | handleMouseEvent (QicsScreenGrid *grid, int row, int col, QMouseEvent *me) |
| virtual bool | handleKeyEvent (QicsScreenGrid *grid, int row, int col, QKeyEvent *ke) |
| virtual void | focusOutEvent (QFocusEvent *) |
| void | contextMenuEvent (QContextMenuEvent *event) |
| QDomElement | toDomXml (const QString &tag, QDomDocument *doc) |
| void | configureFromDomXml (const QDomElement &) |
| virtual void | moveEdit (QicsScreenGrid *, int row, int col, const QRect &rect) |
| virtual void | endEdit (QicsScreenGrid *, int row, int col) |
| virtual bool | editWhenCurrent (void) const |
| virtual QicsCellDisplay * | clone () |
| virtual Qt::FocusReason | lastFocusReason () |
| bool | isEditing () |
| virtual bool | needsVisibilityNotification (void) const |
| virtual QString | tooltipText (QicsGridInfo *info, int row, int col, const QicsDataItem *itm, const QRect &rect) const |
| virtual void | drawCellBorders (QicsGridInfo *info, int row, int col, const QRect &rect, QPainter *painter) |
| virtual QRect | contentRect (QicsGrid *, int, int, const QicsDataItem *, QRect &rect, QPainter *) |
| virtual void | aboutToClear (QicsGridInfo *, int, int) |
Static Public Attributes | |
| static const QString | DateTimeCellDisplayName |
| static const QString | BasicCellDisplayName |
Protected Types | |
|
typedef QMap< QicsScreenGrid *, QicsEntryWidgetInfo * > | QicsEntryWidgetInfoPL |
Protected Slots | |
| virtual void | setValue (const QDateTime &val) |
| virtual void | setValue (const QDate &val) |
| virtual void | setValue (const QTime &val) |
Protected Member Functions | |
| virtual QWidget * | newEntryWidget (QicsScreenGrid *grid) |
| virtual void | keyPressEvent (QKeyEvent *ke) |
| virtual bool | eventFilter (QObject *obj, QEvent *event) |
| virtual QString | textToDisplay (QicsGridInfo *ginfo, int row, int col, const QicsDataItem *itm) const |
| QicsEntryWidgetInfo * | getInfoFromGrid (QicsScreenGrid *grid) |
| QicsEntryWidgetInfo * | getInfoFromEntry (const QWidget *widget) |
| QicsEntryWidgetInfo * | takeInfoFromGrid (QicsScreenGrid *grid) |
| virtual QRect | entryWidgetRect (QicsGridInfo *ginfo, int row, int col, QRect cell_rect) |
| void | celldisplay_init () |
| virtual void | drawBackground (QicsGridInfo *info, int row, int col, const QRect &rect, const QPalette &pal, QPainter *painter, bool is_current=false, bool is_selected=false) |
| virtual void | drawBorder (QicsGridInfo *info, int row, int col, const QRect &rect, const QPalette &pal, QPainter *painter, bool is_current=false, bool is_selected=false) |
| virtual bool | isCellSelected (QicsGridInfo *info, int row, int col) |
| virtual QPalette | cellPalette (QicsGridInfo *info, int row, int col, bool for_printer=false) |
| virtual QRect | displayableCellArea (QicsGridInfo *ginfo, int row, int col, const QRect &cr_full, bool consider_margin=true, bool consider_border=true) const |
| virtual QPixmap | pixmapToDisplay (QicsGridInfo *info, int row, int col, const QicsDataItem *itm) const |
| void | commonInit (QicsGrid *grid, int row, int col, const QicsDataItem *itm, QRect &rect, QPainter *painter, QWidget *wdg, bool draw_bg, bool consider_frame) |
Protected Attributes | |
| QicsEntryWidgetInfoPL | myEntryList |
| QPointer< QicsCell > | myCell |
| QPointer< QicsCell > | myEditCell |
| QPointer< QicsRow > | myRow |
| QPointer< QicsColumn > | myColumn |
| QPointer< QicsMainGrid > | myGrid |
| QPointer< QStyle > | myStyle |
| bool | myIsEditing |
| Qt::FocusReason | myLastFocusReason |
Static Protected Attributes | |
| static bool | for_printer |
| static bool | is_enabled |
| static bool | is_current |
| static bool | is_selected |
| static QicsGridInfo * | ginfo |
| static QStyle::State | style_flags |
| static QPalette | pal |
| static QRect | cr |
| static QColor | fg |
| static QColor | bg |
| static QStyle * | the_style |
| static QString | qs |
Private Attributes | |
| bool | myBlockSignals |
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::QicsSelectCurrentCellPolicy [inherited] |
enum Qics::QicsGridCellClipping [inherited] |
Denotes the policy for displaying text that is too long to fit in its cell.
enum Qics::QicsGridType [inherited] |
Specifies a type of grid object.
enum Qics::QicsHeaderType [inherited] |
Specifies the type of table header.
enum Qics::QicsIndexType [inherited] |
Specifies the type of table index.
enum Qics::QicsLineStyle [inherited] |
Denotes the style of lines and borders in the table widget.
enum Qics::QicsRepaintBehavior [inherited] |
Specifies the recalculation and repainting behavior of tables and grids.
enum Qics::QicsScrollBarMode [inherited] |
enum Qics::QicsScrollDirection [inherited] |
Denotes a direction for scrolling operations, or that an absolute scroll should occur.
enum Qics::QicsSelectionPolicy [inherited] |
Denotes the selection policy for the table.
enum Qics::QicsSortOrder [inherited] |
Specifies whenever ordering should be ascending or descending.
enum Qics::QicsTableDisplayOption [inherited] |
Specifies a printing display policy for elements of the table.
enum Qics::QicsTraversalKeyEditBehavior [inherited] |
Specifies the behavior of the traversal keys. (left, right, up, down, etc) while editing a cell.
enum Qics::QicsCurrentCellDraggingPolicy [inherited] |
Specifies the behavior of drag&drop operations when it has began from current cell.
enum Qics::QicsCellWidthMode [inherited] |
Specifies the behavior of set cell font.
enum Qics::QicsCellDecorationStyle [inherited] |
Specifies the cell decoration style for headers.
| QicsDateTimeCellDisplay::QicsDateTimeCellDisplay | ( | QWidget * | parent = 0 |
) |
Constructor for use by programmers.
| virtual void QicsDateTimeCellDisplay::displayCell | ( | QicsGrid * | grid, | |
| int | row, | |||
| int | col, | |||
| const QicsDataItem * | itm, | |||
| QRect & | rect, | |||
| QPainter * | painter | |||
| ) | [virtual] |
Displays the cell (row, col ) in grid widget grid. The cell will be displayed in region rect, using painter.
| grid | the controlling grid | |
| row | the row in visual coordinates | |
| col | the column in visual coordinates | |
| itm | the value to display. This value may be 0. | |
| rect | the rectangle to paint into | |
| painter | a painting context |
Implements QicsCellDisplay.
| virtual void QicsDateTimeCellDisplay::startEdit | ( | QicsScreenGrid * | , | |
| int | , | |||
| int | , | |||
| const QicsDataItem * | ||||
| ) | [virtual] |
Begin an edit operation in cell (row, col ). This method is intended to be used as a "preparation" for an edit operation. It will be called by the grid in response to a user action or a programmatic call. Note that this method does not specify a location in the grid widget for the edit operation to take place. The location will be specified in a subsequent call to moveEdit().
| grid | the controlling grid | |
| row | the row in visual coordinates | |
| col | the column in visual coordinates | |
| itm | the value to edit. This value may be 0. |
Reimplemented from QicsCellDisplay.
| QString QicsDateTimeCellDisplay::cellDisplayName | ( | ) | const [virtual] |
Returns displayer string name.
Reimplemented from QicsCellDisplay.
| virtual QWidget* QicsDateTimeCellDisplay::widget | ( | void | ) | [inline, virtual] |
Returns widget that cell displayer uses.
Reimplemented from QicsCellDisplay.
| virtual bool QicsDateTimeCellDisplay::isEmpty | ( | QicsGridInfo * | info, | |
| int | row, | |||
| int | col, | |||
| const QicsDataItem * | itm | |||
| ) | const [inline, virtual] |
Returns true if the contents of cell (row, col ) (given data item itm ) are empty, false otherwise.
| info | grid info object | |
| row | the row in visual coordinates | |
| col | the column in visual coordinates | |
| itm | item that will be displayed in the cell |
Implements QicsCellDisplay.
| virtual QSize QicsDateTimeCellDisplay::sizeHint | ( | QicsGrid * | grid, | |
| int | row, | |||
| int | col, | |||
| const QicsDataItem * | itm | |||
| ) | [virtual] |
Returns the size that cell (row, col ) needs to be if it is to completely display itm.
| grid | the controlling grid | |
| row | the row in visual coordinates | |
| col | the column in visual coordinates | |
| itm | the value to display. This value may be 0. |
Implements QicsCellDisplay.
| virtual bool QicsDateTimeCellDisplay::handleMouseEvent | ( | QicsScreenGrid * | grid, | |
| int | row, | |||
| int | col, | |||
| QMouseEvent * | me | |||
| ) | [virtual] |
Handler for mouse events that occur within cell (row, col ). The handler must return true if the event was handled by the cell displayer (and thus should not be handled by the grid), or false otherwise.
| grid | the controlling grid | |
| row | the row in visual coordinates | |
| col | the column in visual coordinates | |
| me | the mouse event |
Reimplemented from QicsCellDisplay.
| virtual bool QicsDateTimeCellDisplay::handleKeyEvent | ( | QicsScreenGrid * | grid, | |
| int | row, | |||
| int | col, | |||
| QKeyEvent * | ke | |||
| ) | [virtual] |
Handler for keyboard events that occur within cell (row, col ). The handler must return true if the event was handled by the cell displayer (and thus should not be handled by the grid), or false otherwise.
| grid | the controlling grid | |
| row | the row in visual coordinates | |
| col | the column in visual coordinates | |
| ke | the keyboard event |
Reimplemented from QicsCellDisplay.
| QDomElement QicsDateTimeCellDisplay::toDomXml | ( | const QString & | tag, | |
| QDomDocument * | doc | |||
| ) | [virtual] |
Helper function. Save displayer state to QDomDocument.
Reimplemented from QicsCellDisplay.
| void QicsDateTimeCellDisplay::configureFromDomXml | ( | const QDomElement & | e | ) | [virtual] |
Helper function. Restore displayer state from QDomElement.
Reimplemented from QicsCellDisplay.
| virtual QWidget* QicsDateTimeCellDisplay::newEntryWidget | ( | QicsScreenGrid * | grid | ) | [protected, virtual] |
Creates a new entry widget as a child of grid. When deriving from this class, you should implement this method so that it returns a new instance of the type of entry widget you want to use.
Implements QicsMovableEntryWidgetCellDisplay.
| virtual QString QicsDateTimeCellDisplay::textToDisplay | ( | QicsGridInfo * | info, | |
| int | row, | |||
| int | col, | |||
| const QicsDataItem * | itm | |||
| ) | const [protected, virtual] |
Same as previous but assumes that myCell is set already.
Returns the label string for cell (row, col ).
This default method returns the value of the label property of the cell.
This method is intended to be reimplemented by subclasses of QicsCheckCellDisplay. The programmer should implement this method so that it returns the appropriate value for the given cell.
| info | grid info object | |
| row | the visual row index of the cell | |
| col | the visual column index of the cell | |
| itm | the data item for this cell (this value may be 0) |
Reimplemented from QicsCellDisplay.
| virtual void QicsDateTimeCellDisplay::setValue | ( | const QDateTime & | val | ) | [protected, virtual, slot] |
Called when an item is selected in the DateTime edit
| virtual void QicsMovableEntryWidgetCellDisplay::moveEdit | ( | QicsScreenGrid * | grid, | |
| int | row, | |||
| int | col, | |||
| const QRect & | rect | |||
| ) | [virtual, inherited] |
This method is called by the grid widget when the cell currently being edited has changed location in the grid. This would most commonly occur when the table is scrolled while an edit operation is underway.
| grid | the controlling grid | |
| row | the row in visual coordinates | |
| col | the column in visual coordinates | |
| rect | the new location of the cell |
Implements QicsCellDisplay.
Reimplemented in QicsCheckCellDisplay, QicsComboCellDisplay, and QicsTextCellDisplay.
| virtual void QicsMovableEntryWidgetCellDisplay::endEdit | ( | QicsScreenGrid * | , | |
| int | , | |||
| int | ||||
| ) | [virtual, inherited] |
This method is called by the grid widget when an edit operation of a cell should be ended. This would most commonly occur when the user traverses out of the cell via keyboard or mouse action.
| grid | the controlling grid | |
| row | the row in visual coordinates | |
| col | the column in visual coordinates |
Reimplemented from QicsCellDisplay.
Reimplemented in QicsComboCellDisplay, and QicsTextCellDisplay.
| virtual bool QicsMovableEntryWidgetCellDisplay::editWhenCurrent | ( | void | ) | const [inline, virtual, inherited] |
Returns true if cells using this displayer should automatically be put into edit mode when they become the current cell in the table.
Implements QicsCellDisplay.
Reimplemented in QicsTextCellDisplay.
| QicsEntryWidgetInfo* QicsMovableEntryWidgetCellDisplay::getInfoFromGrid | ( | QicsScreenGrid * | grid | ) | [protected, inherited] |
Returns the entry widget information for the specified grid widget.
| QicsEntryWidgetInfo* QicsMovableEntryWidgetCellDisplay::getInfoFromEntry | ( | const QWidget * | widget | ) | [protected, inherited] |
Returns the entry widget information for the specified entry widget.
| virtual QRect QicsMovableEntryWidgetCellDisplay::entryWidgetRect | ( | QicsGridInfo * | ginfo, | |
| int | row, | |||
| int | col, | |||
| QRect | cell_rect | |||
| ) | [protected, virtual, inherited] |
Returns the rectangle which specifies the location and size for the entry widget to be placed.
| ginfo | grid info object | |
| row | the cell's row index | |
| col | the cell's column index | |
| cell_rect | the location and size of the cell to be edited |
Reimplemented in QicsCheckCellDisplay, and QicsPushButtonCellDisplay.
| bool QicsCellDisplay::isEditing | ( | ) | [inline, inherited] |
Returns true if cell displayer is editing now, otherwise returns false.
| virtual bool QicsCellDisplay::needsVisibilityNotification | ( | void | ) | const [inline, virtual, inherited] |
Returns true if this displayer should be notified when its cells are no longer visible in the grid, false otherwise.
Reimplemented in QicsWidgetCellDisplay.
| virtual QString QicsCellDisplay::tooltipText | ( | QicsGridInfo * | info, | |
| int | row, | |||
| int | col, | |||
| const QicsDataItem * | itm, | |||
| const QRect & | rect | |||
| ) | const [virtual, inherited] |
Returns the text that a grid widget can display in a tooltip when the user hovers the mouse pointer over this cell.
| info | grid info object | |
| row | the row in visual coordinates | |
| col | the column in visual coordinates | |
| itm | item that will be displayed in the cell | |
| rect | size of the cell |
Reimplemented in QicsTextCellDisplay.
| virtual void QicsCellDisplay::drawCellBorders | ( | QicsGridInfo * | info, | |
| int | row, | |||
| int | col, | |||
| const QRect & | rect, | |||
| QPainter * | painter | |||
| ) | [virtual, inherited] |
Draws the borders of cell (row, col ) (based on cell borders properties contained in info at the location specified by rect.
| info | grid info object | |
| row | the row in visual coordinates | |
| col | the column in visual coordinates | |
| rect | location to draw in | |
| painter | painter to draw with |
| virtual QRect QicsCellDisplay::contentRect | ( | QicsGrid * | , | |
| int | , | |||
| int | , | |||
| const QicsDataItem * | , | |||
| QRect & | rect, | |||
| QPainter * | ||||
| ) | [inline, virtual, inherited] |
Returns the full rect of the content of the displayer.
Reimplemented in QicsTextCellDisplay.
| virtual void QicsCellDisplay::aboutToClear | ( | QicsGridInfo * | , | |
| int | , | |||
| int | ||||
| ) | [inline, virtual, inherited] |
Called internally when the displayer is about to be cleared from the cell at row, col.
Reimplemented in QicsWidgetCellDisplay.
| virtual void QicsCellDisplay::drawBackground | ( | QicsGridInfo * | info, | |
| int | row, | |||
| int | col, | |||
| const QRect & | rect, | |||
| const QPalette & | pal, | |||
| QPainter * | painter, | |||
| bool | is_current = false, |
|||
| bool | is_selected = false | |||
| ) | [protected, virtual, inherited] |
Draws the background of cell (row, col ) using painter (based on cell and grid properties contained info) at the location specified by rect.
| info | grid info object | |
| row | the row in visual coordinates | |
| col | the column in visual coordinates | |
| rect | location to draw in | |
| pal | color group to draw with | |
| painter | painter to draw with | |
| is_current | is this cell the current cell? | |
| is_selected | is this cell selected? |
| virtual void QicsCellDisplay::drawBorder | ( | QicsGridInfo * | info, | |
| int | row, | |||
| int | col, | |||
| const QRect & | rect, | |||
| const QPalette & | pal, | |||
| QPainter * | painter, | |||
| bool | is_current = false, |
|||
| bool | is_selected = false | |||
| ) | [protected, virtual, inherited] |
Draws the border of cell (row, col ) (based on cell and grid properties contained in info at the location specified by rect.
| info | grid info object | |
| row | the row in visual coordinates | |
| col | the column in visual coordinates | |
| rect | location to draw in | |
| pal | color group to draw with | |
| painter | painter to draw with | |
| is_current | is this cell the current cell? | |
| is_selected | is this cell selected? |
| virtual bool QicsCellDisplay::isCellSelected | ( | QicsGridInfo * | info, | |
| int | row, | |||
| int | col | |||
| ) | [protected, virtual, inherited] |
Returns true if cell (row, col ) is selected in grids described by info. If the grid(s) are main table grids, this method simply determines if the cell is contained in the current selection list. If the grid(s) are header grids, this method determines if all the cells in the header cell's row or column are selected.
| info | grid info object | |
| row | the row in visual coordinates | |
| col | the column in visual coordinates |
| virtual QPalette QicsCellDisplay::cellPalette | ( | QicsGridInfo * | info, | |
| int | row, | |||
| int | col, | |||
| bool | for_printer = false | |||
| ) | [protected, virtual, inherited] |
Returns the palette to be used when drawing in cell (row, col ), using grid information from info. If for_printer is true, the palette will have a white background color substituted for any background colors that are the same as the default background color of the grid.
| info | grid info object | |
| row | the row in visual coordinates | |
| col | the column in visual coordinates | |
| for_printer | will this palette be used to print? |
| virtual QRect QicsCellDisplay::displayableCellArea | ( | QicsGridInfo * | ginfo, | |
| int | row, | |||
| int | col, | |||
| const QRect & | cr_full, | |||
| bool | consider_margin = true, |
|||
| bool | consider_border = true | |||
| ) | const [protected, virtual, inherited] |
Returns a rectangle specifying the area of cell (row, col ) that can be used to display information. This rectangle is based on the full area of the cell (contained in cr_full ), minus the area reserved for the cell's border and margin.
| info | grid info object | |
| row | the row in visual coordinates | |
| col | the column in visual coordinates | |
| cr_full | the full area of the cell | |
| consider_margin | should the returned area exclude the margin of the cell? | |
| consider_border | should the returned area exclude the border of the cell? |
| virtual QPixmap QicsCellDisplay::pixmapToDisplay | ( | QicsGridInfo * | info, | |
| int | row, | |||
| int | col, | |||
| const QicsDataItem * | itm | |||
| ) | const [protected, virtual, inherited] |
Returns the pixmap for cell (row, col ).
This default method returns the pixmap that was set for this cell via QicsCell::setPixmap , or 0 if no such pixmap exists.
This method is intended to be reimplemented by subclasses of QicsCheckCellDisplay. The programmer should implement this method so that it returns the appropriate value for the given cell. If no pixmap should be displayed, return the null pixmap.
| info | grid info object | |
| row | the visual row index of the cell | |
| col | the visual column index of the cell | |
| itm | the data item for this cell (this value may be 0) |