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. Qt3 to 4 porting. QLabel::setAutoResize()
Qt 6.11 is out! See what's new in the release blog

Qt3 to 4 porting. QLabel::setAutoResize()

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

    In Qt4 the function QLabel::setAutoResize() disappeared. The porting documentation says that this virtual function is replaced with "Setter".

    What does it mean? I do not find any function to set this value.

    The suggested replacements in Google are:

    • adjustSize()
    • to determine the size of the text and call setFixedSize() on the label

    But both of them requires the additional connection (connect to textChanged() signal and update label size).

    Does anybody know the simpler replacement for this function in Qt4?


    Oleksiy Balabay

    1 Reply Last reply
    0
    • B Offline
      B Offline
      baysmith
      wrote on last edited by
      #2

      Put the label in a layout and set the size policy.

      Nokia Certified Qt Specialist.

      1 Reply Last reply
      0
      • B Offline
        B Offline
        blex
        wrote on last edited by
        #3

        [quote author="Bradley" date="1291366032"]Put the label in a layout and set the size policy.[/quote]

        Great! Thank you. So simple. I feel stupid :)


        Oleksiy Balabay

        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