简体   繁体   English

如何在Qt中获取文件系统操作的上下文菜单?

[英]How to get a context menu for file system actions in Qt?

Is there any way to get a system context menu for files? 有没有办法获取文件的系统上下文菜单?

I need to have all the commands from system menu, not only simple operations like copy/paste/rename, but also some non-standard, like Dropbox actions. 我需要从系统菜单中获取所有命令,不仅包括复制/粘贴/重命名等简单操作,还包括一些非标准操作,如Dropbox操作。

I am using Qt 5.x on Windows, but a solution for Mac OS would be useful, too. 我在Windows上使用Qt 5.x,但Mac OS的解决方案也很有用。 If the answer requires a library independent of Qt, that is ok too. 如果答案需要独立于Qt的库,那也没问题。

Qt does not provide such feature. Qt没有提供这样的功能。 But you could use native API for each platform. 但您可以为每个平台使用本机API。 See 看到

How do you show the Windows Explorer context menu from a C# application? 如何从C#应用程序中显示Windows资源管理器上下文菜单?

for getting Windows explorer menu. 获取Windows资源管理器菜单。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM