Results 1 to 5 of 5

Thread: Image Diplay

  1. #1
    Join Date
    Sep 2013
    Posts
    107
    Thanks
    16
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Image Diplay

    Dear All,

    I need to insert an Image(JPEG) on MainWindow just above the Login area. To display the company Logo.. How to load the image on to MainWindow.Any resources file to be created...

    Thanks in Advance

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Image Diplay

    Add a label above the login widget and load the image with QLabel::setPixmap.
    Here you can find an example of managing image resources.

  3. #3
    Join Date
    Sep 2013
    Posts
    107
    Thanks
    16
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Image Diplay

    Thanks you, I was able to insert Image of PNG format.. If, we need to set the size of image on QLabel means we have to call setMinimum ,max functions or we need to have same size of image.
    In the same way, can we set the Window Icon also?

  4. #4
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Image Diplay

    Do you mean the icon next to window title ? If yes, then use QWidget::setWindowIcon.
    If you want to set custom icon of the app file, then read this: setting the application icon.

    About the sizes, I don't know if i understood you correctly, but maybe you need to setScaledContents to true.

  5. The following user says thank you to stampede for this useful post:

    Vivek1982 (17th October 2013)

  6. #5
    Join Date
    Feb 2014
    Location
    San Jose
    Posts
    4
    Platforms
    Windows

    Default Re: Image Diplay

    Quote Originally Posted by stampede View Post
    Add a label above the login widget and load the image with QLabel::setPixmap.
    Here you can find an example of managing image resources.
    Thanks for providing example of managing image resources. I really appreciate "Add resources to a resource file".

Similar Threads

  1. Replies: 3
    Last Post: 3rd August 2012, 10:35
  2. Diplay web image
    By protocole in forum Qt Programming
    Replies: 14
    Last Post: 10th July 2010, 19:42
  3. Unable to diplay the text on LCD
    By rohan_m_e in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 24th February 2009, 03:38
  4. diplay and resize bitmap
    By tommy in forum Qt Programming
    Replies: 8
    Last Post: 14th November 2007, 17:35
  5. Replies: 3
    Last Post: 14th March 2007, 08:09

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
  •  
Qt is a trademark of The Qt Company.