Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to remove the distance between the QTabBar scroller buttons?
Forum Updated to NodeBB v4.3 + New Features

How to remove the distance between the QTabBar scroller buttons?

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 710 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Helge1980
    wrote on last edited by Helge1980
    #1

    Hi!
    Please tell me why there is a distance between the QTabBar scroller buttons with a small width of the scroller buttons and how can this be fixed?

    Screenshot_20220217_195724.png

    In this case, I have the following in the style sheet:

    QTabBar::scroller {
        width: 6px;
    }
    

    At the same time, the whole paradox is that in a pure example there is no distance between the buttons and
    I can't understand how this could have gone wrong in my example.
    Even the type of this indentation is unclear: it is neither a widget neither a layout, it is not clear what kind of object it is.

    raven-worxR 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      With only one stylesheet piece it's pretty hard to know what's going on.

      Can you provide a minimal compilable example that shows this issue ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      H 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        With only one stylesheet piece it's pretty hard to know what's going on.

        Can you provide a minimal compilable example that shows this issue ?

        H Offline
        H Offline
        Helge1980
        wrote on last edited by Helge1980
        #3

        @SGaist
        This is a very large project, so I myself can't understand in which part of the code this can happen. I'm trying to at least understand the reason why this could theoretically happen. This offset appears exactly at the moment when the scroller buttons appear, but I can say for sure that this is not a widget and not a layout. I checked the contents of the tabbar, it contains only the tabs themselves and two QToolButton scroller buttons.

        raven-worxR 1 Reply Last reply
        0
        • H Helge1980

          @SGaist
          This is a very large project, so I myself can't understand in which part of the code this can happen. I'm trying to at least understand the reason why this could theoretically happen. This offset appears exactly at the moment when the scroller buttons appear, but I can say for sure that this is not a widget and not a layout. I checked the contents of the tabbar, it contains only the tabs themselves and two QToolButton scroller buttons.

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          @Helge1980
          seems like another stylesheet rule's selector is too generic and thus some properties get inherited to those buttons too?

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          H 1 Reply Last reply
          0
          • raven-worxR raven-worx

            @Helge1980
            seems like another stylesheet rule's selector is too generic and thus some properties get inherited to those buttons too?

            H Offline
            H Offline
            Helge1980
            wrote on last edited by
            #5

            @raven-worx
            It doesn't seem like it, I completely disabled all setStyleSheet() in the code and still the same thing happens.

            1 Reply Last reply
            0
            • H Helge1980

              Hi!
              Please tell me why there is a distance between the QTabBar scroller buttons with a small width of the scroller buttons and how can this be fixed?

              Screenshot_20220217_195724.png

              In this case, I have the following in the style sheet:

              QTabBar::scroller {
                  width: 6px;
              }
              

              At the same time, the whole paradox is that in a pure example there is no distance between the buttons and
              I can't understand how this could have gone wrong in my example.
              Even the type of this indentation is unclear: it is neither a widget neither a layout, it is not clear what kind of object it is.

              raven-worxR Offline
              raven-worxR Offline
              raven-worx
              Moderators
              wrote on last edited by
              #6

              @Helge1980 said in How to remove the distance between the QTabBar scroller buttons?:

              At the same time, the whole paradox is that in a pure example there is no distance between the buttons and

              what is a pure example? You mean another Qt application with a also a tabbar in it?

              I can't understand how this could have gone wrong in my example.
              Even the type of this indentation is unclear: it is neither a widget neither a layout, it is not clear what kind of object it is.

              These are widgets handled by QTabBar internally.

              Btw. its better to set the styleheet globally on the qapplication instance than have multiple setStylesheet calls on each widget.

              So you still have something in your code that affects this behavior. Can you take the widget out of its parent widget? So that it appears a separate window. Simply remove the parent widget, the rest of the code shouldn't be affected.

              --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
              If you have a question please use the forum so others can benefit from the solution in the future

              1 Reply Last reply
              0
              • H Offline
                H Offline
                Helge1980
                wrote on last edited by
                #7

                Hi!
                I've already figured it out, it's because I'm using the Qt version 5.9.9.
                I don't know just which minimum version it disappears from, if someone knows, please tell me.
                Thanks!

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved