Skip to content

Commit 6a6cc19

Browse files
committedMay 15, 2014
fix warnings
1 parent 57c7b8a commit 6a6cc19

File tree

8 files changed

+93
-49
lines changed

8 files changed

+93
-49
lines changed
 

‎src/core/composer/qgsatlascomposition.cpp

Lines changed: 48 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -107,53 +107,6 @@ void QgsAtlasComposition::setComposerMap( QgsComposerMap* map )
107107
map->setAtlasDriven( true );
108108
}
109109

110-
bool QgsAtlasComposition::fixedScale() const
111-
{
112-
//deprecated method. Until removed just return the property for the first atlas-enabled composer map
113-
QgsComposerMap * map = composerMap();
114-
if ( !map )
115-
{
116-
return false;
117-
}
118-
119-
return map->atlasFixedScale();
120-
}
121-
122-
void QgsAtlasComposition::setFixedScale( bool fixed )
123-
{
124-
//deprecated method. Until removed just set the property for the first atlas-enabled composer map
125-
QgsComposerMap * map = composerMap();
126-
if ( !map )
127-
{
128-
return;
129-
}
130-
131-
map->setAtlasFixedScale( fixed );
132-
}
133-
134-
float QgsAtlasComposition::margin() const
135-
{
136-
//deprecated method. Until removed just return the property for the first atlas-enabled composer map
137-
QgsComposerMap * map = composerMap();
138-
if ( !map )
139-
{
140-
return 0;
141-
}
142-
143-
return map->atlasMargin();
144-
}
145-
146-
void QgsAtlasComposition::setMargin( float margin )
147-
{
148-
//deprecated method. Until removed just set the property for the first atlas-enabled composer map
149-
QgsComposerMap * map = composerMap();
150-
if ( !map )
151-
{
152-
return;
153-
}
154-
155-
map->setAtlasMargin(( double ) margin );
156-
}
157110

158111
int QgsAtlasComposition::sortKeyAttributeIndex() const
159112
{
@@ -745,4 +698,52 @@ void QgsAtlasComposition::evalFeatureFilename()
745698
}
746699
}
747700

701+
Q_NOWARN_DEPRECATED_PUSH
702+
bool QgsAtlasComposition::fixedScale() const
703+
{
704+
//deprecated method. Until removed just return the property for the first atlas-enabled composer map
705+
QgsComposerMap * map = composerMap();
706+
if ( !map )
707+
{
708+
return false;
709+
}
710+
711+
return map->atlasFixedScale();
712+
}
713+
714+
void QgsAtlasComposition::setFixedScale( bool fixed )
715+
{
716+
//deprecated method. Until removed just set the property for the first atlas-enabled composer map
717+
QgsComposerMap * map = composerMap();
718+
if ( !map )
719+
{
720+
return;
721+
}
722+
723+
map->setAtlasFixedScale( fixed );
724+
}
748725

726+
float QgsAtlasComposition::margin() const
727+
{
728+
//deprecated method. Until removed just return the property for the first atlas-enabled composer map
729+
QgsComposerMap * map = composerMap();
730+
if ( !map )
731+
{
732+
return 0;
733+
}
734+
735+
return map->atlasMargin();
736+
}
737+
738+
void QgsAtlasComposition::setMargin( float margin )
739+
{
740+
//deprecated method. Until removed just set the property for the first atlas-enabled composer map
741+
QgsComposerMap * map = composerMap();
742+
if ( !map )
743+
{
744+
return;
745+
}
746+
747+
map->setAtlasMargin(( double ) margin );
748+
}
749+
Q_NOWARN_DEPRECATED_POP

‎src/core/composer/qgscomposerattributetablemodel.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class CORE_EXPORT QgsComposerAttributeTableColumnModel: public QAbstractTableMod
4343

4444
/**Constructor for QgsComposerAttributeTableColumnModel.
4545
* @param composerTable QgsComposerAttributeTable the model is attached to
46+
* @param parent optional parent
4647
*/
4748
QgsComposerAttributeTableColumnModel( QgsComposerAttributeTable *composerTable, QObject *parent = 0 );
4849
virtual ~QgsComposerAttributeTableColumnModel();
@@ -140,6 +141,7 @@ class CORE_EXPORT QgsComposerTableSortColumnsProxyModel: public QSortFilterProxy
140141
/**Constructor for QgsComposerTableSortColumnsProxyModel.
141142
* @param composerTable QgsComposerAttributeTable the model is attached to
142143
* @param filterType filter for columns, controls whether sorted or unsorted columns are shown
144+
* @param parent optional parent
143145
*/
144146
QgsComposerTableSortColumnsProxyModel( QgsComposerAttributeTable *composerTable, ColumnFilterType filterType, QObject *parent = 0 );
145147

@@ -173,7 +175,7 @@ class CORE_EXPORT QgsComposerTableSortColumnsProxyModel: public QSortFilterProxy
173175
/**Returns the QgsComposerTableColumn corresponding to an index from the source
174176
* QgsComposerAttributeTableColumnModel model.
175177
* @returns QgsComposerTableColumn for specified index from QgsComposerAttributeTableColumnModel
176-
* @param index a QModelIndex
178+
* @param sourceIndex a QModelIndex
177179
* @note added in 2.3
178180
* @see columnFromRow
179181
* @see columnFromIndex

‎src/core/composer/qgscomposeritem.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,12 @@ class CORE_EXPORT QgsComposerItem: public QObject, public QGraphicsRectItem
314314
void drawText( QPainter* p, double x, double y, const QString& text, const QFont& font ) const;
315315

316316
/**Like the above, but with a rectangle for multiline text
317+
* @param p painter to use
318+
* @param rect rectangle to draw into
319+
* @param text text to draw
320+
* @param font font to use
321+
* @param halignment optional horizontal alignment
322+
* @param valignment optional vertical alignment
317323
* @param flags allows for passing Qt::TextFlags to control appearance of rendered text
318324
*/
319325
void drawText( QPainter* p, const QRectF& rect, const QString& text, const QFont& font, Qt::AlignmentFlag halignment = Qt::AlignLeft, Qt::AlignmentFlag valignment = Qt::AlignTop, int flags = Qt::TextWordWrap ) const;

‎src/core/symbology-ng/qgsellipsesymbollayerv2.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ class CORE_EXPORT QgsEllipseSymbolLayerV2: public QgsMarkerSymbolLayerV2
110110
/**Setup mPainterPath
111111
@param symbolName name of symbol
112112
@param context render context
113-
@param f feature f to render (0 if no data defined rendering)*/
113+
@param scaledWidth optional width
114+
@param scaledHeight optional height
115+
@param f optional feature to render (0 if no data defined rendering)
116+
*/
114117
void preparePath( const QString& symbolName, QgsSymbolV2RenderContext& context, double* scaledWidth = 0, double* scaledHeight = 0, const QgsFeature* f = 0 );
115118

116119
/**True if this symbol layer uses a data defined property*/

‎src/gui/symbology-ng/qgssymbolslistwidget.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ void QgsSymbolsListWidget::setLineWidth( double width )
208208

209209
void QgsSymbolsListWidget::symbolAddedToStyle( QString name, QgsSymbolV2* symbol )
210210
{
211+
Q_UNUSED( name );
212+
Q_UNUSED( symbol );
211213
populateSymbolView();
212214
}
213215

‎tests/src/core/testqgsatlascomposition.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,11 @@ void TestQgsAtlasComposition::autoscale_render()
215215

216216
void TestQgsAtlasComposition::autoscale_render_2_0_api()
217217
{
218+
Q_NOWARN_DEPRECATED_PUSH
218219
mAtlas->setComposerMap( mAtlasMap );
219220
mAtlas->setFixedScale( false );
220221
mAtlas->setMargin( 0.10f );
222+
Q_NOWARN_DEPRECATED_POP
221223

222224
mAtlas->beginRender();
223225

@@ -230,9 +232,11 @@ void TestQgsAtlasComposition::autoscale_render_2_0_api()
230232
QVERIFY( checker.testComposition( mReport, 0, 200 ) );
231233
}
232234
mAtlas->endRender();
235+
Q_NOWARN_DEPRECATED_PUSH
233236
mAtlas->setComposerMap( 0 );
234237
mAtlas->setFixedScale( false );
235238
mAtlas->setMargin( 0 );
239+
Q_NOWARN_DEPRECATED_POP
236240
}
237241

238242
void TestQgsAtlasComposition::fixedscale_render()
@@ -260,8 +264,10 @@ void TestQgsAtlasComposition::fixedscale_render()
260264
void TestQgsAtlasComposition::fixedscale_render_2_0_api()
261265
{
262266
mAtlasMap->setNewExtent( QgsRectangle( 209838.166, 6528781.020, 610491.166, 6920530.620 ) );
267+
Q_NOWARN_DEPRECATED_PUSH
263268
mAtlas->setComposerMap( mAtlasMap );
264269
mAtlas->setFixedScale( true );
270+
Q_NOWARN_DEPRECATED_POP
265271
mAtlas->beginRender();
266272

267273
for ( int fit = 0; fit < 2; ++fit )
@@ -273,8 +279,10 @@ void TestQgsAtlasComposition::fixedscale_render_2_0_api()
273279
QVERIFY( checker.testComposition( mReport, 0, 200 ) );
274280
}
275281
mAtlas->endRender();
282+
Q_NOWARN_DEPRECATED_PUSH
276283
mAtlas->setComposerMap( 0 );
277284
mAtlas->setFixedScale( false );
285+
Q_NOWARN_DEPRECATED_POP
278286
}
279287

280288
void TestQgsAtlasComposition::two_map_autoscale_render()

‎tests/src/core/testqgscomposertable.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,9 @@ void TestQgsComposerTable::attributeTableSetAliasOnSubset()
322322
aliases.insert( 1, QString( "1Heading" ) );
323323
aliases.insert( 3, QString( "2Pilots" ) );
324324
aliases.insert( 4, QString( "3Cabin Crew" ) );
325+
Q_NOWARN_DEPRECATED_PUSH
325326
mComposerAttributeTable->setFieldAliasMap( aliases );
327+
Q_NOWARN_DEPRECATED_POP
326328

327329
//get header labels and compare
328330
QMap<int, QString> headerMap = mComposerAttributeTable->headerLabels();
@@ -338,7 +340,9 @@ void TestQgsComposerTable::attributeTableSetAliasOnSubset()
338340
attributes.clear();
339341
aliases.clear();
340342
mComposerAttributeTable->setDisplayAttributes( attributes );
343+
Q_NOWARN_DEPRECATED_PUSH
341344
mComposerAttributeTable->setFieldAliasMap( aliases );
345+
Q_NOWARN_DEPRECATED_POP
342346
}
343347

344348
void TestQgsComposerTable::attributeTableGetAttributes()
@@ -348,7 +352,9 @@ void TestQgsComposerTable::attributeTableGetAttributes()
348352
attributes << 0 << 3 << 4;
349353
mComposerAttributeTable->setDisplayAttributes( attributes );
350354

355+
Q_NOWARN_DEPRECATED_PUSH
351356
QSet<int> evaluated = mComposerAttributeTable->displayAttributes();
357+
Q_NOWARN_DEPRECATED_POP
352358

353359
QCOMPARE( evaluated, attributes );
354360

@@ -363,7 +369,9 @@ void TestQgsComposerTable::attributeTableAlias()
363369

364370
fieldAliasMap.insert( 0, QString( "alias 0" ) );
365371
fieldAliasMap.insert( 3, QString( "alias 3" ) );
372+
Q_NOWARN_DEPRECATED_PUSH
366373
mComposerAttributeTable->setFieldAliasMap( fieldAliasMap );
374+
Q_NOWARN_DEPRECATED_POP
367375

368376
QStringList expectedHeaders;
369377
expectedHeaders << "alias 0" << "Heading" << "Importance" << "alias 3" << "Cabin Crew" << "Staff";
@@ -381,7 +389,9 @@ void TestQgsComposerTable::attributeTableAlias()
381389
}
382390

383391
fieldAliasMap.clear();
392+
Q_NOWARN_DEPRECATED_PUSH
384393
mComposerAttributeTable->setFieldAliasMap( fieldAliasMap );
394+
Q_NOWARN_DEPRECATED_POP
385395
}
386396

387397
void TestQgsComposerTable::attributeTableGetAlias()
@@ -395,15 +405,19 @@ void TestQgsComposerTable::attributeTableGetAlias()
395405

396406
fieldAliasMap.insert( 1, QString( "alias 1" ) );
397407
fieldAliasMap.insert( 2, QString( "alias 2" ) );
408+
Q_NOWARN_DEPRECATED_PUSH
398409
mComposerAttributeTable->setFieldAliasMap( fieldAliasMap );
410+
Q_NOWARN_DEPRECATED_POP
399411

400412
QMap<int, QString> expectedAliases;
401413
expectedAliases.insert( 1, QString( "alias 1" ) );
402414
expectedAliases.insert( 3, QString( "Pilots" ) );
403415
expectedAliases.insert( 4, QString( "Cabin Crew" ) );
404416

405417
//get header labels and compare
418+
Q_NOWARN_DEPRECATED_PUSH
406419
QMap<int, QString> aliasMap = mComposerAttributeTable->fieldAliasMap();
420+
Q_NOWARN_DEPRECATED_POP
407421
QMap<int, QString>::const_iterator aliasIt = aliasMap.constBegin();
408422
QString expected;
409423
QString evaluated;
@@ -415,7 +429,9 @@ void TestQgsComposerTable::attributeTableGetAlias()
415429
}
416430

417431
fieldAliasMap.clear();
432+
Q_NOWARN_DEPRECATED_PUSH
418433
mComposerAttributeTable->setFieldAliasMap( fieldAliasMap );
434+
Q_NOWARN_DEPRECATED_POP
419435
attributes.clear();
420436
mComposerAttributeTable->setDisplayAttributes( attributes );
421437
}
@@ -427,7 +443,9 @@ void TestQgsComposerTable::attributeTableSort()
427443
sort.append( qMakePair( 0, true ) );
428444
sort.append( qMakePair( 1, false ) );
429445
sort.append( qMakePair( 3, true ) );
446+
Q_NOWARN_DEPRECATED_PUSH
430447
mComposerAttributeTable->setSortAttributes( sort );
448+
Q_NOWARN_DEPRECATED_POP
431449
mComposerAttributeTable->setMaximumNumberOfFeatures( 5 );
432450

433451
QList<QStringList> expectedRows;
@@ -451,7 +469,9 @@ void TestQgsComposerTable::attributeTableSort()
451469
compareTable( expectedRows );
452470

453471
sort.clear();
472+
Q_NOWARN_DEPRECATED_PUSH
454473
mComposerAttributeTable->setSortAttributes( sort );
474+
Q_NOWARN_DEPRECATED_POP
455475
}
456476

457477
void TestQgsComposerTable::attributeTableVisibleOnly()

‎tests/src/gui/testqgsmapcanvas.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ void TestQgsMapCanvas::cleanupTestCase()
3333

3434
void TestQgsMapCanvas::testMapRendererInteraction()
3535
{
36+
Q_NOWARN_DEPRECATED_PUSH
3637
QgsMapRenderer* mr = mCanvas->mapRenderer();
38+
Q_NOWARN_DEPRECATED_POP
3739

3840
// CRS transforms
3941

0 commit comments

Comments
 (0)
Please sign in to comment.