Commit f87c8cde authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

WRG: shadow warnings in MonteverdiGui

parent a1bd53c0
......@@ -77,31 +77,31 @@ AbstractDragAndDropEventFilter
/*****************************************************************************/
bool
AbstractDragAndDropEventFilter
::eventFilter( QObject* object, QEvent* event )
::eventFilter( QObject* object, QEvent* e )
{
switch( event->type() )
switch( e->type() )
{
case QEvent::DragEnter:
return DragEnterEvent( object, dynamic_cast< QDragEnterEvent* >( event ) );
return DragEnterEvent( object, dynamic_cast< QDragEnterEvent* >( e ) );
break;
case QEvent::DragMove:
return DragMoveEvent( object, dynamic_cast< QDragMoveEvent* >( event ) );
return DragMoveEvent( object, dynamic_cast< QDragMoveEvent* >( e ) );
break;
case QEvent::DragLeave:
return DragLeaveEvent( object, dynamic_cast< QDragLeaveEvent* >( event ) );
return DragLeaveEvent( object, dynamic_cast< QDragLeaveEvent* >( e ) );
break;
case QEvent::Drop:
return DropEvent( object, dynamic_cast< QDropEvent* >( event ) );
return DropEvent( object, dynamic_cast< QDropEvent* >( e ) );
break;
default:
break;
}
return QObject::eventFilter( object, event );
return QObject::eventFilter( object, e );
}
/*****************************************************************************/
......
......@@ -73,8 +73,8 @@ DoubleValidator
/*******************************************************************************/
DoubleValidator
::DoubleValidator( double bottom, double top, int decimals, QObject* p ) :
QDoubleValidator( bottom, top, decimals, p )
::DoubleValidator( double bottomVal, double topVal, int decim, QObject* p ) :
QDoubleValidator( bottomVal, topVal, decim, p )
{
}
......
......@@ -89,50 +89,50 @@ DropLineEdit
/*******************************************************************************/
void
DropLineEdit
::dragEnterEvent( QDragEnterEvent* event )
::dragEnterEvent( QDragEnterEvent* e )
{
assert( event!=NULL );
assert( e!=NULL );
// Accepts all proposed actions: check will be made in
// dragMoveEvent().
event->acceptProposedAction();
e->acceptProposedAction();
}
/*******************************************************************************/
void
DropLineEdit
::dragMoveEvent( QDragMoveEvent* event )
::dragMoveEvent( QDragMoveEvent* e )
{
assert( event!=NULL );
assert( e!=NULL );
/*
if( ( event->mimeData()->hasText() &&
QUrl( event->mimeData()->text() ).isLocalFile() ) ||
( event->mimeData()->hasFormat(
if( ( e->mimeData()->hasText() &&
QUrl( e->mimeData()->text() ).isLocalFile() ) ||
( e->mimeData()->hasFormat(
"application/x-qabstractitemmodeldatalist" ) ) )
*/
if( event->mimeData()->hasText() ||
event->mimeData()->hasFormat(
if( e->mimeData()->hasText() ||
e->mimeData()->hasFormat(
"application/x-qabstractitemmodeldatalist" ) )
{
event->acceptProposedAction();
e->acceptProposedAction();
}
else
{
event->ignore();
e->ignore();
}
}
/*******************************************************************************/
void
DropLineEdit
::dropEvent( QDropEvent *event )
::dropEvent( QDropEvent *e )
{
assert( event!=NULL );
assert( e!=NULL );
if( event->mimeData()->hasText() )
if( e->mimeData()->hasText() )
{
QUrl url( event->mimeData()->text() );
QUrl url( e->mimeData()->text() );
/*
if( url.isLocalFile() )
......@@ -143,12 +143,12 @@ DropLineEdit
}
*/
}
else if( event->mimeData()->hasFormat(
else if( e->mimeData()->hasFormat(
"application/x-qabstractitemmodeldatalist" ) )
{
// TODO: use simpler mime type
setText(
event->mimeData()->data( "application/x-qabstractitemmodeldatalist" )
e->mimeData()->data( "application/x-qabstractitemmodeldatalist" )
);
}
}
......
......@@ -78,21 +78,21 @@ FilenameDragAndDropEventFilter
/*****************************************************************************/
bool
FilenameDragAndDropEventFilter
::DragEnterEvent( QObject * watched, QDragEnterEvent* event )
::DragEnterEvent( QObject * watched, QDragEnterEvent* e )
{
// qDebug() << this << "::DragEnterEvent(" << object << "," << event << ")";
// qDebug() << event->mimeData()->formats();
// qDebug() << this << "::DragEnterEvent(" << object << "," << e << ")";
// qDebug() << e->mimeData()->formats();
//
// Bypass event its MIME data does not contain any URL(s).
if( !event->mimeData()->hasUrls() )
if( !e->mimeData()->hasUrls() )
return false;
//
// Bypass event if MIME data URL(s) are not all local filenames.
typedef QList< QUrl > QUrlList;
QUrlList urls( event->mimeData()->urls() );
QUrlList urls( e->mimeData()->urls() );
for( QUrlList::const_iterator it( urls.begin() );
it!=urls.end();
......@@ -108,7 +108,7 @@ FilenameDragAndDropEventFilter
#else // QT_VERSION < QT_VERSION_CHECK( 4, 8, 0 )
!it->isLocalFile()
#endif // QT_VERSION < QT_VERSION_CHECK( 4, 8, 0 )
|| event->source()==watched
|| e->source()==watched
)
{
return false;
......@@ -118,7 +118,7 @@ FilenameDragAndDropEventFilter
//
// Accept event if its MIME data contains some URL(s) and they are
// all local filenames.
event->acceptProposedAction();
e->acceptProposedAction();
//
// Eatup event.
......@@ -128,7 +128,7 @@ FilenameDragAndDropEventFilter
/*****************************************************************************/
bool
FilenameDragAndDropEventFilter
::DragLeaveEvent( QObject * /* object */, QDragLeaveEvent * /* event */ )
::DragLeaveEvent( QObject * /* object */, QDragLeaveEvent * /* e */ )
{
// qDebug() << this << "::DragLeaveEvent(" << object << "," << event << ")";
......@@ -151,23 +151,23 @@ FilenameDragAndDropEventFilter
/*****************************************************************************/
bool
FilenameDragAndDropEventFilter
::DropEvent( QObject * watched, QDropEvent * event )
::DropEvent( QObject * watched, QDropEvent * e )
{
// qDebug() << this << "::DropEvent(" << object << "," << event << ")";
// qDebug() << this << "::DropEvent(" << object << "," << e << ")";
assert( event!=NULL );
assert( event->mimeData()!=NULL );
assert( e!=NULL );
assert( e->mimeData()!=NULL );
//
// Bypass event its MIME data does not contain not URL(s).
if( !event->mimeData()->hasUrls() )
if( !e->mimeData()->hasUrls() )
return false;
//
// Bypass event if MIME data URL(s) are not all local filenames.
typedef QList< QUrl > QUrlList;
QUrlList urls( event->mimeData()->urls() );
QUrlList urls( e->mimeData()->urls() );
QStringList filenames;
......@@ -181,7 +181,7 @@ FilenameDragAndDropEventFilter
if( it->isLocalFile() )
#endif // QT_VERSION < QT_VERSION_CHECK( 4, 8, 0 )
{
if( event->source()!=watched )
if( e->source()!=watched )
{
filenames.push_back( it->toLocalFile() );
......
......@@ -73,8 +73,8 @@ namespace mvd
/*******************************************************************************/
HistogramPlotPicker
::HistogramPlotPicker( const PlotCurveVector& curves, QwtPlotCanvas* canvas ) :
QwtPlotPicker( canvas ),
::HistogramPlotPicker( const PlotCurveVector& curves, QwtPlotCanvas* can ) :
QwtPlotPicker( can ),
m_PlotCurves( curves ),
m_RubberBandPens(),
m_IsGrayscaleActivated( false )
......@@ -88,10 +88,10 @@ HistogramPlotPicker
/*******************************************************************************/
HistogramPlotPicker
::HistogramPlotPicker( const PlotCurveVector& curves,
int xAxis,
int yAxis,
QwtPlotCanvas* canvas ) :
QwtPlotPicker( xAxis, yAxis, canvas ),
int xA,
int yA,
QwtPlotCanvas* can ) :
QwtPlotPicker( xA, yA, can ),
m_PlotCurves( curves ),
m_RubberBandPens(),
m_IsGrayscaleActivated( false )
......@@ -106,17 +106,17 @@ HistogramPlotPicker
/*******************************************************************************/
HistogramPlotPicker
::HistogramPlotPicker( const PlotCurveVector& curves,
int xAxis,
int yAxis,
DisplayMode trackerMode,
QwtPlotCanvas* canvas ) :
int xA,
int yA,
DisplayMode tracker,
QwtPlotCanvas* can ) :
QwtPlotPicker(
xAxis,
yAxis,
xA,
yA,
QwtPicker::PointSelection,
QwtPicker::UserRubberBand,
trackerMode,
canvas ),
tracker,
can ),
m_PlotCurves( curves ),
m_RubberBandPens(),
m_IsGrayscaleActivated( false )
......@@ -135,13 +135,13 @@ void
HistogramPlotPicker
::SetRubberBandPen( RgbwChannel channel, const QPen& pen )
{
CountType begin = 0;
CountType end = 0;
CountType start = 0;
CountType stop = 0;
if( !RgbwBounds( begin, end, channel ) )
if( !RgbwBounds( start, stop, channel ) )
return;
for( CountType i=begin; i<end; ++i )
for( CountType i=start; i<stop; ++i )
{
m_RubberBandPens[ i ] = pen;
}
......@@ -188,15 +188,15 @@ HistogramPlotPicker
pos.x(), rect.top()
);
CountType begin = 0;
CountType end = 0;
CountType start = 0;
CountType stop = 0;
if( !RgbwBounds( begin, end, RGBW_CHANNEL_ALL ) )
if( !RgbwBounds( start, stop, RGBW_CHANNEL_ALL ) )
return;
QwtDoublePoint p( invTransform( pos ) );
for( CountType i=begin; i<end; ++i )
for( CountType i=start; i<stop; ++i )
if( m_PlotCurves[ i ]->isVisible() )
{
// RgbwChannel channel = static_cast< RgbwChannel >( i );
......@@ -239,11 +239,11 @@ HistogramPlotPicker
QString text;
text.sprintf( "%.4f", point.x() );
CountType begin = 0;
CountType end = 0;
CountType start = 0;
CountType stop = 0;
if( RgbwBounds( begin, end, RGBW_CHANNEL_ALL ) )
for( CountType i=begin; i<end; ++i )
if( RgbwBounds( start, stop, RGBW_CHANNEL_ALL ) )
for( CountType i=start; i<stop; ++i )
if( m_PlotCurves[ i ]->isVisible() )
{
double c0 = 0.0;
......
......@@ -352,12 +352,12 @@ HistogramWidget
void
HistogramWidget
::SetData( RgbwChannel channel,
double * const x, double * const y, size_t size,
double * const xVal, double * const yVal, size_t sizeVal,
double xMin, double yMin,
double xMax, double yMax )
{
assert( ( x==NULL && y==NULL && size==0 ) ||
( x!=NULL && y!=NULL && size!=0 ) );
assert( ( xVal==NULL && yVal==NULL && sizeVal==0 ) ||
( xVal!=NULL && yVal!=NULL && sizeVal!=0 ) );
CountType begin = 0;
CountType end = 0;
......@@ -370,16 +370,16 @@ HistogramWidget
assert( i<HistogramWidget::CURVE_COUNT );
assert( m_PlotCurves[ i ]!=NULL );
m_PlotCurves[ i ]->setData( x, y, size );
m_PlotCurves[ i ]->setData( xVal, yVal, sizeVal );
if( x==NULL && y==NULL )
if( xVal==NULL && yVal==NULL )
m_PlotCurves[ i ]->setVisible( false );
/*
qDebug()
<< RGBW_CHANNEL_NAMES[ i ]
<< "[" << xMin << "; " << xMax << "]"
<< "x [" << yMin << "; " << yMax << "]";
<< "xVal [" << yMin << "; " << yMax << "]";
*/
m_Bounds[ i ].m_XMin = xMin;
......@@ -516,7 +516,7 @@ HistogramWidget
for( CountType i=begin; i<end; ++i )
{
bool isVisible =
bool isCurveVisible =
m_IsGrayscaleActivated
? i==RGBW_CHANNEL_WHITE
: ( index==RGBW_CHANNEL_WHITE
......@@ -525,9 +525,9 @@ HistogramWidget
assert( i<HistogramWidget::CURVE_COUNT );
m_PlotCurves[ i ]->setVisible( isVisible );
m_LowPlotMarkers[ i ]->setVisible( isVisible );
m_HighPlotMarkers[ i ]->setVisible( isVisible );
m_PlotCurves[ i ]->setVisible( isCurveVisible );
m_LowPlotMarkers[ i ]->setVisible( isCurveVisible );
m_HighPlotMarkers[ i ]->setVisible( isCurveVisible );
}
}
......
......@@ -160,8 +160,8 @@ I18nMainWindow
VectorImageModel *
I18nMainWindow
::ImportImage( const QString& filename,
int width,
int height )
int widthVal,
int heightVal )
{
return
QObjectCast< VectorImageModel * >(
......@@ -170,7 +170,7 @@ I18nMainWindow
// It will be auto-deleted by background-task.
new ImageImporter(
filename,
width, height
widthVal, heightVal
)
),
"QObject is not a VectorImageModel."
......@@ -265,9 +265,9 @@ I18nMainWindow
/*****************************************************************************/
void
I18nMainWindow
::closeEvent( QCloseEvent * event )
::closeEvent( QCloseEvent * e )
{
QMainWindow::closeEvent( event );
QMainWindow::closeEvent( e );
}
/*****************************************************************************/
......
......@@ -368,20 +368,20 @@ ImageViewManipulator
/******************************************************************************/
void
ImageViewManipulator
::MousePressEvent( QMouseEvent* event )
::MousePressEvent( QMouseEvent* e )
{
// qDebug() << this << "::MousePressEvent(" << event << ")";
// qDebug() << this << "::MousePressEvent(" << e << ")";
assert( event!=NULL );
assert( e!=NULL );
switch( event->button() )
switch( e->button() )
{
case Qt::NoButton:
break;
case Qt::LeftButton:
m_MousePressPosition = event->pos();
m_MousePressPosition = e->pos();
m_MousePressOrigin = m_ViewSettings->GetOrigin();
m_IsMouseDragging = true;
break;
......@@ -418,29 +418,29 @@ ImageViewManipulator
/******************************************************************************/
void
ImageViewManipulator
::MouseMoveEvent( QMouseEvent* event )
::MouseMoveEvent( QMouseEvent* e )
{
// qDebug() << this << "::MouseMoveEvent(" << event << ")";
// qDebug() << this << "::MouseMoveEvent(" << e << ")";
assert( event!=NULL );
assert( e!=NULL );
/*
qDebug() << "------------------------------------------------";
qDebug() << this << ":" << event;
qDebug() << this << ":" << e;
*/
Qt::MouseButtons buttons = event->buttons();
Qt::KeyboardModifiers modifiers = event->modifiers();
Qt::MouseButtons buttons = e->buttons();
Qt::KeyboardModifiers modifiers = e->modifiers();
if( buttons==Qt::LeftButton &&
( modifiers==Qt::NoModifier || modifiers== Qt::ControlModifier ) )
{
// Cursor moves from press position to current position;
// Image moves the same direction, so apply the negative translation.
Translate( m_MousePressPosition - event->pos() );
Translate( m_MousePressPosition - e->pos() );
m_MousePressPosition = event->pos();
m_MousePressPosition = e->pos();
emit RefreshViewRequested();
......@@ -456,23 +456,23 @@ ImageViewManipulator
/******************************************************************************/
void
ImageViewManipulator
::MouseReleaseEvent( QMouseEvent* event)
::MouseReleaseEvent( QMouseEvent* e)
{
// qDebug() << this << "::MouseReleaseEvent(" << event << ")";
// qDebug() << this << "::MouseReleaseEvent(" << e << ")";
assert( event!=NULL );
assert( e!=NULL );
/*
qDebug() << this << ":" << event;
qDebug() << this << ":" << e;
*/
/*
Qt::MouseButtons buttons = event->buttons();
Qt::KeyboardModifiers modifiers = event->modifiers();
Qt::MouseButtons buttons = e->buttons();
Qt::KeyboardModifiers modifiers = e->modifiers();
*/
// PointType center;
switch( event->button() )
switch( e->button() )
{
case Qt::NoButton:
break;
......@@ -507,19 +507,19 @@ ImageViewManipulator
/******************************************************************************/
void
ImageViewManipulator
::MouseDoubleClickEvent( QMouseEvent * event )
::MouseDoubleClickEvent( QMouseEvent * e )
{
// qDebug() << this << "::MouseDoubleClickEvent(" << event << ")";
// qDebug() << this << "::MouseDoubleClickEvent(" << e << ")";
assert( event!=NULL );
assert( e!=NULL );
if( event->button()==Qt::LeftButton && event->modifiers()==Qt::NoModifier )
if( e->button()==Qt::LeftButton && e->modifiers()==Qt::NoModifier )
{
PointType center;
assert( !m_ViewSettings.IsNull() );
const QPoint & p = event->pos();
const QPoint & p = e->pos();
m_ViewSettings->ScreenToViewPortTransform( p.x(), p.y(), center[ 0 ], center[ 1 ] );
......@@ -530,49 +530,49 @@ ImageViewManipulator
/******************************************************************************/
void
ImageViewManipulator
::ResizeEvent( QResizeEvent * mvdUseInDebug( event ) )
::ResizeEvent( QResizeEvent * mvdUseInDebug( e ) )
{
assert( event!=NULL );
assert( e!=NULL );
// qDebug() << this << "::ResizeEvent(" << event << ")";
// qDebug() << this << "::ResizeEvent(" << e << ")";
/*
qDebug() << m_ViewSettings.GetPointer();
otb::ViewSettings::SizeType size( m_ViewSettings->GetViewportSize() );
qDebug() << size[ 0 ] << "," << size[ 1 ] << "\t" << event->size();
qDebug() << size[ 0 ] << "," << size[ 1 ] << "\t" << e->size();
*/
#if USE_VIEW_SETTINGS_SIDE_EFFECT
#else // USE_VIEW_SETTINGS_SIDE_EFFECT
SetViewportSize( event->size().width(), event->size().height() );
SetViewportSize( e->size().width(), e->size().height() );
#endif // USE_VIEW_SETTINGS_SIDE_EFFECT
}
/******************************************************************************/
void
ImageViewManipulator
::WheelEvent( QWheelEvent* event )
::WheelEvent( QWheelEvent* e )
{
assert( event!=NULL );
assert( e!=NULL );
Qt::MouseButtons buttons = event->buttons();
Qt::KeyboardModifiers modifiers = event->modifiers();
Qt::MouseButtons buttons = e->buttons();
Qt::KeyboardModifiers modifiers = e->modifiers();
if( buttons!=Qt::NoButton )
return;
// Delta is rotation distance in number of 8th of degrees (see
// http://qt-project.org/doc/qt-4.8/qwheelevent.html#delta).
assert( event->delta()!=0 );