Results 1 to 3 of 3

Thread: keeping aspect ratio while resizing

  1. #1
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    691
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default keeping aspect ratio while resizing

    Hi to all,
    I have a QMainWindow with a custom central widget. I set a background image for that
    central widget.
    I would keep the aspect ratio while resizing to preserve the aspect ratio of the background image.
    How can I do?

    Best Regards,
    Franco
    Franco Amato

  2. #2
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    691
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: keeping aspect ratio while resizing

    Quote Originally Posted by franco.amato View Post
    Hi to all,
    I have a QMainWindow with a custom central widget. I set a background image for that
    central widget.
    I would keep the aspect ratio while resizing to preserve the aspect ratio of the background image.
    How can I do?

    Best Regards,
    Franco
    Is there anyone? I got too many replies
    Franco Amato

  3. #3
    Join Date
    Jun 2007
    Location
    Massachusetts, USA
    Posts
    24
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: keeping aspect ratio while resizing

    Will an implementation of QWidget::heightForWidth(int) help you? If not, then maybe a custom layout manager.

Similar Threads

  1. Replies: 5
    Last Post: 11th June 2011, 16:29
  2. Preserving aspect ratio of image
    By Banjo in forum Qt Programming
    Replies: 2
    Last Post: 16th January 2009, 14:39
  3. Keeping the left side of a splitter from resizing
    By MrGarbage in forum Qt Programming
    Replies: 3
    Last Post: 14th December 2007, 20:50
  4. aspect ratio of top-level widgets
    By urbangipsy in forum Qt Programming
    Replies: 3
    Last Post: 16th January 2007, 22:49

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.