Question

I am new to Qt. I had created a Qtree View using QStandard item model. Now I want to set Url to my items. How can I assign url for tree view items.

Was it helpful?

Solution

you can use setData API of QStandardItem, with user defined role for storing URL.

void QStandardItem::setData ( const QVariant & value, int role = Qt::UserRole + 1 )
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top