C++ (Qt)bool Application::notify( QObject* o, QEvent* e ){ QWidget* w = o->isWidgetType() ? qobject_cast< QWidget* >( o ) : 0; if( w && w->window()->property( "_read-only" ).toBool() ) { switch( e->type() ) { case QEvent::KeyPress: case QEvent::KeyRelease: case QEvent::MouseButtonPress: case QEvent::MouseButtonRelease: case QEvent::MouseButtonDblClick: case QEvent::MouseMove: case QEvent::ContextMenu: case QEvent::Wheel: e->accept(); return false; default: break; } } return QApplication::notify( o, e );}