[Qt-interest] what is that difference between event->accept() and event->acceptProposedAction()

ami guru dosto.walla at gmail.com
Fri Jan 2 13:06:38 CET 2009


Hello forum,

According to the manual there is

"

Once you have supplied a replacement drop action, call accept() instead of
acceptProposedAction <qdropevent.html#acceptProposedAction>().

"

in the following example the drop action has been  over-ridden.


******************************************

    if (event->mimeData()->hasFormat("application/x-fridgemagnet"))
      {
        if (children().contains(event->source()))
      {
            event->setDropAction(Qt::MoveAction);
        /*
          specifies that
          the future move will
          be acceptable
         */
            event->accept();
      }
    else
      {
            /*
              is that ok if event->accept() is used instead?
            */
            event->acceptProposedAction();
      }
      }
    else if (event->mimeData()->hasText())
      {
        event->acceptProposedAction();
      }
    else
      {
        event->ignore();
      }


*****************************************



Regards
Sajjad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090102/143cd0cb/attachment.html 


More information about the Qt-interest-old mailing list