Results 1 to 3 of 3

Thread: Image on QLabel and resizeEvent

  1. #1
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Image on QLabel and resizeEvent

    Hi,

    I'm displaying an image on a QLabel. When I resize the mainWindow, the QLabel is not resized so I can't resize the image that is shown in it.

    Thanks,
    Òscar Llarch i Galán

  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: Image on QLabel and resizeEvent

    Provide more information, please. Are you using layouts? Have you noticed QLabel::scaledContents?
    J-P Nurmi

  3. #3
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Image on QLabel and resizeEvent

    Hi,

    Yes, I'm using layouts. On "resizeEvent" I take the QLabel width and height and I create a QImage scaled with this width and height because the images are very big and I want to show the full image in the avaiable space of the QLabel.

    Thanks,
    Òscar Llarch i Galán

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.