Hydrate QML Type

Import Statement: import .

Methods

Detailed Description

import QuickFlux 1.1

Hydrate provides an interface to rehydrate / hydrate a Store component. Rehydration and dehydration are just another words for deserialize and serialize. It could be used to convert Store into JSON object, and vice versa.

Remarks: Hydrate supports any QObject based type as the target of deserialize and serialize.

Hydrate.rehydrate(store, {
  value1: 1,
  value2: 2.0,
  value3: "",
  value4: {
    subValue1: 1
  }
});

var data = Hydrate.dehydrate(MainStore);
console.log(JSON.stringify(data));

It is added since Quick Flux 1.1

Method Documentation

dehydrate(object)

Serialize data from a object

var data = Hydrate.dehydrate(MainStore);
console.log(JSON.stringify(data));

rehydrate(target, source)

Deserialize data from source and write to target object.

Hydrate.rehydrate(store, {
  value1: 1,
  value2: 2.0,
  value3: "",
  value4: {
    subValue1: 1
  }