QListWidgetItem several pieces of information



  • Hi,

    I was reading the documentation for the QListWidgetItem class and it mentions that "Each item can hold several pieces of information, and will display them appropriately."

    Can someone show me an example of what other pieces of information it can hold? What type?

    Currently I'm using QListWidgetItem to add a list of names to a QListWidget.


  • Qt Champions 2016

    @WhatIf

    Can someone show me an example of what other pieces of information it can hold? What type?

    Any type that's registered for QVariant (declared as a meta-type). Here's what Qt has a data roles, but you can have your own.

    Kind regards.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.