Reviewing merge request #411: Export the tab index to the StyleOptionTab
The patch allows external styles to see the index of the tab they're supposed to draw, to give the style some more possibilities to customize
the look of tab bars (e.g. alternating colors, tabs getting bigger the closer they are to the active tab, ...)
Commits that would be merged:
Comments
If this goes in, All use of QStyleOptionTabV3 need to be updated.
I know for example it is used in QStyleSheetStyle.
Updated to change QStyleSheetStyle usage to QStyleOptionTabV4.
grep -r doesn’t show any other places creating a QStyleOptionTabV3; the only remaining QStyleOptionTabV3 usages are casting to QStyleOptionTabV3 in styles that don’t need the new information (and therefore don’t need to be updated).
if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {if (const StyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
what this change for ?
ritt.k: That was a typo; merge request updated with a patch that fixes it.
+ additional values for a QStyleOptionTabV2 and higher
missed dot
+ if (const QStyleOptionTabV4 *tab = qstyleoption_cast<const QStyleOptionTabV4 *>(&other)) {
braces for single line
+ if (QStyleOptionTabV4 *optionV4 = qstyleoption_cast<QStyleOptionTabV4 *>(option)) {
braces for single line
plz rebase this branch (to shoot down 715dec1) and squash commits into single one
git rebase -i master show_tab_index_to_styleoption
/me requests revise and resubmit :)
Done
+ if (const QStyleOptionTabV4 *tab = qstyleoption_cast<const QStyleOptionTabV4 *>(&other))
missed braces, sorry :)
plz follow the Qt coding style – http://qt.gitorious.org/qt/pages/QtCodingStyle
Actually, removed braces because you were complaining about braces for single line in the older version…
Adding them again
and, as Olivier said before, all use of QStyleOptionTabV3 need to be updated as well (except of most in-code option casts) – see qmacstyle_mac.mm, qcomonstyle_p.h, etc.
done
Thank you for your contribution. With Qt 4 having moved [1] under Open
Governance [2] as well, you can now contribute your changes via Gerrit
[3]. At the same time, contributions via Gitorious can no longer be
merged.
We would still like to see your patch on the new platform, and wish
for you to become a member of the Qt Project. Please read [4] and in
particular [5] to familiarize yourself with the new tools. You will
still find a read-only mirror of all Qt repositories on Gitorious.
With a much wider set of possible reviewers, we are also looking
forward to better response times to contributions. Looking forward to
your patch!
Please note that at this point in time Qt 4.8 is a bugfix only branch,
and all fixes should be submitted to Qt 5 first, as far as
applicable. Qt 4 master is closed.
The Nokia Qt team
[1] http://labs.qt.nokia.com/2012/01/10/qt-4-moved-to-open-governance/
[2] http://labs.qt.nokia.com/2011/10/21/the-qt-project-is-live/
[3] http://codereview.qt-project.org
[4] http://www.qt-project.org
[5] http://developer.qt.nokia.com/wiki/Gerrit_Introduction


Add a new comment:
Login or create an account to post a comment