Skip to content

Commit db17513

Browse files
committed
Fix some warnings, incorrect use of abs for double values
1 parent 76927bb commit db17513

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

src/core/composer/qgscomposermousehandles.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ void QgsComposerMouseHandles::dragMouseMove( const QPointF& currentPosition, boo
824824
{
825825
//constrained (shift) moving should lock to horizontal/vertical movement
826826
//reset the smaller of the x/y movements
827-
if ( abs( moveRectX ) <= abs( moveRectY ) )
827+
if ( qAbs( moveRectX ) <= qAbs( moveRectY ) )
828828
{
829829
moveRectX = 0;
830830
}

src/core/symbology-ng/qgscptcityarchive.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -967,8 +967,7 @@ QMap< QString, QStringList > QgsCptCityDirectoryItem::rampsMap()
967967
QString curName, prevName, prevPath, curVariant, curSep, schemeName;
968968
QStringList listVariant;
969969
QStringList schemeNamesAll, schemeNames;
970-
int num;
971-
bool ok, prevAdd, curAdd;
970+
bool prevAdd, curAdd;
972971

973972
QDir dir( QgsCptCityArchive::defaultBaseDir() + "/" + mPath );
974973
schemeNamesAll = dir.entryList( QStringList( "*.svg" ), QDir::Files, QDir::Name );

src/gui/raster/qgsrasterhistogramwidget.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ QString findClosestTickVal( double target, const QwtScaleDiv * scale, int div =
10681068
current += diff;
10691069
if ( current > target )
10701070
{
1071-
closest = ( abs( target - current + diff ) < abs( target - current ) ) ? current - diff : current;
1071+
closest = ( qAbs( target - current + diff ) < qAbs( target - current ) ) ? current - diff : current;
10721072
break;
10731073
}
10741074
}

tests/qt_modeltest/modeltest.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ void ModelTest::data()
497497
*/
498498
void ModelTest::rowsAboutToBeInserted( const QModelIndex &parent, int start, int end )
499499
{
500-
// Q_UNUSED(end);
500+
Q_UNUSED( end );
501501
// qDebug() << "rowsAboutToBeInserted" << "start=" << start << "end=" << end << "parent=" << model->data ( parent ).toString()
502502
// << "current count of parent=" << model->rowCount ( parent ); // << "display of last=" << model->data( model->index(start-1, 0, parent) );
503503
// qDebug() << model->index(start-1, 0, parent) << model->data( model->index(start-1, 0, parent) );

0 commit comments

Comments
 (0)