/**************************************************************************** ** ** Copyright (C) 2011 Nokia Institute of Technology. ** All rights reserved. ** Contact: Manager (renato.chencarek@openbossa.org) ** ** This file is part of the Incredible Circus project. ** ** GNU Lesser General Public License Usage ** ** This file may be used under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation and ** appearing in the file LICENSE.LGPL included in the packaging of this ** file. Please review the following information to ensure the GNU Lesser ** General Public License version 2.1 requirements will be met: ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ****************************************************************************/ import QtQuick 1.1 Item { id: root anchors.fill: parent signal presented() property alias source: loader.source MouseArea { anchors.fill: parent enabled: loader.visible } Loader { id: loader anchors.fill: parent opacity: 0.0 visible: false onStatusChanged: { if (loader.status == Loader.Ready) loader.state = "visible"; else loader.state = ""; } Connections { target: loader.item onFinished: { root.presented(); loader.state = ""; } } states: State { name: "visible" PropertyChanges { target: loader; opacity: 1.0; visible: true; } } transitions: Transition { from: "visible"; to: ""; SequentialAnimation { NumberAnimation { target: loader; duration: 400; properties: "opacity"; } PropertyAction { target: loader; properties: "visible"; } // unload after finished ScriptAction { script: loader.source = ""; } } } } }