From 1e92e82bb39374e28ad5277682481d4e7429c209 Mon Sep 17 00:00:00 2001 From: asl Date: Fri, 30 Dec 2005 12:32:05 +0000 Subject: [PATCH] PAL8238, remarks: if user switch to other cell by keyboard or by mouse click, the all contents of editor must be selected. --- src/StdMeshersGUI/StdMeshersGUI_DistrTable.cxx | 8 ++++++++ src/StdMeshersGUI/StdMeshersGUI_DistrTable.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/StdMeshersGUI/StdMeshersGUI_DistrTable.cxx b/src/StdMeshersGUI/StdMeshersGUI_DistrTable.cxx index a68b6c9c7..31eeae6fe 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_DistrTable.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_DistrTable.cxx @@ -71,6 +71,14 @@ void StdMeshersGUI_DistrTable::stopEditing( const bool accept ) endEdit( currEditRow(), currEditCol(), accept, false ); } +QWidget* StdMeshersGUI_DistrTable::beginEdit( int row, int col, bool replace ) +{ + QWidget* w = QTable::beginEdit( row, col, replace ); + if( w && w->inherits( "QLineEdit" ) ) + ( ( QLineEdit* )w )->selectAll(); + return w; +} + void StdMeshersGUI_DistrTable::edit( const int r, const int c ) { if( isEditing() ) diff --git a/src/StdMeshersGUI/StdMeshersGUI_DistrTable.h b/src/StdMeshersGUI/StdMeshersGUI_DistrTable.h index c3597dfe2..a6f7f6106 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_DistrTable.h +++ b/src/StdMeshersGUI/StdMeshersGUI_DistrTable.h @@ -72,6 +72,7 @@ protected: virtual QWidget* createEditor( int, int, bool ) const; virtual bool eventFilter( QObject*, QEvent* ); virtual void keyPressEvent( QKeyEvent* ); + virtual QWidget* beginEdit( int row, int col, bool replace ); virtual void edit( const int, const int ); private slots: -- 2.30.2