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. Change size of qLabel frame when I update the labels text
Forum Updated to NodeBB v4.3 + New Features

Change size of qLabel frame when I update the labels text

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 218 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.
  • S Offline
    S Offline
    SOrton
    wrote on last edited by
    #1

    Hey,

    I'm sure its simple to fix but I cant find the solution anywhere

    Basically my label will show 'RED', 'GREEN', 'BLUE' or 'NO COLOUR',
    and I want to update the frame to be tight around the text, rather that set it to outline 'NO COLOUR', which then leaves loads of empty space when it displays 'RED'.

    I have tried to hard code the sizes (set size for each colour to yyyyxzzzz) but cant find a function that allows this

    Thanks!

    S 1 Reply Last reply
    0
    • S SOrton

      Hey,

      I'm sure its simple to fix but I cant find the solution anywhere

      Basically my label will show 'RED', 'GREEN', 'BLUE' or 'NO COLOUR',
      and I want to update the frame to be tight around the text, rather that set it to outline 'NO COLOUR', which then leaves loads of empty space when it displays 'RED'.

      I have tried to hard code the sizes (set size for each colour to yyyyxzzzz) but cant find a function that allows this

      Thanks!

      S Offline
      S Offline
      SOrton
      wrote on last edited by
      #2

      @SOrton Fixed by using setFixedSize()

      1 Reply Last reply
      0
      • S SOrton has marked this topic as solved on

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved