Why wouldn't you just use a QSql[Query|Table]Model for the combo box? Or in Wt, a Wt::Dbo::QueryModel< Result >
QXmlStreamReader is easy if the schema is easy. You just get elements as they occur. ________________________________ From: Jeffrey Scott Flesher Gmail <jeffrey.scott.fles...@gmail.com> To: Wt <witty-interest@lists.sourceforge.net> Sent: Tuesday, March 11, 2014 7:23 PM Subject: [Wt-interest] Can you use XML or SQL as a data source for WComboBox? I do not see any examples of it, beside one very confusing forum thread, with no full example code, I did not find anything else, I am mostly interested in XML. My guess would be that I would use: combo = new WComboBox(this); WStandardItemModel *si = new WStandardItemModel(); and use QXmlStreamReader to read in the data, and attach it with: WStandardItem *i = new WStandardItem(); i->setData(p1.key, UserRole); i->setText(p1.name); si->appendRow(i); combo->setModel(si); Found this at http://andres.jaimes.net/799/how-to-use-a-combobox-with-cwt-witty/ I can work on this and get it to work with no problem, but I was wondering if there is an easier way, or if this is the way to do it. Do you have a Wt class to read XML? or is QXmlStreamReader just as easy and fast? Thanks ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech _______________________________________________ witty-interest mailing list witty-interest@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/witty-interest ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech _______________________________________________ witty-interest mailing list witty-interest@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/witty-interest