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. Internal Drag'n'Drop (move) in QListView and Undo-Redo
QtWS25 Last Chance

Internal Drag'n'Drop (move) in QListView and Undo-Redo

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 5.2k Views
  • 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.
  • B Offline
    B Offline
    blex
    wrote on last edited by
    #1

    Qt supports internal drag'n'drop in QListView.
    Qt provides good Undo-Redo framework.

    Is it possible to simply integrate these two features? How to implement internal move (drag'n'drop in the same list) with undo-redo support?

    I know how to do this "from scratch", I am looking for pretty solution.

    Thanks.


    Oleksiy Balabay

    1 Reply Last reply
    0
    • F Offline
      F Offline
      Franzk
      wrote on last edited by
      #2

      Try taking these steps:

      Implement the internal drag & drop. Make sure it does what you need.

      Define undo/redo points & actions

      Add undo/redo stack to model

      Add interface & GUI for undo/redo

      When the same model also supports moving data from one to another model, you should take a more complex approach, possibly with the undo stack in the top-level widget. Important thing is to learn to use them separately before you integrate them. It helps you keep overview of things. Make a small application that uses the undo stack in a different context so you get a proper feel for how it works.

      "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • B Offline
        B Offline
        blex
        wrote on last edited by
        #3

        Ok, thanks for the reply.

        I think almost in the same way, but expect that simpler integration may be possible.

        Internal move is deeply integrated in the model and view class, so some workarounds are required.


        Oleksiy Balabay

        1 Reply Last reply
        0
        • F Offline
          F Offline
          Franzk
          wrote on last edited by
          #4

          Maybe this one helps: "Using Undo/Redo with Item Views":http://doc.trolltech.com/qq/qq25-undo.html.

          "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • B Offline
            B Offline
            blex
            wrote on last edited by
            #5

            [quote author="Franzk" date="1290084294"]Maybe this one helps: "Using Undo/Redo with Item Views":http://doc.trolltech.com/qq/qq25-undo.html.[/quote]

            Thank you. Not exactly what I want, but very good article. Idea of using Proxy models is intersecting.


            Oleksiy Balabay

            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