OpenMS/OpenMS — pull request #918 by TDI-tenderholt (2014-08-02 18:45:27+00:00)
Title: Support to wrap MetaData instances in QVariant

I'm working on a peak picking tool that makes calls to a public API of a cloud-based service. As this tool essentially has two steps (submit and fetch), I found the need to re-open large mzML files (to keep metadata) for the fetch step unsatisfactory. Therefore, I wanted a method to save all metadata temporarily in a platform- and file-agnostic method and opted to use the QSettings API which requires QVariants.

I'm creating this pull request now so I can receive feedback on these changes (e.g. whether these changes will be used, comment on coding style and git commits, etc.).

Use of the QVariant is as follows:

```
// obtain instance of Software and add to a QVariant
// this should work without any additional code
Software software = input[0].getDataProcessing()[0].getSoftware();
QVariant softwareVariant;
softwareVariant.setValue(software);

// I think these two functions are both required for the
// QVariant::save() and QVariant::load() methods. I know the second
// *is* required because the stream operators need to be registered.
qRegisterMetaType("Software");
qRegisterMetaTypeStreamOperators("Software");

// An example of the QVariant::save() method being called.
QSettings settings;
settings.setValue("Software", softwareVariant);
settings.sync();

// This should call the QVariant::load() method, and unpack it
// into a Software instance.
Software retrievedSoftware = settings.value("Software").value();
```