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. AddSpacing(): something better than pixels?
Forum Updated to NodeBB v4.3 + New Features

AddSpacing(): something better than pixels?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.0k 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.
  • L Offline
    L Offline
    lemzwerg
    wrote on last edited by
    #1

    While I very much like the concept of QVBoxLayout and QHBoxLayout (which resembles TeX's \hbox and \vbox commands a lot), I very much dislike that I have to give pixels as an argument to addSpacing(). Isn't there something better available, say, something comparable to TeX's ex' or em' unit (the height of a small letter `x' and the nominal size of a font, respectively)? Or maybe a percentage as used in CSS?

    Werner
    
    1 Reply Last reply
    0
    • D Offline
      D Offline
      dangelog
      wrote on last edited by
      #2

      You can get the sizing you're looking for by using QFontMetrics. Still, I'd suggest to use an elastic spacing (\vspace*?) with add/insertStretch.

      Software Engineer
      KDAB (UK) Ltd., a KDAB Group company

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lemzwerg
        wrote on last edited by
        #3

        Thanks. BTW, TeX's \vspace is not elastic :-)

        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