Thursday, January 26, 2012

HelloWorld Qt App Explained part 2 of 2

While back I created video tutorial that explains code behind Hello World application for Symbian^3 phones. I am writing this post because I have decided to put the source code here. Maybe it will be convenient for someone to look at it. Only the modified files will be here.

In this video I have explained declarative part of the code inside QML file of the Qt Hello World app for Symbian^3 phones.
Covered in this episode:
- QML code explained


This post (and video featured in it) is 3nd part of 3 part whole. You should read 1st and 2nd article before reading this one.You can find them here:
Hello World for Symbian^3 with Qt Quick components done using Qt Creator
HelloWorld Qt App Explained part 1 of 2





Here is the video:


Here is the Source Code - main.qml file looks like this:

import QtQuick 1.1
import com.nokia.symbian 1.1

PageStackWindow {
    id: window
    initialPage: MainPage {tools: toolBarLayout}
    showStatusBar: true
    showToolBar: true

    ToolBarLayout {
        id: toolBarLayout
        ToolButton {
            flat: true
            iconSource: "toolbar-back"
            onClicked: window.pageStack.depth <= 1 ? Qt.quit() : window.pageStack.pop()
        }
    }
}


MainPage.qml file looks like this:
import QtQuick 1.1
import com.nokia.symbian 1.1

Page {
    id: mainPage
    Text {
        anchors.centerIn: parent
        text: qsTr("Hello world!")
        color: platformStyle.colorNormalLight
        font.pixelSize: 20
    }
}

No comments:

Post a Comment