QGIS API Documentation
2.18.21-Las Palmas (9fba24a)
|
A class to display a table in the print composer, and allow the table to span over multiple frames. More...
#include <qgscomposertablev2.h>
Public Slots | |
void | recalculateFrameSizes () override |
virtual void | refreshAttributes () |
Refreshes the contents shown in the table by querying for new data. More... | |
Public Slots inherited from QgsComposerMultiFrame | |
void | recalculateFrameRects () |
Forces a recalculation of all the associated frame's scene rectangles. More... | |
virtual void | recalculateFrameSizes () |
Recalculates the portion of the multiframe item which is shown in each of it's component frames. More... | |
void | update () |
Forces a redraw of all child frames. More... | |
Public Slots inherited from QgsComposerObject | |
virtual void | refreshDataDefinedProperty (const DataDefinedProperty property=AllProperties, const QgsExpressionContext *context=nullptr) |
Refreshes a data defined property for the item by reevaluating the property's value and redrawing the item with this new value. More... | |
virtual void | repaint () |
Triggers a redraw for the item. More... | |
Public Member Functions | |
QgsComposerTableV2 (QgsComposition *composition, bool createUndoCommands) | |
QgsComposerTableV2 () | |
virtual | ~QgsComposerTableV2 () |
QColor | backgroundColor () const |
Returns the color used for the background of the table. More... | |
double | cellMargin () const |
Returns the margin distance between cell borders and their contents. More... | |
const QgsComposerTableStyle * | cellStyle (CellStyleGroup group) const |
Returns the cell style for a cell group. More... | |
QgsComposerTableColumns * | columns () |
Returns a pointer to the list of QgsComposerTableColumns shown in the table. More... | |
QFont | contentFont () const |
Returns the font used to draw text in table body cells. More... | |
QColor | contentFontColor () const |
Returns the color used to draw text in table body cells. More... | |
QgsComposerTableContents * | contents () |
Returns the current contents of the table. More... | |
EmptyTableMode | emptyTableBehaviour () const |
Returns the behaviour mode for empty tables. More... | |
QString | emptyTableMessage () const |
Returns the message for empty tables with no content rows. More... | |
virtual QSizeF | fixedFrameSize (const int frameIndex=-1) const override |
Returns the fixed size for a frame, if desired. More... | |
virtual bool | getTableContents (QgsComposerTableContents &contents)=0 |
Fetches the contents used for the cells in the table. More... | |
QColor | gridColor () const |
Returns the color used for grid lines in the table. More... | |
double | gridStrokeWidth () const |
Returns the width of grid lines in the table. More... | |
QFont | headerFont () const |
Returns the font used to draw header text in the table. More... | |
QColor | headerFontColor () const |
Returns the color used to draw header text in the table. More... | |
HeaderHAlignment | headerHAlignment () const |
Returns the horizontal alignment for table headers. More... | |
virtual QMap< int, QString > | headerLabels () const |
Returns the text used in the column headers for the table. More... | |
HeaderMode | headerMode () const |
Returns the display mode for headers in the table. More... | |
virtual QSizeF | minFrameSize (const int frameIndex=-1) const override |
Returns the minimum size for a frames, if desired. More... | |
virtual bool | readXML (const QDomElement &itemElem, const QDomDocument &doc, bool ignoreFrames=false) override |
Reads multiframe state information from a DOM element. More... | |
virtual void | render (QPainter *p, const QRectF &renderExtent, const int frameIndex) override |
Renders a portion of the multiframe's content into a painter. More... | |
void | setBackgroundColor (const QColor &color) |
Sets color used for background of table. More... | |
void | setCellMargin (const double margin) |
Sets the margin distance between cell borders and their contents. More... | |
void | setCellStyle (CellStyleGroup group, const QgsComposerTableStyle &style) |
Sets the cell style for a cell group. More... | |
void | setColumns (const QgsComposerTableColumns &columns) |
Replaces the columns in the table with a specified list of QgsComposerTableColumns. More... | |
void | setContentFont (const QFont &font) |
Sets the font used to draw text in table body cells. More... | |
void | setContentFontColor (const QColor &color) |
Sets the color used to draw text in table body cells. More... | |
void | setEmptyTableBehaviour (const EmptyTableMode mode) |
Sets the behaviour for empty tables with no content rows. More... | |
void | setEmptyTableMessage (const QString &message) |
Sets the message for empty tables with no content rows. More... | |
void | setGridColor (const QColor &color) |
Sets color used for grid lines in the table. More... | |
void | setGridStrokeWidth (const double width) |
Sets the width for grid lines in the table. More... | |
void | setHeaderFont (const QFont &font) |
Sets the font used to draw header text in the table. More... | |
void | setHeaderFontColor (const QColor &color) |
Sets the color used to draw header text in the table. More... | |
void | setHeaderHAlignment (const HeaderHAlignment alignment) |
Sets the horizontal alignment for table headers. More... | |
void | setHeaderMode (const HeaderMode mode) |
Sets the display mode for headers in the table. More... | |
void | setShowEmptyRows (const bool showEmpty) |
Sets whether empty rows should be drawn. More... | |
void | setShowGrid (const bool showGrid) |
Sets whether grid lines should be drawn in the table. More... | |
void | setWrapBehaviour (WrapBehaviour behaviour) |
Sets the wrap behaviour for the table, which controls how text within cells is automatically wrapped. More... | |
bool | showEmptyRows () const |
Returns whether empty rows are drawn in the table. More... | |
bool | showGrid () const |
Returns whether grid lines are drawn in the table. More... | |
virtual QSizeF | totalSize () const override |
Returns the total size of the multiframe's content. More... | |
WrapBehaviour | wrapBehaviour () const |
Returns the wrap behaviour for the table, which controls how text within cells is automatically wrapped. More... | |
virtual bool | writeXML (QDomElement &elem, QDomDocument &doc, bool ignoreFrames=false) const override |
Stores state information about multiframe in DOM element. More... | |
Public Member Functions inherited from QgsComposerMultiFrame | |
QgsComposerMultiFrame (QgsComposition *c, bool createUndoCommands) | |
Construct a new multiframe item. More... | |
virtual | ~QgsComposerMultiFrame () |
bool | _readXML (const QDomElement &itemElem, const QDomDocument &doc, bool ignoreFrames=false) |
Restores state information about base multiframe object from a DOM element. More... | |
bool | _writeXML (QDomElement &elem, QDomDocument &doc, bool ignoreFrames=false) const |
Stores state information about base multiframe object in DOM element. More... | |
virtual void | addFrame (QgsComposerFrame *frame, bool recalcFrameSizes=true)=0 |
Adds a frame to the multiframe. More... | |
QgsComposition * | composition () |
Returns the parent composition for the multiframe. More... | |
QgsComposerFrame * | createNewFrame (QgsComposerFrame *currentFrame, QPointF pos, QSizeF size) |
Creates a new frame and adds it to the multi frame and composition. More... | |
bool | createUndoCommands () const |
Returns whether undo commands should be created for interactions with the multiframe. More... | |
void | deleteFrames () |
Removes and deletes all child frames. More... | |
virtual QString | displayName () const |
Get multiframe display name. More... | |
virtual double | findNearbyPageBreak (double yPos) |
Finds the optimal position to break a frame at. More... | |
QgsComposerFrame * | frame (int i) const |
Returns a child frame from the multiframe. More... | |
int | frameCount () const |
Returns the number of frames associated with this multiframe. More... | |
int | frameIndex (QgsComposerFrame *frame) const |
Returns the index of a frame within the multiframe. More... | |
void | removeFrame (int i, const bool removeEmptyPages=false) |
Removes a frame from the multiframe. More... | |
virtual Q_DECL_DEPRECATED void | render (QPainter *p, const QRectF &renderExtent) |
Renders a portion of the multiframe's content into a painter. More... | |
ResizeMode | resizeMode () const |
Returns the resize mode for the multiframe. More... | |
void | setCreateUndoCommands (bool enabled) |
Sets whether undo commands should be created for interactions with the multiframe. More... | |
void | setResizeMode (ResizeMode mode) |
Sets the resize mode for the multiframe, and recalculates frame sizes to match. More... | |
Public Member Functions inherited from QgsComposerObject | |
QgsComposerObject (QgsComposition *composition) | |
Constructor. More... | |
virtual | ~QgsComposerObject () |
const QgsComposition * | composition () const |
Returns the composition the item is attached to. More... | |
QgsComposition * | composition () |
virtual QgsExpressionContext * | createExpressionContext () const |
Creates an expression context relating to the objects' current state. More... | |
QStringList | customProperties () const |
Return list of keys stored in custom properties for the object. More... | |
QVariant | customProperty (const QString &key, const QVariant &defaultValue=QVariant()) const |
Read a custom property from the object. More... | |
QgsDataDefined * | dataDefinedProperty (const DataDefinedProperty property) const |
Returns a reference to the data defined settings for one of the item's data defined properties. More... | |
virtual bool | readXML (const QDomElement &itemElem, const QDomDocument &doc) |
Sets item state from DOM element. More... | |
void | removeCustomProperty (const QString &key) |
Remove a custom property from the object. More... | |
void | setCustomProperty (const QString &key, const QVariant &value) |
Set a custom property for the object. More... | |
void | setDataDefinedProperty (const DataDefinedProperty property, const bool active, const bool useExpression, const QString &expression, const QString &field) |
Sets parameters for a data defined property for the item. More... | |
virtual bool | writeXML (QDomElement &elem, QDomDocument &doc) const |
Stores item state in DOM element. More... | |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const QObject *receiver, const char *method) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
Protected Member Functions | |
virtual bool | calculateMaxColumnWidths () |
Calculates the maximum width of text shown in columns. More... | |
virtual bool | calculateMaxRowHeights () |
Calculates the maximum height of text shown in rows. More... | |
bool | contentsContainsRow (const QgsComposerTableContents &contents, const QgsComposerTableRow &row) const |
Checks whether a table contents contains a given row. More... | |
void | drawHorizontalGridLines (QPainter *painter, int firstRow, int lastRow, bool drawHeaderLines) const |
Draws the horizontal grid lines for the table. More... | |
Q_DECL_DEPRECATED void | drawHorizontalGridLines (QPainter *painter, const int rows, const bool drawHeaderLines) const |
Draws the horizontal grid lines for the table. More... | |
void | drawVerticalGridLines (QPainter *painter, const QMap< int, double > &maxWidthMap, int firstRow, int lastRow, bool hasHeader, bool mergeCells=false) const |
Draws the vertical grid lines for the table. More... | |
Q_DECL_DEPRECATED void | drawVerticalGridLines (QPainter *painter, const QMap< int, double > &maxWidthMap, const int numberRows, const bool hasHeader, const bool mergeCells=false) const |
Draws the vertical grid lines for the table. More... | |
void | recalculateTableSize () |
Recalculates and updates the size of the table and all table frames. More... | |
QPair< int, int > | rowRange (const int frameIndex) const |
Calculates a range of rows which should be visible in a given frame. More... | |
Q_DECL_DEPRECATED QPair< int, int > | rowRange (const QRectF &extent, const int frameIndex) const |
Calculates a range of rows which should be visible in a given frame extent. More... | |
int | rowsVisible (double frameHeight, int firstRow, bool includeHeader, bool includeEmptyRows) const |
Calculates how many content rows would be visible within a frame of the specified height. More... | |
int | rowsVisible (int frameIndex, int firstRow, bool includeEmptyRows) const |
Calculates how many content rows are visible within a given frame. More... | |
Q_DECL_DEPRECATED int | rowsVisible (const int frameIndex) const |
Calculates how many content rows are visible within a given frame. More... | |
Q_DECL_DEPRECATED int | rowsVisible (const double frameHeight, const bool includeHeader) const |
Calculates how many content rows would be visible within a specified height. More... | |
double | totalHeight () |
Returns total height of table contents. More... | |
double | totalWidth () |
Returns total width of table contents. More... | |
Protected Member Functions inherited from QgsComposerObject | |
bool | dataDefinedEvaluate (const QgsComposerObject::DataDefinedProperty property, QVariant &expressionValue, const QgsExpressionContext &context=QgsExpressionContext()) const |
Evaluate a data defined property and return the calculated value. More... | |
Protected Member Functions inherited from QObject | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Protected Attributes | |
QColor | mBackgroundColor |
Color for table background. More... | |
double | mCellMargin |
Margin between cell borders and cell text. More... | |
QMap< CellStyleGroup, QgsComposerTableStyle *> | mCellStyles |
QgsComposerTableColumns | mColumns |
Columns to show in table. More... | |
QFont | mContentFont |
Table contents font. More... | |
QColor | mContentFontColor |
Table contents font color. More... | |
QString | mEmptyTableMessage |
String to show in empty tables. More... | |
EmptyTableMode | mEmptyTableMode |
Behaviour for empty tables. More... | |
QColor | mGridColor |
Color for grid lines. More... | |
double | mGridStrokeWidth |
Width of grid lines. More... | |
QFont | mHeaderFont |
Header font. More... | |
QColor | mHeaderFontColor |
Header font color. More... | |
HeaderHAlignment | mHeaderHAlignment |
Alignment for table headers. More... | |
HeaderMode | mHeaderMode |
Header display mode. More... | |
QMap< int, double > | mMaxColumnWidthMap |
Map of maximum width for each column. More... | |
QMap< int, double > | mMaxRowHeightMap |
Map of maximum height for each row. More... | |
bool | mShowEmptyRows |
True if empty rows should be shown in the table. More... | |
bool | mShowGrid |
True if grid should be shown. More... | |
QgsComposerTableContents | mTableContents |
Contents to show in table. More... | |
QSizeF | mTableSize |
WrapBehaviour | mWrapBehaviour |
Protected Attributes inherited from QgsComposerMultiFrame | |
bool | mCreateUndoCommands |
True: creates QgsMultiFrameCommands on internal changes (e.g. More... | |
QList< QgsComposerFrame * > | mFrameItems |
ResizeMode | mResizeMode |
Protected Attributes inherited from QgsComposerObject | |
QgsComposition * | mComposition |
QgsObjectCustomProperties | mCustomProperties |
Custom properties for object. More... | |
QMap< QgsComposerObject::DataDefinedProperty, QString > | mDataDefinedNames |
Map of data defined properties for the item to string name to use when exporting item to xml. More... | |
Friends | |
class | TestQgsComposerTableV2 |
Additional Inherited Members | |
Signals inherited from QgsComposerMultiFrame | |
void | changed () |
Emitted when the properties of a multi frame have changed, and the GUI item widget must be updated. More... | |
void | contentsChanged () |
Emitted when the contents of the multi frame have changed and the frames must be redrawn. More... | |
Signals inherited from QgsComposerObject | |
void | itemChanged () |
Emitted when the item changes. More... | |
Static Public Member Functions inherited from QObject | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Protected Slots inherited from QgsComposerMultiFrame | |
void | handleFrameRemoval (QgsComposerItem *item) |
Called before a frame is going to be removed. More... | |
void | handlePageChange () |
Adapts to changed number of composition pages if resize type is RepeatOnEveryPage. More... | |
Static Protected Member Functions inherited from QObject | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
Properties inherited from QObject | |
objectName | |
A class to display a table in the print composer, and allow the table to span over multiple frames.
Definition at line 90 of file qgscomposertablev2.h.
Row or column groups for cell styling.
Definition at line 134 of file qgscomposertablev2.h.
Controls how empty tables are displayed.
Enumerator | |
---|---|
HeadersOnly | show header rows only |
HideTable | hides entire table if empty |
ShowMessage | shows preset message instead of table contents |
Definition at line 117 of file qgscomposertablev2.h.
Controls how headers are horizontally aligned in a table.
Enumerator | |
---|---|
FollowColumn | header uses the same alignment as the column |
HeaderLeft | align headers left |
HeaderCenter | align headers to center |
HeaderRight | align headers right |
Definition at line 98 of file qgscomposertablev2.h.
Controls where headers are shown in the table.
Enumerator | |
---|---|
FirstFrame | header shown on first frame only |
AllFrames | headers shown on all frames |
NoHeaders | no headers shown for table |
Definition at line 108 of file qgscomposertablev2.h.
Controls how long strings in the table are handled.
Definition at line 126 of file qgscomposertablev2.h.
QgsComposerTableV2::QgsComposerTableV2 | ( | QgsComposition * | composition, |
bool | createUndoCommands | ||
) |
Definition at line 49 of file qgscomposertablev2.cpp.
QgsComposerTableV2::QgsComposerTableV2 | ( | ) |
Definition at line 82 of file qgscomposertablev2.cpp.
|
virtual |
Definition at line 100 of file qgscomposertablev2.cpp.
|
inline |
Returns the color used for the background of the table.
Definition at line 353 of file qgscomposertablev2.h.
|
protectedvirtual |
Calculates the maximum width of text shown in columns.
Definition at line 903 of file qgscomposertablev2.cpp.
|
protectedvirtual |
Calculates the maximum height of text shown in rows.
Definition at line 978 of file qgscomposertablev2.cpp.
|
inline |
Returns the margin distance between cell borders and their contents.
Definition at line 162 of file qgscomposertablev2.h.
const QgsComposerTableStyle * QgsComposerTableV2::cellStyle | ( | QgsComposerTableV2::CellStyleGroup | group | ) | const |
Returns the cell style for a cell group.
group | group to retrieve style for |
Definition at line 821 of file qgscomposertablev2.cpp.
|
inline |
Returns a pointer to the list of QgsComposerTableColumns shown in the table.
Definition at line 375 of file qgscomposertablev2.h.
|
inline |
Returns the font used to draw text in table body cells.
Definition at line 275 of file qgscomposertablev2.h.
|
inline |
Returns the color used to draw text in table body cells.
Definition at line 291 of file qgscomposertablev2.h.
|
inline |
Returns the current contents of the table.
Excludes header cells.
Definition at line 416 of file qgscomposertablev2.h.
|
protected |
Checks whether a table contents contains a given row.
contents | table contents to check |
row | row to check for |
Definition at line 1321 of file qgscomposertablev2.cpp.
|
protected |
Draws the horizontal grid lines for the table.
painter | destination painter for grid lines |
firstRow | index corresponding to first row shown in frame |
lastRow | index corresponding to last row shown in frame. If greater than the number of content rows in the table, then the default row height will be used for the remaining rows. |
drawHeaderLines | set to true to include for the table header |
Definition at line 1133 of file qgscomposertablev2.cpp.
|
protected |
Draws the horizontal grid lines for the table.
painter | destination painter for grid lines |
rows | number of rows shown in table |
drawHeaderLines | set to true to include for the table header |
Definition at line 1127 of file qgscomposertablev2.cpp.
|
protected |
Draws the vertical grid lines for the table.
painter | destination painter for grid lines |
maxWidthMap | QMap of int to double, where the int contains the column number and the double is the maximum width of text present in the column. |
firstRow | index corresponding to first row shown in frame |
lastRow | index corresponding to last row shown in frame. If greater than the number of content rows in the table, then the default row height will be used for the remaining rows. |
hasHeader | set to true if table frame includes header cells |
mergeCells | set to true to merge table content cells |
Definition at line 1265 of file qgscomposertablev2.cpp.
|
protected |
Draws the vertical grid lines for the table.
painter | destination painter for grid lines |
maxWidthMap | QMap of int to double, where the int contains the column number and the double is the maximum width of text present in the column. |
numberRows | number of rows of content in table frame |
hasHeader | set to true if table frame includes header cells |
mergeCells | set to true to merge table content cells |
Definition at line 1161 of file qgscomposertablev2.cpp.
|
inline |
Returns the behaviour mode for empty tables.
This property controls how the table is drawn if it contains no content rows.
Definition at line 175 of file qgscomposertablev2.h.
|
inline |
Returns the message for empty tables with no content rows.
This message is displayed in the table body if the empty table behaviour is set to ShowMessage
Definition at line 193 of file qgscomposertablev2.h.
|
overridevirtual |
Returns the fixed size for a frame, if desired.
If the fixed frame size changes, the sizes of all frames can be recalculated by calling recalculateFrameRects().
frameIndex | frame number |
Reimplemented from QgsComposerMultiFrame.
Definition at line 843 of file qgscomposertablev2.cpp.
|
pure virtual |
Fetches the contents used for the cells in the table.
contents | QgsComposerTableContents to store retrieved row data in |
Implemented in QgsComposerAttributeTableV2, and QgsComposerTextTableV2.
|
inline |
Returns the color used for grid lines in the table.
Definition at line 339 of file qgscomposertablev2.h.
|
inline |
Returns the width of grid lines in the table.
Definition at line 323 of file qgscomposertablev2.h.
|
inline |
Returns the font used to draw header text in the table.
Definition at line 219 of file qgscomposertablev2.h.
|
inline |
Returns the color used to draw header text in the table.
Definition at line 235 of file qgscomposertablev2.h.
|
inline |
Returns the horizontal alignment for table headers.
Definition at line 247 of file qgscomposertablev2.h.
Returns the text used in the column headers for the table.
Definition at line 829 of file qgscomposertablev2.cpp.
|
inline |
Returns the display mode for headers in the table.
This property controls if and where headers are shown in the table.
Definition at line 261 of file qgscomposertablev2.h.
|
overridevirtual |
Returns the minimum size for a frames, if desired.
If the minimum size changes, the sizes of all frames can be recalculated by calling recalculateFrameRects().
frameIndex | frame number |
Reimplemented from QgsComposerMultiFrame.
Definition at line 849 of file qgscomposertablev2.cpp.
|
overridevirtual |
Reads multiframe state information from a DOM element.
Implementations of readXML should also call the _readXML method to restore general multiframe properties.
itemElem | is DOM element |
doc | is the DOM document |
ignoreFrames | set to false to avoid read state information about child frames from DOM |
Implements QgsComposerMultiFrame.
Reimplemented in QgsComposerAttributeTableV2.
Definition at line 154 of file qgscomposertablev2.cpp.
|
overrideslot |
Definition at line 874 of file qgscomposertablev2.cpp.
|
protected |
Recalculates and updates the size of the table and all table frames.
Definition at line 1312 of file qgscomposertablev2.cpp.
|
virtualslot |
Refreshes the contents shown in the table by querying for new data.
This also causes the column widths and size of the table to change to accommodate the new data.
Definition at line 861 of file qgscomposertablev2.cpp.
|
overridevirtual |
Renders a portion of the multiframe's content into a painter.
painter | destination painter |
renderExtent | visible extent of content to render into the painter. |
frameIndex | frame number for content |
Reimplemented from QgsComposerMultiFrame.
Definition at line 365 of file qgscomposertablev2.cpp.
|
protected |
Calculates a range of rows which should be visible in a given frame.
frameIndex | index number for frame |
Definition at line 333 of file qgscomposertablev2.cpp.
|
protected |
Calculates a range of rows which should be visible in a given frame extent.
extent | visible extent |
frameIndex | index number for frame |
Definition at line 358 of file qgscomposertablev2.cpp.
|
protected |
Calculates how many content rows would be visible within a frame of the specified height.
frameHeight | height of frame |
firstRow | index of first row visible in frame (where 0 = first row in table) |
includeHeader | set to true if frame would include a header row |
includeEmptyRows | set to true to also include rows which would be empty in the returned count. For instance, if the frame would include all table content rows and have space left for extra rows then setting this parameter to true would also include a count of these extra blank rows. |
Definition at line 278 of file qgscomposertablev2.cpp.
|
protected |
Calculates how many content rows are visible within a given frame.
frameIndex | index number for frame |
firstRow | index of first row visible in frame (where 0 = first row in table) |
includeEmptyRows | set to true to also include rows which would be empty in the returned count. For instance, if the frame would include all table content rows and have space left for extra rows then setting this parameter to true would also include a count of these extra blank rows. |
Definition at line 315 of file qgscomposertablev2.cpp.
|
protected |
Calculates how many content rows are visible within a given frame.
frameIndex | index number for frame |
Definition at line 235 of file qgscomposertablev2.cpp.
|
protected |
Calculates how many content rows would be visible within a specified height.
frameHeight | height of frame |
includeHeader | set to true if frame would include a header row |
Definition at line 255 of file qgscomposertablev2.cpp.
void QgsComposerTableV2::setBackgroundColor | ( | const QColor & | color | ) |
Sets color used for background of table.
color | table background color |
Definition at line 778 of file qgscomposertablev2.cpp.
void QgsComposerTableV2::setCellMargin | ( | const double | margin | ) |
Sets the margin distance between cell borders and their contents.
margin | margin for cell contents |
Definition at line 600 of file qgscomposertablev2.cpp.
void QgsComposerTableV2::setCellStyle | ( | QgsComposerTableV2::CellStyleGroup | group, |
const QgsComposerTableStyle & | style | ||
) |
Sets the cell style for a cell group.
group | group to set style for |
style | new cell style |
Definition at line 813 of file qgscomposertablev2.cpp.
void QgsComposerTableV2::setColumns | ( | const QgsComposerTableColumns & | columns | ) |
Replaces the columns in the table with a specified list of QgsComposerTableColumns.
columns | list of QgsComposerTableColumns to show in table. Ownership of columns is transferred to the table. |
Definition at line 804 of file qgscomposertablev2.cpp.
void QgsComposerTableV2::setContentFont | ( | const QFont & | font | ) |
Sets the font used to draw text in table body cells.
font | font for table cells |
Definition at line 710 of file qgscomposertablev2.cpp.
void QgsComposerTableV2::setContentFontColor | ( | const QColor & | color | ) |
Sets the color used to draw text in table body cells.
color | table cell text color |
Definition at line 724 of file qgscomposertablev2.cpp.
void QgsComposerTableV2::setEmptyTableBehaviour | ( | const EmptyTableMode | mode | ) |
Sets the behaviour for empty tables with no content rows.
mode | behaviour mode for empty tables |
Definition at line 615 of file qgscomposertablev2.cpp.
void QgsComposerTableV2::setEmptyTableMessage | ( | const QString & | message | ) |
Sets the message for empty tables with no content rows.
This message is displayed in the table body if the empty table behaviour is set to ShowMessage
message | message to show for empty tables |
Definition at line 630 of file qgscomposertablev2.cpp.
void QgsComposerTableV2::setGridColor | ( | const QColor & | color | ) |
Sets color used for grid lines in the table.
color | grid line color |
Definition at line 765 of file qgscomposertablev2.cpp.
void QgsComposerTableV2::setGridStrokeWidth | ( | const double | width | ) |
Sets the width for grid lines in the table.
width | grid line width |
Definition at line 751 of file qgscomposertablev2.cpp.
void QgsComposerTableV2::setHeaderFont | ( | const QFont & | font | ) |
Sets the font used to draw header text in the table.
font | font for header cells |
Definition at line 657 of file qgscomposertablev2.cpp.
void QgsComposerTableV2::setHeaderFontColor | ( | const QColor & | color | ) |
Sets the color used to draw header text in the table.
color | header text color |
Definition at line 671 of file qgscomposertablev2.cpp.
void QgsComposerTableV2::setHeaderHAlignment | ( | const HeaderHAlignment | alignment | ) |
Sets the horizontal alignment for table headers.
alignment | Horizontal alignment for table header cells |
Definition at line 684 of file qgscomposertablev2.cpp.
void QgsComposerTableV2::setHeaderMode | ( | const HeaderMode | mode | ) |
Sets the display mode for headers in the table.
This property controls if and where headers are shown in the table.
mode | display mode for headers |
Definition at line 697 of file qgscomposertablev2.cpp.
void QgsComposerTableV2::setShowEmptyRows | ( | const bool | showEmpty | ) |
Sets whether empty rows should be drawn.
Tables default to hiding empty rows.
showEmpty | set to true to show empty rows in the table |
Definition at line 645 of file qgscomposertablev2.cpp.
void QgsComposerTableV2::setShowGrid | ( | const bool | showGrid | ) |
Sets whether grid lines should be drawn in the table.
showGrid | set to true to show grid lines |
Definition at line 737 of file qgscomposertablev2.cpp.
void QgsComposerTableV2::setWrapBehaviour | ( | QgsComposerTableV2::WrapBehaviour | behaviour | ) |
Sets the wrap behaviour for the table, which controls how text within cells is automatically wrapped.
behaviour | wrap behaviour |
Definition at line 791 of file qgscomposertablev2.cpp.
|
inline |
Returns whether empty rows are drawn in the table.
Definition at line 205 of file qgscomposertablev2.h.
|
inline |
Returns whether grid lines are drawn in the table.
Definition at line 307 of file qgscomposertablev2.h.
|
protected |
Returns total height of table contents.
Definition at line 1056 of file qgscomposertablev2.cpp.
|
overridevirtual |
Returns the total size of the multiframe's content.
Implements QgsComposerMultiFrame.
Definition at line 230 of file qgscomposertablev2.cpp.
|
protected |
Returns total width of table contents.
Definition at line 1035 of file qgscomposertablev2.cpp.
|
inline |
Returns the wrap behaviour for the table, which controls how text within cells is automatically wrapped.
Definition at line 369 of file qgscomposertablev2.h.
|
overridevirtual |
Stores state information about multiframe in DOM element.
Implementations of writeXML should also call the _writeXML method to save general multiframe properties.
elem | is DOM element |
doc | is the DOM document |
ignoreFrames | set to false to avoid writing state information about child frames into DOM |
Implements QgsComposerMultiFrame.
Reimplemented in QgsComposerAttributeTableV2.
Definition at line 109 of file qgscomposertablev2.cpp.
|
friend |
Definition at line 663 of file qgscomposertablev2.h.
|
protected |
Color for table background.
Definition at line 481 of file qgscomposertablev2.h.
|
protected |
Margin between cell borders and cell text.
Definition at line 442 of file qgscomposertablev2.h.
|
protected |
Definition at line 499 of file qgscomposertablev2.h.
|
protected |
Columns to show in table.
Definition at line 484 of file qgscomposertablev2.h.
|
protected |
Table contents font.
Definition at line 466 of file qgscomposertablev2.h.
|
protected |
Table contents font color.
Definition at line 469 of file qgscomposertablev2.h.
|
protected |
String to show in empty tables.
Definition at line 448 of file qgscomposertablev2.h.
|
protected |
Behaviour for empty tables.
Definition at line 445 of file qgscomposertablev2.h.
|
protected |
Color for grid lines.
Definition at line 478 of file qgscomposertablev2.h.
|
protected |
Width of grid lines.
Definition at line 475 of file qgscomposertablev2.h.
|
protected |
Header font.
Definition at line 454 of file qgscomposertablev2.h.
|
protected |
Header font color.
Definition at line 457 of file qgscomposertablev2.h.
|
protected |
Alignment for table headers.
Definition at line 460 of file qgscomposertablev2.h.
|
protected |
Header display mode.
Definition at line 463 of file qgscomposertablev2.h.
|
protected |
Map of maximum width for each column.
Definition at line 490 of file qgscomposertablev2.h.
|
protected |
Map of maximum height for each row.
Definition at line 493 of file qgscomposertablev2.h.
|
protected |
True if empty rows should be shown in the table.
Definition at line 451 of file qgscomposertablev2.h.
|
protected |
True if grid should be shown.
Definition at line 472 of file qgscomposertablev2.h.
|
protected |
Contents to show in table.
Definition at line 487 of file qgscomposertablev2.h.
|
protected |
Definition at line 495 of file qgscomposertablev2.h.
|
protected |
Definition at line 497 of file qgscomposertablev2.h.