Skip to content

Commit

Permalink
Use qobject_cast
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 2, 2019
1 parent 1b309c6 commit 97daa50
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/layout/qgslayoutitemmapoverview.cpp
Expand Up @@ -401,19 +401,19 @@ void QgsLayoutItemMapOverviewStack::moveOverviewDown( const QString &overviewId
QgsLayoutItemMapOverview *QgsLayoutItemMapOverviewStack::overview( const QString &overviewId ) const
{
QgsLayoutItemMapItem *item = QgsLayoutItemMapItemStack::item( overviewId );
return dynamic_cast<QgsLayoutItemMapOverview *>( item );
return qobject_cast<QgsLayoutItemMapOverview *>( item );
}

QgsLayoutItemMapOverview *QgsLayoutItemMapOverviewStack::overview( const int index ) const
{
QgsLayoutItemMapItem *item = QgsLayoutItemMapItemStack::item( index );
return dynamic_cast<QgsLayoutItemMapOverview *>( item );
return qobject_cast<QgsLayoutItemMapOverview *>( item );
}

QgsLayoutItemMapOverview &QgsLayoutItemMapOverviewStack::operator[]( int idx )
{
QgsLayoutItemMapItem *item = mItems.at( idx );
QgsLayoutItemMapOverview *overview = dynamic_cast<QgsLayoutItemMapOverview *>( item );
QgsLayoutItemMapOverview *overview = qobject_cast<QgsLayoutItemMapOverview *>( item );
return *overview;
}

Expand All @@ -423,7 +423,7 @@ QList<QgsLayoutItemMapOverview *> QgsLayoutItemMapOverviewStack::asList() const
QList< QgsLayoutItemMapItem * >::const_iterator it = mItems.begin();
for ( ; it != mItems.end(); ++it )
{
QgsLayoutItemMapOverview *overview = dynamic_cast<QgsLayoutItemMapOverview *>( *it );
QgsLayoutItemMapOverview *overview = qobject_cast<QgsLayoutItemMapOverview *>( *it );
if ( overview )
{
list.append( overview );
Expand Down

0 comments on commit 97daa50

Please sign in to comment.