Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Mac OS 10.9 QSettings
Qt 6.11 is out! See what's new in the release blog

Mac OS 10.9 QSettings

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 800 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    stima_ua
    wrote on last edited by
    #1

    Hi,

    I'm trying to work with .plist file via QSettings.

    I've Users/user/Library/Preferences/com.name.name.plist with following:
    @
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>key2</key>
    <dict>
    <key>key1_1</key>
    <string>value1_1</string>
    </dict>
    <key>key2</key>
    <dict>
    <key>key2_1</key>
    <string>value2_1</string>
    </dict>
    </dict>
    </plist>
    @

    According to http://qt-project.org/doc/qt-5.0/qtcore/qsettings.html#QSettings and Platform-Specific Notes this
    @
    QSettings qs("name", "name");
    @

    should access to ~/Library/Preferences/com.name.name.plist via QSettings::NativeFormat as xml.
    But it work strange:
    @
    qDebug() << qs.filePath(); /// return Users/user/Library/Preferences/com.name.name.plist -- its ok
    qDebug() << qs.allKeys(); /// retun () -- its not ok!!
    @

    If I access to settings by direct path
    @
    QSettings qs("/Users/User/Library/Preferences/com.name.name.plist", QSettings::NativeFormat);
    @

    its return correct file path too (Users/user/Library/Preferences/com.name.name.plist) and its return correct keys
    key1 and key2.

    But!!! When I want work with childs i have nothing:
    @
    QSettings qs("/Users/User/Library/Preferences/com.name.name.plist", QSettings::NativeFormat);
    qDebug() << qs.allChilds(); // return key1 and key2 only -- its not ok
    qs.beginGroup("key1");
    qDebug() << qs.allChilds(); // return empty () -- its not ok
    qs.endGroup();
    @

    Can some body help me with this?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved