From 6c3390e4cfa487c0f2ca93bd2a228d72f942d479 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Wed, 1 Feb 2012 01:58:39 +0000 Subject: [PATCH] 2012-01-31 17:56 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/qtgui/hbqt_hbqplaintextedit.cpp ! Fixed: a long standing mis-behavior where K_END was not working as expected in column-selection mode. --- harbour/ChangeLog | 5 +++++ .../hbqt/qtgui/hbqt_hbqplaintextedit.cpp | 19 +++++++------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 8cc2295183..1e812cee38 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,11 @@ The license applies to all entries newer than 2009-04-28. */ +2012-01-31 17:56 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbqt/qtgui/hbqt_hbqplaintextedit.cpp + ! Fixed: a long standing mis-behavior where K_END was not + working as expected in column-selection mode. + 2012-02-01 00:50 UTC+0100 Viktor Szakats (harbour syenar.net) * ChangeLog ! added 'incompatible' flag to recent hbhttpd changelog entry diff --git a/harbour/contrib/hbqt/qtgui/hbqt_hbqplaintextedit.cpp b/harbour/contrib/hbqt/qtgui/hbqt_hbqplaintextedit.cpp index c62b2936ae..aec4649ec1 100644 --- a/harbour/contrib/hbqt/qtgui/hbqt_hbqplaintextedit.cpp +++ b/harbour/contrib/hbqt/qtgui/hbqt_hbqplaintextedit.cpp @@ -1012,6 +1012,7 @@ bool HBQPlainTextEdit::hbKeyPressSelectionByApplication( QKeyEvent * event ) } else if( selectionMode == selectionMode_column ) { +HB_TRACE( HB_TR_ALWAYS, ( "HAHAHAHAHAH" ) ); switch( k ) { case Qt::Key_Right: @@ -1050,6 +1051,10 @@ bool HBQPlainTextEdit::hbKeyPressSelectionByApplication( QKeyEvent * event ) } case Qt::Key_End: { + QPlainTextEdit::keyPressEvent( event ); + columnEnds = textCursor().columnNumber(); + break; +#if 0 QTextCursor c( textCursor() ); c.movePosition( QTextCursor::EndOfLine, QTextCursor::MoveAnchor ); if( c.columnNumber() <= columnEnds ) @@ -1062,6 +1067,7 @@ bool HBQPlainTextEdit::hbKeyPressSelectionByApplication( QKeyEvent * event ) event->ignore(); } break; +#endif } case Qt::Key_Up: case Qt::Key_PageUp: @@ -1211,23 +1217,12 @@ bool HBQPlainTextEdit::hbKeyPressSelection( QKeyEvent * event ) break; } case Qt::Key_Home: + case Qt::Key_End: { QPlainTextEdit::keyPressEvent( event ); columnEnds = textCursor().columnNumber(); break; } - case Qt::Key_End: - { - QTextCursor c( textCursor() ); - c.movePosition( QTextCursor::EndOfLine, QTextCursor::MoveAnchor ); - if( c.columnNumber() <= columnEnds ){ - QPlainTextEdit::keyPressEvent( event ); - columnEnds = textCursor().columnNumber();; - } else { - event->ignore(); - } - break; - } case Qt::Key_Up: case Qt::Key_PageUp: case Qt::Key_Down: