refs #478 refs #488, utils / free functions

* seed for random numbers per thread
* added function to get all user metatypes as string
* added new read file function per path/name
* removed DBus operators for pixmap
* JSON operators for byte array
* util function for JSON string
This commit is contained in:
Klaus Basan
2015-10-14 01:48:52 +02:00
committed by Mathew Sutcliffe
parent 19df8a5d71
commit a725ce2181
14 changed files with 120 additions and 64 deletions

View File

@@ -131,6 +131,13 @@ namespace BlackMisc
return json;
}
//! Convenience function JSON as string
QString toJsonString(QJsonDocument::JsonFormat format = QJsonDocument::Indented) const
{
QJsonDocument jsonDoc(toJson());
return jsonDoc.toJson(format);
}
//! \copydoc CValueObject::convertFromJson
void convertFromJson(const QJsonObject &json)
{
@@ -144,6 +151,12 @@ namespace BlackMisc
}
}
//! Assign from JSON object string
void convertFromJson(const QString &jsonString)
{
convertFromJson(BlackMisc::Json::jsonObjectFromString(jsonString));
}
//! \copydoc BlackMisc::CValueObject::convertToQString
QString convertToQString(bool i18n = false) const
{