Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Drag and drop - text between subwindows
Qt 6.12 LTS is out! See what's new in the release blog

Drag and drop - text between subwindows

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 800 Views 2 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by
    #1

    I am starting to look into an idea to "drag and drop" highlighted text between QTextEdit objects.
    Is it in general feasible in Qt?

    Pl45m4P 1 Reply Last reply
    0
    • A Anonymous_Banned275

      I am starting to look into an idea to "drag and drop" highlighted text between QTextEdit objects.
      Is it in general feasible in Qt?

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by
      #2

      @AnneRanch

      Should be possible. Maybe you have to subclass and create your own d'n'd-QTextEdit.
      Have a look at these examples.

      • https://doc.qt.io/qt-6/dnd.html

      • https://doc.qt.io/qt-6/qtwidgets-draganddrop-draggabletext-example.html


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      A 1 Reply Last reply
      0
      • Pl45m4P Pl45m4

        @AnneRanch

        Should be possible. Maybe you have to subclass and create your own d'n'd-QTextEdit.
        Have a look at these examples.

        • https://doc.qt.io/qt-6/dnd.html

        • https://doc.qt.io/qt-6/qtwidgets-draganddrop-draggabletext-example.html

        A Offline
        A Offline
        Anonymous_Banned275
        wrote on last edited by
        #3

        @Pl45m4 Thanks - that is very encouraging and immensely helpful.
        I think the main challenge will be - I am passing , using drag and drop, a text between instances of QTextEdit and only the source is active. So i simple terms - if I start the drag using mouse I will have to figure out how to activate the destination - since the mouse button has to stay down... perhaps I will need a keyboard too... space bar (?) .
        My concern is how to add all these "drag and drop" classes without destroying the initial QTextEdit and MDIArea relations.
        I have never done multiple inheritance, perhaps this will be a good application for that.
        I already have examples cloned, so I will take a look at the example you posted.
        Thanks

        Pl45m4P 1 Reply Last reply
        0
        • A Offline
          A Offline
          Anonymous_Banned275
          wrote on last edited by
          #4

          I did check the example . It is put together as subproject and won't even compile. This is not a first time example does not work. Why QT is putting out such trash is unbelievable. Spare me the usual comments - you are using wrong Qt version ...

          1 Reply Last reply
          0
          • A Anonymous_Banned275

            @Pl45m4 Thanks - that is very encouraging and immensely helpful.
            I think the main challenge will be - I am passing , using drag and drop, a text between instances of QTextEdit and only the source is active. So i simple terms - if I start the drag using mouse I will have to figure out how to activate the destination - since the mouse button has to stay down... perhaps I will need a keyboard too... space bar (?) .
            My concern is how to add all these "drag and drop" classes without destroying the initial QTextEdit and MDIArea relations.
            I have never done multiple inheritance, perhaps this will be a good application for that.
            I already have examples cloned, so I will take a look at the example you posted.
            Thanks

            Pl45m4P Offline
            Pl45m4P Offline
            Pl45m4
            wrote on last edited by
            #5

            @AnneRanch said in Drag and drop - text between subwindows:

            very encouraging and immensely helpful.

            How did it turn from very encouraging and immensely helpful to trash so quickly? :)

            The example project has a main.cpp and a .pro file. So you can use it as standalone project and test the behavior.


            If debugging is the process of removing software bugs, then programming must be the process of putting them in.

            ~E. W. Dijkstra

            1 Reply Last reply
            1

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt
            • Unsolved