From a7c9c99e98f116a57e401f3e3c5530af3cfdf991 Mon Sep 17 00:00:00 2001 From: ouv Date: Mon, 1 Dec 2008 11:56:56 +0000 Subject: [PATCH] Dump Python extension --- src/SalomeApp/SalomeApp_DoubleSpinBox.cxx | 12 ++++++++++++ src/SalomeApp/SalomeApp_DoubleSpinBox.h | 3 ++- src/SalomeApp/SalomeApp_IntSpinBox.cxx | 12 ++++++++++++ src/SalomeApp/SalomeApp_IntSpinBox.h | 1 + 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/SalomeApp/SalomeApp_DoubleSpinBox.cxx b/src/SalomeApp/SalomeApp_DoubleSpinBox.cxx index 991035e2a..b40231f23 100644 --- a/src/SalomeApp/SalomeApp_DoubleSpinBox.cxx +++ b/src/SalomeApp/SalomeApp_DoubleSpinBox.cxx @@ -28,6 +28,7 @@ #include "SALOMEDSClient_ClientFactory.hxx" #include CORBA_SERVER_HEADER(SALOMEDS) +#include #include /*! @@ -321,6 +322,17 @@ bool SalomeApp_DoubleSpinBox::findVariable( const QString& name, double& value ) return false; } +/*! + \brief This function is called when the spinbox recieves key press event. +*/ +void SalomeApp_DoubleSpinBox::keyPressEvent( QKeyEvent* e ) +{ + if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) + QWidget::keyPressEvent( e ); + else + QtxDoubleSpinBox::keyPressEvent( e ); +} + /*! \brief This function is called when the spinbox recieves show event. */ diff --git a/src/SalomeApp/SalomeApp_DoubleSpinBox.h b/src/SalomeApp/SalomeApp_DoubleSpinBox.h index dcb4e37c0..1bb25964d 100644 --- a/src/SalomeApp/SalomeApp_DoubleSpinBox.h +++ b/src/SalomeApp/SalomeApp_DoubleSpinBox.h @@ -65,7 +65,8 @@ protected: bool findVariable( const QString&, double& ) const; - protected: +protected: + virtual void keyPressEvent( QKeyEvent* ); virtual void showEvent( QShowEvent* ); protected slots: diff --git a/src/SalomeApp/SalomeApp_IntSpinBox.cxx b/src/SalomeApp/SalomeApp_IntSpinBox.cxx index 27b91b6da..c950062f6 100644 --- a/src/SalomeApp/SalomeApp_IntSpinBox.cxx +++ b/src/SalomeApp/SalomeApp_IntSpinBox.cxx @@ -28,6 +28,7 @@ #include "SALOMEDSClient_ClientFactory.hxx" #include CORBA_SERVER_HEADER(SALOMEDS) +#include #include /*! @@ -274,6 +275,17 @@ bool SalomeApp_IntSpinBox::findVariable( const QString& name, int& value ) const return false; } +/*! + \brief This function is called when the spinbox recieves key press event. +*/ +void SalomeApp_IntSpinBox::keyPressEvent( QKeyEvent* e ) +{ + if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) + QWidget::keyPressEvent( e ); + else + QtxIntSpinBox::keyPressEvent( e ); +} + /*! \brief This function is called when the spinbox recieves show event. */ diff --git a/src/SalomeApp/SalomeApp_IntSpinBox.h b/src/SalomeApp/SalomeApp_IntSpinBox.h index 6eb189736..82508d83b 100644 --- a/src/SalomeApp/SalomeApp_IntSpinBox.h +++ b/src/SalomeApp/SalomeApp_IntSpinBox.h @@ -64,6 +64,7 @@ protected: bool findVariable( const QString&, int& ) const; protected: + virtual void keyPressEvent( QKeyEvent* ); virtual void showEvent( QShowEvent* ); protected slots: -- 2.39.2