Results 1 to 7 of 7

Thread: .qrc

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2011
    Posts
    203
    Thanks
    7
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default .qrc

    This is taken directly from the documentation:

    "In particular, you can pass a resource path instead of a file name to the QIcon, QImage, or QPixmap constructor:"

    I created a .qrc file into which I've input some .bmp files that I wish to use in my program and then I tried loading those images via:

    Qt Code:
    1. QImage Image;
    2. if(!Image.load(":/Images/sample.bmp")
    3. {
    To copy to clipboard, switch view to plain text mode 

    Ufortunately, when I run the program, the image does not load. My folder structure is such that in the same directory as the .qrc file, I have a folder called Images in which I have my images that I'm trying to acces. If I simply use the direct system path to the image in the load function, everything works fine, but using the .qrc method, I can't seem to get the image to load.

    EDIT: .pro has RESOURCES listed.
    Last edited by Atomic_Sheep; 24th September 2012 at 17:28.

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.