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. Autosize children of a QFrame
QtWS25 Last Chance

Autosize children of a QFrame

Scheduled Pinned Locked Moved Unsolved General and Desktop
qframesizewidth
2 Posts 2 Posters 910 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.
  • M Offline
    M Offline
    McLion
    wrote on 18 Sept 2017, 09:17 last edited by
    #1

    Hi
    I have a QFrame that contains some QLabel's.
    The width of the frame is set variable based on the content of one of the labels - this works as expected.
    The complete frame is animated instead of only shown and hidden, respecting the variable width - works as expected too.

    Is there a way to automatically extend the width of all child labels of the frame to the same, i.e. the current size the frame gets?
    I know I can set this with some lines of codes manually. However, if there is a functionality in Qt that can di this that would be the nicer solution.

    Thanks
    McL

    J 1 Reply Last reply 18 Sept 2017, 12:00
    0
    • M McLion
      18 Sept 2017, 09:17

      Hi
      I have a QFrame that contains some QLabel's.
      The width of the frame is set variable based on the content of one of the labels - this works as expected.
      The complete frame is animated instead of only shown and hidden, respecting the variable width - works as expected too.

      Is there a way to automatically extend the width of all child labels of the frame to the same, i.e. the current size the frame gets?
      I know I can set this with some lines of codes manually. However, if there is a functionality in Qt that can di this that would be the nicer solution.

      Thanks
      McL

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 18 Sept 2017, 12:00 last edited by
      #2

      @McLion You can use layouts for those labels

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2

      2/2

      18 Sept 2017, 12:00

      • Login

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