mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-12 00:06:43 -04:00
[composer] Refresh view action now also reloads html items and refreshes attribute table features.
This commit is contained in:
parent
8eb929aeda
commit
2d7cd38b45
@ -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 );
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user