Skip to content
Permalink
Browse files
fix warnings
  • Loading branch information
jef-n committed May 15, 2014
1 parent 57c7b8a commit 6a6cc194d976f857fdbaf9afcc6c08727c8704f5
@@ -107,53 +107,6 @@ void QgsAtlasComposition::setComposerMap( QgsComposerMap* map )
map->setAtlasDriven( true );
}

bool QgsAtlasComposition::fixedScale() const
{
//deprecated method. Until removed just return the property for the first atlas-enabled composer map
QgsComposerMap * map = composerMap();
if ( !map )
{
return false;
}

return map->atlasFixedScale();
}

void QgsAtlasComposition::setFixedScale( bool fixed )
{
//deprecated method. Until removed just set the property for the first atlas-enabled composer map
QgsComposerMap * map = composerMap();
if ( !map )
{
return;
}

map->setAtlasFixedScale( fixed );
}

float QgsAtlasComposition::margin() const
{
//deprecated method. Until removed just return the property for the first atlas-enabled composer map
QgsComposerMap * map = composerMap();
if ( !map )
{
return 0;
}

return map->atlasMargin();
}

void QgsAtlasComposition::setMargin( float margin )
{
//deprecated method. Until removed just set the property for the first atlas-enabled composer map
QgsComposerMap * map = composerMap();
if ( !map )
{
return;
}

map->setAtlasMargin(( double ) margin );
}

int QgsAtlasComposition::sortKeyAttributeIndex() const
{
@@ -745,4 +698,52 @@ void QgsAtlasComposition::evalFeatureFilename()
}
}

Q_NOWARN_DEPRECATED_PUSH
bool QgsAtlasComposition::fixedScale() const
{
//deprecated method. Until removed just return the property for the first atlas-enabled composer map
QgsComposerMap * map = composerMap();
if ( !map )
{
return false;
}

return map->atlasFixedScale();
}

void QgsAtlasComposition::setFixedScale( bool fixed )
{
//deprecated method. Until removed just set the property for the first atlas-enabled composer map
QgsComposerMap * map = composerMap();
if ( !map )
{
return;
}

map->setAtlasFixedScale( fixed );
}

float QgsAtlasComposition::margin() const
{
//deprecated method. Until removed just return the property for the first atlas-enabled composer map
QgsComposerMap * map = composerMap();
if ( !map )
{
return 0;
}

return map->atlasMargin();
}

void QgsAtlasComposition::setMargin( float margin )
{
//deprecated method. Until removed just set the property for the first atlas-enabled composer map
QgsComposerMap * map = composerMap();
if ( !map )
{
return;
}

map->setAtlasMargin(( double ) margin );
}
Q_NOWARN_DEPRECATED_POP
@@ -43,6 +43,7 @@ class CORE_EXPORT QgsComposerAttributeTableColumnModel: public QAbstractTableMod

/**Constructor for QgsComposerAttributeTableColumnModel.
* @param composerTable QgsComposerAttributeTable the model is attached to
* @param parent optional parent
*/
QgsComposerAttributeTableColumnModel( QgsComposerAttributeTable *composerTable, QObject *parent = 0 );
virtual ~QgsComposerAttributeTableColumnModel();
@@ -140,6 +141,7 @@ class CORE_EXPORT QgsComposerTableSortColumnsProxyModel: public QSortFilterProxy
/**Constructor for QgsComposerTableSortColumnsProxyModel.
* @param composerTable QgsComposerAttributeTable the model is attached to
* @param filterType filter for columns, controls whether sorted or unsorted columns are shown
* @param parent optional parent
*/
QgsComposerTableSortColumnsProxyModel( QgsComposerAttributeTable *composerTable, ColumnFilterType filterType, QObject *parent = 0 );

@@ -173,7 +175,7 @@ class CORE_EXPORT QgsComposerTableSortColumnsProxyModel: public QSortFilterProxy
/**Returns the QgsComposerTableColumn corresponding to an index from the source
* QgsComposerAttributeTableColumnModel model.
* @returns QgsComposerTableColumn for specified index from QgsComposerAttributeTableColumnModel
* @param index a QModelIndex
* @param sourceIndex a QModelIndex
* @note added in 2.3
* @see columnFromRow
* @see columnFromIndex
@@ -314,6 +314,12 @@ class CORE_EXPORT QgsComposerItem: public QObject, public QGraphicsRectItem
void drawText( QPainter* p, double x, double y, const QString& text, const QFont& font ) const;

/**Like the above, but with a rectangle for multiline text
* @param p painter to use
* @param rect rectangle to draw into
* @param text text to draw
* @param font font to use
* @param halignment optional horizontal alignment
* @param valignment optional vertical alignment
* @param flags allows for passing Qt::TextFlags to control appearance of rendered text
*/
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;
@@ -110,7 +110,10 @@ class CORE_EXPORT QgsEllipseSymbolLayerV2: public QgsMarkerSymbolLayerV2
/**Setup mPainterPath
@param symbolName name of symbol
@param context render context
@param f feature f to render (0 if no data defined rendering)*/
@param scaledWidth optional width
@param scaledHeight optional height
@param f optional feature to render (0 if no data defined rendering)
*/
void preparePath( const QString& symbolName, QgsSymbolV2RenderContext& context, double* scaledWidth = 0, double* scaledHeight = 0, const QgsFeature* f = 0 );

/**True if this symbol layer uses a data defined property*/
@@ -208,6 +208,8 @@ void QgsSymbolsListWidget::setLineWidth( double width )

void QgsSymbolsListWidget::symbolAddedToStyle( QString name, QgsSymbolV2* symbol )
{
Q_UNUSED( name );
Q_UNUSED( symbol );
populateSymbolView();
}

@@ -215,9 +215,11 @@ void TestQgsAtlasComposition::autoscale_render()

void TestQgsAtlasComposition::autoscale_render_2_0_api()
{
Q_NOWARN_DEPRECATED_PUSH
mAtlas->setComposerMap( mAtlasMap );
mAtlas->setFixedScale( false );
mAtlas->setMargin( 0.10f );
Q_NOWARN_DEPRECATED_POP

mAtlas->beginRender();

@@ -230,9 +232,11 @@ void TestQgsAtlasComposition::autoscale_render_2_0_api()
QVERIFY( checker.testComposition( mReport, 0, 200 ) );
}
mAtlas->endRender();
Q_NOWARN_DEPRECATED_PUSH
mAtlas->setComposerMap( 0 );
mAtlas->setFixedScale( false );
mAtlas->setMargin( 0 );
Q_NOWARN_DEPRECATED_POP
}

void TestQgsAtlasComposition::fixedscale_render()
@@ -260,8 +264,10 @@ void TestQgsAtlasComposition::fixedscale_render()
void TestQgsAtlasComposition::fixedscale_render_2_0_api()
{
mAtlasMap->setNewExtent( QgsRectangle( 209838.166, 6528781.020, 610491.166, 6920530.620 ) );
Q_NOWARN_DEPRECATED_PUSH
mAtlas->setComposerMap( mAtlasMap );
mAtlas->setFixedScale( true );
Q_NOWARN_DEPRECATED_POP
mAtlas->beginRender();

for ( int fit = 0; fit < 2; ++fit )
@@ -273,8 +279,10 @@ void TestQgsAtlasComposition::fixedscale_render_2_0_api()
QVERIFY( checker.testComposition( mReport, 0, 200 ) );
}
mAtlas->endRender();
Q_NOWARN_DEPRECATED_PUSH
mAtlas->setComposerMap( 0 );
mAtlas->setFixedScale( false );
Q_NOWARN_DEPRECATED_POP
}

void TestQgsAtlasComposition::two_map_autoscale_render()
@@ -322,7 +322,9 @@ void TestQgsComposerTable::attributeTableSetAliasOnSubset()
aliases.insert( 1, QString( "1Heading" ) );
aliases.insert( 3, QString( "2Pilots" ) );
aliases.insert( 4, QString( "3Cabin Crew" ) );
Q_NOWARN_DEPRECATED_PUSH
mComposerAttributeTable->setFieldAliasMap( aliases );
Q_NOWARN_DEPRECATED_POP

//get header labels and compare
QMap<int, QString> headerMap = mComposerAttributeTable->headerLabels();
@@ -338,7 +340,9 @@ void TestQgsComposerTable::attributeTableSetAliasOnSubset()
attributes.clear();
aliases.clear();
mComposerAttributeTable->setDisplayAttributes( attributes );
Q_NOWARN_DEPRECATED_PUSH
mComposerAttributeTable->setFieldAliasMap( aliases );
Q_NOWARN_DEPRECATED_POP
}

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

Q_NOWARN_DEPRECATED_PUSH
QSet<int> evaluated = mComposerAttributeTable->displayAttributes();
Q_NOWARN_DEPRECATED_POP

QCOMPARE( evaluated, attributes );

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

fieldAliasMap.insert( 0, QString( "alias 0" ) );
fieldAliasMap.insert( 3, QString( "alias 3" ) );
Q_NOWARN_DEPRECATED_PUSH
mComposerAttributeTable->setFieldAliasMap( fieldAliasMap );
Q_NOWARN_DEPRECATED_POP

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

fieldAliasMap.clear();
Q_NOWARN_DEPRECATED_PUSH
mComposerAttributeTable->setFieldAliasMap( fieldAliasMap );
Q_NOWARN_DEPRECATED_POP
}

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

fieldAliasMap.insert( 1, QString( "alias 1" ) );
fieldAliasMap.insert( 2, QString( "alias 2" ) );
Q_NOWARN_DEPRECATED_PUSH
mComposerAttributeTable->setFieldAliasMap( fieldAliasMap );
Q_NOWARN_DEPRECATED_POP

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

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

fieldAliasMap.clear();
Q_NOWARN_DEPRECATED_PUSH
mComposerAttributeTable->setFieldAliasMap( fieldAliasMap );
Q_NOWARN_DEPRECATED_POP
attributes.clear();
mComposerAttributeTable->setDisplayAttributes( attributes );
}
@@ -427,7 +443,9 @@ void TestQgsComposerTable::attributeTableSort()
sort.append( qMakePair( 0, true ) );
sort.append( qMakePair( 1, false ) );
sort.append( qMakePair( 3, true ) );
Q_NOWARN_DEPRECATED_PUSH
mComposerAttributeTable->setSortAttributes( sort );
Q_NOWARN_DEPRECATED_POP
mComposerAttributeTable->setMaximumNumberOfFeatures( 5 );

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

sort.clear();
Q_NOWARN_DEPRECATED_PUSH
mComposerAttributeTable->setSortAttributes( sort );
Q_NOWARN_DEPRECATED_POP
}

void TestQgsComposerTable::attributeTableVisibleOnly()
@@ -33,7 +33,9 @@ void TestQgsMapCanvas::cleanupTestCase()

void TestQgsMapCanvas::testMapRendererInteraction()
{
Q_NOWARN_DEPRECATED_PUSH
QgsMapRenderer* mr = mCanvas->mapRenderer();
Q_NOWARN_DEPRECATED_POP

// CRS transforms

0 comments on commit 6a6cc19

Please sign in to comment.