Results 1 to 4 of 4

Thread: Distributing an application with resources

  1. #1
    Join Date
    Jul 2007
    Location
    California, USA
    Posts
    62
    Thanks
    17
    Thanked 7 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Distributing an application with resources

    This is for windows but I'll need to do the same for Linux eventually.

    I've created an application that has resources using Compiled-In Resources. I have a myResources.qrc file and I create my images using code like:
    Qt Code:
    1. m_stopInputAction->setIcon(QIcon(":/stop.gif"));
    To copy to clipboard, switch view to plain text mode 

    In my main.cpp, I have:
    Qt Code:
    1. QApplication app(argc, argv);
    2. Q_INIT_RESOURCE(myResources);
    To copy to clipboard, switch view to plain text mode 

    This works fine on my machine. I copied the executable and all the dlls from my qt/lib directory over to another machine and put them into one directory. When I ran the program, everything came up except the icons. I tried copying over the myResources.qrc file also but that didn't help.

    Is there a step that I am missing?

    Thanks.

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Distributing an application with resources

    Its the gif plugin. Search the forums.
    I think you have to copy them in the plugins/imageformats directory on the target machine.

  3. #3
    Join Date
    Jul 2007
    Location
    California, USA
    Posts
    62
    Thanks
    17
    Thanked 7 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Distributing an application with resources/icons [resolved]

    I found the image dlls (qgif4.dll, etc) under
    C:\Qt\4.3.1\plugins\imageformats

    and then needed to make a ".\imageformats" directory where the executable is and put the dlls in that.

    It doesn't appear that I need a qt.conf file in case anyone else runs into the same problem.

    This link wasn't that much help except that it showed me how to cut down on the dlls I was copying by using the depends tool (but it doesn't cover the image dlls)

    http://doc.trolltech.com/4.3/deploym...n-dependencies

    p.s. unfortunately, I couldn't search for "gif" in the forums - the search mechanism rejected it as being too short.

  4. #4
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Distributing an application with resources

    An alternative solution is to abandon GIF. The PNG image format is supported by everyone, and it's not a plugin. It's perfect for icons.

Similar Threads

  1. Distributing QT application for Mac OS
    By mb0 in forum Qt Programming
    Replies: 1
    Last Post: 31st May 2007, 18:59
  2. dll + application
    By fpujol in forum Qt Programming
    Replies: 11
    Last Post: 15th April 2007, 18:37
  3. Replies: 3
    Last Post: 8th December 2006, 18:51

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.