How to assign different Url to my TreeView Items

146 Views Asked by At

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.

1

There are 1 best solutions below

0
On BEST ANSWER

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 )