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. Question about event->mimeData()->hasFormat(...)
Forum Updated to NodeBB v4.3 + New Features

Question about event->mimeData()->hasFormat(...)

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.5k 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.
  • T Offline
    T Offline
    timain
    wrote on last edited by
    #1

    Hi,
    I want to know what the QString: "application/x-dnditemdata" means in this block of code (used in a drag-and-drop function): if (event->mimeData()->hasFormat("application/x-dnditemdata"))

    What kind of format is it?
    Thanks for your reply.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      I suppose you are looking at the Draggable Icon example. It's just a custom mime-type for the application's drag&drop data.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • T Offline
        T Offline
        timain
        wrote on last edited by
        #3

        Thanks SGalst , it's clear now,
        I am trying to disable drag-and-drop for just one image(QLabel) and permit it for the others but I d'on't know what to do, the setDraggable(false) option disable it for all of them, I would be pleased if you had some ideas.

        Thank you.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Before starting the drag operation, check that if it's for that specific QLabel and don't do it if it is

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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