Results 1 to 2 of 2

Thread: How to compile qt resource files?

  1. #1
    Join Date
    Jun 2009
    Posts
    22
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default How to compile qt resource files?

    In my project , I add a ".qrc" file.Here is its contents:
    Qt Code:
    1. <RCC>
    2. <qresource prefix="/iSchema" >
    3. <file>Resources/Winter.jpg</file>
    4. <file>Resources/action_new.png</file>
    5. </qresource>
    6. </RCC>
    To copy to clipboard, switch view to plain text mode 
    Before add this file, my ".exe" file is 100KB. After add, it's 204KB. And thoes two picures are 120KB. So as i see it, the qt resource is compiled into ".exe" files.

    I don't liks this way.
    1.The ".exe" file will be biger and biger if I add more and more picture.
    2.If I change some picture ,I have to recompile the ".exe" file.

    Could you tell my how to comile qt resouce files (such as picture and langure files) to a ".dll" file ? And in my ".cpp" file ,how to use it?

  2. #2
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to compile qt resource files?

    You can load them into a dll. What I think you would have to do is make a dll that provides you with functions that return a QPixmap based on what image you want to have. However, you will end up recompiling your dll instead of your application. To me there is no real advantage here unless you wish to use the exact same dll in a different application.
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

Similar Threads

  1. qtgui4.dll error in visual c++ 2005
    By Comptrol in forum Installation and Deployment
    Replies: 33
    Last Post: 19th June 2008, 07:18
  2. Access to PostgreSQL DB on a linux server
    By rmagro in forum Qt Programming
    Replies: 28
    Last Post: 13th March 2008, 09:02
  3. Client/Server Error: BadIDChoice
    By 3nc31 in forum Qt Programming
    Replies: 5
    Last Post: 27th November 2007, 10:22
  4. Replies: 2
    Last Post: 5th September 2007, 22:31
  5. Replies: 2
    Last Post: 8th March 2007, 21:47

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.