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. [Solved] Qt5 QAbstractItemModel::setSupportedDragActions() deprecated
Forum Updated to NodeBB v4.3 + New Features

[Solved] Qt5 QAbstractItemModel::setSupportedDragActions() deprecated

Scheduled Pinned Locked Moved General and Desktop
8 Posts 3 Posters 4.7k 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.
  • S Offline
    S Offline
    Sam
    wrote on last edited by
    #1

    It seems that QAbstractItemModel::setSupportedDragActions() deprecated in Qt 5, Previously we could use

    @model->setSupportedDragActions(Qt::MoveAction);@

    What to use in Qt 5 ?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Sam
      wrote on last edited by
      #2

      --any updates--

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

        did you check the porting guide?
        http://qt-project.org/doc/qt-5.0/qtdoc/portingguide.html

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lgeyer
          wrote on last edited by
          #4

          QAbstractItemModel::supportedDragActions() is now virtual (as supportedDropActions() is).

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Sam
            wrote on last edited by
            #5

            [quote author="Thomas Zander" date="1359463661"]did you check the porting guide?
            http://qt-project.org/doc/qt-5.0/qtdoc/portingguide.html[/quote]

            Yes but there is no information for setSupportedDragAction() however i checked "Compatibility Members for QAbstractItemModel":http://qt-project.org/doc/qt-5.0/qtcore/qabstractitemmodel-compat.html

            [quote author="Lukas Geyer" date="1359464000"]QAbstractItemModel::supportedDragActions() is now virtual (as supportedDropActions() is).[/quote]

            I checked this "commit":https://gitorious.org/trojita/trojita/commit/7f88a8630d8ca7a48aa902b121167ccce3cfba1e and also "porting to the final release of Qt 5":http://comments.gmane.org/gmane.comp.lib.qt.user/5264 but got a bit confused what should be used. For my custom model i override supportedDropActions()

            @Qt::DropActions DragDropListModel::supportedDropActions() const
            {
            return Qt::CopyAction | Qt::MoveAction;
            }@

            but then i also used
            @model->setSupportedDragActions(Qt::MoveAction); @

            So is it required or should i drop that statement ?

            1 Reply Last reply
            0
            • L Offline
              L Offline
              lgeyer
              wrote on last edited by
              #6

              [quote author="Sam" date="1359464719"]... for my custom model i override supportedDropActions() ...[/quote]Just override supportedDragActions() in the same way instead of calling setSupportedDragActions().

              1 Reply Last reply
              0
              • S Offline
                S Offline
                Sam
                wrote on last edited by
                #7

                [quote author="Lukas Geyer" date="1359469546"]Just override supportedDragActions() in the same way instead of calling setSupportedDragActions().[/quote]

                Thanks a lot, I understood now.

                Regards
                Soumitra.

                1 Reply Last reply
                0
                • L Offline
                  L Offline
                  lgeyer
                  wrote on last edited by
                  #8

                  You're welcome! ;-)

                  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