Commit e12c9f58 authored by Ludovic Hussonnois's avatar Ludovic Hussonnois

ENH: Connect Signal/Slot to edit projection reference zoom level.

parent 33988433
......@@ -107,7 +107,6 @@ namespace mvd
/* CONSTANTS */
#define REFERENCE_LAYER_COMBOBOX_NAME "referenceLayerComboBox"
#define REFERENCE_PROJECTION_ZOOM_LINE_EDIT "ProjZoomLineEdit"
#define FORCE_NO_GLSL ( ( defined( OTB_DEBUG ) && 0 ) || 0 )
......@@ -142,9 +141,9 @@ MainWindow
#endif // USE_TABBED_VIEW
m_StatusBarWidget( NULL ),
m_ShaderWidget( NULL ),
m_ProjectionBarWidget( NULL ),
m_FilenameDragAndDropEventFilter( NULL ),
m_KeymapDialog( NULL ),
m_ProjectionBarWidget( NULL ),
m_GLSL140( -2 ),
m_isGLSLAvailable( false ),
m_ForceNoGLSL( false )
......@@ -639,23 +638,21 @@ MainWindow
assert( m_ProjectionBarWidget!=NULL );
assert( m_ImageView!=NULL );
/*
QObject::connect(
m_ImageView,
SIGNAL( ScaleChanged( double, double ) ),
// to:
m_ProjectionBarWidget,
SLOT( SetProjectionScale( double, double ) )
m_ImageView,
SIGNAL( ScaleChanged( double, double ) ),
// to:
m_ProjectionBarWidget,
SLOT( SetProjectionScale( double, double ) )
);
QObject::connect(
m_ProjectionBarWidget,
SIGNAL( ProjectionScaleChanged( double ) ),
// to:
m_ImageView->GetManipulator(),
SLOT( ZoomTo( double ) )
m_ProjectionBarWidget,
SIGNAL( ProjectionScaleChanged( double ) ),
// to:
m_ImageView->GetManipulator(),
SLOT( ZoomTo( double ) )
);
*/
}
......
......@@ -84,6 +84,9 @@ public:
/** \brief Destructor. */
~ProjectionBarWidget() ITK_OVERRIDE;
public slots:
void SetProjectionScale(double scale_x, double scale_y);
private:
/**
......
......@@ -37,6 +37,19 @@ ProjectionBarWidget::~ProjectionBarWidget()
m_UI = NULL;
}
void ProjectionBarWidget::SetProjectionScale(double scale_x, double scale_y)
{
QString text = "1:1";
if( scale_x>1.0 )
text = QString( "%1:1" ).arg( scale_x );
else if( scale_x<1.0 )
text = QString( "1:%1" ).arg( 1.0 / scale_x );
m_UI->projectionScaleLineEdit->setText(text);
}
void ProjectionBarWidget::on_projectionScaleLineEdit_returnPressed()
{
ChangeScale();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment