Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
[closed]Rean an xml and create checkboxes
annatz last edited by
I have created some checkboxes with some examinations.
@checkbox1 = new QCheckBox("Geniki Aimatos", this);
checkbox2 = new QCheckBox("UREA", this);
checkbox3 = new QCheckBox("CREA", this);@
but i want to change my code and read the examinations from an xml file. the xml may change in the future.It may be bigger.
So how can i create the checkboxes? each checkbox should have a different name. if i count the examinations of the file, how can i define the checkboxes?
lgeyer last edited by
Use QXmlStreamReader to read the XML, create QCheckBoxes on the fly and add them to a layout, for example a QVBoxLayout to have them aligned properly. Use setObjectName() to associate a unique identifier with each checkbox.
andre last edited by
Annatz, you have opened more than enough topics on this application of yours and the XML file reading & writing that comes with it now.