I have a simple DOM model for working with XML (from this tutorial: http://doc.qt.io/qt-5/qtwidgets-itemviews-simpledommodel-example.html). Now in my code I want to get data by index like this:
auto data = model_->data(index, Qt::DisplayRole);
But method data()
returns QVariant
and I want to convert it to QDomNode
. How can I do that? I have tried this: https://stackoverflow.com/a/24363059/5955876, but it didn't help. I guess it is because QDomNode
isn't QObject
. Any suggestions?