<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">But doesn’t QStandardPath resolve to different locations depending if legacyExternalStorage is enabled or not?<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 3 Sep 2021, at 13:51, Jérôme Godbout <<a href="mailto:jgodbout@dimonoff.com" class="">jgodbout@dimonoff.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Take care with the eternal storage opt out will no more be possible after November. We will need to target SDK 12 to publish to the store. So the 11 opt out flag will no more be possible (November for existing application, for new application it’s already started since august).<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Try to push an update asap so your user can migrate the data to the application proper folder. Other application cannot access the files anymore. If your file are already into the application data folder you do not have to worry much you still can access them easily.<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">But the QStandard path have work fine for us so far.  You can check the actual path it resolve to on this page (scroll a bit down to see the path for Android):<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><a href="https://doc.qt.io/qt-5/qstandardpaths.html#StandardLocation-enum" style="color: blue; text-decoration: underline;" class="">https://doc.qt.io/qt-5/qstandardpaths.html#StandardLocation-enum</a><o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(181, 196, 223); padding: 3pt 0cm 0cm;" class=""><p class="MsoNormal" style="margin: 0cm 0cm 12pt; font-size: 11pt; font-family: Calibri, sans-serif;"><b class=""><span style="font-size: 12pt;" class="">From:<span class="Apple-converted-space"> </span></span></b><span style="font-size: 12pt;" class="">Interest <<a href="mailto:interest-bounces@qt-project.org" class="">interest-bounces@qt-project.org</a>> on behalf of ekke <<a href="mailto:ekke@ekkes-corner.org" class="">ekke@ekkes-corner.org</a>><br class=""><b class="">Date:<span class="Apple-converted-space"> </span></b>Friday, September 3, 2021 at 5:47 AM<br class=""><b class="">To:<span class="Apple-converted-space"> </span></b>Nuno Santos <<a href="mailto:nuno.santos@imaginando.pt" class="">nuno.santos@imaginando.pt</a>><br class=""><b class="">Cc:<span class="Apple-converted-space"> </span></b>Qt Interest <<a href="mailto:interest@qt-project.org" class="">interest@qt-project.org</a>><br class=""><b class="">Subject:<span class="Apple-converted-space"> </span></b>Re: [Interest] Save / load file contents on android<o:p class=""></o:p></span></p></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Hi Nuno,<o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Am 03.09.21 um 11:05 schrieb Nuno Santos:<o:p class=""></o:p></div></div><blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Ekke,<span class="Apple-converted-space"> </span><o:p class=""></o:p></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">I have been experiencing some inconsistencies with Android file access using QStandardPaths, mostly now that I’m preparing the ground for Android 11 support. From Android 11 onwards, there will be changes in the way an app can access filesystem resources.<o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">This problem started when one of apps was in some systems using legacy file access while in others was already using the new storage approach. In order to temporary fixes this issues I have set the requestLegacyExternalStorage to true, however, soon this will end as in Android 11 it will be ignored.<span class="Apple-converted-space"> </span><o:p class=""></o:p></div></div></blockquote><p class="">I'm in the same situation as you ;-) have set requestLegacyExternalStorage ATM<o:p class=""></o:p></p><p class="">last weeks had much work moving all my projects from Qt 5.13.2 to 5.15.5, so I can prepare for Qt 6.2<o:p class=""></o:p></p><p class="">now there will be 3 weeks vacation<o:p class=""></o:p></p><p class="">then support of Android 11 file storage will be high on my TODO list<o:p class=""></o:p></p><p class="">... and hoping then to find some docs / tips HowTo support this from Qt ;-)<o:p class=""></o:p></p><p class="">ekke<o:p class=""></o:p></p><blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class=""><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">One of the current challenges I’m facing the moving/copying resources from legacy storage to new storage when using QStandardPaths and QFileDialog.<o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">How have you been handling Android 11 support and data migration from older versions?<o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Are you able to do it just with Qt stuff or do you need to handle some of the things with native android API’s?<o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Thanks!<o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Nuno<o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div class=""><blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class=""><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">On 31 Aug 2021, at 13:38, ekke <<a href="mailto:ekke@ekkes-corner.org" style="color: blue; text-decoration: underline;" class="">ekke@ekkes-corner.org</a>> wrote:<o:p class=""></o:p></div></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div class=""><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 9pt; font-family: Helvetica;" class="">Am 31.08.21 um 14:12 schrieb Wilhelm Meier via Interest:<o:p class=""></o:p></span></div></div><blockquote style="margin-top: 5pt; margin-bottom: 5pt; font-variant-caps: normal; text-align: start; -webkit-text-stroke-width: 0px; word-spacing: 0px;" class=""><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class="">Hi all,<o:p class=""></o:p></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><o:p class=""> </o:p></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class="">does anybody have a minimum working example how to load / save json file<o:p class=""></o:p></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class="">contents (auscii contents) to / from a file on android.<o:p class=""></o:p></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><o:p class=""> </o:p></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class="">I made several attempts, but I get weird filenames and I'm not able to<o:p class=""></o:p></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class="">load the stored file.<o:p class=""></o:p></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><o:p class=""> </o:p></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class="">thx<o:p class=""></o:p></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class="">_______________________________________________<o:p class=""></o:p></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class="">Interest mailing list<o:p class=""></o:p></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><a href="mailto:Interest@qt-project.org" style="color: blue; text-decoration: underline;" class="">Interest@qt-project.org</a><o:p class=""></o:p></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><a href="https://lists.qt-project.org/listinfo/interest" style="color: blue; text-decoration: underline;" class="">https://lists.qt-project.org/listinfo/interest</a><o:p class=""></o:p></pre></blockquote><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New"; caret-color: rgb(0, 0, 0); font-variant-caps: normal; text-align: start; -webkit-text-stroke-width: 0px; word-spacing: 0px;" class=""><span style="font-size: 9pt; color: purple;" class="">Hi,<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt; color: purple;" class="">some snippets HowTo save a JSON. use QVariantMap for a JSON Object or QVariantList for JSON Array<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt; color: purple;" class=""><o:p class=""> </o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt; color: purple;" class="">    QJsonDocument</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt; color: rgb(9, 46, 100);" class="">jda</span><span style="font-size: 9pt;" class=""> <span style="color: rgb(0, 103, 124);" class="">=</span><span style="color: silver;" class=""> </span><span style="color: purple;" class="">QJsonDocument</span>::<span style="color: rgb(0, 103, 124);" class="">fromVariant</span>(myQVariantMap);<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New"; caret-color: rgb(0, 0, 0); font-variant-caps: normal; text-align: start; -webkit-text-stroke-width: 0px; word-spacing: 0px;" class=""><span style="font-size: 9pt; color: silver;" class="">    </span><span style="font-size: 9pt; color: purple;" class="">QByteArray</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt; color: rgb(9, 46, 100);" class="">buffer</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt;" class="">=<span style="color: silver;" class=""> </span><span style="color: rgb(9, 46, 100);" class="">jda</span>.<span style="color: rgb(0, 103, 124);" class="">toJson</span>();<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New"; caret-color: rgb(0, 0, 0); font-variant-caps: normal; text-align: start; -webkit-text-stroke-width: 0px; word-spacing: 0px;" class=""><span style="font-size: 9pt; color: silver;" class="">    </span><span style="font-size: 9pt; color: rgb(0, 103, 124);" class="">saveTestFile</span><span style="font-size: 9pt;" class="">(<span style="color: green;" class="">"_my_test.json"</span>,<span style="color: silver;" class=""> </span><span style="color: rgb(9, 46, 100);" class="">buffer</span>);<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt;" class="">...<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt;" class=""><o:p class=""> </o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt; color: olive;" class="">void</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt; color: purple;" class="">DataServer</span><span style="font-size: 9pt;" class="">::<b class=""><span style="color: rgb(0, 103, 124);" class="">saveTestFile</span></b>(<span style="color: olive;" class="">const</span><span style="color: silver;" class=""> </span><span style="color: purple;" class="">QString</span>&<span style="color: silver;" class=""> </span><span style="color: rgb(9, 46, 100);" class="">fileName</span>,<span style="color: silver;" class=""> </span><span style="color: olive;" class="">const</span><span style="color: silver;" class=""> </span><span style="color: purple;" class="">QByteArray</span>&<span style="color: silver;" class=""> </span><span style="color: rgb(9, 46, 100);" class="">buffer</span>)<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt;" class="">{<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt; color: silver;" class="">    </span><span style="font-size: 9pt; color: purple;" class="">QString</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt; color: rgb(9, 46, 100);" class="">filePath</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt;" class="">=<span style="color: silver;" class=""> </span><span style="color: maroon;" class="">mDataManager</span>-><span style="color: rgb(0, 103, 124);" class="">dataPath</span>(<span style="color: rgb(9, 46, 100);" class="">fileName</span>);<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt; color: silver;" class="">    </span><span style="font-size: 9pt; color: purple;" class="">QFile</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt; color: rgb(9, 46, 100);" class="">saveFile</span><span style="font-size: 9pt;" class="">(<span style="color: rgb(9, 46, 100);" class="">filePath</span>);<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt; color: silver;" class="">    </span><span style="font-size: 9pt; color: olive;" class="">if</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt;" class="">(!<span style="color: rgb(9, 46, 100);" class="">saveFile</span>.<i class=""><span style="color: rgb(0, 103, 124);" class="">open</span></i>(<span style="color: purple;" class="">QIODevice</span>::<span style="color: purple;" class="">WriteOnly</span>))<span style="color: silver;" class=""> </span>{<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt; color: silver;" class="">        </span><span style="font-size: 9pt; color: navy;" class="">qWarning</span><span style="font-size: 9pt;" class="">()<span style="color: silver;" class=""> </span><span style="color: rgb(0, 103, 124);" class=""><<</span><span style="color: silver;" class=""> </span><span style="color: green;" class="">"Couldn't open file to write "</span><span style="color: silver;" class=""> </span><span style="color: rgb(0, 103, 124);" class=""><<</span><span style="color: silver;" class=""> </span><span style="color: rgb(9, 46, 100);" class="">filePath</span>;<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt; color: silver;" class="">        </span><span style="font-size: 9pt; color: olive;" class="">return</span><span style="font-size: 9pt;" class="">;<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt; color: silver;" class="">    </span><span style="font-size: 9pt;" class="">}<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt; color: silver;" class="">    </span><span style="font-size: 9pt; color: purple;" class="">qint64</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt; color: rgb(9, 46, 100);" class="">bytesWritten</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt;" class="">=<span style="color: silver;" class=""> </span><span style="color: rgb(9, 46, 100);" class="">saveFile</span>.<span style="color: rgb(0, 103, 124);" class="">write</span>(<span style="color: rgb(9, 46, 100);" class="">buffer</span>);<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt; color: silver;" class="">    </span><span style="font-size: 9pt; color: rgb(9, 46, 100);" class="">saveFile</span><span style="font-size: 9pt;" class="">.<i class=""><span style="color: rgb(0, 103, 124);" class="">close</span></i>();<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt; color: silver;" class="">    </span><span style="font-size: 9pt; color: navy;" class="">qDebug</span><span style="font-size: 9pt;" class="">()<span style="color: silver;" class=""> </span><span style="color: rgb(0, 103, 124);" class=""><<</span><span style="color: silver;" class=""> </span><span style="color: green;" class="">"Bytes written: "</span><span style="color: silver;" class=""> </span><span style="color: rgb(0, 103, 124);" class=""><<</span><span style="color: silver;" class=""> </span><span style="color: rgb(9, 46, 100);" class="">bytesWritten</span><span style="color: silver;" class=""> </span><span style="color: rgb(0, 103, 124);" class=""><<</span><span style="color: silver;" class=""> </span><span style="color: green;" class="">" to: "</span><span style="color: silver;" class=""> </span><span style="color: rgb(0, 103, 124);" class=""><<</span><span style="color: silver;" class=""> </span><span style="color: rgb(9, 46, 100);" class="">filePath</span>;<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt;" class="">}<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt;" class="">....<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt;" class=""><o:p class=""> </o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt; color: silver;" class="">    </span><span style="font-size: 9pt; color: green;" class="">//</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt; color: green;" class="">Android:</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt; color: green;" class="">AppDataLocation</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt; color: green;" class="">works</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt; color: green;" class="">out</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt; color: green;" class="">of</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt; color: green;" class="">the</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt; color: green;" class="">box,</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt; color: green;" class="">iOS</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt; color: green;" class="">you</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt; color: green;" class="">must</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt; color: green;" class="">create</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt; color: green;" class="">the</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt; color: green;" class="">DIR</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt; color: green;" class="">first</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt; color: green;" class="">!!</span><span style="font-size: 9pt;" class=""><o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt; color: silver;" class="">    </span><span style="font-size: 9pt; color: maroon;" class="">mDataRoot</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt; color: rgb(0, 103, 124);" class="">=</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt; color: purple;" class="">QStandardPaths</span><span style="font-size: 9pt;" class="">::<span style="color: rgb(0, 103, 124);" class="">standardLocations</span>(<span style="color: purple;" class="">QStandardPaths</span>::<span style="color: purple;" class="">AppDataLocation</span>).<span style="color: rgb(0, 103, 124);" class="">value</span>(<span style="color: navy;" class="">0</span>);<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt; color: silver;" class="">    </span><span style="font-size: 9pt; color: maroon;" class="">mDataPath</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt; color: rgb(0, 103, 124);" class="">=</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt; color: maroon;" class="">mDataRoot</span><span style="font-size: 9pt; color: rgb(0, 103, 124);" class="">+</span><span style="font-size: 9pt; color: green;" class="">"/data/"</span><span style="font-size: 9pt;" class="">;<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt;" class="">----<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt;" class="">and reading is similar<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt;" class=""><o:p class=""> </o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt; color: rgb(9, 46, 100);" class="">    jda</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt; color: rgb(0, 103, 124);" class="">=</span><span style="font-size: 9pt; color: silver;" class=""> </span><span style="font-size: 9pt; color: purple;" class="">QJsonDocument</span><span style="font-size: 9pt;" class="">::<span style="color: rgb(0, 103, 124);" class="">fromJson</span>(<span style="color: rgb(9, 46, 100);" class="">dataFile</span>.<span style="color: rgb(0, 103, 124);" class="">readAll</span>());<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt; color: silver;" class="">    </span><span style="font-size: 9pt; color: rgb(9, 46, 100);" class="">dataFile</span><span style="font-size: 9pt;" class="">.<i class=""><span style="color: rgb(0, 103, 124);" class="">close</span></i>();<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt; color: silver;" class="">    </span><span style="font-size: 9pt; color: olive;" class="">if</span><span style="font-size: 9pt;" class="">(!<span style="color: rgb(9, 46, 100);" class="">jda</span>.<span style="color: rgb(0, 103, 124);" class="">isArray</span>())<span style="color: silver;" class=""> </span>{<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt; color: silver;" class="">        </span><span style="font-size: 9pt;" class="">myMap = <span style="color: rgb(9, 46, 100);" class="">jda</span>.<span style="color: rgb(0, 103, 124);" class="">toVariant</span>().<span style="color: rgb(0, 103, 124);" class="">toMap</span>();<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt; color: silver;" class="">    </span><span style="font-size: 9pt;" class="">} else {<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt;" class="">    my<span style="color: rgb(9, 46, 100);" class="">List</span><span style="color: silver;" class=""> </span><span style="color: rgb(0, 103, 124);" class="">=</span><span style="color: silver;" class=""> </span><span style="color: rgb(9, 46, 100);" class="">jda</span>.<span style="color: rgb(0, 103, 124);" class="">toVariant</span>().<span style="color: rgb(0, 103, 124);" class="">toList</span>();<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt;" class="">    }<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt;" class="">-----<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 9pt;" class="">hope it helps<o:p class=""></o:p></span></pre><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 9pt; font-family: Helvetica;" class="">_______________________________________________<br class="">Interest mailing list<br class=""></span><a href="mailto:Interest@qt-project.org" style="color: blue; text-decoration: underline;" class=""><span style="font-size: 9pt; font-family: Helvetica;" class="">Interest@qt-project.org</span></a><span style="font-size: 9pt; font-family: Helvetica;" class=""><br class=""></span><a href="https://lists.qt-project.org/listinfo/interest" style="color: blue; text-decoration: underline;" class=""><span style="font-size: 9pt; font-family: Helvetica;" class="">https://lists.qt-project.org/listinfo/interest</span></a></div></div></blockquote></div></div></blockquote></div></div></blockquote></div><br class=""></body></html>