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. QSpinbox Stylesheets: How do I remove *ALL* borders
Forum Updated to NodeBB v4.3 + New Features

QSpinbox Stylesheets: How do I remove *ALL* borders

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.7k 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.
  • T Offline
    T Offline
    tfox
    wrote on last edited by
    #1

    I have a treeview, and I need to keep as much information on the screen as possible.
    My problem is, when I set the line height for the tree, the spinbox delegate can only show about half the height of the number. I did some digging, and found I could set the border to none in the stylesheet and that did help some.

    However, the numbers are still getting cut off. That cut-off looks sloppy, and I want to get rid of it completely. Any help would be appreciated.

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by Chris Kawa
      #2

      Hi, welcome to the forum.

      You could set a negative padding-top css value on the spinbox to move the text up.
      Anyway, I have to say this looks really fragile. What if someone has a different system font size or shape or enables UI scaling in OS settings?
      Getting rid of all the margin also hurts readability. That's why we have line spacing in all the text since like... the text was invented :) Are you sure a "wall of letters" is really the look you're going for?

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tfox
        wrote on last edited by
        #3

        First off, that padding-top (along with padding-bottom) was exactly what I was looking for. Thank you very much :)

        If there's a different font size/shape, then the height of each row for the tree is set so the font will fit. And thankfully, this isn't just a wall-O-text. There's still vertical line spacing coming from the tree itself, and the tree is relatively sparse by design. It's this sparseness that makes a minimal line height preferable. The problem was the extra margin added with the spinbox delegate.

        Also, Since I've got you here, is there someplace that has a comprehensive list of which css options the standard qt widgets look at?

        1 Reply Last reply
        0
        • Chris KawaC Offline
          Chris KawaC Offline
          Chris Kawa
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @tfox said:

          is there someplace that has a comprehensive list of which css options the standard qt widgets look at?

          Yup, take a look here.

          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