PDA

View Full Version : How to enable copy-paste & click for QListView item?



zgulser
9th May 2014, 14:45
Hello everyone,

I need an urgent help regarding my QListView behavior. I have a chat program which uses MVC - that is it has a QListView, QAbstractItemModel and QItemDelegate classes for displaying messaging UI.

Everything seems working but I had no luck to interact with my messages by mouse. I couldn't copy-paste the text in the listview. Also couldn't click links in the listview as well.

I reimplemented flags function to make items selectable and editable but still not able to do copy-paste etc.

Any ideas?

wysota
12th May 2014, 09:52
If you want all these in a list view then you will have to implement all those features yourself in the delegate. Making an item "editable" means that you can trigger creating an editor widget for an item. Making an item "selectable" means that it can be marked as selected in the item selection model. It does't mean you will be able to interact with any part of the item (like selecting part of its text).

zgulser
12th May 2014, 14:54
I see your points regarding ItemIsSelectable & ItemIsEditable flags. That's in the pocket. Thanks.

In addition, I have my own delegate already but couldn't figured it out how to make , for example, the links clickable in the listview. Any specific suggestions?

Regards

zgulser
14th May 2014, 11:11
Nobody yet?