By doesn't work i mean that it acts like I wouldn't change anything at all: tab widget reacts as it is supposed to to the left mouse button, but no reaction whatsoever when I use the right one.

The "Qt::TabWidget::mousePressEvent(event)" statement won't work, in fact it prevents whole program from running. Probably you ment something else but Ruby syntax made it incorrect, if so please write what the statement you suggested would look like in C++ or whatever language you use.

And now I realized that I don't call the original function in that posted code, I've changed it already but still no difference. I believe that I must change 'mousePressEvent' in some other widget, but still don't now in which one.