FET Forum

FET Support (English) => Programming Help => Topic started by: AboZeid on December 01, 2010, 01:21:29 PM

Title: Copy resource to output folder
Post by: AboZeid on December 01, 2010, 01:21:29 PM
How can I copy a resource file to output folder?
I want to put an image and specified CSS file in the same directory with HTML output files.
Title: Re: Copy resource to output folder
Post by: Liviu Lalescu on December 02, 2010, 09:36:41 AM
Sorry, but I do not understand.
Title: Re: Copy resource to output folder
Post by: AboZeid on December 04, 2010, 07:44:02 AM
I've an external CSS and images file, and i want to copy these files to output folder (with HTML and XML files) so I can use them in generated HTML files.
I want to make some modification in CSS original file, like add a logo and background image... but I need to copy external images and css files every timetable generate.
I try this within writeSimulationResults() function:
QDir().mkdir(OUTPUT_DIR_TIMETABLES+FILE_SEP+"images");
QFile(":/images/head_bg.png").copy(OUTPUT_DIR_TIMETABLES+FILE_SEP+"images/head_bg.png");

Is there a better way?[/size]
Title: Re: Copy resource to output folder
Post by: Liviu Lalescu on December 04, 2010, 09:13:47 AM
I think this is a good way to solve your problem.

Another solution would be to use a file copying routine, directly, so that head_bg.png is not stored directly into the memory, but this way you don't have the guarantee that the file head_bg.png is always available.