Qt IVI Generator Addressbook Example
import QtQuick 2.0
import example.ivi.addressbook.simulation 1.0
QtObject {
property var settings : IviSimulator.findData(IviSimulator.simulationData, "AddressBook")
property bool defaultInitialized: false
property var backend : AddressBookBackend {
function initialize() {
print("AddressBookSimulation INITIALIZE")
if (!defaultInitialized) {
IviSimulator.initializeDefault(settings, backend)
defaultInitialized = true
}
Base.initialize()
}
function setContacts(contacts) {
if (IviSimulator.checkSettings(settings["contacts"], contacts)) {
console.log("SIMULATION contacts changed to: " + contacts);
backend.contacts = contacts
} else {
console.log("SIMULATION changing contacts is not possible: provided: " + contacts + " constraint: " + IviSimulator.constraint(settings["contacts"]));
}
}
}
}