@@ -503,19 +503,19 @@ QgsComposition* QgsWMSProjectParser::initComposition( const QString& composerTem
503
503
QList<QgsComposerItem *>::iterator itemIt = itemList.begin ();
504
504
for ( ; itemIt != itemList.end (); ++itemIt )
505
505
{
506
- QgsComposerLabel* label = dynamic_cast < QgsComposerLabel *>( *itemIt );
506
+ QgsComposerLabel* label = qobject_cast < QgsComposerLabel *>( *itemIt );
507
507
if ( label )
508
508
{
509
509
labelList.push_back ( label );
510
510
continue ;
511
511
}
512
- QgsComposerMap* map = dynamic_cast < QgsComposerMap *>( *itemIt );
512
+ QgsComposerMap* map = qobject_cast < QgsComposerMap *>( *itemIt );
513
513
if ( map )
514
514
{
515
515
mapList.push_back ( map );
516
516
continue ;
517
517
}
518
- QgsComposerLegend* legend = dynamic_cast < QgsComposerLegend *>( *itemIt );
518
+ QgsComposerLegend* legend = qobject_cast < QgsComposerLegend *>( *itemIt );
519
519
if ( legend )
520
520
{
521
521
QgsLegendModelV2* model = legend->modelV2 ();
@@ -567,7 +567,7 @@ QgsComposition* QgsWMSProjectParser::initComposition( const QString& composerTem
567
567
legendList.push_back ( legend );
568
568
continue ;
569
569
}
570
- QgsComposerPicture* pic = dynamic_cast < QgsComposerPicture *>( *itemIt );
570
+ QgsComposerPicture* pic = qobject_cast < QgsComposerPicture *>( *itemIt );
571
571
if ( pic )
572
572
{
573
573
pic->setPicturePath ( mProjectParser ->convertToAbsolutePath (( pic )->picturePath () ) );
@@ -576,11 +576,11 @@ QgsComposition* QgsWMSProjectParser::initComposition( const QString& composerTem
576
576
577
577
// an html item will be a composer frame and if it is we can try to get
578
578
// its multiframe parent and then try to cast that to a composer html
579
- const QgsComposerFrame* frame = dynamic_cast <const QgsComposerFrame *>( *itemIt );
579
+ const QgsComposerFrame* frame = qobject_cast <const QgsComposerFrame *>( *itemIt );
580
580
if ( frame )
581
581
{
582
582
const QgsComposerMultiFrame * multiFrame = frame->multiFrame ();
583
- const QgsComposerHtml* composerHtml = dynamic_cast <const QgsComposerHtml *>( multiFrame );
583
+ const QgsComposerHtml* composerHtml = qobject_cast <const QgsComposerHtml *>( multiFrame );
584
584
if ( composerHtml )
585
585
{
586
586
htmlList.push_back ( composerHtml );
@@ -1332,7 +1332,7 @@ void QgsWMSProjectParser::addLayers( QDomDocument &doc,
1332
1332
bool geometryLayer = true ;
1333
1333
if ( currentLayer->type () == QgsMapLayer::VectorLayer )
1334
1334
{
1335
- QgsVectorLayer* vLayer = dynamic_cast <QgsVectorLayer*>( currentLayer );
1335
+ QgsVectorLayer* vLayer = qobject_cast <QgsVectorLayer*>( currentLayer );
1336
1336
if ( vLayer )
1337
1337
{
1338
1338
if ( vLayer->wkbType () == QGis::WKBNoGeometry )
@@ -1841,7 +1841,7 @@ QDomDocument QgsWMSProjectParser::getStyles( QStringList& layerList ) const
1841
1841
for ( int j = 0 ; j < currentLayerList.size (); j++ )
1842
1842
{
1843
1843
QgsMapLayer* currentLayer = currentLayerList.at ( j );
1844
- QgsVectorLayer* layer = dynamic_cast <QgsVectorLayer*>( currentLayer );
1844
+ QgsVectorLayer* layer = qobject_cast <QgsVectorLayer*>( currentLayer );
1845
1845
if ( !layer )
1846
1846
{
1847
1847
throw QgsMapServiceException ( " Error" , QString ( " Could not get style because:\n %1" ).arg ( " Non-vector layers not supported yet" ) );
0 commit comments