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:
<?xml version="1.0" encoding="UTF-8"?>
<HMI>
<Parameter type=[COLOR="#008000"]"textfield"[/COLOR]>
<Label>DS ID</Label>
<Size>80</Size>
<Value>-1</Value>
<ToolTip>Enter DS_ID. For all use -1</ToolTip>
</Parameter>
<Parameter type=[COLOR="#008000"]"textfield"[/COLOR]>
<Label>RT Number</Label>
<Size>80</Size>
<Value>-1</Value>
<ToolTip>Track number. For all use -1</ToolTip>
</Parameter>
<Parameter type=[COLOR="#008000"]"textfield"[/COLOR]>
<Label>Sigma Value</Label>
<Size>80</Size>
<Value>2</Value>
<ToolTip>Sigma value. For for which AA will be performed</ToolTip>
</Parameter>
</HMI>
<?xml version="1.0" encoding="UTF-8"?>
<HMI>
<Parameter type=[COLOR="#008000"]"textfield"[/COLOR]>
<Label>DS ID</Label>
<Size>80</Size>
<Value>-1</Value>
<ToolTip>Enter DS_ID. For all use -1</ToolTip>
</Parameter>
<Parameter type=[COLOR="#008000"]"textfield"[/COLOR]>
<Label>RT Number</Label>
<Size>80</Size>
<Value>-1</Value>
<ToolTip>Track number. For all use -1</ToolTip>
</Parameter>
<Parameter type=[COLOR="#008000"]"textfield"[/COLOR]>
<Label>Sigma Value</Label>
<Size>80</Size>
<Value>2</Value>
<ToolTip>Sigma value. For for which AA will be performed</ToolTip>
</Parameter>
</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
Bookmarks