Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, October 2001
XML --> Qt 'skeleton' application (runtime)


Message 1 in thread


I was wondering if there are support in Qt (v3) for reading XML files
(like the ones from Designer, or similar) and building an application from
it (like when 'testing' a gui in the Designer).

Java has this feature (or will soon in v1.4), where one can specify in an
XML file things like:

<object class="javax.swing.JButton">
  <string>Press me</string>
  <void method="setName">
    <string>Greeting</string>
  </void>
</object>

(this is for JavaBeans and only public methods are accesible)
A complex gui would be built by adding child widgets to a parents, like:

<object class="javax.swing.JPanel">
  <void method="add">
    <object id="button1" class="javax.swing.JButton"/>
  </void>
...

and events are handled similary using addXXXXListener.

reading and building in a complex gui 'skeleton' can then be done by one
function call like:
XMLDecoder d = new XMLDecoder(
                       new BufferedInputStream(
                           new FileInputStream("Browse.xml")));

So, working with the Qt Designer, seeing the className(), and get/set
functions for Q_OBJECTS etc. (using moc) shouldn't this be possible
with Qt too, and is it implemented allready?

espen
-------------------------------------------------------------------
I don't need to test my programs. I have an error-correcting modem.


Message 2 in thread

Hello,

You want QWidgetFactory.  I believe it is new in Qt3.

-Justin

On Monday 01 October 2001 11:55, you wrote:
> I was wondering if there are support in Qt (v3) for reading XML files
> (like the ones from Designer, or similar) and building an application from
> it (like when 'testing' a gui in the Designer).
>
> Java has this feature (or will soon in v1.4), where one can specify in an
> XML file things like:
>
> <object class="javax.swing.JButton">
>   <string>Press me</string>
>   <void method="setName">
>     <string>Greeting</string>
>   </void>
> </object>
>
> (this is for JavaBeans and only public methods are accesible)
> A complex gui would be built by adding child widgets to a parents, like:
>
> <object class="javax.swing.JPanel">
>   <void method="add">
>     <object id="button1" class="javax.swing.JButton"/>
>   </void>
> ...
>
> and events are handled similary using addXXXXListener.
>
> reading and building in a complex gui 'skeleton' can then be done by one
> function call like:
> XMLDecoder d = new XMLDecoder(
>                        new BufferedInputStream(
>                            new FileInputStream("Browse.xml")));
>
> So, working with the Qt Designer, seeing the className(), and get/set
> functions for Q_OBJECTS etc. (using moc) shouldn't this be possible
> with Qt too, and is it implemented allready?
>
> espen
> -------------------------------------------------------------------
> I don't need to test my programs. I have an error-correcting modem.