Skip to content
Permalink
Browse files

[composer] Refresh view action now also reloads html items and refres…

…hes attribute table features.
  • Loading branch information
nyalldawson committed May 1, 2014
1 parent 8eb929a commit 2d7cd38b45cb82f5c6ec87c8726cd6e006d32a67
@@ -408,6 +408,12 @@ class QgsComposition : QGraphicsScene
@note added in version 2.2*/
void updateBounds();

/**Forces items in the composition to refresh. For instance, this causes maps to redraw
* and rebuild cached images, html items to reload their source url, and attribute tables
* to refresh their contents.
@note added in version 2.3*/
void refreshItems();

protected:
void init();

@@ -441,4 +447,7 @@ class QgsComposition : QGraphicsScene
void composerTableAdded( QgsComposerAttributeTable* table );
/**Is emitted when a composer item has been removed from the scene*/
void itemRemoved( QgsComposerItem* );

/**Is emitted when item in the composition must be refreshed*/
void refreshItemsTriggered();
};
@@ -1022,6 +1022,7 @@ void QgsComposer::on_mActionRefreshView_triggered()
}
}

mComposition->refreshItems();
mComposition->update();
}

@@ -66,6 +66,11 @@ QgsComposerAttributeTable::QgsComposerAttributeTable( QgsComposition* compositio
}
}
connect( QgsMapLayerRegistry::instance(), SIGNAL( layerWillBeRemoved( QString ) ), this, SLOT( removeLayer( const QString& ) ) );

if ( mComposition )
{
connect( mComposition, SIGNAL( refreshItemsTriggered() ), this, SLOT( refreshAttributes() ) );
}
}

QgsComposerAttributeTable::~QgsComposerAttributeTable()
@@ -36,6 +36,7 @@ QgsComposerHtml::QgsComposerHtml( QgsComposition* c, bool createUndoCommands ):
if ( mComposition )
{
QObject::connect( mComposition, SIGNAL( itemRemoved( QgsComposerItem* ) ), this, SLOT( handleFrameRemoval( QgsComposerItem* ) ) );
connect( mComposition, SIGNAL( refreshItemsTriggered() ), this, SLOT( loadHtml() ) );
}
}

@@ -181,6 +181,11 @@ void QgsComposition::updateBounds()
setSceneRect( compositionBounds() );
}

void QgsComposition::refreshItems()
{
emit refreshItemsTriggered();
}

QRectF QgsComposition::compositionBounds() const
{
//start with an empty rectangle
@@ -464,6 +464,12 @@ class CORE_EXPORT QgsComposition : public QGraphicsScene
@note added in version 2.2*/
void updateBounds();

/**Forces items in the composition to refresh. For instance, this causes maps to redraw
* and rebuild cached images, html items to reload their source url, and attribute tables
* to refresh their contents.
@note added in version 2.3*/
void refreshItems();

protected:
void init();

@@ -596,6 +602,9 @@ class CORE_EXPORT QgsComposition : public QGraphicsScene
/**Is emitted when a composer item has been removed from the scene*/
void itemRemoved( QgsComposerItem* );

/**Is emitted when item in the composition must be refreshed*/
void refreshItemsTriggered();

/**Is emitted when the composition has an updated status bar message for the composer window*/
void statusMsgChanged( QString message );
};

0 comments on commit 2d7cd38

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