Skip to content
Permalink
Browse files

[FEATURE][composer] New composer item for multi frame attribute tables.

Allows table content to be spread over multiple frames. Note:
existing table items are not automatically upgraded to multiframe
tables (to avoid API breaks with plugins), so only newly added
tables gain these new options.

QgsComposerTable is effectively deprecated and will be removed at the
next API break.

This work was sponsored by the City of Uster, Switzerland.
  • Loading branch information
nyalldawson committed Sep 17, 2014
1 parent 993aa83 commit cb739056443fb8ff6c88c074641dc06527cc4026
@@ -582,6 +582,7 @@ void QgsComposerAttributeTableV2::addFrame( QgsComposerFrame *frame, bool recalc

if ( recalcFrameSizes )
{

recalculateFrameSizes();
}
}
@@ -142,7 +142,7 @@ class CORE_EXPORT QgsComposerMultiFrame: public QgsComposerObject
* this may cause new frames to be added or frames to be removed, in order to fit
* the current size of the multiframe's content.
*/
void recalculateFrameSizes();
virtual void recalculateFrameSizes();

/**Forces a recalculation of all the associated frame's scene rectangles. This
* method is useful for multiframes which implement a minFrameSize() or
@@ -136,13 +136,6 @@ bool QgsComposerTableV2::readXML( const QDomElement &itemElem, const QDomDocumen

QSizeF QgsComposerTableV2::totalSize() const
{
//TODO - handle multiple cell headers
//also check height calculation function



//calculate total size

return mTableSize;
}

@@ -526,11 +519,12 @@ void QgsComposerTableV2::refreshAttributes()
{
return;
}
}

//since contents have changed, we also need to recalculate the column widths
//and size of table
//gettablecontents does this!
// adjustFrameToSize();
void QgsComposerTableV2::recalculateFrameSizes()
{
mTableSize = QSizeF( totalWidth(), totalHeight() );
QgsComposerMultiFrame::recalculateFrameSizes();
}

bool QgsComposerTableV2::calculateMaxColumnWidths()
@@ -703,8 +697,6 @@ void QgsComposerTableV2::drawVerticalGridLines( QPainter *painter, const QMap<in

void QgsComposerTableV2::adjustFrameToSize()
{
mTableSize = QSizeF( totalWidth(), totalHeight() );

recalculateFrameSizes();

//force recalculation of frame rects, so that they are set to the correct
@@ -272,6 +272,8 @@ class CORE_EXPORT QgsComposerTableV2: public QgsComposerMultiFrame
*/
virtual void refreshAttributes();

void recalculateFrameSizes();

protected:
/**Margin between cell borders and cell text*/
double mCellMargin;

0 comments on commit cb73905

Please sign in to comment.
You can’t perform that action at this time.