import Nemo.Configuration 1.0 Item { Rectangle { id: rect anchors.fill: parent color: '#000000' MouseArea { anchors.fill: parent onClicked: rect.color = Qt.hsla(Math.random(), 0.5, 0.5, 1.0); } } ConfigurationGroup { id: settings path: "/apps/harbour-yourApp" } Component.onCompleted: { rect.color = settings.value("rectColor", "#000000") } Component.onDestruction: { settings.setValue("rectColor", rect.color) } }