title: Drag and drop onto a QStandardItemModel in a QTreeView not working
body: <p>I have a QTreeView with a QStandardItemModel attached to it. I am trying to enabled drag and drop from external sources. I've done everything mentioned in the documentation for drag and drop and drag and drop with item views, but things aren't working right. When I try to drag a file onto the tree view, the icon always has an X on it saying that drop isn't available. (I use OS X, I don't know what the icon would look like it windows). I want to be able to drop on certain items, but until I get the basics down, I can't code that functionality. </p>
  
  <p>Here is my subclassed tree view source code:</p>
  
  <pre><code>MyTreeView::MyTreeView(QWidget *parent) :
      QTreeView(parent)
  {
      setContextMenuPolicy(Qt::CustomContextMenu);
      setAcceptDrops(true);
      setDropIndicatorShown(true);
  }
  
  void MyTreeView::dragEnterEvent(QDragEnterEvent *event)
  {
      event-&gt;acceptProposedAction();
  }
  
  void MyTreeView::dropEvent(QDropEvent *event)
  {
      qDebug("I am here");
      event-&gt;acceptProposedAction();
  }
  </code></pre>
  
  <p>and here is the source for the subclassed standard item model:</p>
  
  <pre><code>MyStandardItemModel::MyStandardItemModel(QObject *parent) :
      QStandardItemModel(parent)
  {
  }
  
  Qt::DropActions MyStandardItemModel::supportedDropActions() const
  {
      return Qt::CopyAction;
  }
  
  Qt::ItemFlags MyStandardItemModel::flags(const QModelIndex &amp;index) const
  {
      Qt::ItemFlags defaultFlags = QStandardItemModel::flags(index);
  
      if (index.isValid())
          return Qt::ItemIsDropEnabled | defaultFlags;
      else
          return defaultFlags;
  }
  
  bool MyStandardItemModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &amp;parent)
  {
      qDebug("I am in the model");
  }
  </code></pre>
  
  <p>As I said, the icon is telling me that drop is not available, but if I drop it anyhow, the text "I am here" from the tree view gets printed. But the text "I am in the model" from the model view never gets printed. I'm not sure what I need to do to get the model to recognize that drops are available and change the icon, or to get the dropMimeData function to call. Any help is appreciated, because I've read the documentation over and over and I'm clearly missing something.</p>