Skip to content
Permalink
Browse files

rename QgsComposerLegend::modelV2() to model()

  • Loading branch information
3nids committed Aug 8, 2016
1 parent 820cc56 commit 772f59349e563357a4f38f92e734d31e67c94ec8
@@ -145,6 +145,13 @@ corresponding counterparts in QgsUnitTypes should be used instead.</li>
<li>GenericDataSourceURI has been renamed to GenericDataSourceUri</li>
</ul>

\subsection qgis_api_break_3_0_QgsComposerLegend QgsComposerLegend

<ul>
<li>model() now returns the new QgsLegendModel (previousyl QgsLegendModelV2, see \ref qgis_api_break_3_0_renamed_classes).</li>
<li>modelV2() has been renamed to model().</li>
</ul>

\subsection qgis_api_break_3_0_QgsComposerLegendItem QgsComposerLegendItem

<ul>
@@ -61,7 +61,7 @@ class QgsComposerLegend : QgsComposerItem
bool resizeToContents() const;

//! @note added in 2.6
QgsLegendModelV2* modelV2();
QgsLegendModelV2* model();

//! @note added in 2.6
void setAutoUpdateModel( bool autoUpdate );
@@ -75,7 +75,7 @@ QgsComposerLegendWidget::QgsComposerLegendWidget( QgsComposerLegend* legend )

if ( legend )
{
mItemTreeView->setModel( legend->modelV2() );
mItemTreeView->setModel( legend->model() );
mItemTreeView->setMenuProvider( new QgsComposerLegendMenuProvider( mItemTreeView, this ) );
connect( legend, SIGNAL( itemChanged() ), this, SLOT( setGuiElements() ) );
mWrapCharLineEdit->setText( legend->wrapChar() );
@@ -654,7 +654,7 @@ void QgsComposerLegendWidget::on_mAddToolButton_clicked()
if ( layer )
{
mLegend->beginCommand( "Legend item added" );
mLegend->modelV2()->rootGroup()->addLayer( layer );
mLegend->model()->rootGroup()->addLayer( layer );
mLegend->endCommand();
}
}
@@ -710,7 +710,7 @@ void QgsComposerLegendWidget::on_mRemoveToolButton_clicked()
Q_FOREACH ( const QPersistentModelIndex& index, indexes )
{
if ( index.isValid() && mItemTreeView->layerTreeModel()->index2node( index ) )
mLegend->modelV2()->removeRow( index.row(), index.parent() );
mLegend->model()->removeRow( index.row(), index.parent() );
}

mLegend->adjustBoxSize();
@@ -844,7 +844,7 @@ void QgsComposerLegendWidget::on_mAddGroupToolButton_clicked()
if ( mLegend )
{
mLegend->beginCommand( tr( "Legend group added" ) );
mLegend->modelV2()->rootGroup()->addGroup( tr( "Group" ) );
mLegend->model()->rootGroup()->addGroup( tr( "Group" ) );
mLegend->updateItem();
mLegend->endCommand();
}
@@ -86,8 +86,11 @@ class CORE_EXPORT QgsComposerLegend : public QgsComposerItem
*/
bool resizeToContents() const;

//! @note added in 2.6
QgsLegendModelV2* modelV2() { return mLegendModel2; }

/**
* Returns the legend model
*/
QgsLegendModelV2* model() { return mLegendModel; }

//! @note added in 2.6
void setAutoUpdateModel( bool autoUpdate );
@@ -279,7 +282,7 @@ class CORE_EXPORT QgsComposerLegend : public QgsComposerItem
//! use new custom layer tree and update model. if new root is null pointer, will use project's tree
void setCustomLayerTree( QgsLayerTreeGroup* rootGroup );

QgsLegendModelV2* mLegendModel2;
QgsLegendModelV2* mLegendModel;
QgsLayerTreeGroup* mCustomLayerTree;

QgsLegendSettings mSettings;

0 comments on commit 772f593

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