Added mouse press event handling and handled qt bug