开发者

Opening files from Finder with a Qt-based application?

开发者 https://www.devze.com 2023-01-11 03:41 出处:网络
Apparently, for Cocoa applications, you\'re supposed to impleme开发者_开发知识库nt [[NSApp delegate] application:openFile:] or something like that to allow your application to open files double clicke

Apparently, for Cocoa applications, you're supposed to impleme开发者_开发知识库nt [[NSApp delegate] application:openFile:] or something like that to allow your application to open files double clicked in Finder.

How do you achieve this functionality using Qt, as the name of the file to be opened is not passed on the command line?


QFileOpenEvent (Qt4/Qt5) should do the trick.

Also see https://doc.qt.io/archives/qq/qq18-macfeatures.html

0

精彩评论

暂无评论...
验证码 换一张
取 消