Try installing the event filter on the view port.
Qt Code:
installEventFilter(kf); viewport()->installEventFilter(kf);To copy to clipboard, switch view to plain text mode
Try installing the event filter on the view port.
Qt Code:
installEventFilter(kf); viewport()->installEventFilter(kf);To copy to clipboard, switch view to plain text mode
J-P Nurmi
Levon Nikoghosyan (2nd October 2006), Trasmeister (2nd October 2006)
Was wrestling with the same problem with QTableWidget this morning! Thanks!
// OBJECT_NAME means, your instance name of the looking object
// for example:- QTextEdit* sampleEdit = new QTextEdit()
// watched == sampleEdit
if( ( watched == OBJECT_NAME ) && ( e->type()==QEvent::MouseButtonPress ) )
{
QMouseEvent *mousePress = (QMouseEvent*)e;
if ( (mousePress->button() == Qt::LeftButton) || (mousePress->button() == Qt::LeftButton) )
{
// do your code //
return true;
}
}
I think the above code will help you regarding MOUSE PRESS EVENT with QListWidget.
Bookmarks