Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. The Lounge
  4. Web-like templating engine for XML/.ui files
Qt 6.11 is out! See what's new in the release blog

Web-like templating engine for XML/.ui files

Scheduled Pinned Locked Moved The Lounge
1 Posts 1 Posters 2.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    alexbottoni
    wrote on last edited by
    #1

    Just out of curiosity, I'm wondering if anybody has ever tried/thought/dreamed to do some "templating" with the XML (.ui) files created by Qt Designer.

    I mean:

    • Qt Designer creates XML files (that is: text files, very similar to HTML, that can be easily modified by a external program, either at compile-time or at run-time)

    • Qt can load these files from any QUIDevice (that is: stuff coming from the disk, from memory, from the network...) thanks to QUILoader or QFormBuilder

    As a consequence, in principle it is possible to implement this workflow:
    *
    Create one or more XML templates with QT Designer (and, maybe, some manual/automatic tweak)

    • At compile time, use a Ruby, Python or C++ template engine to produce a set of XML/.ui files

    [OR, at run-time, use a C++ template engine like Grantlee, Clearsilver or Wt, or the Qt internal QtXML module, to load a XML template from disk and to create a suitable XML/.ui file]

    • Load the resulting XML/.ui GUI definition files with QUILoader and show the resulting GUI to the user.

    This would be a very near replica of the typical "templating engine" used in most web application (like Smarty, Cheetah and so on).

    Of course, given that it is already possible to dynamically create a GUI at run-time with the regular C++/Qt code, it would be somehow redundant to use such a technique. Nevertheless, It seems to me that it could be useful for some MDD-oriented project.

    Can anybody see any possible/interesting application of such a technique?

    Thanks

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved