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. Drag and drop a label itself
Qt 6.11 is out! See what's new in the release blog

Drag and drop a label itself

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.0k Views 1 Watching
  • 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.
  • G Offline
    G Offline
    GrishaA
    wrote on last edited by
    #1

    Hello.
    My label contains pixmap (chess piece). I want to make user able to drag it to other square of a board. Squares of the board are also labels. I see it in way that piece should be draggable while square should be droppable.
    I've managed to learn how to drag and drop a pixmap using that kind of labels.
    But now I am asking: is there a way to "drag and drop" piece label itself?
    If not what would you suggest me?
    I see such a solution: when starting dropping emit a signal to a layout, which contains a piece connected to a slot which removes the piece from the layout, and send other signal to add the piece to another place on the same layout. I don't like it, because looks bit sophisticated may be there are better solutions?

    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