From 10:00 CET Friday 22nd November we will adjust how the server works to deal with some recently reported problems. Therefore there may be a load problem, if you experience more problems than usual trying to access the forum then please PM AndyS or any of the moderators so they can inform me.


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 2017

    @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