Results 1 to 8 of 8

Thread: Create a dialog on the fly dynamically based on an input xml file

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    691
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Create a dialog on the fly dynamically based on an input xml file

    Hi Qt community,

    I need to read an xml custom file and based on its content I have to create and show a dialog showing what has been described in the xml file.
    A small example of part of the content of the file:

    Qt Code:
    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <HMI>
    3. <Parameter type=[COLOR="#008000"]"textfield"[/COLOR]>
    4. <Label>DS ID</Label>
    5. <Size>80</Size>
    6. <Value>-1</Value>
    7. <ToolTip>Enter DS_ID. For all use -1</ToolTip>
    8. </Parameter>
    9. <Parameter type=[COLOR="#008000"]"textfield"[/COLOR]>
    10. <Label>RT Number</Label>
    11. <Size>80</Size>
    12. <Value>-1</Value>
    13. <ToolTip>Track number. For all use -1</ToolTip>
    14. </Parameter>
    15. <Parameter type=[COLOR="#008000"]"textfield"[/COLOR]>
    16. <Label>Sigma Value</Label>
    17. <Size>80</Size>
    18. <Value>2</Value>
    19. <ToolTip>Sigma value. For for which AA will be performed</ToolTip>
    20. </Parameter>
    21. </HMI>
    To copy to clipboard, switch view to plain text mode 

    This will be translated in a dialog having 3 couples of QLabel and QLineEdit respectively.
    Each couple of <Label>labelText</Label> tags identifies the QLabel (having labelText as text) and each Parameter type="textfield" identifies the QLineEdit widgets with the text between the tags <Value> and </Value>. I have no problem in parsing an xml file, but I'm not very clear on how to create dialog on the fly.

    Any help will be appreciated.
    Franco
    Last edited by d_stranz; 25th November 2021 at 16:59. Reason: missing [code] tags
    Franco Amato

Similar Threads

  1. Replies: 1
    Last Post: 12th March 2015, 06:41
  2. Replies: 0
    Last Post: 25th March 2014, 06:24
  3. Replies: 7
    Last Post: 5th February 2014, 11:20
  4. Replies: 3
    Last Post: 19th October 2011, 13:08
  5. Replies: 2
    Last Post: 28th September 2010, 10:34

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.