Results 1 to 2 of 2

Thread: adjustSize for right adjustement

  1. #1
    Join Date
    Feb 2006
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default adjustSize for right adjustement

    Hi all,

    I use Qt/Mac 4.1.3 and use the function adjustSize() to adjust the size in my derived
    QLabel class. This works fine when the QLabel's content is left adjusted. But with a right adjustement it will do the same as it were left adjusted.

    What it should do:
    The right edge of the QLable should stay where it was and the left part should resize.

    Does anyone know how to solve this, or is there a better way?

    Thanks,
    square

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: adjustSize for right adjustement

    How about a horizontal layout?

    hboxlayout:

    |-------|-----|
    |stretch|label|
    |-------|-----|


    QWidget::adjustSize() just tries to resize the widget according to it's size hint..
    J-P Nurmi

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.