diff --git a/modules/highgui/src/window_QT.h b/modules/highgui/src/window_QT.h
index 641dfebd81..b08d7133cf 100644
--- a/modules/highgui/src/window_QT.h
+++ b/modules/highgui/src/window_QT.h
@@ -414,7 +414,7 @@ public:
 protected:
     void icvmouseEvent(QMouseEvent* event, type_mouse_event category);
     void icvmouseHandler(QMouseEvent* event, type_mouse_event category, int& cv_event, int& flags);
-    void icvmouseProcessing(QPointF pt, int cv_event, int flags);
+    virtual void icvmouseProcessing(QPointF pt, int cv_event, int flags);
 
     CvMouseCallback mouseCallback;
     void* mouseData;