QGIS API Documentation  2.8.2-Wien
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Slots | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
QgsComposerTableV2 Class Reference

A class to display a table in the print composer, and allow the table to span over multiple frames. More...

#include <qgscomposertablev2.h>

Inheritance diagram for QgsComposerTableV2:
Inheritance graph
[legend]

Public Types

enum  EmptyTableMode { HeadersOnly = 0, HideTable, ShowMessage }
enum  HeaderHAlignment { FollowColumn, HeaderLeft, HeaderCenter, HeaderRight }
enum  HeaderMode { FirstFrame = 0, AllFrames, NoHeaders }
- Public Types inherited from QgsComposerMultiFrame
enum  ResizeMode { UseExistingFrames = 0, ExtendToNextPage, RepeatOnEveryPage, RepeatUntilFinished }
- Public Types inherited from QgsComposerObject
enum  DataDefinedProperty {
  NoProperty = 0, AllProperties, TestProperty, PresetPaperSize,
  PaperWidth, PaperHeight, NumPages, PaperOrientation,
  PageNumber, PositionX, PositionY, ItemWidth,
  ItemHeight, ItemRotation, Transparency, BlendMode,
  ExcludeFromExports, MapRotation, MapScale, MapXMin,
  MapYMin, MapXMax, MapYMax, MapAtlasMargin,
  PictureSource, SourceUrl
}
 Data defined properties for different item types. More...
enum  PropertyValueType { EvaluatedValue = 0, OriginalValue }
 Specifies whether the value returned by a function should be the original, user set value, or the current evaluated value for the property. More...

Public Slots

void recalculateFrameSizes () override
virtual void refreshAttributes ()
 Refreshes the contents shown in the table by querying for new data.
- Public Slots inherited from QgsComposerMultiFrame
void recalculateFrameRects ()
 Forces a recalculation of all the associated frame's scene rectangles.
virtual void recalculateFrameSizes ()
 Recalculates the portion of the multiframe item which is shown in each of it's component frames.
void update ()
 Forces a redraw of all child frames.
- Public Slots inherited from QgsComposerObject
virtual void refreshDataDefinedProperty (const DataDefinedProperty property=AllProperties)
 Refreshes a data defined property for the item by reevaluating the property's value and redrawing the item with this new value.
virtual void repaint ()
 Triggers a redraw for the item.

Public Member Functions

 QgsComposerTableV2 (QgsComposition *composition, bool createUndoCommands)
 QgsComposerTableV2 ()
virtual ~QgsComposerTableV2 ()
QColor backgroundColor () const
 Returns the color used for the background of the table.
double cellMargin () const
 Returns the margin distance between cell borders and their contents.
QgsComposerTableColumnscolumns ()
 Returns a pointer to the list of QgsComposerTableColumns shown in the table.
QFont contentFont () const
 Returns the font used to draw text in table body cells.
QColor contentFontColor () const
 Returns the color used to draw text in table body cells.
QgsComposerTableContentscontents ()
 Returns the current contents of the table.
EmptyTableMode emptyTableBehaviour () const
 Returns the behaviour mode for empty tables.
QString emptyTableMessage () const
 Returns the message for empty tables with no content rows.
virtual QSizeF fixedFrameSize (const int frameIndex=-1) const override
 Returns the fixed size for a frame, if desired.
virtual bool getTableContents (QgsComposerTableContents &contents)=0
 Fetches the contents used for the cells in the table.
QColor gridColor () const
 Returns the color used for grid lines in the table.
double gridStrokeWidth () const
 Returns the width of grid lines in the table.
QFont headerFont () const
 Returns the font used to draw header text in the table.
QColor headerFontColor () const
 Returns the color used to draw header text in the table.
HeaderHAlignment headerHAlignment () const
 Returns the horizontal alignment for table headers.
virtual QMap< int, QString > headerLabels () const
 Returns the text used in the column headers for the table.
HeaderMode headerMode () const
 Returns the display mode for headers in the table.
virtual QSizeF minFrameSize (const int frameIndex=-1) const override
 Returns the minimum size for a frames, if desired.
virtual bool readXML (const QDomElement &itemElem, const QDomDocument &doc, bool ignoreFrames=false) override
 Reads multiframe state information from a DOM element.
virtual void render (QPainter *p, const QRectF &renderExtent, const int frameIndex) override
 Renders a portion of the multiframe's content into a painter.
void setBackgroundColor (const QColor &color)
 Sets color used for background of table.
void setCellMargin (const double margin)
 Sets the margin distance between cell borders and their contents.
void setColumns (QgsComposerTableColumns columns)
 Replaces the columns in the table with a specified list of QgsComposerTableColumns.
void setContentFont (const QFont &font)
 Sets the font used to draw text in table body cells.
void setContentFontColor (const QColor &color)
 Sets the color used to draw text in table body cells.
void setEmptyTableBehaviour (const EmptyTableMode mode)
 Sets the behaviour for empty tables with no content rows.
void setEmptyTableMessage (const QString message)
 Sets the message for empty tables with no content rows.
void setGridColor (const QColor &color)
 Sets color used for grid lines in the table.
void setGridStrokeWidth (const double width)
 Sets the width for grid lines in the table.
void setHeaderFont (const QFont &font)
 Sets the font used to draw header text in the table.
void setHeaderFontColor (const QColor &color)
 Sets the color used to draw header text in the table.
void setHeaderHAlignment (const HeaderHAlignment alignment)
 Sets the horizontal alignment for table headers.
void setHeaderMode (const HeaderMode mode)
 Sets the display mode for headers in the table.
void setShowEmptyRows (const bool showEmpty)
 Sets whether empty rows should be drawn.
void setShowGrid (const bool showGrid)
 Sets whether grid lines should be drawn in the table.
bool showEmptyRows () const
 Returns whether empty rows are drawn in the table.
bool showGrid () const
 Returns whether grid lines are drawn in the table.
virtual QSizeF totalSize () const override
 Returns the total size of the multiframe's content.
virtual bool writeXML (QDomElement &elem, QDomDocument &doc, bool ignoreFrames=false) const override
 Stores state information about multiframe in DOM element.
- Public Member Functions inherited from QgsComposerMultiFrame
 QgsComposerMultiFrame (QgsComposition *c, bool createUndoCommands)
 Construct a new multiframe item.
virtual ~QgsComposerMultiFrame ()
bool _readXML (const QDomElement &itemElem, const QDomDocument &doc, bool ignoreFrames=false)
 Restores state information about base multiframe object from a DOM element.
bool _writeXML (QDomElement &elem, QDomDocument &doc, bool ignoreFrames=false) const
 Stores state information about base multiframe object in DOM element.
virtual void addFrame (QgsComposerFrame *frame, bool recalcFrameSizes=true)=0
 Adds a frame to the multiframe.
QgsCompositioncomposition ()
 Returns the parent composition for the multiframe.
QgsComposerFramecreateNewFrame (QgsComposerFrame *currentFrame, QPointF pos, QSizeF size)
 Creates a new frame and adds it to the multi frame and composition.
bool createUndoCommands () const
 Returns whether undo commands should be created for interactions with the multiframe.
void deleteFrames ()
 Removes and deletes all child frames.
virtual QString displayName () const
 Get multiframe display name.
virtual double findNearbyPageBreak (double yPos)
 Finds the optimal position to break a frame at.
QgsComposerFrameframe (int i) const
 Returns a child frame from the multiframe.
int frameCount () const
 Returns the number of frames associated with this multiframe.
int frameIndex (QgsComposerFrame *frame) const
 Returns the index of a frame within the multiframe.
void removeFrame (int i, const bool removeEmptyPages=false)
 Removes a frame from the multiframe.
virtual Q_DECL_DEPRECATED void render (QPainter *p, const QRectF &renderExtent)
 Renders a portion of the multiframe's content into a painter.
ResizeMode resizeMode () const
 Returns the resize mode for the multiframe.
void setCreateUndoCommands (bool enabled)
 Sets whether undo commands should be created for interactions with the multiframe.
void setResizeMode (ResizeMode mode)
 Sets the resize mode for the multiframe, and recalculates frame sizes to match.
- Public Member Functions inherited from QgsComposerObject
 QgsComposerObject (QgsComposition *composition)
 Constructor.
virtual ~QgsComposerObject ()
const QgsCompositioncomposition () const
 Returns the composition the item is attached to.
QgsDataDefineddataDefinedProperty (const DataDefinedProperty property) const
 Returns a reference to the data defined settings for one of the item's data defined properties.
virtual bool readXML (const QDomElement &itemElem, const QDomDocument &doc)
 Sets item state from DOM element.
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.
virtual bool writeXML (QDomElement &elem, QDomDocument &doc) const
 Stores item state in DOM element.

Protected Member Functions

virtual bool calculateMaxColumnWidths ()
 Calculates the maximum width of text shown in columns.
bool contentsContainsRow (const QgsComposerTableContents &contents, const QgsComposerTableRow &row) const
 Checks whether a table contents contains a given row.
void drawHorizontalGridLines (QPainter *painter, const int rows, const bool drawHeaderLines) const
 Draws the horizontal grid lines for the table.
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.
void recalculateTableSize ()
 Recalculates and updates the size of the table and all table frames.
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.
int rowsVisible (const int frameIndex) const
 Calculates how many content rows are visible within a given frame.
int rowsVisible (const double frameHeight, const bool includeHeader) const
 Calculates how many content rows would be visible within a specified height.
double totalHeight () const
 Returns total height of table contents.
double totalWidth ()
 Returns total width of table contents.

Protected Attributes

QColor mBackgroundColor
 Color for table background.
double mCellMargin
 Margin between cell borders and cell text.
QgsComposerTableColumns mColumns
 Columns to show in table.
QFont mContentFont
 Table contents font.
QColor mContentFontColor
 Table contents font color.
QString mEmptyTableMessage
 String to show in empty tables.
EmptyTableMode mEmptyTableMode
 Behaviour for empty tables.
QColor mGridColor
 Color for grid lines.
double mGridStrokeWidth
 Width of grid lines.
QFont mHeaderFont
 Header font.
QColor mHeaderFontColor
 Header font color.
HeaderHAlignment mHeaderHAlignment
 Alignment for table headers.
HeaderMode mHeaderMode
 Header display mode.
QMap< int, double > mMaxColumnWidthMap
 Map of maximum width for each column.
bool mShowEmptyRows
 True if empty rows should be shown in the table.
bool mShowGrid
 True if grid should be shown.
QgsComposerTableContents mTableContents
 Contents to show in table.
QSizeF mTableSize
- Protected Attributes inherited from QgsComposerMultiFrame
bool mCreateUndoCommands
 True: creates QgsMultiFrameCommands on internal changes (e.g.
QList< QgsComposerFrame * > mFrameItems
ResizeMode mResizeMode
- Protected Attributes inherited from QgsComposerObject
QgsCompositionmComposition
QMap
< QgsComposerObject::DataDefinedProperty,
QString > 
mDataDefinedNames
 Map of data defined properties for the item to string name to use when exporting item to xml.

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.
void contentsChanged ()
 Emitted when the contents of the multi frame have changed and the frames must be redrawn.
- Protected Slots inherited from QgsComposerMultiFrame
void handleFrameRemoval (QgsComposerItem *item)
 Called before a frame is going to be removed.
void handlePageChange ()
 Adapts to changed number of composition pages if resize type is RepeatOnEveryPage.

Detailed Description

A class to display a table in the print composer, and allow the table to span over multiple frames.

Note
added in QGIS 2.5

Definition at line 49 of file qgscomposertablev2.h.

Member Enumeration Documentation

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 76 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 57 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 67 of file qgscomposertablev2.h.

Constructor & Destructor Documentation

QgsComposerTableV2::QgsComposerTableV2 ( QgsComposition composition,
bool  createUndoCommands 
)

Definition at line 24 of file qgscomposertablev2.cpp.

QgsComposerTableV2::QgsComposerTableV2 ( )

Definition at line 54 of file qgscomposertablev2.cpp.

QgsComposerTableV2::~QgsComposerTableV2 ( )
virtual

Definition at line 71 of file qgscomposertablev2.cpp.

Member Function Documentation

QColor QgsComposerTableV2::backgroundColor ( ) const
inline

Returns the color used for the background of the table.

Returns
table background color
See Also
setBackgroundColor
gridColor

Definition at line 289 of file qgscomposertablev2.h.

bool QgsComposerTableV2::calculateMaxColumnWidths ( )
protectedvirtual

Calculates the maximum width of text shown in columns.

Definition at line 666 of file qgscomposertablev2.cpp.

double QgsComposerTableV2::cellMargin ( ) const
inline

Returns the margin distance between cell borders and their contents.

Returns
margin for cell contents
See Also
setCellMargin

Definition at line 98 of file qgscomposertablev2.h.

QgsComposerTableColumns* QgsComposerTableV2::columns ( )
inline

Returns a pointer to the list of QgsComposerTableColumns shown in the table.

Returns
pointer to list of columns in table
See Also
setColumns

Definition at line 295 of file qgscomposertablev2.h.

QFont QgsComposerTableV2::contentFont ( ) const
inline

Returns the font used to draw text in table body cells.

Returns
font for table cells
See Also
setContentFont
headerFont

Definition at line 211 of file qgscomposertablev2.h.

QColor QgsComposerTableV2::contentFontColor ( ) const
inline

Returns the color used to draw text in table body cells.

Returns
text color for table cells
See Also
setContentFontColor
contentFont
headerFontColor

Definition at line 227 of file qgscomposertablev2.h.

QgsComposerTableContents* QgsComposerTableV2::contents ( )
inline

Returns the current contents of the table.

Excludes header cells.

Returns
table contents

Definition at line 320 of file qgscomposertablev2.h.

bool QgsComposerTableV2::contentsContainsRow ( const QgsComposerTableContents contents,
const QgsComposerTableRow row 
) const
protected

Checks whether a table contents contains a given row.

Parameters
contentstable contents to check
rowrow to check for
Returns
true if contents contains rows

Definition at line 865 of file qgscomposertablev2.cpp.

void QgsComposerTableV2::drawHorizontalGridLines ( QPainter *  painter,
const int  rows,
const bool  drawHeaderLines 
) const
protected

Draws the horizontal grid lines for the table.

Parameters
painterdestination painter for grid lines
rowsnumber of rows shown in table
drawHeaderLinesset to true to include for the table header
See Also
drawVerticalGridLines

Definition at line 789 of file qgscomposertablev2.cpp.

void QgsComposerTableV2::drawVerticalGridLines ( QPainter *  painter,
const QMap< int, double > &  maxWidthMap,
const int  numberRows,
const bool  hasHeader,
const bool  mergeCells = false 
) const
protected

Draws the vertical grid lines for the table.

Parameters
painterdestination painter for grid lines
maxWidthMapQMap of int to double, where the int contains the column number and the double is the maximum width of text present in the column.
numberRowsnumber of rows of content in table frame
hasHeaderset to true if table frame includes header cells
mergeCellsset to true to merge table content cells
Note
not available in python bindings
See Also
drawVerticalGridLines
calculateMaxColumnWidths
Note
not available in python bindings

Definition at line 815 of file qgscomposertablev2.cpp.

EmptyTableMode QgsComposerTableV2::emptyTableBehaviour ( ) const
inline

Returns the behaviour mode for empty tables.

This property controls how the table is drawn if it contains no content rows.

Returns
behaviour mode for empty tables
See Also
setEmptyTableBehaviour

Definition at line 111 of file qgscomposertablev2.h.

QString QgsComposerTableV2::emptyTableMessage ( ) const
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

Returns
message to show for empty tables
See Also
setEmptyTableMessage
emptyTableBehaviour

Definition at line 129 of file qgscomposertablev2.h.

QSizeF QgsComposerTableV2::fixedFrameSize ( const int  frameIndex = -1) const
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().

Parameters
frameIndexframe number
Returns
fixed size for frame. If the size has a width or height of 0, then the frame size is not fixed in that direction and frames can have variable width or height accordingly.
Note
added in version 2.5
See Also
minFrameSize
recalculateFrameRects

Reimplemented from QgsComposerMultiFrame.

Definition at line 630 of file qgscomposertablev2.cpp.

virtual bool QgsComposerTableV2::getTableContents ( QgsComposerTableContents contents)
pure virtual

Fetches the contents used for the cells in the table.

Returns
true if table contents were successfully retrieved.
Parameters
contentsQgsComposerTableContents to store retrieved row data in
Note
not available in python bindings

Implemented in QgsComposerAttributeTableV2.

QColor QgsComposerTableV2::gridColor ( ) const
inline

Returns the color used for grid lines in the table.

Returns
grid line color
See Also
setGridColor
showGrid
gridStrokeWidth

Definition at line 275 of file qgscomposertablev2.h.

double QgsComposerTableV2::gridStrokeWidth ( ) const
inline

Returns the width of grid lines in the table.

Returns
grid line width
See Also
setGridStrokeWidth
showGrid
gridColor

Definition at line 259 of file qgscomposertablev2.h.

QFont QgsComposerTableV2::headerFont ( ) const
inline

Returns the font used to draw header text in the table.

Returns
font for header cells
See Also
setHeaderFont
contentFont

Definition at line 155 of file qgscomposertablev2.h.

QColor QgsComposerTableV2::headerFontColor ( ) const
inline

Returns the color used to draw header text in the table.

Returns
color for header text
See Also
setHeaderFontColor
headerFont
contentFontColor

Definition at line 171 of file qgscomposertablev2.h.

HeaderHAlignment QgsComposerTableV2::headerHAlignment ( ) const
inline

Returns the horizontal alignment for table headers.

Returns
Horizontal alignment for table header cells
See Also
setHeaderHAlignment

Definition at line 183 of file qgscomposertablev2.h.

QMap< int, QString > QgsComposerTableV2::headerLabels ( ) const
virtual

Returns the text used in the column headers for the table.

Returns
QMap of int to QString, where the int is the column index (starting at 0), and the string is the text to use for the column's header
Note
not available in python bindings

Definition at line 616 of file qgscomposertablev2.cpp.

HeaderMode QgsComposerTableV2::headerMode ( ) const
inline

Returns the display mode for headers in the table.

This property controls if and where headers are shown in the table.

Returns
display mode for headers
See Also
setHeaderMode

Definition at line 197 of file qgscomposertablev2.h.

QSizeF QgsComposerTableV2::minFrameSize ( const int  frameIndex = -1) const
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().

Parameters
frameIndexframe number
Returns
minimum size for frame. If the size has a width or height of 0, then the frame size has no minimum in that direction.
Note
added in version 2.5
See Also
fixedFrameSize
recalculateFrameRects

Reimplemented from QgsComposerMultiFrame.

Definition at line 636 of file qgscomposertablev2.cpp.

bool QgsComposerTableV2::readXML ( const QDomElement &  itemElem,
const QDomDocument &  doc,
bool  ignoreFrames = false 
)
overridevirtual

Reads multiframe state information from a DOM element.

Implementations of readXML should also call the _readXML method to restore general multiframe properties.

Parameters
itemElemis DOM element
docis the DOM document
ignoreFramesset to false to avoid read state information about child frames from DOM
See Also
_readXML

Implements QgsComposerMultiFrame.

Reimplemented in QgsComposerAttributeTableV2.

Definition at line 109 of file qgscomposertablev2.cpp.

void QgsComposerTableV2::recalculateFrameSizes ( )
overrideslot

Definition at line 660 of file qgscomposertablev2.cpp.

void QgsComposerTableV2::recalculateTableSize ( )
protected

Recalculates and updates the size of the table and all table frames.

Definition at line 856 of file qgscomposertablev2.cpp.

void QgsComposerTableV2::refreshAttributes ( )
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.

See Also
adjustFrameToSize

Definition at line 648 of file qgscomposertablev2.cpp.

void QgsComposerTableV2::render ( QPainter *  painter,
const QRectF &  renderExtent,
const int  frameIndex 
)
overridevirtual

Renders a portion of the multiframe's content into a painter.

Parameters
painterdestination painter
renderExtentvisible extent of content to render into the painter.
frameIndexframe number for content
Note
added in version 2.5

Reimplemented from QgsComposerMultiFrame.

Definition at line 247 of file qgscomposertablev2.cpp.

QPair< int, int > QgsComposerTableV2::rowRange ( const QRectF &  extent,
const int  frameIndex 
) const
protected

Calculates a range of rows which should be visible in a given frame extent.

Parameters
extentvisible extent
frameIndexindex number for frame
Returns
row range

Definition at line 205 of file qgscomposertablev2.cpp.

int QgsComposerTableV2::rowsVisible ( const int  frameIndex) const
protected

Calculates how many content rows are visible within a given frame.

Parameters
frameIndexindex number for frame
Returns
number of visible content rows (excludes header rows)

Definition at line 164 of file qgscomposertablev2.cpp.

int QgsComposerTableV2::rowsVisible ( const double  frameHeight,
const bool  includeHeader 
) const
protected

Calculates how many content rows would be visible within a specified height.

Parameters
frameHeightheight of frame
includeHeaderset to true if frame would include a header row
Returns
number of visible content rows (excluding header row)

Definition at line 182 of file qgscomposertablev2.cpp.

void QgsComposerTableV2::setBackgroundColor ( const QColor &  color)

Sets color used for background of table.

Parameters
colortable background color
See Also
backgroundColor
setGridColor

Definition at line 594 of file qgscomposertablev2.cpp.

void QgsComposerTableV2::setCellMargin ( const double  margin)

Sets the margin distance between cell borders and their contents.

Parameters
marginmargin for cell contents
See Also
cellMargin

Definition at line 416 of file qgscomposertablev2.cpp.

void QgsComposerTableV2::setColumns ( QgsComposerTableColumns  columns)

Replaces the columns in the table with a specified list of QgsComposerTableColumns.

Parameters
columnslist of QgsComposerTableColumns to show in table
See Also
columns

Definition at line 607 of file qgscomposertablev2.cpp.

void QgsComposerTableV2::setContentFont ( const QFont &  font)

Sets the font used to draw text in table body cells.

Parameters
fontfont for table cells
See Also
contentFont
setHeaderFont

Definition at line 526 of file qgscomposertablev2.cpp.

void QgsComposerTableV2::setContentFontColor ( const QColor &  color)

Sets the color used to draw text in table body cells.

Parameters
colortable cell text color
See Also
contentFontColor
setContentFont
setHeaderFontColor

Definition at line 540 of file qgscomposertablev2.cpp.

void QgsComposerTableV2::setEmptyTableBehaviour ( const EmptyTableMode  mode)

Sets the behaviour for empty tables with no content rows.

Parameters
modebehaviour mode for empty tables
See Also
emptyTableBehaviour

Definition at line 431 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

Parameters
messagemessage to show for empty tables
See Also
emptyTableMessage
setEmptyTableBehaviour

Definition at line 446 of file qgscomposertablev2.cpp.

void QgsComposerTableV2::setGridColor ( const QColor &  color)

Sets color used for grid lines in the table.

Parameters
colorgrid line color
See Also
gridColor
setShowGrid
setGridStrokeWidth

Definition at line 581 of file qgscomposertablev2.cpp.

void QgsComposerTableV2::setGridStrokeWidth ( const double  width)

Sets the width for grid lines in the table.

Parameters
widthgrid line width
See Also
gridStrokeWidth
setShowGrid
setGridColor

Definition at line 567 of file qgscomposertablev2.cpp.

void QgsComposerTableV2::setHeaderFont ( const QFont &  font)

Sets the font used to draw header text in the table.

Parameters
fontfont for header cells
See Also
headerFont
setContentFont

Definition at line 473 of file qgscomposertablev2.cpp.

void QgsComposerTableV2::setHeaderFontColor ( const QColor &  color)

Sets the color used to draw header text in the table.

Parameters
colorheader text color
See Also
headerFontColor
setHeaderFont
setContentFontColor

Definition at line 487 of file qgscomposertablev2.cpp.

void QgsComposerTableV2::setHeaderHAlignment ( const HeaderHAlignment  alignment)

Sets the horizontal alignment for table headers.

Parameters
alignmentHorizontal alignment for table header cells
See Also
headerHAlignment

Definition at line 500 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.

Parameters
modedisplay mode for headers
See Also
headerMode

Definition at line 513 of file qgscomposertablev2.cpp.

void QgsComposerTableV2::setShowEmptyRows ( const bool  showEmpty)

Sets whether empty rows should be drawn.

Tables default to hiding empty rows.

Parameters
showEmptyset to true to show empty rows in the table
See Also
showEmptyRows

Definition at line 461 of file qgscomposertablev2.cpp.

void QgsComposerTableV2::setShowGrid ( const bool  showGrid)

Sets whether grid lines should be drawn in the table.

Parameters
showGridset to true to show grid lines
See Also
showGrid
setGridStrokeWidth
setGridColor

Definition at line 553 of file qgscomposertablev2.cpp.

bool QgsComposerTableV2::showEmptyRows ( ) const
inline

Returns whether empty rows are drawn in the table.

Returns
true if empty rows are drawn
See Also
setShowEmptyRows

Definition at line 141 of file qgscomposertablev2.h.

bool QgsComposerTableV2::showGrid ( ) const
inline

Returns whether grid lines are drawn in the table.

Returns
true if grid lines are shown
See Also
setShowGrid
gridStrokeWidth
gridColor

Definition at line 243 of file qgscomposertablev2.h.

double QgsComposerTableV2::totalHeight ( ) const
protected

Returns total height of table contents.

Returns
total height
See Also
totalWidth

Definition at line 733 of file qgscomposertablev2.cpp.

QSizeF QgsComposerTableV2::totalSize ( ) const
overridevirtual

Returns the total size of the multiframe's content.

Returns
total size required for content

Implements QgsComposerMultiFrame.

Definition at line 159 of file qgscomposertablev2.cpp.

double QgsComposerTableV2::totalWidth ( )
protected

Returns total width of table contents.

Returns
table width
See Also
totalHeight

Definition at line 712 of file qgscomposertablev2.cpp.

bool QgsComposerTableV2::writeXML ( QDomElement &  elem,
QDomDocument &  doc,
bool  ignoreFrames = false 
) const
overridevirtual

Stores state information about multiframe in DOM element.

Implementations of writeXML should also call the _writeXML method to save general multiframe properties.

Parameters
elemis DOM element
docis the DOM document
ignoreFramesset to false to avoid writing state information about child frames into DOM
See Also
_writeXML

Implements QgsComposerMultiFrame.

Reimplemented in QgsComposerAttributeTableV2.

Definition at line 77 of file qgscomposertablev2.cpp.

Friends And Related Function Documentation

friend class TestQgsComposerTableV2
friend

Definition at line 470 of file qgscomposertablev2.h.

Member Data Documentation

QColor QgsComposerTableV2::mBackgroundColor
protected

Color for table background.

Definition at line 385 of file qgscomposertablev2.h.

double QgsComposerTableV2::mCellMargin
protected

Margin between cell borders and cell text.

Definition at line 346 of file qgscomposertablev2.h.

QgsComposerTableColumns QgsComposerTableV2::mColumns
protected

Columns to show in table.

Definition at line 388 of file qgscomposertablev2.h.

QFont QgsComposerTableV2::mContentFont
protected

Table contents font.

Definition at line 370 of file qgscomposertablev2.h.

QColor QgsComposerTableV2::mContentFontColor
protected

Table contents font color.

Definition at line 373 of file qgscomposertablev2.h.

QString QgsComposerTableV2::mEmptyTableMessage
protected

String to show in empty tables.

Definition at line 352 of file qgscomposertablev2.h.

EmptyTableMode QgsComposerTableV2::mEmptyTableMode
protected

Behaviour for empty tables.

Definition at line 349 of file qgscomposertablev2.h.

QColor QgsComposerTableV2::mGridColor
protected

Color for grid lines.

Definition at line 382 of file qgscomposertablev2.h.

double QgsComposerTableV2::mGridStrokeWidth
protected

Width of grid lines.

Definition at line 379 of file qgscomposertablev2.h.

QFont QgsComposerTableV2::mHeaderFont
protected

Header font.

Definition at line 358 of file qgscomposertablev2.h.

QColor QgsComposerTableV2::mHeaderFontColor
protected

Header font color.

Definition at line 361 of file qgscomposertablev2.h.

HeaderHAlignment QgsComposerTableV2::mHeaderHAlignment
protected

Alignment for table headers.

Definition at line 364 of file qgscomposertablev2.h.

HeaderMode QgsComposerTableV2::mHeaderMode
protected

Header display mode.

Definition at line 367 of file qgscomposertablev2.h.

QMap<int, double> QgsComposerTableV2::mMaxColumnWidthMap
protected

Map of maximum width for each column.

Definition at line 394 of file qgscomposertablev2.h.

bool QgsComposerTableV2::mShowEmptyRows
protected

True if empty rows should be shown in the table.

Definition at line 355 of file qgscomposertablev2.h.

bool QgsComposerTableV2::mShowGrid
protected

True if grid should be shown.

Definition at line 376 of file qgscomposertablev2.h.

QgsComposerTableContents QgsComposerTableV2::mTableContents
protected

Contents to show in table.

Definition at line 391 of file qgscomposertablev2.h.

QSizeF QgsComposerTableV2::mTableSize
protected

Definition at line 396 of file qgscomposertablev2.h.


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