import org.hildon.components 1.0 Window { id: mainWindow windowTitle: "Gallery" contextMenuPolicy: Qt.ActionsContextMenu // Display the list of actions in a context menu when a long-press occurs tools: Action { text: "About" onTriggered: dialog.open() } actions: [ Action { text: "Action 1" onTriggered: console.log(text + " clicked") }, Action { text: "Action 2" onTriggered: console.log(text + " clicked") }, Action { text: "Action 3" onTriggered: console.log(text + " clicked") } ] Column { width: 460 anchors { top: parent.top topMargin: 20 horizontalCenter: parent.horizontalCenter } spacing: 20 Label { width: parent.width alignment: Qt.AlignCenter font.bold: true font.pixelSize: 32 color: platformStyle.activeTextColor wordWrap: true text: qsTr("Welcome to Qt Components Hildon Gallery.") } Button { width: parent.width text: qsTr("Next window") onClicked: windowStack.push(Qt.resolvedUrl("SecondWindow.qml"), { windowTitle: "Stacked window" }) } Button { width: parent.width text: qsTr("Toggle orientation") onClicked: screen.orientationLock = screen.orientationLock === Screen.PortraitOrientation ? Screen.LandscapeOrientation : Screen.PortraitOrientation } CheckBox { width: parent.width text: qsTr("Fullscreen") onClicked: mainWindow.fullScreen = !mainWindow.fullScreen } } Dialog { id: dialog windowTitle: qsTr("About") content: Label { anchors.fill: parent wordWrap: true text: qsTr("Qt Components Hildon Gallery is a demo of Qt Components Hildon.") } buttons: Button { text: qsTr("Done") onClicked: dialog.accept() } } }
import org.hildon.components 1.0 Window { id: root tools: [ ActionGroup { exclusive: true Action { checkable: true checked: true text: qsTr("One") onTriggered: stack.currentIndex = 0 } Action { checkable: true text: qsTr("Two") onTriggered: stack.currentIndex = 1 } Action { checkable: true text: qsTr("Three") onTriggered: stack.currentIndex = 2 } }, Action { text: qsTr("Pop window") onTriggered: windowStack.pop() }, Action { text: qsTr("Toggle orientation") onTriggered: screen.orientationLock = screen.orientationLock === Screen.PortraitOrientation ? Screen.LandscapeOrientation : Screen.PortraitOrientation } ] Stack { id: stack anchors.fill: parent Label { alignment: Qt.AlignCenter font.bold: true font.pixelSize: 40 color: platformStyle.activeTextColor wordWrap: true text: qsTr("Showing tab one") } Label { alignment: Qt.AlignCenter font.bold: true font.pixelSize: 40 color: platformStyle.activeTextColor wordWrap: true text: qsTr("Showing tab two") } Label { alignment: Qt.AlignCenter font.bold: true font.pixelSize: 40 color: platformStyle.activeTextColor wordWrap: true text: qsTr("Showing tab three") } } }