Add scene graph dirty state tracking
This was previously done explicitly in the widget example, but that doesn't work nicely with the declarative approach in the QtQuick integration.