Qt 4.8.5 Mac Handle file dropping on dock icon

I'm porting some Qt apps to Mac OS. And have some questions because I have no experience in developing apps for Mac OS.

    <li>Where Applications usually save there settings in Mac OS?</li> <li>How to handle file dropping on icon in dock?</li> </ul>


    Mac OS X applications typically save their settings in ~/Library/Preferences/ using an XML document called a Property List. If you use the QCoreApplication::setOrganization(..) et all methods, just use QSettings and your code will remain cross platform and do the right thing.

    Handling file dropping on the application icon is a little more involved but there is already a pretty good answer and also a Qt Quarterly dealing with this problem. It will basically involve:

    <ol> <li>Setting up the Info.plist in the application bundle to identify what files types are handled by your application.</li> <li>Subclassing QApplication to handle QEvent::FileOpen.</li> </ol>

    人吐槽 人点赞



用户名: 密码:
验证码: 匿名发表


查看评论:Qt 4.8.5 Mac Handle file dropping on dock icon