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. How to understand Drag and Drop MIME types ?
Forum Updated to NodeBB v4.3 + New Features

How to understand Drag and Drop MIME types ?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 7.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
    godbod
    wrote on last edited by
    #1

    Hello everybody, I am coding a simple window, with two QListWidget's inside. My aim was to be able to drag and drop, elements of the QListWidget from one list to another... I was then wondering about, how I should understand MIME types... I tried to read about it in the documentation, but I am sure, someone explanation could be really interesting for me to better understand the meaning...Thanks in advance.

    L'imagination est tout, c'est l’aperçu des futures attractions de la vie.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      The data of a Drag'n'drop operation is stored in a mime data object. Which types are there defines, ow data could be extracted (text --> text, Url --> file or web adress, image --> picture, ...)

      You can also define custom types, so you can store the data in an oüptimal way for your application.

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • G Offline
        G Offline
        godbod
        wrote on last edited by
        #3

        I understand, suppose I need to drag n` drop a QListWidget then, How can I define a custom widget ? that's exactly the point... thank you for your quick Answer... :)

        L'imagination est tout, c'est l’aperçu des futures attractions de la vie.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          giesbert
          wrote on last edited by
          #4

          you will not drag'n'drop a widget
          I think you mean a listWidgetItem, right?

          There is a description on how to do drag'n'drop, that is (from my POV) good:

          • "FAQ: How can I drag and drop in a widget":http://developer.qt.nokia.com/faq/answer/how_can_i_do_drag_and_drop_in_a_widget
          • "FAQ: How can I drag from e.g a QListWidget and drop in an editable QTableView?":http://developer.qt.nokia.com/faq/answer/how_can_i_drag_from_e.g_a_qlistwidget_and_drop_in_an_editable_qtableview
          • "FAQ: When dragging and dropping between 2 views, how can I perform a move without pressing Shift?":http://developer.qt.nokia.com/faq/answer/when_dragging_and_dropping_between_2_views_how_can_i_perform_a_move_without
          • "Wiki: Drag and Drop within a GridView":http://developer.qt.nokia.com/wiki/Drag_and_Drop_within_a_GridView
          • "Docs: Drag and drop support in models":http://doc.qt.nokia.com/4.7/model-view-programming.html#drag-and-drop-support-and-mime-type-handling
          • "Docs: Drag and Drop Examples":http://doc.qt.nokia.com/4.7/examples-draganddrop.html

          These links should give you some ideas.

          Nokia Certified Qt Specialist.
          Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

          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