Working label updates on atlas feature change

This commit is contained in:
Nyall Dawson 2017-12-20 18:05:05 +10:00
parent 5d1d25b36b
commit b602b3d58e
3 changed files with 5 additions and 0 deletions

View File

@ -1943,6 +1943,7 @@ void QgsLayoutDesignerDialog::atlasPreviewTriggered( bool checked )
else
{
QgisApp::instance()->mapCanvas()->stopRendering();
atlas->first();
#if 0 //TODO
emit atlasPreviewFeatureChanged();
#endif
@ -2220,6 +2221,7 @@ void QgsLayoutDesignerDialog::createAtlasWidget()
mStatusBar->showMessage( message );
} );
connect( atlas, &QgsLayoutAtlas::toggled, this, &QgsLayoutDesignerDialog::toggleAtlasControls );
connect( atlas, &QgsLayoutAtlas::toggled, this, &QgsLayoutDesignerDialog::refreshLayout );
connect( atlas, &QgsLayoutAtlas::numberFeaturesChanged, this, &QgsLayoutDesignerDialog::updateAtlasPageComboBox );
connect( atlas, &QgsLayoutAtlas::featureChanged, this, &QgsLayoutDesignerDialog::atlasFeatureChanged );
toggleAtlasControls( atlas->enabled() && atlas->coverageLayer() );

View File

@ -492,6 +492,7 @@ void QgsLayoutItemLabel::setFrameStrokeWidth( const QgsLayoutMeasurement &stroke
void QgsLayoutItemLabel::refresh()
{
QgsLayoutItem::refresh();
contentChanged();
}

View File

@ -18,6 +18,7 @@
#include <QPainter>
#include "qgslayout.h"
#include "qgslayoutcontext.h"
#include "qgslayoutobject.h"
@ -92,6 +93,7 @@ QgsLayoutObject::QgsLayoutObject( QgsLayout *layout )
if ( mLayout )
{
connect( mLayout, &QgsLayout::refreshed, this, &QgsLayoutObject::refresh );
connect( &mLayout->context(), &QgsLayoutContext::changed, this, &QgsLayoutObject::refresh );
}
}