Results 1 to 3 of 3

Thread: Reading content from a file in qmake

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2011
    Location
    Piteå, Sweden
    Posts
    13
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11

    Default Reading content from a file in qmake

    We're using Pococapsule to define a configuration XML file which will eventually end up in a .cpp file which contains factories for the various classes. This XML file contains references to other modules' XML files like this:

    Qt Code:
    1. <!DOCTYPE poco-application-context
    2. SYSTEM "http://www.pocomatic.com/poco-application-context.dtd" [
    3. <!ENTITY ModuleX SYSTEM "../../ModuleX/conf/ModuleX.xml" >
    4. <!ENTITY ModuleY SYSTEM "../../ModuleY/conf/ModuleY.xml" >
    5. <!ENTITY ModuleZ SYSTEM "../../ModuleZ/conf/ModuleZ.xml" >
    6. ]>
    To copy to clipboard, switch view to plain text mode 

    When any of these or the master XML file is touched the .cpp file needs to be rebuilt. I already have it working for the master XML file but I'm having problems trying to figure out how to extract the individual includes and add them to the dependency list. My first thought was to extract the contents of the XML file using the undocumented cat function but I can't get that to work

    Qt Code:
    1. # Hard coded for test
    2. CONFIGCONTENT = cat(/path/to/ModuleX.xml)
    3. message($$CONFIGCONTENT)
    To copy to clipboard, switch view to plain text mode 

    This only prints the actual command (cat /....) and not the file's content. Am I missing something here or is there some better way of doing this? I want to try to avoid external programs since it will be built on multiple platforms.
    Last edited by MarcoAlanen; 23rd March 2011 at 07:29.

Similar Threads

  1. Replies: 11
    Last Post: 10th February 2011, 00:38
  2. Replies: 3
    Last Post: 29th December 2010, 17:14
  3. Problems reading content of QFile
    By martinn in forum Newbie
    Replies: 12
    Last Post: 6th April 2010, 18:42
  4. set content(&file)
    By rk0747 in forum Qt Programming
    Replies: 1
    Last Post: 6th February 2010, 08:31
  5. Saving QLabel content in a file
    By Caius Aérobus in forum Newbie
    Replies: 1
    Last Post: 29th October 2008, 17:03

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
  •  
Qt is a trademark of The Qt Company.