0

Since I enabled sandbox on my Qt application, I have many log message in the console when navigating with the QFileDialog:

23/02/2016 12:25:51,000 kernel[0]: Sandbox: Joker(87965) deny file-read-xattr /Users/martin/Documents/a.txt
23/02/2016 12:25:51,000 kernel[0]: Sandbox: Joker(87965) deny file-read-xattr /Users/martin/Documents/b.txt
23/02/2016 12:25:52,000 kernel[0]: Sandbox: Joker(87965) deny file-read-xattr /Users/martin/Documents/c.txt

Is there a way to avoid this?

1 Answer 1

1

As discussed here,

The file save dialog requires a non-empty default filename to work correctly inside a sandbox. You can supply a default filename to the save dialog as follows:

QString fileSavePath = QFileDialog::getSaveFileName(this, "Save file", "default filename");

Or if you create the dialog instance yourself:

QFileDialog *fileSaveDialog = new QFileDialog(this);
fileSaveDialog->setAcceptMode(QFileDialog::AcceptSave);
fileSaveDialog->selectFile("default filename");

You should probably also use a custom info.plist and insert the key ForAppStore, with a value of yes

To build with a custom plist, create the file and reference it in the .pro like this: -

QMAKE_INFO_PLIST = Info.plist

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.