Drag and Drop not working, if application lies in specific directory <p>I implemented a drag and drop functionality in an Qt application (In case you want to see some code, see below). I thought everything is working fine until a user told me that it is not working for him.</p> <p>Usually you see this <a href="https://i.stack.imgur.com/fOGMu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fOGMu.png" alt="Drag and drop ok"></a> icon, if <code>dragEnterEvent()</code> does not call <code>event-&gt;acceptProposedAction()</code>, then you see this <a href="https://i.stack.imgur.com/3OyId.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3OyId.png" alt="Filetype unsupported"></a> icon. And if the issue occurs you see an icon similar to this <a href="https://cdn3.iconfinder.com/data/icons/pix-glyph-set/50/520753-not_allowed-20.png" rel="nofollow noreferrer"><img src="https://cdn3.iconfinder.com/data/icons/pix-glyph-set/50/520753-not_allowed-20.png" alt="Does not work icon"></a> (It's not exactly that icon, but I am not able to capture it, as windows removes the mouse icon in screenshots).</p> <p>We could find out that on some computers (not for me sadly, so debugging that is quite hard) it depends on the setup. In particular the installation path: If the application lies in one specific directory (or one of its subdirectories) the described error occurs. If we move the whole application directory somewhere else and execute it from there, everything works fine.</p> <p>Adding some debug output showed that the dragEnterEvent() does not fire in the broken setup.</p> <p>What could be the reason? How can I debug that issue?</p> <hr> <p>We had some suspicions but nothing that realy makes sense. But I want to share them anyway:</p> <ul> <li>Permissions (But why should drag and drop rely on permissions, right?)</li> <li>Wrong libraries used (as there are multiple Qt versions installed)</li> <li>Another widget receives the event (How can that depend on the application directory?)</li> </ul> <hr> <p>Code snippet:</p> <pre><code>MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), /* more here */ { /* more here */ setAcceptDrops(true); /* more here */ } void MainWindow::dragEnterEvent(QDragEnterEvent* event) { const QMimeData* mimeData = event-&gt;mimeData(); if (mimeData-&gt;hasUrls()) { QString fileName = mimeData-&gt;urls().at(0).toLocalFile(); QFileInfo file(fileName); if(isSupportedFileType(file.completeSuffix())) { event-&gt;acceptProposedAction(); } } } void MainWindow::dropEvent(QDropEvent *event) { const QMimeData* mimeData = event-&gt;mimeData(); if (mimeData-&gt;hasUrls()) { QList&lt;QUrl&gt; urlList = mimeData-&gt;urls(); if(openFiles(urlList)) { event-&gt;acceptProposedAction(); } } } </code></pre>