The first part adds QTabBarPrivate::initBasicStyleOption()
which is basically QTabBar::initStyleOption() but
without the expensive QFontMetrics::elidedText() call.
That is because QTabBar::tabSizeHint() would call
initStyleOption() and then immediately discard the result
of that computation.
Then, QTabBar::tabSizeHint() is modified to cache the calls
to QFontMetrics::size(), which is also expensive. The cache
is invalidated when the style or the font changes, or when
the elide mode is set.
Change-Id: I591b2e401af3576a2ebabc5b94f19ae157e28cf2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Wayne Arnold <wayne.arnold@autodesk.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>