[Qt-interest] about absolute

Oliver.Knoll at comit.ch Oliver.Knoll at comit.ch
Tue May 25 13:35:38 CEST 2010


pengliang(??) wrote on Tuesday, May 25, 2010 5:34 AM:
>       file_path = ":/instruction_params_chinese.xml"; 
> QFile file(file_path);
> 
> I don't know why qt don't know where is file_path in this program,

Why should it? Unless you are actually *embedding* that file into your executable, that is... (note the ':' (colon), which indicates that Qt should be looking for an *embedded* file - just to state the obvious again...)

- Does the path /instructions_params_chinese.xml match with the one in the corresponding *.qrc file?

- Do you run rcc on that file? (It the above *.qrc correctly registered under RESOURCES in your *.pro file?)

- Is your exectuable up-to-date with the latest changes done in your *.qrc file?

Make sure you understand http://doc.trolltech.com/4.6/resources.html

Cheers, Oliver
-- 
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22



More information about the Qt-interest-old mailing list