Results 1 to 2 of 2

Thread: Why QAbstractItemView::dragEnterEvent is always accepted?

  1. #1
    Join Date
    May 2017
    Qt products
    Unix/X11 Windows

    Default Why QAbstractItemView::dragEnterEvent is always accepted?

    Why QAbstractItemView::dragEnterEvent doesn't​ check model's canDropMimeData method? This results in incorrect 1-pixel area along widget boundary which is always "positive-drop" without taking into account if model can actually accept data. Is there any workaround?

  2. #2
    Join Date
    Jan 2006
    Munich, Germany
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Unix/X11 Windows

    Default Re: Why QAbstractItemView::dragEnterEvent is always accepted?

    The docs say:
    This function is called with the given event when a drag and drop operation enters the widget. If the drag is over a valid dropping place (e.g. over an item that accepts drops), the event is accepted; otherwise it is ignored.
    So, it seems to me its not checking the model's canDropMimeData() since it is going even lower, it asks the item over which the event happens.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Replies: 0
    Last Post: 2nd March 2015, 11:39
  2. Qt::Accepted in Qt 5.0
    By Higgs in forum Newbie
    Replies: 2
    Last Post: 14th February 2014, 16:41
  3. How to be notified on dragEnterEvent?
    By tuxit in forum Qt Quick
    Replies: 6
    Last Post: 12th August 2011, 12:29
  4. Not getting dragEnterEvent - sometimes
    By derekn in forum Qt Programming
    Replies: 0
    Last Post: 30th October 2009, 06:41

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.