Results 1 to 8 of 8

Thread: How to paste image on the form through designer

  1. #1
    Join Date
    May 2006
    Posts
    68
    Thanks
    10
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default How to paste image on the form through designer

    Please tell as to how to paste the image ( jpeg/png) on the form in designer.

    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to paste image on the form through designer

    Use QLabel.

  3. #3
    Join Date
    May 2006
    Posts
    68
    Thanks
    10
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to paste image on the form through designer

    I did use the Qlabel only and then I chose the pixmap from the property editor. The pixmap was a png file.
    It does come on the form and even in the preview window
    But when I make the entire thing the image is missing
    I then put the png file in the release folder. It still did not work out
    Am I missing something.
    As far as the png files for icon are concerned when I put them in the release folder they start showing up in the final version.
    Where am I going wrong.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to paste image on the form through designer

    The best solution is to use resources, but if you prefer to load images from disk, make sure you use proper paths.

    Note that relative paths depend on current working directory, which might change depending how users start your application. The safest way is to load them in the code using absolute paths constructed from QCoreApplication::applicationDirPath(), QDir::separator() and relative path to your image.

  5. #5
    Join Date
    May 2006
    Posts
    68
    Thanks
    10
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to paste image on the form through designer

    I have taken the resources approach
    Somehow I am missing something somewhere
    I am sending you the code ( attached along)
    Can u pinpoint the mistake
    PS -- I always amend my makefile to takeout all references of debug since my make gives me trouble of cannot find - lqtmaind ( and I am in no mood to sort that out). This has been working fine so donot take that as mistake.
    What else am I missing.
    Attached Files Attached Files
    Last edited by deekayt; 10th November 2006 at 21:18. Reason: TO UPLOAD THEFILE

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to paste image on the form through designer

    The problem is that your .ui file doesn't use resources, but files. When you assign a pixmap to a label, make sure you select "specify resource" instead of "specify image file".

  7. The following user says thank you to jacek for this useful post:

    deekayt (13th November 2006)

  8. #7
    Join Date
    May 2006
    Posts
    68
    Thanks
    10
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to paste image on the form through designer

    Dear JACEK
    My problem of Thread 24 regrading " How To Redirect The Console Output To A Text Browser/pop Up " in QT PROGRAMMING FORUM is still not sorted out
    I know this is bit twisted but I am actually stuck up

  9. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to paste image on the form through designer

    Quote Originally Posted by deekayt View Post
    Dear JACEK
    My problem of Thread 24 regrading " How To Redirect The Console Output To A Text Browser/pop Up " in QT PROGRAMMING FORUM is still not sorted out
    I know this is bit twisted but I am actually stuck up
    How is it related to this thread?

Similar Threads

  1. [Qt4.1] How to insert an image inside a Form?
    By Gonzalez in forum Qt Tools
    Replies: 5
    Last Post: 23rd September 2008, 12:20
  2. Replies: 5
    Last Post: 10th May 2006, 01:20
  3. How and when to repaint a widget ?
    By yellowmat in forum Newbie
    Replies: 7
    Last Post: 3rd April 2006, 17:36
  4. [QT4 & XP] QTreeView issue with Designer form
    By incapacitant in forum Newbie
    Replies: 3
    Last Post: 2nd March 2006, 18:42
  5. Replies: 4
    Last Post: 6th February 2006, 15:30

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.