Results 1 to 6 of 6

Thread: How to compile resources(bitmap,icon)

  1. #1
    Join Date
    May 2006
    Posts
    32
    Thanks
    15
    Thanked 2 Times in 2 Posts

    Smile How to compile resources(bitmap,icon)

    Hi,guys:

    I want to translate all the icons to binanry and load them when I need it.

    I know qt supports two solutions for image resources,but I can not remember where I
    ever see it.

    Thanks.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How to compile resources(bitmap,icon)

    J-P Nurmi

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

    iGoo (21st July 2006)

  4. #3
    Join Date
    May 2006
    Posts
    32
    Thanks
    15
    Thanked 2 Times in 2 Posts

    Default Re: How to compile resources(bitmap,icon)

    Thank.

  5. #4
    Join Date
    May 2006
    Posts
    32
    Thanks
    15
    Thanked 2 Times in 2 Posts

    Unhappy Re: How to compile resources(bitmap,icon)

    I use qt4.1 and vs2003,here below is part of my vcproj file
    Qt Code:
    1. <Filter
    2. Name="Resource Files"
    3. Filter="qrc;*"
    4. UniqueIdentifier="{D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E}"
    5. ParseFiles="FALSE">
    6. <File
    7. RelativePath="..\..\..\..\DlgTrigRec_bg.bmp">
    8. </File>
    9. <File
    10. RelativePath=".\Resources\xx.bmp">
    11. </File>
    12. </Filter>
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. <File
    2. RelativePath=".\xSysVer.ico">
    3. <FileConfiguration
    4. Name="Release|Win32">
    5. <Tool
    6. Name="VCCustomBuildTool"
    7. Description="Creating windows resources..."
    8. CommandLine="rc.exe /fo &quot;xSysVer.res&quot; &quot;xSysVer.rc&quot;
    9. "
    10. Outputs="xSysVer.res"/>
    11. </FileConfiguration>
    12. <FileConfiguration
    13. Name="Debug|Win32">
    14. <Tool
    15. Name="VCCustomBuildTool"
    16. Description="Creating windows resources..."
    17. CommandLine="rc.exe /fo &quot;xSysVer.res&quot; &quot;xSysVer.rc&quot;
    18. "
    19. Outputs="xSysVer.res"/>
    20. </FileConfiguration>
    21. </File>
    To copy to clipboard, switch view to plain text mode 

    how to modify it to compile my resources please?

    I am confused by the project file that Vs2003 uses rc.exe or rcc(qt) to compile resource.

    and I find that the qt logon icon was compiled and shown at the left corner of the widget's
    caption.
    How It does.




    Thanks.

  6. #5
    Join Date
    May 2006
    Posts
    32
    Thanks
    15
    Thanked 2 Times in 2 Posts

    Default Re: How to compile resources(bitmap,icon)

    I got it.

    Qt Code:
    1. project xtest
    2.  
    3. 1&#12289;把图片拷贝到resources文件夹下面去(或者随便一个文件)//copy images to a dir
    4. 2&#12289;新建一个xtest.qrc文件//new xtest.qrc
    5. &#26684;式如下//format
    6. <!DOCTYPE RCC><RCC version="1.0">
    7. <qresource>
    8. <file>resources/xx.bmp</file>
    9. </qresource>
    10. </RCC>
    11. 4&#12289;把该文件添加到工程里面的resources目录下(在vs界面上添加)//add xtext.qrc to project
    12. 5&#12289;右键点击该添加的文件,选择属性配置编译器:如下//configure compile tool
    13. commandline: "$(QTDIR)\bin\rcc.exe" -o ".\GeneratedFiles\qrc_xtext.cpp" ".\xtest.qrc"
    14. description: Run igoo configure rcc...
    15.  
    16. outputs: ".\GeneratedFiles\qrc_xtest.cpp"
    17.  
    18. dep : $(QTDIR)\bin\rcc.exe
    To copy to clipboard, switch view to plain text mode 

  7. #6
    Join Date
    Jan 2006
    Posts
    122
    Thanks
    16
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to compile resources(bitmap,icon)

    Is this method suggested even for several large bmp used as background for application or it's slower than deploy the bmps as single files into the user pc?
    thanks

Similar Threads

  1. how to correctly compile threads support?
    By srhlefty in forum Installation and Deployment
    Replies: 9
    Last Post: 25th June 2006, 19:15
  2. Newbie:cannot compile - moc'ing error
    By publicENEMY in forum Installation and Deployment
    Replies: 2
    Last Post: 1st June 2006, 07:55
  3. Can't Compile Tutorial 7
    By Reenen in forum Newbie
    Replies: 10
    Last Post: 9th February 2006, 14:06
  4. fftw unable to compile
    By superutsav in forum General Programming
    Replies: 7
    Last Post: 24th January 2006, 14:10
  5. TIP: If Qt4.1 debug compile doesn't work...
    By pthomas in forum Newbie
    Replies: 3
    Last Post: 13th January 2006, 14:36

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.