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. QToolBox and scrollbars taking the extra space ?
Forum Updated to NodeBB v4.3 + New Features

QToolBox and scrollbars taking the extra space ?

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 2 Posters 1.9k Views 1 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.
  • D Offline
    D Offline
    ddze
    wrote on last edited by
    #1

    I am trying to get rid of a QScrollBar in a QToolbox because they (even not visible) take the space hence the QToolButton(s) do not expand horizontally to the full extent. I have tried to apply the style sheets like:

    QScrollBar:horizontal {
    height: 0px;
    width: 0px;
    }
    
    QScrollBar:vertical {
    height: 0px;
    width: 0px;
    }
    

    Did not help. Is there a way to use the scrollbar(s) space for the QToolButtons ?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      hi
      In win 7. Qt 5.5. setting your stylesheet on the
      QToolbox, does remove the scrollbar and allow me to
      let the widget go all way to the edge.

      http://postimg.org/image/kw3ypohl5/

      D 1 Reply Last reply
      0
      • mrjjM mrjj

        hi
        In win 7. Qt 5.5. setting your stylesheet on the
        QToolbox, does remove the scrollbar and allow me to
        let the widget go all way to the edge.

        http://postimg.org/image/kw3ypohl5/

        D Offline
        D Offline
        ddze
        wrote on last edited by ddze
        #3

        @mrjj ,

        I am running a Windows 7 and Qt version 5.5.0/5.5/mingw492_32 libs ,

        hmm, very strange.

        P.S

        just notice a gap on the left side of the QToolButton on the provided picture ... is there a way to remove that one ?

        mrjjM 1 Reply Last reply
        0
        • D ddze

          @mrjj ,

          I am running a Windows 7 and Qt version 5.5.0/5.5/mingw492_32 libs ,

          hmm, very strange.

          P.S

          just notice a gap on the left side of the QToolButton on the provided picture ... is there a way to remove that one ?

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by mrjj
          #4

          @ddze
          Hmm does seem very close to my version.

          • just notice a gap on the left side of the QToolButton on the provided picture
            Yes that is just the layouts "layoutLeftMargin" that default has 9. if u set to 0
            its aligned with left side.

          maybe u can try my test project and tell me if does the same for you
          https://www.dropbox.com/s/19ilrtzsyrsrv97/test.zip?dl=0

          Maybe you use another layout or something else so it seems to work for me and not for you.
          Maybe my sample is not working as u want it to. just looking like it :)

          D 1 Reply Last reply
          2
          • mrjjM mrjj

            @ddze
            Hmm does seem very close to my version.

            • just notice a gap on the left side of the QToolButton on the provided picture
              Yes that is just the layouts "layoutLeftMargin" that default has 9. if u set to 0
              its aligned with left side.

            maybe u can try my test project and tell me if does the same for you
            https://www.dropbox.com/s/19ilrtzsyrsrv97/test.zip?dl=0

            Maybe you use another layout or something else so it seems to work for me and not for you.
            Maybe my sample is not working as u want it to. just looking like it :)

            D Offline
            D Offline
            ddze
            wrote on last edited by
            #5

            @mrjj ,

            Thanks so much , your example works fine on my pc too. So it must be something with the layout properties in my project.

            Strange, cause I checked all the buttons, and they are expanding with the stretch set above zero to take the extra space.

            But it is important for me to know that is workable.

            mrjjM 1 Reply Last reply
            0
            • D ddze

              @mrjj ,

              Thanks so much , your example works fine on my pc too. So it must be something with the layout properties in my project.

              Strange, cause I checked all the buttons, and they are expanding with the stretch set above zero to take the extra space.

              But it is important for me to know that is workable.

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @ddze
              Ok that is good news.
              Its probably just something simple then.

              I set the layoutMargins (left and right ) on the layout i put inside
              QToolBox "page"/area.
              and then ur stylesheet.
              (just for the record)

              D 1 Reply Last reply
              0
              • mrjjM mrjj

                @ddze
                Ok that is good news.
                Its probably just something simple then.

                I set the layoutMargins (left and right ) on the layout i put inside
                QToolBox "page"/area.
                and then ur stylesheet.
                (just for the record)

                D Offline
                D Offline
                ddze
                wrote on last edited by ddze
                #7

                @mrjj ,

                yes , you were right, the, I needed to LayoutStretch of docket widget to 1,1,1,1,1,1,1 and that has solved the expanding of the buttons. ( I thought the QButton size policy was enough , but a docket widget needed the stretch to expand the buttons).

                Thank you so much.

                1 Reply Last reply
                1

                • Login

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