Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Add custom QWidget to QListWidget
Qt 6.12 LTS is out! See what's new in the release blog

Add custom QWidget to QListWidget

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 385 Views
  • 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.
  • J Offline
    J Offline
    Julianng17
    wrote on last edited by Julianng17
    #1

    I created a list using QListWidget and would like to add my custom class derived from QWidget as entries into that list. The custom QWidget consists of four horizontally aligned elements; two labels, and two images, and some data to react to user input.

    I tried deriving my custom list entry from QListWidgetItem in order to add it to the QListWidget, but doing that I get an error when assigning my custom widget as the parent of any of its elements (candidate constructor not viable: no known conversion from 'ListEntry*' to 'QWidget *' for 1st argument).

    How would I go about creating a custom class composed of multiple widgets and adding it to a QListWidget?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt
    • Unsolved