Read and write plist (Mac OS X property list) files in Qt
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore Added a usage example. Updated README with alternative build instruct… Feb 2, 2015
plistserializer.cpp Const correctness Feb 2, 2015
qtplist.pri Changed name to qtplist. Feb 2, 2015

Qt Pods


This is a PList (Mac OS X property list) parser for Qt. See for more information about the format.

How to install

qtplist is available via qt-pods. See here for reference:

Alternatively, you can just copy PListSerializer and/or PListParser into your source tree. They don't have any dependencies beyond Qt Core and Qt XML.

How it works

exampleusage.cpp has a simple example of using each class.

Basically, it takes a QIODevice (generally a file), and returns you a QVariant with all the values in the PList.

Suppose this is your plist file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">

This would get converted into a QVariantMap, with keys SomeKey and MyOtherKey, with respective values Value1 and Value2. If your PList has arrays or dictionaries inside, they are converted to QVariantLists and QVariantMaps.

It can also do the conversion the other way: if you have a QVariant, QVariantList, or QVariantMap, it can generate a PList file out of it, using PListSerializer.

That's it!