QSpinbox Stylesheets: How do I remove *ALL* borders



  • 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.


  • Moderators

    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?



  • 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?


  • Moderators

    @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.


Log in to reply
 

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