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. Ratio margin setting according to window size
Forum Updated to NodeBB v4.3 + New Features

Ratio margin setting according to window size

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 118 Views
  • 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.
  • I Offline
    I Offline
    IknowQT
    wrote on last edited by
    #1

    The parent window size is fixed and the margin or padding value is hard-coded depending on the fixed size, but the size of the parent window may change. I want to find the ratio of the margin or padding value according to the parent size, but what if the decimal point comes out?

    Do I just have to resize it?

    JonBJ 1 Reply Last reply
    0
    • I IknowQT

      The parent window size is fixed and the margin or padding value is hard-coded depending on the fixed size, but the size of the parent window may change. I want to find the ratio of the margin or padding value according to the parent size, but what if the decimal point comes out?

      Do I just have to resize it?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @IknowQT
      Are you setting margin/padding sizes via QSS (stylesheet) or via values in the style? HTML CSS allows percentages for sizes, but I don't think Qt QSS permits that. In which case, unless someone knows better, you will indeed need to change values in resize() code.

      but what if the decimal point comes out?

      Don't know what this means, or why it would be relevant,.

      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