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 signal for a button
Forum Updated to NodeBB v4.3 + New Features

Drag and drop signal for a button

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

    Hi i have two QVBoxLayouts next to each other which are displaying files in two different locations (each file is a separate button).
    i would like to be able to move a file from one directory to another when the user clicks and drags on the button and releases it over the other QVBoxLayout ( a similar process to drag / drop in windows ).

    regards, Tim.

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

      Hi,

      Just to know, why don't you use QFileSystemModel with a view (QListView for example) ?

      That would make the filesystem operations and the drag and drop easier to implement.

      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
        Timmoth
        wrote on last edited by
        #3

        the controls needed to be custom built because of a few specific functions.
        (i need full control over what folders the users is allowed to browse too )

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

          Are you sure that it would not be easier to implement some sort of filter over the QFileSystemModel ? Or make your own model ?

          In between, the "Drag and Drop":http://qt-project.org/doc/qt-5.0/qtgui/dnd.html documentation is what you need to get started

          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