Hi there,
I am trying to get a simple thing running: alowing the user to delete a listviewitem with the "del" key. But it seems that the listview doesn't get that key. Some other keys I tried are not a problem....
It seem that something is catching my keay away?
Any help is welcome
Thanks in advance
Rafael
void CEngravingDialog
::keyPressEvent( QKeyEvent *event
) {
if( listViewElements->hasMouse() )
{
switch( event->key() )
{
case Key_Delete: //Delete if item in listview is selected
ButtonDelete();
break;
default:
}
}
}
void CEngravingDialog::keyPressEvent( QKeyEvent *event )
{
if( listViewElements->hasMouse() )
{
switch( event->key() )
{
case Key_Delete: //Delete if item in listview is selected
ButtonDelete();
break;
default:
QWidget::keyPressEvent( event );
}
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks