为什么我不能将文件拖放到Qt示例中

Why cant I drop a file into the Qt Sample drop example?

本文关键字:Qt 拖放 不能 文件 为什么      更新时间:2023-10-16

我正试图将文件拖放到应用程序中以工作,因此我编译了该示例,但每次尝试拖放文件时,我都会得到"不允许拖放"符号。我也在自己的示例中尝试过这一点,在调试模式中,我发现甚至没有实现任何函数(dragEnterEvent、dragMoveEvent、dropEvent)。这里有什么问题/我该怎么解决?

此外,在Win7 x64 上运行Qt 4.8

我发现了问题:您无法从未升级的应用程序(explorer.exe)拖放到升级的应用。

感谢@HansPassant的解决方法:添加一个清单文件:

<?xml version="1.0"encoding="UTF-8"standalone="yes"?><assembly xmlns="urn:schemas-microsoft-com:asm.v1"manifestVersion="1.0"><trustInfo xmlns="urn:schemas-microsoft.com:asm.v3"><安全><requestedPrivileges><requestedExecutionLevel level="asInvoker"uiAccess="true"/><requestedPrivileges><安全><trustInfo><组装>

此清单要求"uiAccess"为true,并要求exe受信任和签名。

注:中提出的解决方案http://helgeklein.com/blog/2010/03/how-to-enable-drag-and-drop-for-an-elevated-mfc-application-on-vistawindows-7/使用CCD_ 1不起作用。