/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Components project on Qt Labs. ** ** No Commercial Usage ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions contained ** in the Technology Preview License Agreement accompanying this package. ** ** GNU Lesser General Public License Usage ** Alternatively, 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. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** ****************************************************************************/ import Qt 4.7 import com.nokia.meego 1.0 Window { id: window state:"Landscape" StatusBar { id: statusBar anchors.top: parent.top anchors.bottom:myToolbar.top orientation: screen.orientation width: parent.width } ToolBar { id: myToolbar anchors.top: statusBar.bottom // anchors.bottom: pageStack.top } PageStack { id: pageStack clip: true anchors.top: toolBar.bottom anchors.bottom: parent.bottom width: parent.width toolBar: myToolbar } ToolBarLayout { id: commonTools visible: false ToolItem { iconId: "icon-m-toolbar-home"; onClicked: pageStack.pop(); } ToolItem { iconId: "icon-m-toolbar-view-menu"; onClicked: myMenu.open(); } ToolItem { iconId: "icon-m-toolbar-back"; onClicked: pageStack.pop(); } } Component { id: mainpageComponent Page { id:mainPage tools: ToolBarLayout { ToolItem { iconId: "icon-m-toolbar-home"; onClicked: pageStack.pop(); } ToolItem { iconId: "icon-m-toolbar-view-menu"; onClicked: myMenu.open();} ToolItem { iconId: "icon-m-toolbar-close"; onClicked: Qt.quit(); } } Rectangle { anchors.fill: parent color: "white" } Flickable { // id: mainScrolArea anchors.fill: parent contentHeight: mainContent.height contentWidth: parent.width Column { id:mainContent anchors.centerIn: parent spacing: 10 Button { height: 50 width: 600 text: "Show a cat" onClicked:(pageStack.push(catComponent)) } Button { height: 50 width: 600 text: "Show a dialog" onClicked:(pageStack.push(dialogComponent)) } Row { AltGauge { width:200 height:200 id:alt1 value: testSlider.value*500 } AttitudeGauge { width:200 height:200 id:ati2 roll: testSlider.value*500 pitch:testSlider2.value } } Row { Slider { id:testSlider } Slider { id:testSlider2 minimumValue: -90 maximumValue: 90 } } } } } } Component { id: catComponent Page { id:catPage tools:commonTools Image { anchors.centerIn: parent source: "aureo600.jpg" } } } Component { id: dialogComponent Page { id:dialog tools:commonTools Flickable { // clip: true id: dialogscrolarea anchors.fill: parent flickableDirection:Flickable.VerticalFlick anchors.leftMargin:50;anchors.rightMargin:50 contentHeight: dialogcontent.height contentWidth: parent.width Column { id: dialogcontent width: parent.width //anchors.left:parent.left;anchors.right:parent.right anchors.leftMargin:150;anchors.rightMargin:150 spacing: 10 Button { text: "Button 1" width: parent.width } /* LineEdit { id: line1 width:parent.width anchors.left: parent.left; anchors.right: parent.Right promptText: "Enter text here" } */ Button { text: "ToggleButton" width:parent.width checkable:true } CheckBox { id: cbox } Switch { id: switch1 } Button { text: "Button 3" width:parent.width } Button { text: "Button 4" width:parent.width } Button { text: "Button 5" width:parent.width } } } } } Component.onCompleted: { if (mainpageComponent.status == Component.Ready) pageStack.push(mainpageComponent); else console.log("Error loading component:", mainpageComponent.errorString()); } }