Skip to content

Commit 4e2afeb

Browse files
committed
[composer] Don't auto set maximum number of attributes when resizing item. Instead, keep the maximum number of rows as whatever the user set. This change prevents the attribute table from shrinking and never re-growing (fix #10911)
1 parent 70d5857 commit 4e2afeb

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/core/composer/qgscomposerattributetable.cpp

+2-12
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,8 @@ bool QgsComposerAttributeTable::getFeatureAttributes( QList<QgsAttributeMap> &at
463463
c.setAscending( sortColumns.at( i ).second );
464464
qStableSort( attributeMaps.begin(), attributeMaps.end(), c );
465465
}
466+
467+
adjustFrameToSize();
466468
return true;
467469
}
468470

@@ -485,22 +487,10 @@ void QgsComposerAttributeTable::setSceneRect( const QRectF& rectangle )
485487
//update rect for data defined size and position
486488
QRectF evaluatedRect = evalItemRect( rectangle );
487489

488-
double titleHeight = 2 * mGridStrokeWidth + 2 * mLineTextDistance + QgsComposerUtils::fontAscentMM( mHeaderFont );
489-
double attributeHeight = mGridStrokeWidth + 2 * mLineTextDistance + QgsComposerUtils::fontAscentMM( mContentFont );
490-
if (( evaluatedRect.height() - titleHeight ) > 0 )
491-
{
492-
mMaximumNumberOfFeatures = ( evaluatedRect.height() - titleHeight ) / attributeHeight;
493-
}
494-
else
495-
{
496-
mMaximumNumberOfFeatures = 0;
497-
}
498490
QgsComposerItem::setSceneRect( evaluatedRect );
499491

500492
//refresh table attributes, since number of features has likely changed
501493
refreshAttributes();
502-
503-
emit maximumNumberOfFeaturesChanged( mMaximumNumberOfFeatures );
504494
}
505495

506496
void QgsComposerAttributeTable::setSortAttributes( const QList<QPair<int, bool> > att )

0 commit comments

Comments
 (0)