mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-28 00:04:04 -04:00
[composer] Recalculate table size when margin or grid width changes
This commit is contained in:
parent
8feb9ae9af
commit
48c3b99f7b
@ -136,6 +136,13 @@ void QgsComposerTable::paint( QPainter* painter, const QStyleOptionGraphicsItem*
|
||||
}
|
||||
}
|
||||
|
||||
void QgsComposerTable::setLineTextDistance( double d )
|
||||
{
|
||||
mLineTextDistance = d;
|
||||
//since spacing has changed, we need to recalculate the table size
|
||||
adjustFrameToSize();
|
||||
}
|
||||
|
||||
void QgsComposerTable::setHeaderFont( const QFont& f )
|
||||
{
|
||||
mHeaderFont = f;
|
||||
@ -150,6 +157,20 @@ void QgsComposerTable::setContentFont( const QFont& f )
|
||||
adjustFrameToSize();
|
||||
}
|
||||
|
||||
void QgsComposerTable::setShowGrid( bool show )
|
||||
{
|
||||
mShowGrid = show;
|
||||
//since grid spacing has changed, we need to recalculate the table size
|
||||
adjustFrameToSize();
|
||||
}
|
||||
|
||||
void QgsComposerTable::setGridStrokeWidth( double w )
|
||||
{
|
||||
mGridStrokeWidth = w;
|
||||
//since grid spacing has changed, we need to recalculate the table size
|
||||
adjustFrameToSize();
|
||||
}
|
||||
|
||||
void QgsComposerTable::adjustFrameToSize()
|
||||
{
|
||||
//check how much space each column needs
|
||||
|
@ -43,7 +43,7 @@ class CORE_EXPORT QgsComposerTable: public QgsComposerItem
|
||||
virtual bool writeXML( QDomElement& elem, QDomDocument & doc ) const = 0;
|
||||
virtual bool readXML( const QDomElement& itemElem, const QDomDocument& doc ) = 0;
|
||||
|
||||
void setLineTextDistance( double d ) { mLineTextDistance = d; }
|
||||
void setLineTextDistance( double d );
|
||||
double lineTextDistance() const { return mLineTextDistance; }
|
||||
|
||||
void setHeaderFont( const QFont& f );
|
||||
@ -52,10 +52,10 @@ class CORE_EXPORT QgsComposerTable: public QgsComposerItem
|
||||
void setContentFont( const QFont& f );
|
||||
QFont contentFont() const { return mContentFont; }
|
||||
|
||||
void setShowGrid( bool show ) { mShowGrid = show;}
|
||||
void setShowGrid( bool show );
|
||||
bool showGrid() const { return mShowGrid; }
|
||||
|
||||
void setGridStrokeWidth( double w ) { mGridStrokeWidth = w; }
|
||||
void setGridStrokeWidth( double w );
|
||||
double gridStrokeWidth() const { return mGridStrokeWidth; }
|
||||
|
||||
void setGridColor( const QColor& c ) { mGridColor = c; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user