In my app I have a QTabBar
widget that uses scroll buttons if there are many tabs.
Now, on currentChanged(int)
signal I call a method that renames previous and current tab (calls setTabText()
).
Unfortunately this repaints whole QTabBar
and as a result if my current tab was somewhere in the middle of scrolled tab bar after repaint it is the last painted tab on the bar so that I see more preceding tabs. Is there any way to keep the current tab at the same position?
I'm not sure if I understood the issue correctly, but with the following code, my application is working good.
Please, test this code to check if it's working for you and see the differences with your app.
main.cpp
mainwindow.h
mainwindow.cpp