Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved QToolButton is adding extra padding by itself

    General and Desktop
    2
    4
    291
    Loading More Posts
    • 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.
    • K
      Kite R last edited by

      Hi, I'm adding icons to QToolButtons with setIconSize(QSize(16, 16), but I'm getting this annoying extra padding on the right and bottom. Anyone have an idea why?

      alt text

      1 Reply Last reply Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion last edited by

        Hi
        yes its reserved for hover effect. ( blue frame)
        I dont know any way easy to get rid of it.

        1 Reply Last reply Reply Quote 0
        • K
          Kite R last edited by

          I can adjust padding using a stylesheet.

          QToolButton { padding: -1 -2 -2 -1; }
          

          Resets the padding completely, but I'm getting varying results on different QToolBars, was hoping there was a good way to reset it properly.

          1 Reply Last reply Reply Quote 0
          • mrjj
            mrjj Lifetime Qt Champion last edited by

            Hi
            I tried with QProxyStyle but could not guess where it get the border from so gave up and went with stylesheet.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post