Got same situation and that's what I exactly did. Also, in mousePressEvent I'm hiding QLineEdit if it's visible in order to avoid situation when tabRect() of the tab being currently edited changes (could also update QLineEdit's geometry, but prefer to do it in that way). One unsolved problem still exists - when tool buttons responsible for rewinding tabs are visible - clicking them WON'T change QLineEdit position nor hide it - and I can't find a way to do that, because those buttons are part of QTabBarPrivate, which's inaccessible for me (can't catch any event, signal or whatever). (Put briefly: when rewinding tabs, QLineEdit remains visible, in wrong position and covers other tabs; It should disappear.)
Any ideas how to avoid it?
Bookmarks