Nominate our 2022 Qt Champions!

Making a simpler FancyTabBar (like QtCreator uses)

  • Question:

    p. I want to build a side button navigation similar to Qt Creator's ("Welcome", "Edit", "Debug", etc). Has anyone tried to make a simple version of that?


    p. The code for Qt Creator's side button navigation looks like some hybrid tabbed window, but it's abstracted through so many layers it makes my head spin. The core code is in FancyTabBar.cpp (instantiated in mainwindow.cpp [path: .../qt-creator-src/src/plugins/coreplugin/]). Some of it seems clear (FancyTabBar::paintTab draws some rectangles to create the bar and the buttons), but all the linkage to hook those rectangles to the to the content widgets looses me. I understand that the inner workings of Qt Creator are complex out of necessity, but I was hoping someone was familiar with the logic of how it works and could suggest a much more straight forward way to create that navigation/presentation model.

  • Bascially, there's a QStackedLayout (m_modesStack if I recall correctly) which holds the widgets corresponding to the selected icon (aka mode).

Log in to reply