Qlist in Qtreeview
-
Is it possible to display a Qlist of string values in a QtreeView? If possible how?
-
Hi,
Yes it is:
QApplication app(argc, argv); QStringList stringList; stringList << "String1" << "String2" << "String3"; QStringListModel *model = new QStringListModel(stringList); QTreeView view; view.setModel(model); view.show(); return app.exec();
-
Well, your model should then return one column and the string list size as row count. Then data should return the appropriate string from the list