Fix some warnings, incorrect use of abs for double values

This commit is contained in:
Nyall Dawson 2015-02-10 18:54:18 +11:00
parent 76927bb833
commit db17513287
4 changed files with 4 additions and 5 deletions

View File

@ -824,7 +824,7 @@ void QgsComposerMouseHandles::dragMouseMove( const QPointF& currentPosition, boo
{
//constrained (shift) moving should lock to horizontal/vertical movement
//reset the smaller of the x/y movements
if ( abs( moveRectX ) <= abs( moveRectY ) )
if ( qAbs( moveRectX ) <= qAbs( moveRectY ) )
{
moveRectX = 0;
}

View File

@ -967,8 +967,7 @@ QMap< QString, QStringList > QgsCptCityDirectoryItem::rampsMap()
QString curName, prevName, prevPath, curVariant, curSep, schemeName;
QStringList listVariant;
QStringList schemeNamesAll, schemeNames;
int num;
bool ok, prevAdd, curAdd;
bool prevAdd, curAdd;
QDir dir( QgsCptCityArchive::defaultBaseDir() + "/" + mPath );
schemeNamesAll = dir.entryList( QStringList( "*.svg" ), QDir::Files, QDir::Name );

View File

@ -1068,7 +1068,7 @@ QString findClosestTickVal( double target, const QwtScaleDiv * scale, int div =
current += diff;
if ( current > target )
{
closest = ( abs( target - current + diff ) < abs( target - current ) ) ? current - diff : current;
closest = ( qAbs( target - current + diff ) < qAbs( target - current ) ) ? current - diff : current;
break;
}
}

View File

@ -497,7 +497,7 @@ void ModelTest::data()
*/
void ModelTest::rowsAboutToBeInserted( const QModelIndex &parent, int start, int end )
{
// Q_UNUSED(end);
Q_UNUSED( end );
// qDebug() << "rowsAboutToBeInserted" << "start=" << start << "end=" << end << "parent=" << model->data ( parent ).toString()
// << "current count of parent=" << model->rowCount ( parent ); // << "display of last=" << model->data( model->index(start-1, 0, parent) );
// qDebug() << model->index(start-1, 0, parent) << model->data( model->index(start-1, 0, parent) );