Alundra
23rd January 2015, 01:17
Hi,
I have inherited QListView to have keypress event to handle the enter/return key.
All works fine but one problem exists, if you enter during edit of an item, that does the action.
Here the actual code :
virtual void keyPressEvent( QKeyEvent* event )
{
QListView::keyPressEvent( event );
if( ( event->key() == Qt::Key_Enter ) || ( event->key() == Qt::Key_Return ) )
ActivateSelectedItem();
}
How bypass the action during edit of the item ?
Thanks for the help
I have inherited QListView to have keypress event to handle the enter/return key.
All works fine but one problem exists, if you enter during edit of an item, that does the action.
Here the actual code :
virtual void keyPressEvent( QKeyEvent* event )
{
QListView::keyPressEvent( event );
if( ( event->key() == Qt::Key_Enter ) || ( event->key() == Qt::Key_Return ) )
ActivateSelectedItem();
}
How bypass the action during edit of the item ?
Thanks for the help