Details
-
Bug
-
Resolution: Done
-
P2: Important
-
6.3.0
-
None
-
Qt 6.3, armeabi-v7a, Pixel 3a
-
-
140ca89a3c (qt/qtbase/dev) 140ca89a3c (qt/tqtc-qtbase/dev) c140edb442 (qt/qtbase/6.3) c140edb442 (qt/tqtc-qtbase/6.3) e9eae9e0e3 (qt/tqtc-qtbase/6.2) 16414f6d35 (qt/qtbase/6.4) 16414f6d35 (qt/tqtc-qtbase/6.4)
-
2022wk20FOAndroid&Automotive, 2022wk22FOQtforAndroid
Description
I'm trying to write data per QSettings on Android using an URL from a file dialog. The file is created but no content written. Seems the content:// conversion is not working properly, I see multiple files being created in the file dialog of my program after pressing Save (attachment) but only one in the file explorer app.
Not sure if this warning helps:
W ParcelFileDescriptor: Peer expected signal when closed; unable to deliver after detach
Some simplified code:
import QtQuick import QtQuick.Controls import QtQuick.Dialogs import Qt.labs.platform import Qt.labs.settings Window { width: 640 height: 480 visible: true title: qsTr("Hello World") FileDialog { id: fileDialog folder: StandardPaths.writableLocation(StandardPaths.DocumentsLocation) onAccepted: { mySettings.fileName = file mySettings.setValue("test",true) } } Settings { id: mySettings } Button { id: btnClose text: "Click me" onClicked: { fileDialog.acceptLabel = qsTr("Save") fileDialog.fileMode = FileDialog.SaveFile fileDialog.title = qsTr("Save configuration") fileDialog.open() } } }
The actual code runs on Qt withÂ
QSettings settings(fileName, QSettings::IniFormat); qDebug() << settings.fileName() << settings.status(); //returns some content:// url and NoError settings.beginGroup("config"); for (auto i = configData.begin(); i!=configData.end(); i++) settings.setValue(i.key(), i.value()); settings.endGroup(); qDebug() << settings.status(); //still NoError
Attachments
Issue Links
- resulted in
-
QTBUG-113519 Settings path changed when upgrading Qt version on Android
- Closed
-
QTBUG-109405 [Regression] 6.3.1 -> 6.4.1 Android - QSettings lost
- Closed