I really want to have a QTabWidget that can be renamed by double-click on tab caption.
I have googled and found this solution, but it's more like an outline for a developer who knows his way through Qt and subclassing it's widgets.
I'm kind of stuck how to implement all that. I have used an example given further down that thread (with IndependentLineEdit
and so on) and it worked, but it's not what i wanted.
I do not want to have any kind of InputDialog. I do not want to have any floating widget or something.
What i basically want is to use QTabWidget (subclass), that behaves the similar way as spreadsheet tabs do in modern office suites - like, tab label is substituted with seamless line edit, which resets tab label on Enter or leaves it intact on Esc.
I have not been able to find such a solution so far. I do understand that what I actually need is very close to this:
provide a temporary QLineEdit at QTabBar::tabRect() filled with QTabBar::tabText()
but i do not understand how to do that. Moreover, since QTabBar is kind of bare tabbar i would also prefer to have in enclosed into QTabWidget (subclass).