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. Bug in Qt 5.12 drag n'drop ?
Forum Updated to NodeBB v4.3 + New Features

Bug in Qt 5.12 drag n'drop ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
qat 5.12 drag ndrop
57 Posts 12 Posters 15.9k Views 4 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 skylendar
    15 Dec 2018, 18:02

    @aha_1980

    And you forget something: Qt is actually a commercial program, and most of you, if not all, are paid for debugging it. Why should I work for you for free ?

    J Offline
    J Offline
    J.Hilk
    Moderators
    wrote on 16 Dec 2018, 08:27 last edited by
    #25

    @skylendar said in Bug in Qt 5.12 drag n'drop ?:

    @aha_1980

    And you forget something: Qt is actually a commercial program, and most of you, if not all, are paid for debugging it. Why should I work for you for free ?

    If you happen to own a commercial license you should contact the customer support they may be able to help you more directly.

    However they also will ask for a minimal compileable project, if your current project is considerably too large.
    Alternatively there is also the option of paid consulting either from the QtCompany directly or other companies, like for example KDAB


    Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


    Q: What's that?
    A: It's blue light.
    Q: What does it do?
    A: It turns blue.

    S 1 Reply Last reply 16 Dec 2018, 14:04
    2
    • J J.Hilk
      16 Dec 2018, 08:27

      @skylendar said in Bug in Qt 5.12 drag n'drop ?:

      @aha_1980

      And you forget something: Qt is actually a commercial program, and most of you, if not all, are paid for debugging it. Why should I work for you for free ?

      If you happen to own a commercial license you should contact the customer support they may be able to help you more directly.

      However they also will ask for a minimal compileable project, if your current project is considerably too large.
      Alternatively there is also the option of paid consulting either from the QtCompany directly or other companies, like for example KDAB

      S Offline
      S Offline
      skylendar
      wrote on 16 Dec 2018, 14:04 last edited by
      #26

      @J.Hilk

      Who has a linux dnd program which can be tested ?

      M 1 Reply Last reply 16 Dec 2018, 16:01
      0
      • S skylendar
        16 Dec 2018, 14:04

        @J.Hilk

        Who has a linux dnd program which can be tested ?

        M Offline
        M Offline
        mrjj
        Lifetime Qt Champion
        wrote on 16 Dec 2018, 16:01 last edited by
        #27

        @skylendar
        Hi
        What about test with the sample that comes with Qt ?
        http://doc.qt.io/qt-5/dnd.html#examples
        There are often directly available in Creator.

        S 1 Reply Last reply 17 Dec 2018, 15:41
        0
        • M mrjj
          16 Dec 2018, 16:01

          @skylendar
          Hi
          What about test with the sample that comes with Qt ?
          http://doc.qt.io/qt-5/dnd.html#examples
          There are often directly available in Creator.

          S Offline
          S Offline
          skylendar
          wrote on 17 Dec 2018, 15:41 last edited by
          #28

          @mrjj

          Found the puzzle in the examples. It works, but in my case the draggable widget is placed in a QTreeWidget, not just an ordinary QWidget.

          M 1 Reply Last reply 17 Dec 2018, 15:59
          0
          • S skylendar
            17 Dec 2018, 15:41

            @mrjj

            Found the puzzle in the examples. It works, but in my case the draggable widget is placed in a QTreeWidget, not just an ordinary QWidget.

            M Offline
            M Offline
            mrjj
            Lifetime Qt Champion
            wrote on 17 Dec 2018, 15:59 last edited by
            #29

            Hi
            well it its almost the same unless you used
            QStandardItemModel::dropMimeData()
            or something like that.

            S 1 Reply Last reply 17 Dec 2018, 16:44
            0
            • M mrjj
              17 Dec 2018, 15:59

              Hi
              well it its almost the same unless you used
              QStandardItemModel::dropMimeData()
              or something like that.

              S Offline
              S Offline
              skylendar
              wrote on 17 Dec 2018, 16:44 last edited by skylendar
              #30

              @mrjj

              I can drag from my QTreeWidget, but I can't drop anymore my icon onto my QWidget target, whereas it worked in the previous version of qt (5.11).

              Everything seems ok, but the dropEvent() method of my QWidget isn't activated (setAcceptDrop() is set to true, of course)

              M 1 Reply Last reply 17 Dec 2018, 16:52
              0
              • S skylendar
                17 Dec 2018, 16:44

                @mrjj

                I can drag from my QTreeWidget, but I can't drop anymore my icon onto my QWidget target, whereas it worked in the previous version of qt (5.11).

                Everything seems ok, but the dropEvent() method of my QWidget isn't activated (setAcceptDrop() is set to true, of course)

                M Offline
                M Offline
                mrjj
                Lifetime Qt Champion
                wrote on 17 Dec 2018, 16:52 last edited by
                #31

                @skylendar
                Check the
                http://doc.qt.io/qt-5/qtwidgets-draganddrop-puzzle-example.html
                as it drops from ListWidget to Widget.

                S 1 Reply Last reply 17 Dec 2018, 16:57
                0
                • M mrjj
                  17 Dec 2018, 16:52

                  @skylendar
                  Check the
                  http://doc.qt.io/qt-5/qtwidgets-draganddrop-puzzle-example.html
                  as it drops from ListWidget to Widget.

                  S Offline
                  S Offline
                  skylendar
                  wrote on 17 Dec 2018, 16:57 last edited by
                  #32

                  @mrjj

                  But I already did that... The codes are very similar, but in my case it doesn't work anymore

                  M 1 Reply Last reply 17 Dec 2018, 17:02
                  0
                  • C Offline
                    C Offline
                    Christian Ehrlicher
                    Lifetime Qt Champion
                    wrote on 17 Dec 2018, 17:01 last edited by
                    #33

                    @skylendar said in Bug in Qt 5.12 drag n'drop ?:

                    The codes are very similar

                    So you should modify one of them until you hit or fix the problem...

                    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                    Visit the Qt Academy at https://academy.qt.io/catalog

                    S 1 Reply Last reply 17 Dec 2018, 18:49
                    0
                    • S skylendar
                      17 Dec 2018, 16:57

                      @mrjj

                      But I already did that... The codes are very similar, but in my case it doesn't work anymore

                      M Offline
                      M Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on 17 Dec 2018, 17:02 last edited by
                      #34

                      @skylendar
                      Ok but it does not seems Qt related then as those sample didn't change between
                      5.11 and 5.12 so if they still work it seems unlikely something broke on Qt level.

                      S 1 Reply Last reply 17 Dec 2018, 18:48
                      0
                      • M mrjj
                        17 Dec 2018, 17:02

                        @skylendar
                        Ok but it does not seems Qt related then as those sample didn't change between
                        5.11 and 5.12 so if they still work it seems unlikely something broke on Qt level.

                        S Offline
                        S Offline
                        skylendar
                        wrote on 17 Dec 2018, 18:48 last edited by
                        #35

                        @mrjj

                        On the contrary ! My code didn't change between 5.11 and 5.12, and suddenly it doesn't work...

                        J 1 Reply Last reply 18 Dec 2018, 07:34
                        0
                        • C Christian Ehrlicher
                          17 Dec 2018, 17:01

                          @skylendar said in Bug in Qt 5.12 drag n'drop ?:

                          The codes are very similar

                          So you should modify one of them until you hit or fix the problem...

                          S Offline
                          S Offline
                          skylendar
                          wrote on 17 Dec 2018, 18:49 last edited by
                          #36

                          @Christian-Ehrlicher
                          it's exactly what I'm doing :-£

                          1 Reply Last reply
                          0
                          • S skylendar
                            17 Dec 2018, 18:48

                            @mrjj

                            On the contrary ! My code didn't change between 5.11 and 5.12, and suddenly it doesn't work...

                            J Offline
                            J Offline
                            jsulm
                            Lifetime Qt Champion
                            wrote on 18 Dec 2018, 07:34 last edited by
                            #37

                            @skylendar said in Bug in Qt 5.12 drag n'drop ?:

                            My code didn't change between 5.11 and 5.12, and suddenly it doesn't work

                            This does not prove that there is a bug in Qt (though there could be).
                            It could be a problem in your code which didn't cause issues with Qt 5.11 but does with Qt 5.12.
                            So, before saying there is a bug in Qt you should really prove that.

                            https://forum.qt.io/topic/113070/qt-code-of-conduct

                            A 1 Reply Last reply 21 Dec 2018, 13:21
                            1
                            • J jsulm
                              18 Dec 2018, 07:34

                              @skylendar said in Bug in Qt 5.12 drag n'drop ?:

                              My code didn't change between 5.11 and 5.12, and suddenly it doesn't work

                              This does not prove that there is a bug in Qt (though there could be).
                              It could be a problem in your code which didn't cause issues with Qt 5.11 but does with Qt 5.12.
                              So, before saying there is a bug in Qt you should really prove that.

                              A Offline
                              A Offline
                              armindev
                              wrote on 21 Dec 2018, 13:21 last edited by
                              #38

                              @jsulm said in Bug in Qt 5.12 drag n'drop ?:

                              t prove that there is a bug in

                              I also have an Application which has a drag n'drop problem since I've updated to Qt 5.12.0 (macOS 10.14.2 Mojave). The eventFilter method is not called anymore with QEvent::Drop

                              Therefore I can not drop anything into my QLineEdit derived object...

                              // MyLineEdit is derived from QLineEdit
                              
                              bool MyLineEdit::eventFilter(QObject* object, QEvent* event)
                              {
                              
                                  if(m_droppable) {
                              
                                      if(event->type() == QEvent::DragEnter) {
                                          event->accept();
                                      }
                              
                                      // since Qt 5.12.0 the following condition is never true! 
                                      if(event->type() == QEvent::Drop) {
                                           // this line is never reached
                                           // ..
                                      }
                              
                                  }
                              }
                              
                              
                              1 Reply Last reply
                              0
                              • C Offline
                                C Offline
                                Christian Ehrlicher
                                Lifetime Qt Champion
                                wrote on 21 Dec 2018, 15:14 last edited by Christian Ehrlicher
                                #39

                                This works fine with 5.11 and 5.12 on Linux:

                                class MyLineEdit : public QLineEdit
                                {
                                    Q_OBJECT
                                public:
                                    using QLineEdit::QLineEdit;
                                
                                    bool eventFilter(QObject *object, QEvent *event)
                                    {
                                        if (event->type() == QEvent::DragEnter)
                                            event->accept();
                                        if (event->type() == QEvent::Drop)
                                            qDebug() << "Drop";
                                        return QLineEdit::eventFilter(object, event);
                                    }
                                };
                                
                                int main(int argc, char *argv[])
                                {
                                    QApplication app(argc, argv);
                                    MyLineEdit le;
                                    le.installEventFilter(&le);
                                    le.show();
                                    return app.exec();
                                }
                                
                                #include "main.moc"
                                

                                If it does not work on Mac please open a bug report.

                                /edit: There were some dnd changes between 5.11 and 5.12: 10b3286313c78fa380b5fe676a7c14f3ae84f017 - it works fine on Linux, did not yet test on windows and don't have a mac...

                                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                                Visit the Qt Academy at https://academy.qt.io/catalog

                                A 1 Reply Last reply 21 Dec 2018, 18:44
                                2
                                • M Offline
                                  M Offline
                                  Maaz Momin
                                  wrote on 21 Dec 2018, 15:20 last edited by
                                  #40

                                  Hello guys... Since we are talking about Drag and Drop. Can somebody also look into this bug report?

                                  https://bugreports.qt.io/browse/QTBUG-70725

                                  1 Reply Last reply
                                  0
                                  • C Christian Ehrlicher
                                    21 Dec 2018, 15:14

                                    This works fine with 5.11 and 5.12 on Linux:

                                    class MyLineEdit : public QLineEdit
                                    {
                                        Q_OBJECT
                                    public:
                                        using QLineEdit::QLineEdit;
                                    
                                        bool eventFilter(QObject *object, QEvent *event)
                                        {
                                            if (event->type() == QEvent::DragEnter)
                                                event->accept();
                                            if (event->type() == QEvent::Drop)
                                                qDebug() << "Drop";
                                            return QLineEdit::eventFilter(object, event);
                                        }
                                    };
                                    
                                    int main(int argc, char *argv[])
                                    {
                                        QApplication app(argc, argv);
                                        MyLineEdit le;
                                        le.installEventFilter(&le);
                                        le.show();
                                        return app.exec();
                                    }
                                    
                                    #include "main.moc"
                                    

                                    If it does not work on Mac please open a bug report.

                                    /edit: There were some dnd changes between 5.11 and 5.12: 10b3286313c78fa380b5fe676a7c14f3ae84f017 - it works fine on Linux, did not yet test on windows and don't have a mac...

                                    A Offline
                                    A Offline
                                    armindev
                                    wrote on 21 Dec 2018, 18:44 last edited by
                                    #41

                                    @Christian-Ehrlicher said in Bug in Qt 5.12 drag n'drop ?:

                                    MyLineEdit

                                    Hm... this works on mac too!

                                    Seems to be a special constelation which doesn't work or it's a bug in specific circumstancens only...

                                    1 Reply Last reply
                                    0
                                    • C Offline
                                      C Offline
                                      Christian Ehrlicher
                                      Lifetime Qt Champion
                                      wrote on 21 Dec 2018, 18:57 last edited by
                                      #42

                                      @armindev said in Bug in Qt 5.12 drag n'drop ?:

                                      Seems to be a special constelation

                                      Is it possible to simplify your program until the bug is gone away?

                                      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                                      Visit the Qt Academy at https://academy.qt.io/catalog

                                      A 1 Reply Last reply 21 Dec 2018, 19:16
                                      1
                                      • C Christian Ehrlicher
                                        21 Dec 2018, 18:57

                                        @armindev said in Bug in Qt 5.12 drag n'drop ?:

                                        Seems to be a special constelation

                                        Is it possible to simplify your program until the bug is gone away?

                                        A Offline
                                        A Offline
                                        armindev
                                        wrote on 21 Dec 2018, 19:16 last edited by
                                        #43

                                        @Christian-Ehrlicher

                                        I will try this but this will take a while ..

                                        1 Reply Last reply
                                        0
                                        • C Offline
                                          C Offline
                                          Christian Ehrlicher
                                          Lifetime Qt Champion
                                          wrote on 21 Dec 2018, 19:26 last edited by
                                          #44

                                          @armindev said in Bug in Qt 5.12 drag n'drop ?:

                                          I will try this but this will take a while ..

                                          Thx and take your time. There seems to be something wrong in a corner case and it would be really good to find it out :)

                                          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                                          Visit the Qt Academy at https://academy.qt.io/catalog

                                          1 Reply Last reply
                                          0

                                          34/57

                                          17 Dec 2018, 17:02

                                          • Login

                                          • Login or register to search.
                                          34 out of 57
                                          • First post
                                            34/57
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved