Results 1 to 2 of 2

Thread: Static linking images?? What's wrong?

  1. #1
    Join Date
    Mar 2010
    Posts
    10
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Static linking images?? What's wrong?

    Hi,
    i have problem with linking images to my program, so mayby somebody can help me.

    I have:
    - QLabel -> Label
    - QImage -> Image
    - QComboBox -> Box

    I load example image to "Image",next i use function setPixmap on Label and choose "Image".
    Next i add options (1,2,3) to "Box"
    If i choose 1 i see first image,if 2 second and if 3 third.
    Every time when i choose something from "Box" i load to "Image" new image,and refresh Label putting a new loaded image.
    It is ok when i compile it and use on QtCreator but...
    If i compile my program in release mode,and put exe file(with images) in output folder with "dll" files to run it without using a QtCreator it doesn't work.
    A place where should be image is always black.
    How i must compile this project to use this file without images in output folder(mayby something like static linking) or in the end what to do to this work.?

    It is a example how i load images:
    Qt Code:
    1. first_image.load ("foto.jpg");
    To copy to clipboard, switch view to plain text mode 
    I put images in the same folder what exe file.
    Please help.

  2. #2
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Static linking images?? What's wrong?

    Read about Qt's resource system

Similar Threads

  1. Static linking with Qt
    By prykHetQuo in forum Qt Programming
    Replies: 3
    Last Post: 3rd June 2009, 20:56
  2. Static linking in Linux
    By anupamgee in forum Qt Programming
    Replies: 4
    Last Post: 2nd June 2009, 14:34
  3. Static linking
    By didcea in forum Qt Programming
    Replies: 0
    Last Post: 11th October 2008, 18:40
  4. Static linking of Qt programs
    By divya balachandran in forum Qt Programming
    Replies: 0
    Last Post: 15th September 2008, 12:10
  5. Linking to wrong version of Qt in Cmake
    By Matt Smith in forum Qt Programming
    Replies: 1
    Last Post: 9th December 2007, 10:39

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.