Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
显然,对于 Cocoa 应用程序,您应该实现[[NSApp delegate] application:openFile:]或类似的东西来允许您的应用程序打开在 Finder 中双击的文件。
[[NSApp delegate] application:openFile:]
您如何使用 Qt 实现此功能,因为要打开的文件的名称未在命令行上传递?
QFileOpenEvent ( Qt4 / Qt5 ) 应该可以解决问题。
另见https://doc.qt.io/archives/qq/qq18-macfeatures.html