Results 1 to 3 of 3

Thread: Dynamic resource loading not work in another computer

  1. #1
    Join Date
    Sep 2007
    Location
    Taiwan
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Unhappy Dynamic resource loading not work in another computer

    The version of Qt library I use is 4.2.2.

    In my application, I create a rcc file,

    rcc -binary xxx.qrc -o xxx.rcc

    then in my code, I register the resource.

    Qt Code:
    1. QResource::registerResource( "xxx.rcc" );
    To copy to clipboard, switch view to plain text mode 

    The image is displayed like this:

    Qt Code:
    1. QPixmap logo( ":/images/somelogo.JPG" );
    2. QLabel *yyy = new QLabel;
    3. yyy->setPixmap( logo );
    To copy to clipboard, switch view to plain text mode 

    And the rcc file is placed in the same directory as the executable. It works fine in my development machine.

    But when I execute the application in another computer, the image disappears.(My application initializes successfully.) The executable and the rcc file are also in the same directory. Can anyone help me?

    Regards,
    GRUB
    Last edited by GRUB; 3rd September 2007 at 09:54.

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

    Default Re: Dynamic resource loading not work in another computer

    You might be missing the JPG plugin on the other computer. Copy it from your $QTDIR/plugins/imageformats directory to imageformats subdirectory of where your binary lies on the target machine.

  3. The following user says thank you to wysota for this useful post:

    GRUB (3rd September 2007)

  4. #3
    Join Date
    Sep 2007
    Location
    Taiwan
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Dynamic resource loading not work in another computer


    It does work! Thank you.

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.