Stacked dock widgets tab bars not consistent



  • Hello! I am relatively new to Qt, and have been pulling my hair out trying to solve this issue. I am working on a theme for the open source project OBS, which just updated to allow dock widgets for many of the main UI elements.

    However, when stacking two dock widgets together, the QTabBar is near impossible to style correctly with a QSS file, and the overall behavior is extremely inconsistent. For example, the biggest issue I'm having is that the separator line (I'm not even really sure what to call this specific element) is present when two widgets are newly stacked, as shown here:

    New stack

    But when the program is restarted, this line is now gone, and the entire object looks different (presumably because this line is adding 1px of height to the QTabBar itsel:

    Old stack

    So, the question I have is, in the context of a stacked dock widget, what is that line element called and how can I select it/remove/change it with QSS or otherwise? QSS would be preferred as that will be the minimum amount of changes needed. I have searched around and found quite a few people having this same issue with the dock widget tab bar and how it does not behave like a normal QTabBar. Thanks in advance for any advice or help you can provide.

    For reference, here is the QSS I'm working with as it relates to the QTabBar: https://gist.github.com/Fenrirthviti/2006b0d555408a82c64485571a131ccb


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Can you also provide a minimal sample code that shows the problem once the style sheet is applied ?



  • @SGaist Unfortunately, I don't think I will be able to. As I mentioned, I'm very new to Qt and I don't know how to generate a sample application (I know next to nothing about C/C++, I'm more of a web guy).

    I will see if I can find some simple sample applications, however, and try to replicate it there.



  • Ok, I've managed to create a reduced test case (using the Dock Widgets example app that ships with Qt) to replicate this issue.

    What constitutes "minimal sample code" that you need to see here? Here's what happens in the example:

    Before restart:
    before

    After restart:
    after

    You can see that the line is 1px smaller after relaunching the test app.


  • Lifetime Qt Champion

    If the code is small you can post it here.



  • @SGaist I still don't understand what specifically you're asking for, so here's the entire application: https://gist.github.com/Fenrirthviti/f9c801031adfa2604dbea03d98854585


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.