Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Reordering QListWidgetItems in QListWidget (iconMode) by Drag and Drop movement
Forum Update on Monday, May 27th 2025

Reordering QListWidgetItems in QListWidget (iconMode) by Drag and Drop movement

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.1k 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
    justAnoob
    wrote on last edited by
    #1

    I got a QListWidget with viewMode = IconMode and flow = LeftToRight to display some icon.
    Now i want the User to be able to move the items around to change their order (movement is set to "Snap" with a fixed gridSize) and add new items via Drag and Drop from another QListWidget.
    So far this is working, but when moving items inside the QListWidget it leaves an empty space where the item used to be.
    While searching for a solution i found doItemsLayout() which in fact clears the empty spaces but lays them out in order of creation.

    What is the right way to achieve this behavior?

    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 Extensions
    • Unsolved