Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved QListWidgetItem several pieces of information

    General and Desktop
    qlistwidgetitem
    2
    2
    691
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • W
      WhatIf last edited by

      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.

      kshegunov 1 Reply Last reply Reply Quote 0
      • kshegunov
        kshegunov Moderators @WhatIf last edited by

        @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.

        Read and abide by the Qt Code of Conduct

        1 Reply Last reply Reply Quote 0
        • First post
          Last post