How to port KTabBar::mouseMiddleClick?

Frank Reininghaus frank78ac at googlemail.com
Sun Nov 9 10:28:56 UTC 2014


Hi,

2014-11-06 2:59 GMT+01:00 Milian Wolff:
> Hey all,
>
> what do I do to get middle-click-closes-tab in Qt 5 without KTabBar?
> Previously, we used KTabBar and its mouseMiddleClick signal.

AFAIK, currently the only solution is to subclass QTabBar, override
the mousePressEvent method and emit a signal from there. Dolphin uses
this approach. There were many other reasons why Emmanuel created a
custom QTabBar subclass for Dolphin though .

If many apps need the "middle click to close" bevavior, then
reanimating KTabBar or getting this functionality into QTabBar might
be better than making every app create its own tab bar class.

Best regards,
Frank


More information about the Kde-frameworks-devel mailing list