<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.meego.com/skins/common/feed.css?270"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.meego.com/index.php?title=Special:Contributions/Dlawlor&amp;feed=atom&amp;limit=50&amp;target=Dlawlor&amp;year=&amp;month=</id>
		<title>MeeGo wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.meego.com/index.php?title=Special:Contributions/Dlawlor&amp;feed=atom&amp;limit=50&amp;target=Dlawlor&amp;year=&amp;month="/>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/Special:Contributions/Dlawlor"/>
		<updated>2013-05-26T08:40:53Z</updated>
		<subtitle>From MeeGo wiki</subtitle>
		<generator>MediaWiki 1.16.2</generator>

	<entry>
		<id>http://wiki.meego.com/QML/Sample_App_Using_CPP_Models</id>
		<title>QML/Sample App Using CPP Models</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/QML/Sample_App_Using_CPP_Models"/>
				<updated>2011-05-22T14:55:22Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: /* Follow these steps on a chroot / Xephyr system */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
This tutorial will demonstrate a simple (but non-trivial) app which uses&lt;br /&gt;
* Meego UX Component widgets&lt;br /&gt;
* C++ models&lt;br /&gt;
* QML List Views&lt;br /&gt;
* QML Components&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes you have the MeeGo SDK installed on Linux&amp;lt;br/&amp;gt;&lt;br /&gt;
See: http://wiki.meego.com/SDK/Docs/1.2/MeeGo_SDK_1.2_Preview&lt;br /&gt;
&lt;br /&gt;
Also assumed: you have a a chroot / Xephyr environment set up.&amp;lt;br/&amp;gt;&lt;br /&gt;
* http://wiki.meego.com/MeeGo_UX_Components_Chroot_Tutorial&lt;br /&gt;
* http://wiki.meego.com/Developing_in_a_MeeGo_Environment&lt;br /&gt;
&lt;br /&gt;
This tutorial will use meego-ux-components objects like:&lt;br /&gt;
* Book Menus - &lt;br /&gt;
* Buttons&lt;br /&gt;
* AppPage&lt;br /&gt;
For other uses of Meego UX Components, and another tutorial of Book Menus, See: &lt;br /&gt;
* http://wiki.meego.com/MeeGo_UX_Components&lt;br /&gt;
* http://wiki.meego.com/MeeGo_UX_Tutorials&lt;br /&gt;
&lt;br /&gt;
Other QML Tutorials:&lt;br /&gt;
* http://wiki.meego.com/QML_tutorials&lt;br /&gt;
&lt;br /&gt;
== Follow these steps on a chroot / Xephyr system ==&lt;br /&gt;
Note: These steps will also work for QEMU emulator and devices connected to the MeeGo SDK&lt;br /&gt;
&lt;br /&gt;
=== Start Qt Creator ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qtcreator &amp;amp;&amp;gt;/dev/null &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create a new project ===&lt;br /&gt;
... screen shots ...&lt;br /&gt;
&lt;br /&gt;
==== The auto-generated QML File looks like this: ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import QtQuick 1.0&lt;br /&gt;
&lt;br /&gt;
Rectangle {&lt;br /&gt;
    width: 360&lt;br /&gt;
    height: 360&lt;br /&gt;
    Text {&lt;br /&gt;
        text: &amp;quot;Hello World&amp;quot;&lt;br /&gt;
        anchors.centerIn: parent&lt;br /&gt;
    }&lt;br /&gt;
    MouseArea {&lt;br /&gt;
        anchors.fill: parent&lt;br /&gt;
        onClicked: {&lt;br /&gt;
            Qt.quit();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Turn off Shadow Build====&lt;br /&gt;
&lt;br /&gt;
==== Build-&amp;gt;Build All ====&lt;br /&gt;
&lt;br /&gt;
=== Run ===&lt;br /&gt;
(CTRL-R or Green &amp;quot;Play&amp;quot; Button)&lt;br /&gt;
&lt;br /&gt;
==== The running app looks like this: ====&lt;br /&gt;
&amp;lt;screen shot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clicking it closes the app (Qt.quit())&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add code to main.qml ===&lt;br /&gt;
&lt;br /&gt;
==== Replace the contents of main.qml with this: ====&lt;br /&gt;
The last 2 Component statements are commented out so the app will run as is before creating more files.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import Qt 4.7&lt;br /&gt;
import MeeGo.Components 0.1&lt;br /&gt;
&lt;br /&gt;
Window {&lt;br /&gt;
    id: window&lt;br /&gt;
&lt;br /&gt;
    bookMenuModel: [ qsTr(&amp;quot;Button Demo&amp;quot;), qsTr(&amp;quot;Book 2&amp;quot;) ]&lt;br /&gt;
    bookMenuPayload: [ gallery, book2 ]&lt;br /&gt;
    bookMenuTitle: qsTr(&amp;quot;Book Menu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    Component.onCompleted: switchBook( gallery )&lt;br /&gt;
&lt;br /&gt;
    //Component { id: gallery; MainPage {} }&lt;br /&gt;
    //Component { id: book2; Book2 {} }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Test / Run ====&lt;br /&gt;
Run the app and see the Book Menu. If you click on one of the menu items, you'll notice an error because of the commented out Component statements.&lt;br /&gt;
&lt;br /&gt;
=== Add code for the Book Page example ===&lt;br /&gt;
==== Adding the Book2 Component ====&lt;br /&gt;
(from the meego-ux-widgetgallery example)&lt;br /&gt;
* (right click on the QML folder in the Projects view and Add New... / QML File / &amp;quot;Book2.qml&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
* Replace the generated file Book2.qml with this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2011 Intel Corporation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is licensed under the terms and conditions of the&lt;br /&gt;
 * LGPL, version 2.1.  The full text of the LGPL Licence is at&lt;br /&gt;
 * http://www.gnu.org/licenses/lgpl.html&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* This file contains relativy empty pages and is meant to demonstrate the&lt;br /&gt;
   book/page concept */&lt;br /&gt;
&lt;br /&gt;
import Qt 4.7&lt;br /&gt;
&lt;br /&gt;
PageDummy {&lt;br /&gt;
    id: pageDummy&lt;br /&gt;
&lt;br /&gt;
    innerText: qsTr(&amp;quot;book 2, page 1&amp;quot;)&lt;br /&gt;
    rectColor: &amp;quot;lightblue&amp;quot;&lt;br /&gt;
    showButton: true&lt;br /&gt;
    buttonLabel: qsTr(&amp;quot;Page 2&amp;quot;)&lt;br /&gt;
    pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    onClicked: { addPage( page2 ) }&lt;br /&gt;
&lt;br /&gt;
    Component{&lt;br /&gt;
        id: page2;&lt;br /&gt;
&lt;br /&gt;
        PageDummy {&lt;br /&gt;
            id: pageDummy2&lt;br /&gt;
&lt;br /&gt;
            innerText: qsTr(&amp;quot;book 2, page 2&amp;quot;)&lt;br /&gt;
            rectColor: &amp;quot;lightgreen&amp;quot;&lt;br /&gt;
            showButton: true&lt;br /&gt;
            buttonLabel: qsTr(&amp;quot;Page 3&amp;quot;)&lt;br /&gt;
            pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: { addPage( page3 )&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    Component{&lt;br /&gt;
        id: page3;&lt;br /&gt;
&lt;br /&gt;
        PageDummy {&lt;br /&gt;
            id: pageDummy3&lt;br /&gt;
&lt;br /&gt;
            innerText: qsTr(&amp;quot;book 2, page 3&amp;quot;)&lt;br /&gt;
            rectColor: &amp;quot;orange&amp;quot;&lt;br /&gt;
            showButton: true&lt;br /&gt;
            buttonLabel: qsTr(&amp;quot;Page 4&amp;quot;)&lt;br /&gt;
            pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: { addPage( page4 )&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    Component{&lt;br /&gt;
        id: page4;&lt;br /&gt;
&lt;br /&gt;
        PageDummy {&lt;br /&gt;
            id: pageDummy4&lt;br /&gt;
&lt;br /&gt;
            innerText: qsTr(&amp;quot;book 2, page 4&amp;quot;)&lt;br /&gt;
            rectColor: &amp;quot;darkgrey&amp;quot;&lt;br /&gt;
            pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Add PageDummy.qml ====&lt;br /&gt;
The file Book2.qml references PageDummy.qml, so create it the same way as Book2.qml&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2011 Intel Corporation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is licensed under the terms and conditions of the&lt;br /&gt;
 * LGPL, version 2.1.  The full text of the LGPL Licence is at&lt;br /&gt;
 * http://www.gnu.org/licenses/lgpl.html&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* This file is just meant as a dummy to quickly create pages for&lt;br /&gt;
   demonstrating the book/page concept. */&lt;br /&gt;
import Qt 4.7&lt;br /&gt;
import MeeGo.Components 0.1&lt;br /&gt;
&lt;br /&gt;
AppPage {&lt;br /&gt;
    id: pageDummy&lt;br /&gt;
&lt;br /&gt;
    property alias innerText: rectText.text //text shown in the rect&lt;br /&gt;
    property alias rectColor: innerRect.color   //color of the rect in the middle&lt;br /&gt;
    property alias showButton: nextButton.visible   //nextButton visible?&lt;br /&gt;
    property alias buttonLabel: nextButton.text    //nextButton label&lt;br /&gt;
    property string bookTitle: &amp;quot;book title&amp;quot; //shown in the title bar&lt;br /&gt;
&lt;br /&gt;
    signal clicked()&lt;br /&gt;
&lt;br /&gt;
    anchors.fill:  parent&lt;br /&gt;
&lt;br /&gt;
    Rectangle { z: -1; anchors.fill: parent; color: &amp;quot;grey&amp;quot; } //background&lt;br /&gt;
&lt;br /&gt;
    Rectangle {&lt;br /&gt;
        id: innerRect&lt;br /&gt;
&lt;br /&gt;
        anchors.fill: parent&lt;br /&gt;
        anchors.margins:  50&lt;br /&gt;
        color: &amp;quot;lightgreen&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Text {&lt;br /&gt;
            id: rectText&lt;br /&gt;
&lt;br /&gt;
            text: &amp;quot;dummy page&amp;quot;&lt;br /&gt;
            anchors.centerIn: parent&lt;br /&gt;
            font.pixelSize: 40&lt;br /&gt;
            color: &amp;quot;black&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    Button {&lt;br /&gt;
        id: nextButton&lt;br /&gt;
&lt;br /&gt;
        visible: false&lt;br /&gt;
        text: &amp;quot;next page &amp;gt;&amp;quot;&lt;br /&gt;
        anchors.right:  innerRect.right&lt;br /&gt;
        anchors.bottom:  innerRect.bottom&lt;br /&gt;
        anchors.margins: 10&lt;br /&gt;
        onClicked: { pageDummy.clicked() }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see the use of the meego-ux-components &amp;quot;Button&amp;quot; and &amp;quot;AppPage&amp;quot; components in PageDummy.qml&lt;br /&gt;
&lt;br /&gt;
==== Now, replace the two commented out Component statements in main.qml with:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    Component {&lt;br /&gt;
        id: gallery;&lt;br /&gt;
        AppPage {id: dummy2}&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Dummy page until MainPage.qml is defined&lt;br /&gt;
    AppPage { id: gallery; }&lt;br /&gt;
    //Component { id: gallery; MainPage {} }&lt;br /&gt;
&lt;br /&gt;
    Component { id: book2; Book2 {} }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the MainPage.qml file isn't created yet, we use a dummy AppPage placeholder temporarily to prevent a run-time error when invoking the menu.&lt;br /&gt;
&lt;br /&gt;
=== Run ===&lt;br /&gt;
You can now click on the Book2 menu and see a new page. &lt;br /&gt;
&lt;br /&gt;
=== Add code for seeing Custom List Views in the MainPage ===&lt;br /&gt;
&lt;br /&gt;
We will use a C++ QAbstractListModel to repersent out list.&lt;br /&gt;
&lt;br /&gt;
==== mymodel.h ====&lt;br /&gt;
Create the file mymodel.h by right-clicking on the simple-app project name and &amp;quot;Add New...&amp;quot; a C++ Header File&lt;br /&gt;
&lt;br /&gt;
Paste this into mymodel.h&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#ifndef MYMODEL_H&lt;br /&gt;
#define MYMODEL_H&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;QAbstractListModel&amp;gt;&lt;br /&gt;
#include &amp;lt;QColor&amp;gt;&lt;br /&gt;
&lt;br /&gt;
struct Data {&lt;br /&gt;
    Data( const char* name, const QString&amp;amp; flag, double population )&lt;br /&gt;
        : name(name), flag(flag), population(population) {}&lt;br /&gt;
    QString name;&lt;br /&gt;
    QString flag;&lt;br /&gt;
    double population;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
const int FlagRole = Qt::UserRole + 1;&lt;br /&gt;
const int PopulationRole = Qt::UserRole + 2;&lt;br /&gt;
class MyModel : public QAbstractListModel&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    MyModel();&lt;br /&gt;
    int rowCount( const QModelIndex&amp;amp; ) const;&lt;br /&gt;
    QVariant data( const QModelIndex&amp;amp; index, int role = Qt::DisplayRole ) const;&lt;br /&gt;
&lt;br /&gt;
    QList&amp;lt; Data &amp;gt; m_data;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#endif // MYMODEL_H&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the mymodel.cpp file with this content:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;mymodel.h&amp;quot;&lt;br /&gt;
#include &amp;lt;QByteArray&amp;gt;&lt;br /&gt;
MyModel::MyModel()&lt;br /&gt;
{&lt;br /&gt;
    m_data&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Denmark&amp;quot;, &amp;quot;qrc:images/denmark.jpg&amp;quot;, 5.4)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Sweden&amp;quot;, &amp;quot;qrc:images/sweden.jpg&amp;quot;, 9.3)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Iceland&amp;quot;, &amp;quot;qrc:images/iceland.jpg&amp;quot;, 3.2)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Norway&amp;quot;, &amp;quot;qrc:images/norway.jpg&amp;quot;, 4.8)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Finland&amp;quot;, &amp;quot;qrc:images/finland.jpg&amp;quot;, 5.3);&lt;br /&gt;
&lt;br /&gt;
    // By default the DisplayRole is mapped to the propery &amp;quot;display&amp;quot;&lt;br /&gt;
    QHash&amp;lt;int, QByteArray&amp;gt; mapping =roleNames();&lt;br /&gt;
    mapping.insert( FlagRole, &amp;quot;flag&amp;quot;);&lt;br /&gt;
    mapping.insert( PopulationRole, &amp;quot;population&amp;quot;);&lt;br /&gt;
    setRoleNames( mapping );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int MyModel::rowCount( const QModelIndex&amp;amp; ) const&lt;br /&gt;
{&lt;br /&gt;
    return m_data.count();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
QVariant MyModel::data(const QModelIndex &amp;amp;index, int role) const&lt;br /&gt;
{&lt;br /&gt;
    if ( !index.isValid() )&lt;br /&gt;
        return QVariant();&lt;br /&gt;
&lt;br /&gt;
    Data data = m_data[index.row()];&lt;br /&gt;
    if ( role == Qt::DisplayRole )&lt;br /&gt;
        return data.name;&lt;br /&gt;
    else if ( role == FlagRole )&lt;br /&gt;
        return data.flag;&lt;br /&gt;
    else if ( role == PopulationRole )&lt;br /&gt;
        return data.population;&lt;br /&gt;
    else&lt;br /&gt;
        return QVariant();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modify main.cpp ====&lt;br /&gt;
Modify main.cpp by replacing its contents with this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;QtGui/QApplication&amp;gt;&lt;br /&gt;
#include &amp;lt;QDeclarativeEngine&amp;gt;&lt;br /&gt;
#include &amp;lt;QDeclarativeContext&amp;gt;&lt;br /&gt;
#include &amp;quot;qmlapplicationviewer.h&amp;quot;&lt;br /&gt;
#include &amp;quot;mymodel.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
    QApplication app(argc, argv);&lt;br /&gt;
&lt;br /&gt;
    MyModel model;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    QmlApplicationViewer viewer;&lt;br /&gt;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);&lt;br /&gt;
    viewer.setMainQmlFile(QLatin1String(&amp;quot;qml/simple-app/main.qml&amp;quot;));&lt;br /&gt;
    viewer.showExpanded();&lt;br /&gt;
&lt;br /&gt;
    // Register the model &amp;quot;myModel&amp;quot; with QML&lt;br /&gt;
    QDeclarativeContext *context = viewer.engine()-&amp;gt;rootContext();&lt;br /&gt;
    context-&amp;gt;setContextProperty(&amp;quot;myModel&amp;quot;, &amp;amp;model);&lt;br /&gt;
&lt;br /&gt;
    return app.exec();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Add the file MainPage.qml ====&lt;br /&gt;
&lt;br /&gt;
A Component called MainPage.qml which will display row of Buttons that act like Tabs in a QTabView.&lt;br /&gt;
&lt;br /&gt;
The area below the buttons are filled with one of two mini-apps (List View sample, and mini file browser)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2011 Intel Corporation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is licensed under the terms and conditions of the&lt;br /&gt;
 * LGPL, version 2.1.  The full text of the LGPL Licence is at&lt;br /&gt;
 * http://www.gnu.org/licenses/lgpl.html&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* The MainPage lets the user switch between different contents which&lt;br /&gt;
   show the widgets available in these components. */&lt;br /&gt;
&lt;br /&gt;
//import Qt 4.7&lt;br /&gt;
import QtQuick 1.0&lt;br /&gt;
import MeeGo.Components 0.1&lt;br /&gt;
&lt;br /&gt;
AppPage {&lt;br /&gt;
    id: mainPage&lt;br /&gt;
&lt;br /&gt;
    // This will be the first app / content displayed in the Button Demo page&lt;br /&gt;
    state: &amp;quot;flags&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    pageTitle: qsTr(&amp;quot;Button Demo&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    // Demo an Action Menu......&lt;br /&gt;
    // Comment the block below to see a new Action Menu&lt;br /&gt;
&lt;br /&gt;
//    actionMenuModel: [ qsTr(&amp;quot;Landscape&amp;quot;),&lt;br /&gt;
//                       qsTr(&amp;quot;Portrait&amp;quot;),&lt;br /&gt;
//                       qsTr(&amp;quot;Inv. Landscape&amp;quot;),&lt;br /&gt;
//                       qsTr(&amp;quot;Inv. Portrait&amp;quot;) ]&lt;br /&gt;
//    actionMenuPayload: [  1, 2, 3, 4 ]&lt;br /&gt;
//    actionMenuTitle: qsTr(&amp;quot;Action Menu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
//    onActionMenuTriggered: {&lt;br /&gt;
&lt;br /&gt;
//        if( selectedItem == 1) {&lt;br /&gt;
//            window.orientation = 1&lt;br /&gt;
//        } else if( selectedItem == 2) {&lt;br /&gt;
//            window.orientation = 2&lt;br /&gt;
//        } else if( selectedItem == 3) {&lt;br /&gt;
//            window.orientation = 3&lt;br /&gt;
//        } else if( selectedItem == 4) {&lt;br /&gt;
//            window.orientation = 0&lt;br /&gt;
//        }&lt;br /&gt;
//    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Item {&lt;br /&gt;
        id: contentButtons&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        // Some Debug output to stderr ...&lt;br /&gt;
        onVisibleChanged: {&lt;br /&gt;
            console.log(&amp;quot;xxxxxxxxxxxxxx 1 Parent wid &amp;quot;, parent.width);&lt;br /&gt;
            console.log(&amp;quot;xxxxxxxxxxxxxx 2 Wid        &amp;quot;, width);&lt;br /&gt;
        }&lt;br /&gt;
        onWidthChanged: {&lt;br /&gt;
            console.log(&amp;quot;wwwwwwwwwwwwww 1 Parent wid &amp;quot;, parent.width);&lt;br /&gt;
            console.log(&amp;quot;wwwwwwwwwwwwww 2 Wid        &amp;quot;, width);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        property int buttonWidth: parent.width * 0.2;&lt;br /&gt;
        property int buttonHeight: 60;&lt;br /&gt;
        property int buttonMargins: 2;&lt;br /&gt;
&lt;br /&gt;
        property string activeButtonImage: &amp;quot;image://themedimage/widgets/common/button/button-default&amp;quot;&lt;br /&gt;
        property string buttonImage: &amp;quot;image://themedimage/widgets/common/button/button&amp;quot;&lt;br /&gt;
        property string buttonImagePressed: &amp;quot;image://themedimage/widgets/common/button/button-default-pressed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        //width: 2 * buttonWidth + 3 * buttonMargins&lt;br /&gt;
        height: buttonHeight&lt;br /&gt;
        anchors.top: parent.top&lt;br /&gt;
        anchors.topMargin:  10&lt;br /&gt;
        anchors.horizontalCenter: parent.horizontalCenter&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Button {&lt;br /&gt;
            id: flagsButton&lt;br /&gt;
            active: true&lt;br /&gt;
            width:  parent.buttonWidth; height: parent.buttonHeight&lt;br /&gt;
&lt;br /&gt;
            // Since there are only two buttons, the right of this button is near the center.&lt;br /&gt;
            anchors { margins: parent.buttonMargins; right: parent.horizontalCenter;}&lt;br /&gt;
            text: qsTr(&amp;quot;Flags&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: {&lt;br /&gt;
                mainPage.state = &amp;quot;flags&amp;quot;&lt;br /&gt;
                active = true&lt;br /&gt;
                browserButton.active = false&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Button {&lt;br /&gt;
            id: browserButton&lt;br /&gt;
&lt;br /&gt;
            width:  parent.buttonWidth; height: parent.buttonHeight&lt;br /&gt;
&lt;br /&gt;
            // This button is to the right of the flags button&lt;br /&gt;
            anchors { margins: parent.buttonMargins; left: flagsButton.right }&lt;br /&gt;
            text: qsTr(&amp;quot;File Browser&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: {&lt;br /&gt;
                mainPage.state = &amp;quot;browser&amp;quot;&lt;br /&gt;
                active = true&lt;br /&gt;
                flagsButton.active = false&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // This item holds the contents of the selected button and fills the rest of the window&lt;br /&gt;
    Item {&lt;br /&gt;
        id: contentSpace&lt;br /&gt;
&lt;br /&gt;
        anchors { top: contentButtons.bottom; bottom: parent.bottom; left: parent.left; right: parent.right }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    // One of these two components will fill the contentSpace Item above.&lt;br /&gt;
    FlagContent    { id: flagContent;    anchors.fill: contentSpace; anchors.top: contentButtons.bottom }&lt;br /&gt;
&lt;br /&gt;
    //Placeholder until BrowserContent.qml is present&lt;br /&gt;
    Rectangle      { id: browserContent; anchors.fill: contentSpace; anchors.top: contentButtons.bottom; color: &amp;quot;red&amp;quot;; }&lt;br /&gt;
    //BrowserContent { id: browserContent; anchors.fill: contentSpace }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Rectangle { z: -1; anchors.fill: parent; color: &amp;quot;grey&amp;quot; } //background&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    states:  [&lt;br /&gt;
        State {&lt;br /&gt;
            name: &amp;quot;flags&amp;quot;&lt;br /&gt;
            PropertyChanges { target: flagContent; visible: true }&lt;br /&gt;
            PropertyChanges { target: browserContent; visible: false }&lt;br /&gt;
        },&lt;br /&gt;
        State {&lt;br /&gt;
            name: &amp;quot;browser&amp;quot;&lt;br /&gt;
            PropertyChanges { target: flagContent; visible: false }&lt;br /&gt;
            PropertyChanges { target: browserContent; visible: true }&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Add the File FlagContent.qml ====&lt;br /&gt;
&lt;br /&gt;
This shows an example of using a QML ListView - which uses a delegate for a row to be displayed&lt;br /&gt;
&lt;br /&gt;
The model statement references a C++ model called &amp;quot;myModel&amp;quot; defined in mymodel.{h,cpp}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import QtQuick 1.0&lt;br /&gt;
&lt;br /&gt;
    ListView {&lt;br /&gt;
        clip: true&lt;br /&gt;
        model: myModel&lt;br /&gt;
        anchors.top: parent.bottom&lt;br /&gt;
        anchors.fill: parent&lt;br /&gt;
        delegate: Rectangle {&lt;br /&gt;
            color: Qt.rgba(0.9,0.9,0.9)&lt;br /&gt;
            height: childrenRect.height&lt;br /&gt;
            width: parent.width&lt;br /&gt;
            Image {&lt;br /&gt;
                id: image&lt;br /&gt;
                source: flag&lt;br /&gt;
                width: 64&lt;br /&gt;
                height: 64&lt;br /&gt;
                fillMode: Image.PreserveAspectFit&lt;br /&gt;
&lt;br /&gt;
                anchors { left:parent.left; leftMargin:30}&lt;br /&gt;
            }&lt;br /&gt;
            Text {&lt;br /&gt;
                text: display + &amp;quot;\n&amp;quot; +&amp;quot;population: &amp;quot; + population + &amp;quot; mill.&amp;quot;&lt;br /&gt;
                anchors { left:image.right; verticalCenter: image.verticalCenter; leftMargin: 5 }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modify main.qml ====&lt;br /&gt;
Remove this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    AppPage { id: gallery; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Uncomment this line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Component { id: gallery; MainPage {} }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Copy Resource Files ====&lt;br /&gt;
Copy the images and .qrc file from the solution directory:&lt;br /&gt;
&lt;br /&gt;
* Please rename this file to remove the .jpg due to a problem uploading to wiki.meego.com&lt;br /&gt;
&lt;br /&gt;
[[Media:Qml-button-ex-rename-to-tgz.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Add this to your simple-app.pro&lt;br /&gt;
RESOURCES += resources.qrc&lt;br /&gt;
&lt;br /&gt;
==== Rebuild and Run ====&lt;br /&gt;
Since we added new .cpp and .h files, it would be a good idea to Build-&amp;gt;Run Qmake; Build-&amp;gt;Rebuild All&lt;br /&gt;
&lt;br /&gt;
Run...&lt;br /&gt;
&lt;br /&gt;
=== Adding code for the File Browser ===&lt;br /&gt;
To see another mini-app for the &amp;quot;Browser&amp;quot; button, copy these files to your project from the solution directory:&lt;br /&gt;
* Please rename this file to remove the .jpg due to a problem uploading to wiki.meego.com&lt;br /&gt;
&lt;br /&gt;
[[Media:Qml-button-ex-rename-to-tgz.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Move these files to your project's qml directory (sub directory of project)&lt;br /&gt;
BrowserContent.qml&lt;br /&gt;
FileSystemView.qml&lt;br /&gt;
ImageViewer.qml&lt;br /&gt;
PathDisplay.qml&lt;br /&gt;
&lt;br /&gt;
Move these files to your project's top-level directory&lt;br /&gt;
dirmodel.cpp&lt;br /&gt;
dirmodel.h&lt;br /&gt;
main.cpp (new code added to register a Directory Model with QML named &amp;quot;_model&amp;quot; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modify your project's .pro file by adding &lt;br /&gt;
*dirmodel.h to HEADERS&lt;br /&gt;
*dirmodel.cpp to SOURCES&lt;br /&gt;
&lt;br /&gt;
==== Replace these two lines in MainPage.qml:====&lt;br /&gt;
&lt;br /&gt;
We were using a generic red rectangle to hold a space for the BrowserContent Component, we can now use it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    Rectangle      { id: browserContent; anchors.fill: contentSpace; anchors.top: contentButtons.bottom; color: &amp;quot;red&amp;quot;; }&lt;br /&gt;
    //BrowserContent { id: browserContent; anchors.fill: contentSpace }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    BrowserContent { id: browserContent; anchors.fill: contentSpace }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Rebuild All ====&lt;br /&gt;
&lt;br /&gt;
==== Run ====&lt;br /&gt;
Clicking on the Browser button should allow you to browse the file system. If you click on a jpg or png, the image will be previewed.&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/Main_Page</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/Main_Page"/>
				<updated>2011-05-22T14:52:59Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: /* Developer Guide */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== MeeGo Project Functions ==&lt;br /&gt;
* [[Community Office]]&lt;br /&gt;
* [[Localization team|Localization]]&lt;br /&gt;
* [http://meego.com/about/governance/program-office Program Office]&lt;br /&gt;
* [[Core_OS_Program | Core OS Program]]&lt;br /&gt;
* [[Handset_Program | Handset UX Program]]&lt;br /&gt;
* [[In-vehicle | In Vehicle Infotainment - IVI]]&lt;br /&gt;
* [[Product Management]]&lt;br /&gt;
* [[Quality]]&lt;br /&gt;
** [[Error Management]]&lt;br /&gt;
* [[Release_Engineering|Release Engineering]]&lt;br /&gt;
* [http://meego.com/about/governance/ui-design User Interface Design]&lt;br /&gt;
* [[SDK]]&lt;br /&gt;
* [[Architecture]]&lt;br /&gt;
* [[Meego IT]]&lt;br /&gt;
&lt;br /&gt;
= User =&lt;br /&gt;
&lt;br /&gt;
* [[MeeGo Netbook FAQ]]&lt;br /&gt;
* [http://meego.com/devices/netbook/installing-meego-your-netbook Install MeeGo on your netbook]&lt;br /&gt;
* [[Devices|Supported devices]]&lt;br /&gt;
* [[Install MeeGo from Hard Disk]]&lt;br /&gt;
&lt;br /&gt;
= Developer =&lt;br /&gt;
== Developer Guide ==&lt;br /&gt;
&lt;br /&gt;
* [[SDK/Docs/1.1|Developer Guide for MeeGo 1.1]]&lt;br /&gt;
* [[SDK/Docs/1.0|Developer Guide for MeeGo 1.0]]&lt;br /&gt;
* [[Build_Infrastructure | Build Infrastructure]]&lt;br /&gt;
* [[MeeGo Porting Guide]]&lt;br /&gt;
* [[QML tutorials]] - Some tutorials to help get started with QML, the Qt Modelling Language.&lt;br /&gt;
* [[QML/Sample_App_Using_CPP_Models | Sample App using C++ models with QML]] Build a sample QML app which uses C++ models&lt;br /&gt;
* [http://mxr.meego.com/ MeeGo cross reference] - Index of MeeGo source code&lt;br /&gt;
&lt;br /&gt;
Other documents:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Document&lt;br /&gt;
! Variety (Version)&lt;br /&gt;
! Architectures&lt;br /&gt;
|-&lt;br /&gt;
|Instructions for [[ARM|ARM based devices (N900, BeagleBoard, PandaBoard, Snowball)]]&lt;br /&gt;
|All&lt;br /&gt;
|ARM&lt;br /&gt;
|-&lt;br /&gt;
|Instructions for [[MeeGo_1.0_Netbook_VirtualBox|VirtualBox]]&lt;br /&gt;
|Netbook (1.0)&lt;br /&gt;
|Intel&lt;br /&gt;
|-&lt;br /&gt;
|Instructions for [[MeeGo SDK on Windows with VirtualBox]]&lt;br /&gt;
|All&lt;br /&gt;
|All&lt;br /&gt;
|-&lt;br /&gt;
|Tips for [[Developing With The Aava]]&lt;br /&gt;
|Handset/Aava&lt;br /&gt;
|Intel&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Release Process ==&lt;br /&gt;
The MeeGo Release Process includes:&lt;br /&gt;
* [[Release_Engineering/Process|Release process and work flow]]&lt;br /&gt;
* [[Release_Engineering/Release_Timeline|MeeGo releases every 6 months]]&lt;br /&gt;
* [[Release_Engineering/Process|Nightly builds for developers and weekly releases will be available]]&lt;br /&gt;
&lt;br /&gt;
== MeeGo Components ==&lt;br /&gt;
* [[MeeGo_UX_Components|MeeGo Components]] - Supported common QML components&lt;br /&gt;
** [[Components_Migration|Migration to Components]] - Guides and roadmap for migrating from MeeGo.Labs.Components to MeeGo.Components&lt;br /&gt;
* [[MeeGoLabs_UX_Components|MeeGo Labs Components]] - Unsupported, experimental QML components&lt;br /&gt;
&lt;br /&gt;
= Community =&lt;br /&gt;
&lt;br /&gt;
== Contributing to MeeGo ==&lt;br /&gt;
* Read our [[Community guidelines]]: [[Wiki contribution guidelines|Wiki]], [[Mailing list guidelines|mailing list]], [[Forum/Guidelines|forum]], and [[Community guidelines|more]].&lt;br /&gt;
* [[Community communication|Participate in our forums, mailing lists, and more]].&lt;br /&gt;
* [http://meego.com/about/contribution-guidelines Contribute to MeeGo].&lt;br /&gt;
* [[Build_Infrastructure/Community_Builder|Building applications]] for MeeGo&lt;br /&gt;
&lt;br /&gt;
See also [[Who's who]].&lt;br /&gt;
&lt;br /&gt;
== Meetings ==&lt;br /&gt;
&lt;br /&gt;
[[MeeGo-Meeting IRC Schedule]]&lt;br /&gt;
&lt;br /&gt;
The following groups have regular meetings, see their respective pages for details.&lt;br /&gt;
&lt;br /&gt;
* [[Technical Steering Group meetings]]&lt;br /&gt;
* [[Community Office/Meetings|Community Office meetings]]&lt;br /&gt;
* [[Localization team]]&lt;br /&gt;
&lt;br /&gt;
Regional Activities.&lt;br /&gt;
* [[Local MeeGo Networks]]&lt;br /&gt;
&lt;br /&gt;
== Bi-Annual MeeGo Conference ==&lt;br /&gt;
&lt;br /&gt;
'''Upcoming Conferences'''&lt;br /&gt;
* [[MeeGo Conference Spring 2011|Spring 2011: May 23 - 25 at the Hyatt Regency, San Francisco]]&lt;br /&gt;
* [[MeeGo Conference Fall 2011|Fall 2011: November Date TBD in Europe]]&lt;br /&gt;
&lt;br /&gt;
'''Past Conference Wrap-Up Information'''&lt;br /&gt;
* [[MeeGo_Conference_2010|Fall 2010: November 15 - 17 in Dublin]]&lt;br /&gt;
&lt;br /&gt;
== Structure and Governance ==&lt;br /&gt;
&lt;br /&gt;
MeeGo is an open source project led by the MeeGo Technical Steering Group (TSG). The governance model is based on meritocracy and the best practices and values of the Open Source culture. The MeeGo project lives under the auspices of the Linux Foundation. &lt;br /&gt;
&lt;br /&gt;
* [http://meego.com/about/governance MeeGo Project Structure and Governance Overview]&lt;br /&gt;
* Bi-weekly [[Technical Steering Group meetings]]&lt;br /&gt;
* [[Working Group Process]]&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
* [[MeeGo FAQ]]&lt;br /&gt;
* [[Glossary|Glossary and Acronyms]]&lt;br /&gt;
* [[Community guidelines]]&lt;br /&gt;
* [[Special:PopularPages|Popular Wiki Pages]]&lt;br /&gt;
* [[Special:MostLinkedPages|Most Linked-to Pages]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Top level]]&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/QML/Sample_App_Using_CPP_Models</id>
		<title>QML/Sample App Using CPP Models</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/QML/Sample_App_Using_CPP_Models"/>
				<updated>2011-05-20T21:57:09Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
This tutorial will demonstrate a simple (but non-trivial) app which uses&lt;br /&gt;
* Meego UX Component widgets&lt;br /&gt;
* C++ models&lt;br /&gt;
* QML List Views&lt;br /&gt;
* QML Components&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes you have the MeeGo SDK installed on Linux&amp;lt;br/&amp;gt;&lt;br /&gt;
See: http://wiki.meego.com/SDK/Docs/1.2/MeeGo_SDK_1.2_Preview&lt;br /&gt;
&lt;br /&gt;
Also assumed: you have a a chroot / Xephyr environment set up.&amp;lt;br/&amp;gt;&lt;br /&gt;
* http://wiki.meego.com/MeeGo_UX_Components_Chroot_Tutorial&lt;br /&gt;
* http://wiki.meego.com/Developing_in_a_MeeGo_Environment&lt;br /&gt;
&lt;br /&gt;
This tutorial will use meego-ux-components objects like:&lt;br /&gt;
* Book Menus - &lt;br /&gt;
* Buttons&lt;br /&gt;
* AppPage&lt;br /&gt;
For other uses of Meego UX Components, and another tutorial of Book Menus, See: &lt;br /&gt;
* http://wiki.meego.com/MeeGo_UX_Components&lt;br /&gt;
* http://wiki.meego.com/MeeGo_UX_Tutorials&lt;br /&gt;
&lt;br /&gt;
Other QML Tutorials:&lt;br /&gt;
* http://wiki.meego.com/QML_tutorials&lt;br /&gt;
&lt;br /&gt;
== Follow these steps on a chroot / Xephyr system ==&lt;br /&gt;
&lt;br /&gt;
=== Start Qt Creator ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qtcreator &amp;amp;&amp;gt;/dev/null &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create a new project ===&lt;br /&gt;
... screen shots ...&lt;br /&gt;
&lt;br /&gt;
==== The auto-generated QML File looks like this: ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import QtQuick 1.0&lt;br /&gt;
&lt;br /&gt;
Rectangle {&lt;br /&gt;
    width: 360&lt;br /&gt;
    height: 360&lt;br /&gt;
    Text {&lt;br /&gt;
        text: &amp;quot;Hello World&amp;quot;&lt;br /&gt;
        anchors.centerIn: parent&lt;br /&gt;
    }&lt;br /&gt;
    MouseArea {&lt;br /&gt;
        anchors.fill: parent&lt;br /&gt;
        onClicked: {&lt;br /&gt;
            Qt.quit();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Turn off Shadow Build====&lt;br /&gt;
&lt;br /&gt;
==== Build-&amp;gt;Build All ====&lt;br /&gt;
&lt;br /&gt;
=== Run ===&lt;br /&gt;
(CTRL-R or Green &amp;quot;Play&amp;quot; Button)&lt;br /&gt;
&lt;br /&gt;
==== The running app looks like this: ====&lt;br /&gt;
&amp;lt;screen shot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clicking it closes the app (Qt.quit())&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add code to main.qml ===&lt;br /&gt;
&lt;br /&gt;
==== Replace the contents of main.qml with this: ====&lt;br /&gt;
The last 2 Component statements are commented out so the app will run as is before creating more files.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import Qt 4.7&lt;br /&gt;
import MeeGo.Components 0.1&lt;br /&gt;
&lt;br /&gt;
Window {&lt;br /&gt;
    id: window&lt;br /&gt;
&lt;br /&gt;
    bookMenuModel: [ qsTr(&amp;quot;Button Demo&amp;quot;), qsTr(&amp;quot;Book 2&amp;quot;) ]&lt;br /&gt;
    bookMenuPayload: [ gallery, book2 ]&lt;br /&gt;
    bookMenuTitle: qsTr(&amp;quot;Book Menu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    Component.onCompleted: switchBook( gallery )&lt;br /&gt;
&lt;br /&gt;
    //Component { id: gallery; MainPage {} }&lt;br /&gt;
    //Component { id: book2; Book2 {} }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Test / Run ====&lt;br /&gt;
Run the app and see the Book Menu. If you click on one of the menu items, you'll notice an error because of the commented out Component statements.&lt;br /&gt;
&lt;br /&gt;
=== Add code for the Book Page example ===&lt;br /&gt;
==== Adding the Book2 Component ====&lt;br /&gt;
(from the meego-ux-widgetgallery example)&lt;br /&gt;
* (right click on the QML folder in the Projects view and Add New... / QML File / &amp;quot;Book2.qml&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
* Replace the generated file Book2.qml with this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2011 Intel Corporation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is licensed under the terms and conditions of the&lt;br /&gt;
 * LGPL, version 2.1.  The full text of the LGPL Licence is at&lt;br /&gt;
 * http://www.gnu.org/licenses/lgpl.html&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* This file contains relativy empty pages and is meant to demonstrate the&lt;br /&gt;
   book/page concept */&lt;br /&gt;
&lt;br /&gt;
import Qt 4.7&lt;br /&gt;
&lt;br /&gt;
PageDummy {&lt;br /&gt;
    id: pageDummy&lt;br /&gt;
&lt;br /&gt;
    innerText: qsTr(&amp;quot;book 2, page 1&amp;quot;)&lt;br /&gt;
    rectColor: &amp;quot;lightblue&amp;quot;&lt;br /&gt;
    showButton: true&lt;br /&gt;
    buttonLabel: qsTr(&amp;quot;Page 2&amp;quot;)&lt;br /&gt;
    pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    onClicked: { addPage( page2 ) }&lt;br /&gt;
&lt;br /&gt;
    Component{&lt;br /&gt;
        id: page2;&lt;br /&gt;
&lt;br /&gt;
        PageDummy {&lt;br /&gt;
            id: pageDummy2&lt;br /&gt;
&lt;br /&gt;
            innerText: qsTr(&amp;quot;book 2, page 2&amp;quot;)&lt;br /&gt;
            rectColor: &amp;quot;lightgreen&amp;quot;&lt;br /&gt;
            showButton: true&lt;br /&gt;
            buttonLabel: qsTr(&amp;quot;Page 3&amp;quot;)&lt;br /&gt;
            pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: { addPage( page3 )&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    Component{&lt;br /&gt;
        id: page3;&lt;br /&gt;
&lt;br /&gt;
        PageDummy {&lt;br /&gt;
            id: pageDummy3&lt;br /&gt;
&lt;br /&gt;
            innerText: qsTr(&amp;quot;book 2, page 3&amp;quot;)&lt;br /&gt;
            rectColor: &amp;quot;orange&amp;quot;&lt;br /&gt;
            showButton: true&lt;br /&gt;
            buttonLabel: qsTr(&amp;quot;Page 4&amp;quot;)&lt;br /&gt;
            pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: { addPage( page4 )&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    Component{&lt;br /&gt;
        id: page4;&lt;br /&gt;
&lt;br /&gt;
        PageDummy {&lt;br /&gt;
            id: pageDummy4&lt;br /&gt;
&lt;br /&gt;
            innerText: qsTr(&amp;quot;book 2, page 4&amp;quot;)&lt;br /&gt;
            rectColor: &amp;quot;darkgrey&amp;quot;&lt;br /&gt;
            pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Add PageDummy.qml ====&lt;br /&gt;
The file Book2.qml references PageDummy.qml, so create it the same way as Book2.qml&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2011 Intel Corporation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is licensed under the terms and conditions of the&lt;br /&gt;
 * LGPL, version 2.1.  The full text of the LGPL Licence is at&lt;br /&gt;
 * http://www.gnu.org/licenses/lgpl.html&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* This file is just meant as a dummy to quickly create pages for&lt;br /&gt;
   demonstrating the book/page concept. */&lt;br /&gt;
import Qt 4.7&lt;br /&gt;
import MeeGo.Components 0.1&lt;br /&gt;
&lt;br /&gt;
AppPage {&lt;br /&gt;
    id: pageDummy&lt;br /&gt;
&lt;br /&gt;
    property alias innerText: rectText.text //text shown in the rect&lt;br /&gt;
    property alias rectColor: innerRect.color   //color of the rect in the middle&lt;br /&gt;
    property alias showButton: nextButton.visible   //nextButton visible?&lt;br /&gt;
    property alias buttonLabel: nextButton.text    //nextButton label&lt;br /&gt;
    property string bookTitle: &amp;quot;book title&amp;quot; //shown in the title bar&lt;br /&gt;
&lt;br /&gt;
    signal clicked()&lt;br /&gt;
&lt;br /&gt;
    anchors.fill:  parent&lt;br /&gt;
&lt;br /&gt;
    Rectangle { z: -1; anchors.fill: parent; color: &amp;quot;grey&amp;quot; } //background&lt;br /&gt;
&lt;br /&gt;
    Rectangle {&lt;br /&gt;
        id: innerRect&lt;br /&gt;
&lt;br /&gt;
        anchors.fill: parent&lt;br /&gt;
        anchors.margins:  50&lt;br /&gt;
        color: &amp;quot;lightgreen&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Text {&lt;br /&gt;
            id: rectText&lt;br /&gt;
&lt;br /&gt;
            text: &amp;quot;dummy page&amp;quot;&lt;br /&gt;
            anchors.centerIn: parent&lt;br /&gt;
            font.pixelSize: 40&lt;br /&gt;
            color: &amp;quot;black&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    Button {&lt;br /&gt;
        id: nextButton&lt;br /&gt;
&lt;br /&gt;
        visible: false&lt;br /&gt;
        text: &amp;quot;next page &amp;gt;&amp;quot;&lt;br /&gt;
        anchors.right:  innerRect.right&lt;br /&gt;
        anchors.bottom:  innerRect.bottom&lt;br /&gt;
        anchors.margins: 10&lt;br /&gt;
        onClicked: { pageDummy.clicked() }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see the use of the meego-ux-components &amp;quot;Button&amp;quot; and &amp;quot;AppPage&amp;quot; components in PageDummy.qml&lt;br /&gt;
&lt;br /&gt;
==== Now, replace the two commented out Component statements in main.qml with:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    Component {&lt;br /&gt;
        id: gallery;&lt;br /&gt;
        AppPage {id: dummy2}&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Dummy page until MainPage.qml is defined&lt;br /&gt;
    AppPage { id: gallery; }&lt;br /&gt;
    //Component { id: gallery; MainPage {} }&lt;br /&gt;
&lt;br /&gt;
    Component { id: book2; Book2 {} }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the MainPage.qml file isn't created yet, we use a dummy AppPage placeholder temporarily to prevent a run-time error when invoking the menu.&lt;br /&gt;
&lt;br /&gt;
=== Run ===&lt;br /&gt;
You can now click on the Book2 menu and see a new page. &lt;br /&gt;
&lt;br /&gt;
=== Add code for seeing Custom List Views in the MainPage ===&lt;br /&gt;
&lt;br /&gt;
We will use a C++ QAbstractListModel to repersent out list.&lt;br /&gt;
&lt;br /&gt;
==== mymodel.h ====&lt;br /&gt;
Create the file mymodel.h by right-clicking on the simple-app project name and &amp;quot;Add New...&amp;quot; a C++ Header File&lt;br /&gt;
&lt;br /&gt;
Paste this into mymodel.h&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#ifndef MYMODEL_H&lt;br /&gt;
#define MYMODEL_H&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;QAbstractListModel&amp;gt;&lt;br /&gt;
#include &amp;lt;QColor&amp;gt;&lt;br /&gt;
&lt;br /&gt;
struct Data {&lt;br /&gt;
    Data( const char* name, const QString&amp;amp; flag, double population )&lt;br /&gt;
        : name(name), flag(flag), population(population) {}&lt;br /&gt;
    QString name;&lt;br /&gt;
    QString flag;&lt;br /&gt;
    double population;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
const int FlagRole = Qt::UserRole + 1;&lt;br /&gt;
const int PopulationRole = Qt::UserRole + 2;&lt;br /&gt;
class MyModel : public QAbstractListModel&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    MyModel();&lt;br /&gt;
    int rowCount( const QModelIndex&amp;amp; ) const;&lt;br /&gt;
    QVariant data( const QModelIndex&amp;amp; index, int role = Qt::DisplayRole ) const;&lt;br /&gt;
&lt;br /&gt;
    QList&amp;lt; Data &amp;gt; m_data;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#endif // MYMODEL_H&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the mymodel.cpp file with this content:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;mymodel.h&amp;quot;&lt;br /&gt;
#include &amp;lt;QByteArray&amp;gt;&lt;br /&gt;
MyModel::MyModel()&lt;br /&gt;
{&lt;br /&gt;
    m_data&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Denmark&amp;quot;, &amp;quot;qrc:images/denmark.jpg&amp;quot;, 5.4)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Sweden&amp;quot;, &amp;quot;qrc:images/sweden.jpg&amp;quot;, 9.3)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Iceland&amp;quot;, &amp;quot;qrc:images/iceland.jpg&amp;quot;, 3.2)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Norway&amp;quot;, &amp;quot;qrc:images/norway.jpg&amp;quot;, 4.8)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Finland&amp;quot;, &amp;quot;qrc:images/finland.jpg&amp;quot;, 5.3);&lt;br /&gt;
&lt;br /&gt;
    // By default the DisplayRole is mapped to the propery &amp;quot;display&amp;quot;&lt;br /&gt;
    QHash&amp;lt;int, QByteArray&amp;gt; mapping =roleNames();&lt;br /&gt;
    mapping.insert( FlagRole, &amp;quot;flag&amp;quot;);&lt;br /&gt;
    mapping.insert( PopulationRole, &amp;quot;population&amp;quot;);&lt;br /&gt;
    setRoleNames( mapping );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int MyModel::rowCount( const QModelIndex&amp;amp; ) const&lt;br /&gt;
{&lt;br /&gt;
    return m_data.count();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
QVariant MyModel::data(const QModelIndex &amp;amp;index, int role) const&lt;br /&gt;
{&lt;br /&gt;
    if ( !index.isValid() )&lt;br /&gt;
        return QVariant();&lt;br /&gt;
&lt;br /&gt;
    Data data = m_data[index.row()];&lt;br /&gt;
    if ( role == Qt::DisplayRole )&lt;br /&gt;
        return data.name;&lt;br /&gt;
    else if ( role == FlagRole )&lt;br /&gt;
        return data.flag;&lt;br /&gt;
    else if ( role == PopulationRole )&lt;br /&gt;
        return data.population;&lt;br /&gt;
    else&lt;br /&gt;
        return QVariant();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modify main.cpp ====&lt;br /&gt;
Modify main.cpp by replacing its contents with this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;QtGui/QApplication&amp;gt;&lt;br /&gt;
#include &amp;lt;QDeclarativeEngine&amp;gt;&lt;br /&gt;
#include &amp;lt;QDeclarativeContext&amp;gt;&lt;br /&gt;
#include &amp;quot;qmlapplicationviewer.h&amp;quot;&lt;br /&gt;
#include &amp;quot;mymodel.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
    QApplication app(argc, argv);&lt;br /&gt;
&lt;br /&gt;
    MyModel model;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    QmlApplicationViewer viewer;&lt;br /&gt;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);&lt;br /&gt;
    viewer.setMainQmlFile(QLatin1String(&amp;quot;qml/simple-app/main.qml&amp;quot;));&lt;br /&gt;
    viewer.showExpanded();&lt;br /&gt;
&lt;br /&gt;
    // Register the model &amp;quot;myModel&amp;quot; with QML&lt;br /&gt;
    QDeclarativeContext *context = viewer.engine()-&amp;gt;rootContext();&lt;br /&gt;
    context-&amp;gt;setContextProperty(&amp;quot;myModel&amp;quot;, &amp;amp;model);&lt;br /&gt;
&lt;br /&gt;
    return app.exec();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Add the file MainPage.qml ====&lt;br /&gt;
&lt;br /&gt;
A Component called MainPage.qml which will display row of Buttons that act like Tabs in a QTabView.&lt;br /&gt;
&lt;br /&gt;
The area below the buttons are filled with one of two mini-apps (List View sample, and mini file browser)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2011 Intel Corporation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is licensed under the terms and conditions of the&lt;br /&gt;
 * LGPL, version 2.1.  The full text of the LGPL Licence is at&lt;br /&gt;
 * http://www.gnu.org/licenses/lgpl.html&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* The MainPage lets the user switch between different contents which&lt;br /&gt;
   show the widgets available in these components. */&lt;br /&gt;
&lt;br /&gt;
//import Qt 4.7&lt;br /&gt;
import QtQuick 1.0&lt;br /&gt;
import MeeGo.Components 0.1&lt;br /&gt;
&lt;br /&gt;
AppPage {&lt;br /&gt;
    id: mainPage&lt;br /&gt;
&lt;br /&gt;
    // This will be the first app / content displayed in the Button Demo page&lt;br /&gt;
    state: &amp;quot;flags&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    pageTitle: qsTr(&amp;quot;Button Demo&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    // Demo an Action Menu......&lt;br /&gt;
    // Comment the block below to see a new Action Menu&lt;br /&gt;
&lt;br /&gt;
//    actionMenuModel: [ qsTr(&amp;quot;Landscape&amp;quot;),&lt;br /&gt;
//                       qsTr(&amp;quot;Portrait&amp;quot;),&lt;br /&gt;
//                       qsTr(&amp;quot;Inv. Landscape&amp;quot;),&lt;br /&gt;
//                       qsTr(&amp;quot;Inv. Portrait&amp;quot;) ]&lt;br /&gt;
//    actionMenuPayload: [  1, 2, 3, 4 ]&lt;br /&gt;
//    actionMenuTitle: qsTr(&amp;quot;Action Menu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
//    onActionMenuTriggered: {&lt;br /&gt;
&lt;br /&gt;
//        if( selectedItem == 1) {&lt;br /&gt;
//            window.orientation = 1&lt;br /&gt;
//        } else if( selectedItem == 2) {&lt;br /&gt;
//            window.orientation = 2&lt;br /&gt;
//        } else if( selectedItem == 3) {&lt;br /&gt;
//            window.orientation = 3&lt;br /&gt;
//        } else if( selectedItem == 4) {&lt;br /&gt;
//            window.orientation = 0&lt;br /&gt;
//        }&lt;br /&gt;
//    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Item {&lt;br /&gt;
        id: contentButtons&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        // Some Debug output to stderr ...&lt;br /&gt;
        onVisibleChanged: {&lt;br /&gt;
            console.log(&amp;quot;xxxxxxxxxxxxxx 1 Parent wid &amp;quot;, parent.width);&lt;br /&gt;
            console.log(&amp;quot;xxxxxxxxxxxxxx 2 Wid        &amp;quot;, width);&lt;br /&gt;
        }&lt;br /&gt;
        onWidthChanged: {&lt;br /&gt;
            console.log(&amp;quot;wwwwwwwwwwwwww 1 Parent wid &amp;quot;, parent.width);&lt;br /&gt;
            console.log(&amp;quot;wwwwwwwwwwwwww 2 Wid        &amp;quot;, width);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        property int buttonWidth: parent.width * 0.2;&lt;br /&gt;
        property int buttonHeight: 60;&lt;br /&gt;
        property int buttonMargins: 2;&lt;br /&gt;
&lt;br /&gt;
        property string activeButtonImage: &amp;quot;image://themedimage/widgets/common/button/button-default&amp;quot;&lt;br /&gt;
        property string buttonImage: &amp;quot;image://themedimage/widgets/common/button/button&amp;quot;&lt;br /&gt;
        property string buttonImagePressed: &amp;quot;image://themedimage/widgets/common/button/button-default-pressed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        //width: 2 * buttonWidth + 3 * buttonMargins&lt;br /&gt;
        height: buttonHeight&lt;br /&gt;
        anchors.top: parent.top&lt;br /&gt;
        anchors.topMargin:  10&lt;br /&gt;
        anchors.horizontalCenter: parent.horizontalCenter&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Button {&lt;br /&gt;
            id: flagsButton&lt;br /&gt;
            active: true&lt;br /&gt;
            width:  parent.buttonWidth; height: parent.buttonHeight&lt;br /&gt;
&lt;br /&gt;
            // Since there are only two buttons, the right of this button is near the center.&lt;br /&gt;
            anchors { margins: parent.buttonMargins; right: parent.horizontalCenter;}&lt;br /&gt;
            text: qsTr(&amp;quot;Flags&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: {&lt;br /&gt;
                mainPage.state = &amp;quot;flags&amp;quot;&lt;br /&gt;
                active = true&lt;br /&gt;
                browserButton.active = false&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Button {&lt;br /&gt;
            id: browserButton&lt;br /&gt;
&lt;br /&gt;
            width:  parent.buttonWidth; height: parent.buttonHeight&lt;br /&gt;
&lt;br /&gt;
            // This button is to the right of the flags button&lt;br /&gt;
            anchors { margins: parent.buttonMargins; left: flagsButton.right }&lt;br /&gt;
            text: qsTr(&amp;quot;File Browser&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: {&lt;br /&gt;
                mainPage.state = &amp;quot;browser&amp;quot;&lt;br /&gt;
                active = true&lt;br /&gt;
                flagsButton.active = false&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // This item holds the contents of the selected button and fills the rest of the window&lt;br /&gt;
    Item {&lt;br /&gt;
        id: contentSpace&lt;br /&gt;
&lt;br /&gt;
        anchors { top: contentButtons.bottom; bottom: parent.bottom; left: parent.left; right: parent.right }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    // One of these two components will fill the contentSpace Item above.&lt;br /&gt;
    FlagContent    { id: flagContent;    anchors.fill: contentSpace; anchors.top: contentButtons.bottom }&lt;br /&gt;
&lt;br /&gt;
    //Placeholder until BrowserContent.qml is present&lt;br /&gt;
    Rectangle      { id: browserContent; anchors.fill: contentSpace; anchors.top: contentButtons.bottom; color: &amp;quot;red&amp;quot;; }&lt;br /&gt;
    //BrowserContent { id: browserContent; anchors.fill: contentSpace }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Rectangle { z: -1; anchors.fill: parent; color: &amp;quot;grey&amp;quot; } //background&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    states:  [&lt;br /&gt;
        State {&lt;br /&gt;
            name: &amp;quot;flags&amp;quot;&lt;br /&gt;
            PropertyChanges { target: flagContent; visible: true }&lt;br /&gt;
            PropertyChanges { target: browserContent; visible: false }&lt;br /&gt;
        },&lt;br /&gt;
        State {&lt;br /&gt;
            name: &amp;quot;browser&amp;quot;&lt;br /&gt;
            PropertyChanges { target: flagContent; visible: false }&lt;br /&gt;
            PropertyChanges { target: browserContent; visible: true }&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Add the File FlagContent.qml ====&lt;br /&gt;
&lt;br /&gt;
This shows an example of using a QML ListView - which uses a delegate for a row to be displayed&lt;br /&gt;
&lt;br /&gt;
The model statement references a C++ model called &amp;quot;myModel&amp;quot; defined in mymodel.{h,cpp}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import QtQuick 1.0&lt;br /&gt;
&lt;br /&gt;
    ListView {&lt;br /&gt;
        clip: true&lt;br /&gt;
        model: myModel&lt;br /&gt;
        anchors.top: parent.bottom&lt;br /&gt;
        anchors.fill: parent&lt;br /&gt;
        delegate: Rectangle {&lt;br /&gt;
            color: Qt.rgba(0.9,0.9,0.9)&lt;br /&gt;
            height: childrenRect.height&lt;br /&gt;
            width: parent.width&lt;br /&gt;
            Image {&lt;br /&gt;
                id: image&lt;br /&gt;
                source: flag&lt;br /&gt;
                width: 64&lt;br /&gt;
                height: 64&lt;br /&gt;
                fillMode: Image.PreserveAspectFit&lt;br /&gt;
&lt;br /&gt;
                anchors { left:parent.left; leftMargin:30}&lt;br /&gt;
            }&lt;br /&gt;
            Text {&lt;br /&gt;
                text: display + &amp;quot;\n&amp;quot; +&amp;quot;population: &amp;quot; + population + &amp;quot; mill.&amp;quot;&lt;br /&gt;
                anchors { left:image.right; verticalCenter: image.verticalCenter; leftMargin: 5 }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modify main.qml ====&lt;br /&gt;
Remove this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    AppPage { id: gallery; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Uncomment this line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Component { id: gallery; MainPage {} }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Copy Resource Files ====&lt;br /&gt;
Copy the images and .qrc file from the solution directory:&lt;br /&gt;
&lt;br /&gt;
Add this to your simple-app.pro&lt;br /&gt;
RESOURCES += resources.qrc&lt;br /&gt;
&lt;br /&gt;
==== Rebuild and Run ====&lt;br /&gt;
Since we added new .cpp and .h files, it would be a good idea to Build-&amp;gt;Run Qmake; Build-&amp;gt;Rebuild All&lt;br /&gt;
&lt;br /&gt;
Run...&lt;br /&gt;
&lt;br /&gt;
=== Adding code for the File Browser ===&lt;br /&gt;
To see another mini-app for the &amp;quot;Browser&amp;quot; button, copy these files to your project from the solution directory:&lt;br /&gt;
[[Media:Qml-button-ex-rename-to-tgz.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Move these files to your project's qml directory (sub directory of project)&lt;br /&gt;
BrowserContent.qml&lt;br /&gt;
FileSystemView.qml&lt;br /&gt;
ImageViewer.qml&lt;br /&gt;
PathDisplay.qml&lt;br /&gt;
&lt;br /&gt;
Move these files to your project's top-level directory&lt;br /&gt;
dirmodel.cpp&lt;br /&gt;
dirmodel.h&lt;br /&gt;
main.cpp (new code added to register a Directory Model with QML named &amp;quot;_model&amp;quot; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modify your project's .pro file by adding &lt;br /&gt;
*dirmodel.h to HEADERS&lt;br /&gt;
*dirmodel.cpp to SOURCES&lt;br /&gt;
&lt;br /&gt;
==== Replace these two lines in MainPage.qml:====&lt;br /&gt;
&lt;br /&gt;
We were using a generic red rectangle to hold a space for the BrowserContent Component, we can now use it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    Rectangle      { id: browserContent; anchors.fill: contentSpace; anchors.top: contentButtons.bottom; color: &amp;quot;red&amp;quot;; }&lt;br /&gt;
    //BrowserContent { id: browserContent; anchors.fill: contentSpace }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    BrowserContent { id: browserContent; anchors.fill: contentSpace }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Rebuild All ====&lt;br /&gt;
&lt;br /&gt;
==== Run ====&lt;br /&gt;
Clicking on the Browser button should allow you to browse the file system. If you click on a jpg or png, the image will be previewed.&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/QML/Sample_App_Using_CPP_Models</id>
		<title>QML/Sample App Using CPP Models</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/QML/Sample_App_Using_CPP_Models"/>
				<updated>2011-05-09T23:28:31Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: /* Adding code for the File Browser */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
This tutorial will demonstrate a simple (but non-trivial) app which uses&lt;br /&gt;
* Meego UX Component widgets&lt;br /&gt;
* C++ models&lt;br /&gt;
* QML List Views&lt;br /&gt;
* QML Components&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes you have the MeeGo SDK installed on Linux&amp;lt;br/&amp;gt;&lt;br /&gt;
See: http://wiki.meego.com/SDK/Docs/1.2/MeeGo_SDK_1.2_Preview&lt;br /&gt;
&lt;br /&gt;
Also assumed: you have a a chroot / Xephyr environment set up.&amp;lt;br/&amp;gt;&lt;br /&gt;
* http://wiki.meego.com/MeeGo_UX_Components_Chroot_Tutorial&lt;br /&gt;
* http://wiki.meego.com/Developing_in_a_MeeGo_Environment&lt;br /&gt;
&lt;br /&gt;
This tutorial will use meego-ux-components objects like:&lt;br /&gt;
* Book Menus - &lt;br /&gt;
* Buttons&lt;br /&gt;
* AppPage&lt;br /&gt;
For other uses of Meego UX Components, and another tutorial of Book Menus, See: &lt;br /&gt;
* http://wiki.meego.com/MeeGo_UX_Components&lt;br /&gt;
* http://wiki.meego.com/MeeGo_UX_Tutorials&lt;br /&gt;
&lt;br /&gt;
Other QML Tutorials:&lt;br /&gt;
* http://wiki.meego.com/QML_tutorials&lt;br /&gt;
&lt;br /&gt;
== Follow these steps on a chroot / Xephyr system ==&lt;br /&gt;
&lt;br /&gt;
=== Start Qt Creator ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qtcreator &amp;amp;&amp;gt;/dev/null &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create a new project ===&lt;br /&gt;
... screen shots ...&lt;br /&gt;
&lt;br /&gt;
==== The auto-generated QML File looks like this: ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import QtQuick 1.0&lt;br /&gt;
&lt;br /&gt;
Rectangle {&lt;br /&gt;
    width: 360&lt;br /&gt;
    height: 360&lt;br /&gt;
    Text {&lt;br /&gt;
        text: &amp;quot;Hello World&amp;quot;&lt;br /&gt;
        anchors.centerIn: parent&lt;br /&gt;
    }&lt;br /&gt;
    MouseArea {&lt;br /&gt;
        anchors.fill: parent&lt;br /&gt;
        onClicked: {&lt;br /&gt;
            Qt.quit();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Turn off Shadow Build====&lt;br /&gt;
&lt;br /&gt;
==== Build-&amp;gt;Build All ====&lt;br /&gt;
&lt;br /&gt;
=== Run ===&lt;br /&gt;
(CTRL-R or Green &amp;quot;Play&amp;quot; Button)&lt;br /&gt;
&lt;br /&gt;
==== The running app looks like this: ====&lt;br /&gt;
&amp;lt;screen shot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clicking it closes the app (Qt.quit())&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add code to main.qml ===&lt;br /&gt;
&lt;br /&gt;
==== Replace the contents of main.qml with this: ====&lt;br /&gt;
The last 2 Component statements are commented out so the app will run as is before creating more files.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import Qt 4.7&lt;br /&gt;
import MeeGo.Components 0.1&lt;br /&gt;
&lt;br /&gt;
Window {&lt;br /&gt;
    id: window&lt;br /&gt;
&lt;br /&gt;
    bookMenuModel: [ qsTr(&amp;quot;Button Demo&amp;quot;), qsTr(&amp;quot;Book 2&amp;quot;) ]&lt;br /&gt;
    bookMenuPayload: [ gallery, book2 ]&lt;br /&gt;
    bookMenuTitle: qsTr(&amp;quot;Book Menu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    Component.onCompleted: switchBook( gallery )&lt;br /&gt;
&lt;br /&gt;
    //Component { id: gallery; MainPage {} }&lt;br /&gt;
    //Component { id: book2; Book2 {} }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Test / Run ====&lt;br /&gt;
Run the app and see the Book Menu. If you click on one of the menu items, you'll notice an error because of the commented out Component statements.&lt;br /&gt;
&lt;br /&gt;
=== Add code for the Book Page example ===&lt;br /&gt;
==== Adding the Book2 Component ====&lt;br /&gt;
(from the meego-ux-widgetgallery example)&lt;br /&gt;
* (right click on the QML folder in the Projects view and Add New... / QML File / &amp;quot;Book2.qml&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
* Replace the generated file Book2.qml with this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2011 Intel Corporation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is licensed under the terms and conditions of the&lt;br /&gt;
 * LGPL, version 2.1.  The full text of the LGPL Licence is at&lt;br /&gt;
 * http://www.gnu.org/licenses/lgpl.html&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* This file contains relativy empty pages and is meant to demonstrate the&lt;br /&gt;
   book/page concept */&lt;br /&gt;
&lt;br /&gt;
import Qt 4.7&lt;br /&gt;
&lt;br /&gt;
PageDummy {&lt;br /&gt;
    id: pageDummy&lt;br /&gt;
&lt;br /&gt;
    innerText: qsTr(&amp;quot;book 2, page 1&amp;quot;)&lt;br /&gt;
    rectColor: &amp;quot;lightblue&amp;quot;&lt;br /&gt;
    showButton: true&lt;br /&gt;
    buttonLabel: qsTr(&amp;quot;Page 2&amp;quot;)&lt;br /&gt;
    pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    onClicked: { addPage( page2 ) }&lt;br /&gt;
&lt;br /&gt;
    Component{&lt;br /&gt;
        id: page2;&lt;br /&gt;
&lt;br /&gt;
        PageDummy {&lt;br /&gt;
            id: pageDummy2&lt;br /&gt;
&lt;br /&gt;
            innerText: qsTr(&amp;quot;book 2, page 2&amp;quot;)&lt;br /&gt;
            rectColor: &amp;quot;lightgreen&amp;quot;&lt;br /&gt;
            showButton: true&lt;br /&gt;
            buttonLabel: qsTr(&amp;quot;Page 3&amp;quot;)&lt;br /&gt;
            pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: { addPage( page3 )&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    Component{&lt;br /&gt;
        id: page3;&lt;br /&gt;
&lt;br /&gt;
        PageDummy {&lt;br /&gt;
            id: pageDummy3&lt;br /&gt;
&lt;br /&gt;
            innerText: qsTr(&amp;quot;book 2, page 3&amp;quot;)&lt;br /&gt;
            rectColor: &amp;quot;orange&amp;quot;&lt;br /&gt;
            showButton: true&lt;br /&gt;
            buttonLabel: qsTr(&amp;quot;Page 4&amp;quot;)&lt;br /&gt;
            pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: { addPage( page4 )&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    Component{&lt;br /&gt;
        id: page4;&lt;br /&gt;
&lt;br /&gt;
        PageDummy {&lt;br /&gt;
            id: pageDummy4&lt;br /&gt;
&lt;br /&gt;
            innerText: qsTr(&amp;quot;book 2, page 4&amp;quot;)&lt;br /&gt;
            rectColor: &amp;quot;darkgrey&amp;quot;&lt;br /&gt;
            pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Add PageDummy.qml ====&lt;br /&gt;
The file Book2.qml references PageDummy.qml, so create it the same way as Book2.qml&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2011 Intel Corporation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is licensed under the terms and conditions of the&lt;br /&gt;
 * LGPL, version 2.1.  The full text of the LGPL Licence is at&lt;br /&gt;
 * http://www.gnu.org/licenses/lgpl.html&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* This file is just meant as a dummy to quickly create pages for&lt;br /&gt;
   demonstrating the book/page concept. */&lt;br /&gt;
import Qt 4.7&lt;br /&gt;
import MeeGo.Components 0.1&lt;br /&gt;
&lt;br /&gt;
AppPage {&lt;br /&gt;
    id: pageDummy&lt;br /&gt;
&lt;br /&gt;
    property alias innerText: rectText.text //text shown in the rect&lt;br /&gt;
    property alias rectColor: innerRect.color   //color of the rect in the middle&lt;br /&gt;
    property alias showButton: nextButton.visible   //nextButton visible?&lt;br /&gt;
    property alias buttonLabel: nextButton.text    //nextButton label&lt;br /&gt;
    property string bookTitle: &amp;quot;book title&amp;quot; //shown in the title bar&lt;br /&gt;
&lt;br /&gt;
    signal clicked()&lt;br /&gt;
&lt;br /&gt;
    anchors.fill:  parent&lt;br /&gt;
&lt;br /&gt;
    Rectangle { z: -1; anchors.fill: parent; color: &amp;quot;grey&amp;quot; } //background&lt;br /&gt;
&lt;br /&gt;
    Rectangle {&lt;br /&gt;
        id: innerRect&lt;br /&gt;
&lt;br /&gt;
        anchors.fill: parent&lt;br /&gt;
        anchors.margins:  50&lt;br /&gt;
        color: &amp;quot;lightgreen&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Text {&lt;br /&gt;
            id: rectText&lt;br /&gt;
&lt;br /&gt;
            text: &amp;quot;dummy page&amp;quot;&lt;br /&gt;
            anchors.centerIn: parent&lt;br /&gt;
            font.pixelSize: 40&lt;br /&gt;
            color: &amp;quot;black&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    Button {&lt;br /&gt;
        id: nextButton&lt;br /&gt;
&lt;br /&gt;
        visible: false&lt;br /&gt;
        text: &amp;quot;next page &amp;gt;&amp;quot;&lt;br /&gt;
        anchors.right:  innerRect.right&lt;br /&gt;
        anchors.bottom:  innerRect.bottom&lt;br /&gt;
        anchors.margins: 10&lt;br /&gt;
        onClicked: { pageDummy.clicked() }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see the use of the meego-ux-components &amp;quot;Button&amp;quot; and &amp;quot;AppPage&amp;quot; components in PageDummy.qml&lt;br /&gt;
&lt;br /&gt;
==== Now, replace the two commented out Component statements in main.qml with:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    Component {&lt;br /&gt;
        id: gallery;&lt;br /&gt;
        AppPage {id: dummy2}&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Dummy page until MainPage.qml is defined&lt;br /&gt;
    AppPage { id: gallery; }&lt;br /&gt;
    //Component { id: gallery; MainPage {} }&lt;br /&gt;
&lt;br /&gt;
    Component { id: book2; Book2 {} }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the MainPage.qml file isn't created yet, we use a dummy AppPage placeholder temporarily to prevent a run-time error when invoking the menu.&lt;br /&gt;
&lt;br /&gt;
=== Run ===&lt;br /&gt;
You can now click on the Book2 menu and see a new page. &lt;br /&gt;
&lt;br /&gt;
=== Add code for seeing Custom List Views in the MainPage ===&lt;br /&gt;
&lt;br /&gt;
We will use a C++ QAbstractListModel to repersent out list.&lt;br /&gt;
&lt;br /&gt;
==== mymodel.h ====&lt;br /&gt;
Create the file mymodel.h by right-clicking on the simple-app project name and &amp;quot;Add New...&amp;quot; a C++ Header File&lt;br /&gt;
&lt;br /&gt;
Paste this into mymodel.h&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#ifndef MYMODEL_H&lt;br /&gt;
#define MYMODEL_H&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;QAbstractListModel&amp;gt;&lt;br /&gt;
#include &amp;lt;QColor&amp;gt;&lt;br /&gt;
&lt;br /&gt;
struct Data {&lt;br /&gt;
    Data( const char* name, const QString&amp;amp; flag, double population )&lt;br /&gt;
        : name(name), flag(flag), population(population) {}&lt;br /&gt;
    QString name;&lt;br /&gt;
    QString flag;&lt;br /&gt;
    double population;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
const int FlagRole = Qt::UserRole + 1;&lt;br /&gt;
const int PopulationRole = Qt::UserRole + 2;&lt;br /&gt;
class MyModel : public QAbstractListModel&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    MyModel();&lt;br /&gt;
    int rowCount( const QModelIndex&amp;amp; ) const;&lt;br /&gt;
    QVariant data( const QModelIndex&amp;amp; index, int role = Qt::DisplayRole ) const;&lt;br /&gt;
&lt;br /&gt;
    QList&amp;lt; Data &amp;gt; m_data;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#endif // MYMODEL_H&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the mymodel.cpp file with this content:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;mymodel.h&amp;quot;&lt;br /&gt;
#include &amp;lt;QByteArray&amp;gt;&lt;br /&gt;
MyModel::MyModel()&lt;br /&gt;
{&lt;br /&gt;
    m_data&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Denmark&amp;quot;, &amp;quot;qrc:images/denmark.jpg&amp;quot;, 5.4)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Sweden&amp;quot;, &amp;quot;qrc:images/sweden.jpg&amp;quot;, 9.3)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Iceland&amp;quot;, &amp;quot;qrc:images/iceland.jpg&amp;quot;, 3.2)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Norway&amp;quot;, &amp;quot;qrc:images/norway.jpg&amp;quot;, 4.8)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Finland&amp;quot;, &amp;quot;qrc:images/finland.jpg&amp;quot;, 5.3);&lt;br /&gt;
&lt;br /&gt;
    // By default the DisplayRole is mapped to the propery &amp;quot;display&amp;quot;&lt;br /&gt;
    QHash&amp;lt;int, QByteArray&amp;gt; mapping =roleNames();&lt;br /&gt;
    mapping.insert( FlagRole, &amp;quot;flag&amp;quot;);&lt;br /&gt;
    mapping.insert( PopulationRole, &amp;quot;population&amp;quot;);&lt;br /&gt;
    setRoleNames( mapping );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int MyModel::rowCount( const QModelIndex&amp;amp; ) const&lt;br /&gt;
{&lt;br /&gt;
    return m_data.count();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
QVariant MyModel::data(const QModelIndex &amp;amp;index, int role) const&lt;br /&gt;
{&lt;br /&gt;
    if ( !index.isValid() )&lt;br /&gt;
        return QVariant();&lt;br /&gt;
&lt;br /&gt;
    Data data = m_data[index.row()];&lt;br /&gt;
    if ( role == Qt::DisplayRole )&lt;br /&gt;
        return data.name;&lt;br /&gt;
    else if ( role == FlagRole )&lt;br /&gt;
        return data.flag;&lt;br /&gt;
    else if ( role == PopulationRole )&lt;br /&gt;
        return data.population;&lt;br /&gt;
    else&lt;br /&gt;
        return QVariant();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modify main.cpp ====&lt;br /&gt;
Modify main.cpp by replacing its contents with this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;QtGui/QApplication&amp;gt;&lt;br /&gt;
#include &amp;lt;QDeclarativeEngine&amp;gt;&lt;br /&gt;
#include &amp;lt;QDeclarativeContext&amp;gt;&lt;br /&gt;
#include &amp;quot;qmlapplicationviewer.h&amp;quot;&lt;br /&gt;
#include &amp;quot;mymodel.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
    QApplication app(argc, argv);&lt;br /&gt;
&lt;br /&gt;
    MyModel model;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    QmlApplicationViewer viewer;&lt;br /&gt;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);&lt;br /&gt;
    viewer.setMainQmlFile(QLatin1String(&amp;quot;qml/simple-app/main.qml&amp;quot;));&lt;br /&gt;
    viewer.showExpanded();&lt;br /&gt;
&lt;br /&gt;
    // Register the model &amp;quot;myModel&amp;quot; with QML&lt;br /&gt;
    QDeclarativeContext *context = viewer.engine()-&amp;gt;rootContext();&lt;br /&gt;
    context-&amp;gt;setContextProperty(&amp;quot;myModel&amp;quot;, &amp;amp;model);&lt;br /&gt;
&lt;br /&gt;
    return app.exec();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Add the file MainPage.qml ====&lt;br /&gt;
&lt;br /&gt;
A Component called MainPage.qml which will display row of Buttons that act like Tabs in a QTabView.&lt;br /&gt;
&lt;br /&gt;
The area below the buttons are filled with one of two mini-apps (List View sample, and mini file browser)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2011 Intel Corporation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is licensed under the terms and conditions of the&lt;br /&gt;
 * LGPL, version 2.1.  The full text of the LGPL Licence is at&lt;br /&gt;
 * http://www.gnu.org/licenses/lgpl.html&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* The MainPage lets the user switch between different contents which&lt;br /&gt;
   show the widgets available in these components. */&lt;br /&gt;
&lt;br /&gt;
//import Qt 4.7&lt;br /&gt;
import QtQuick 1.0&lt;br /&gt;
import MeeGo.Components 0.1&lt;br /&gt;
&lt;br /&gt;
AppPage {&lt;br /&gt;
    id: mainPage&lt;br /&gt;
&lt;br /&gt;
    // This will be the first app / content displayed in the Button Demo page&lt;br /&gt;
    state: &amp;quot;flags&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    pageTitle: qsTr(&amp;quot;Button Demo&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    // Demo an Action Menu......&lt;br /&gt;
    // Comment the block below to see a new Action Menu&lt;br /&gt;
&lt;br /&gt;
//    actionMenuModel: [ qsTr(&amp;quot;Landscape&amp;quot;),&lt;br /&gt;
//                       qsTr(&amp;quot;Portrait&amp;quot;),&lt;br /&gt;
//                       qsTr(&amp;quot;Inv. Landscape&amp;quot;),&lt;br /&gt;
//                       qsTr(&amp;quot;Inv. Portrait&amp;quot;) ]&lt;br /&gt;
//    actionMenuPayload: [  1, 2, 3, 4 ]&lt;br /&gt;
//    actionMenuTitle: qsTr(&amp;quot;Action Menu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
//    onActionMenuTriggered: {&lt;br /&gt;
&lt;br /&gt;
//        if( selectedItem == 1) {&lt;br /&gt;
//            window.orientation = 1&lt;br /&gt;
//        } else if( selectedItem == 2) {&lt;br /&gt;
//            window.orientation = 2&lt;br /&gt;
//        } else if( selectedItem == 3) {&lt;br /&gt;
//            window.orientation = 3&lt;br /&gt;
//        } else if( selectedItem == 4) {&lt;br /&gt;
//            window.orientation = 0&lt;br /&gt;
//        }&lt;br /&gt;
//    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Item {&lt;br /&gt;
        id: contentButtons&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        // Some Debug output to stderr ...&lt;br /&gt;
        onVisibleChanged: {&lt;br /&gt;
            console.log(&amp;quot;xxxxxxxxxxxxxx 1 Parent wid &amp;quot;, parent.width);&lt;br /&gt;
            console.log(&amp;quot;xxxxxxxxxxxxxx 2 Wid        &amp;quot;, width);&lt;br /&gt;
        }&lt;br /&gt;
        onWidthChanged: {&lt;br /&gt;
            console.log(&amp;quot;wwwwwwwwwwwwww 1 Parent wid &amp;quot;, parent.width);&lt;br /&gt;
            console.log(&amp;quot;wwwwwwwwwwwwww 2 Wid        &amp;quot;, width);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        property int buttonWidth: parent.width * 0.2;&lt;br /&gt;
        property int buttonHeight: 60;&lt;br /&gt;
        property int buttonMargins: 2;&lt;br /&gt;
&lt;br /&gt;
        property string activeButtonImage: &amp;quot;image://themedimage/widgets/common/button/button-default&amp;quot;&lt;br /&gt;
        property string buttonImage: &amp;quot;image://themedimage/widgets/common/button/button&amp;quot;&lt;br /&gt;
        property string buttonImagePressed: &amp;quot;image://themedimage/widgets/common/button/button-default-pressed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        //width: 2 * buttonWidth + 3 * buttonMargins&lt;br /&gt;
        height: buttonHeight&lt;br /&gt;
        anchors.top: parent.top&lt;br /&gt;
        anchors.topMargin:  10&lt;br /&gt;
        anchors.horizontalCenter: parent.horizontalCenter&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Button {&lt;br /&gt;
            id: flagsButton&lt;br /&gt;
            active: true&lt;br /&gt;
            width:  parent.buttonWidth; height: parent.buttonHeight&lt;br /&gt;
&lt;br /&gt;
            // Since there are only two buttons, the right of this button is near the center.&lt;br /&gt;
            anchors { margins: parent.buttonMargins; right: parent.horizontalCenter;}&lt;br /&gt;
            text: qsTr(&amp;quot;Flags&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: {&lt;br /&gt;
                mainPage.state = &amp;quot;flags&amp;quot;&lt;br /&gt;
                active = true&lt;br /&gt;
                browserButton.active = false&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Button {&lt;br /&gt;
            id: browserButton&lt;br /&gt;
&lt;br /&gt;
            width:  parent.buttonWidth; height: parent.buttonHeight&lt;br /&gt;
&lt;br /&gt;
            // This button is to the right of the flags button&lt;br /&gt;
            anchors { margins: parent.buttonMargins; left: flagsButton.right }&lt;br /&gt;
            text: qsTr(&amp;quot;File Browser&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: {&lt;br /&gt;
                mainPage.state = &amp;quot;browser&amp;quot;&lt;br /&gt;
                active = true&lt;br /&gt;
                flagsButton.active = false&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // This item holds the contents of the selected button and fills the rest of the window&lt;br /&gt;
    Item {&lt;br /&gt;
        id: contentSpace&lt;br /&gt;
&lt;br /&gt;
        anchors { top: contentButtons.bottom; bottom: parent.bottom; left: parent.left; right: parent.right }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    // One of these two components will fill the contentSpace Item above.&lt;br /&gt;
    FlagContent    { id: flagContent;    anchors.fill: contentSpace; anchors.top: contentButtons.bottom }&lt;br /&gt;
&lt;br /&gt;
    //Placeholder until BrowserContent.qml is present&lt;br /&gt;
    Rectangle      { id: browserContent; anchors.fill: contentSpace; anchors.top: contentButtons.bottom; color: &amp;quot;red&amp;quot;; }&lt;br /&gt;
    //BrowserContent { id: browserContent; anchors.fill: contentSpace }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Rectangle { z: -1; anchors.fill: parent; color: &amp;quot;grey&amp;quot; } //background&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    states:  [&lt;br /&gt;
        State {&lt;br /&gt;
            name: &amp;quot;flags&amp;quot;&lt;br /&gt;
            PropertyChanges { target: flagContent; visible: true }&lt;br /&gt;
            PropertyChanges { target: browserContent; visible: false }&lt;br /&gt;
        },&lt;br /&gt;
        State {&lt;br /&gt;
            name: &amp;quot;browser&amp;quot;&lt;br /&gt;
            PropertyChanges { target: flagContent; visible: false }&lt;br /&gt;
            PropertyChanges { target: browserContent; visible: true }&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Add the File FlagContent.qml ====&lt;br /&gt;
&lt;br /&gt;
This shows an example of using a QML ListView - which uses a delegate for a row to be displayed&lt;br /&gt;
&lt;br /&gt;
The model statement references a C++ model called &amp;quot;myModel&amp;quot; defined in mymodel.{h,cpp}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import QtQuick 1.0&lt;br /&gt;
&lt;br /&gt;
    ListView {&lt;br /&gt;
        clip: true&lt;br /&gt;
        model: myModel&lt;br /&gt;
        anchors.top: parent.bottom&lt;br /&gt;
        anchors.fill: parent&lt;br /&gt;
        delegate: Rectangle {&lt;br /&gt;
            color: Qt.rgba(0.9,0.9,0.9)&lt;br /&gt;
            height: childrenRect.height&lt;br /&gt;
            width: parent.width&lt;br /&gt;
            Image {&lt;br /&gt;
                id: image&lt;br /&gt;
                source: flag&lt;br /&gt;
                width: 64&lt;br /&gt;
                height: 64&lt;br /&gt;
                fillMode: Image.PreserveAspectFit&lt;br /&gt;
&lt;br /&gt;
                anchors { left:parent.left; leftMargin:30}&lt;br /&gt;
            }&lt;br /&gt;
            Text {&lt;br /&gt;
                text: display + &amp;quot;\n&amp;quot; +&amp;quot;population: &amp;quot; + population + &amp;quot; mill.&amp;quot;&lt;br /&gt;
                anchors { left:image.right; verticalCenter: image.verticalCenter; leftMargin: 5 }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modify main.qml ====&lt;br /&gt;
Remove this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    AppPage { id: gallery; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Uncomment this line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Component { id: gallery; MainPage {} }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Copy Resource Files ====&lt;br /&gt;
Copy the images and .qrc file from the solution directory:&lt;br /&gt;
&lt;br /&gt;
Add this to your simple-app.pro&lt;br /&gt;
RESOURCES += resources.qrc&lt;br /&gt;
&lt;br /&gt;
==== Rebuild and Run ====&lt;br /&gt;
Since we added new .cpp and .h files, it would be a good idea to Build-&amp;gt;Run Qmake; Build-&amp;gt;Rebuild All&lt;br /&gt;
&lt;br /&gt;
Run...&lt;br /&gt;
&lt;br /&gt;
=== Adding code for the File Browser ===&lt;br /&gt;
To see another mini-app for the &amp;quot;Browser&amp;quot; button, copy these files to your project from the solution directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Move these files to your project's qml directory (sub directory of project)&lt;br /&gt;
BrowserContent.qml&lt;br /&gt;
FileSystemView.qml&lt;br /&gt;
ImageViewer.qml&lt;br /&gt;
PathDisplay.qml&lt;br /&gt;
&lt;br /&gt;
Move these files to your project's top-level directory&lt;br /&gt;
dirmodel.cpp&lt;br /&gt;
dirmodel.h&lt;br /&gt;
main.cpp (new code added to register a Directory Model with QML named &amp;quot;_model&amp;quot; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modify your project's .pro file by adding &lt;br /&gt;
*dirmodel.h to HEADERS&lt;br /&gt;
*dirmodel.cpp to SOURCES&lt;br /&gt;
&lt;br /&gt;
==== Replace these two lines in MainPage.qml:====&lt;br /&gt;
&lt;br /&gt;
We were using a generic red rectangle to hold a space for the BrowserContent Component, we can now use it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    Rectangle      { id: browserContent; anchors.fill: contentSpace; anchors.top: contentButtons.bottom; color: &amp;quot;red&amp;quot;; }&lt;br /&gt;
    //BrowserContent { id: browserContent; anchors.fill: contentSpace }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    BrowserContent { id: browserContent; anchors.fill: contentSpace }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Rebuild All ====&lt;br /&gt;
&lt;br /&gt;
==== Run ====&lt;br /&gt;
Clicking on the Browser button should allow you to browse the file system. If you click on a jpg or png, the image will be previewed.&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/File:Qml-button-ex-rename-to-tgz.jpg</id>
		<title>File:Qml-button-ex-rename-to-tgz.jpg</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/File:Qml-button-ex-rename-to-tgz.jpg"/>
				<updated>2011-05-06T23:56:23Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: This is a .tgz file renamed to .jpg so it will upload.

Please rename to qml-button-ex.tgz

QML / C++ Project for completed project associated with http://wiki.meego.com/QML/Sample_App_Using_CPP_Models

This is the &amp;quot;solution&amp;quot; project referenced there&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a .tgz file renamed to .jpg so it will upload.&lt;br /&gt;
&lt;br /&gt;
Please rename to qml-button-ex.tgz&lt;br /&gt;
&lt;br /&gt;
QML / C++ Project for completed project associated with http://wiki.meego.com/QML/Sample_App_Using_CPP_Models&lt;br /&gt;
&lt;br /&gt;
This is the &amp;quot;solution&amp;quot; project referenced there&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/QML/Sample_App_Using_CPP_Models</id>
		<title>QML/Sample App Using CPP Models</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/QML/Sample_App_Using_CPP_Models"/>
				<updated>2011-05-06T23:39:27Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: /* Replace these two lines in MainPage.qml: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
This tutorial will demonstrate a simple (but non-trivial) app which uses&lt;br /&gt;
* Meego UX Component widgets&lt;br /&gt;
* C++ models&lt;br /&gt;
* QML List Views&lt;br /&gt;
* QML Components&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes you have the MeeGo SDK installed on Linux&amp;lt;br/&amp;gt;&lt;br /&gt;
See: http://wiki.meego.com/SDK/Docs/1.2/MeeGo_SDK_1.2_Preview&lt;br /&gt;
&lt;br /&gt;
Also assumed: you have a a chroot / Xephyr environment set up.&amp;lt;br/&amp;gt;&lt;br /&gt;
* http://wiki.meego.com/MeeGo_UX_Components_Chroot_Tutorial&lt;br /&gt;
* http://wiki.meego.com/Developing_in_a_MeeGo_Environment&lt;br /&gt;
&lt;br /&gt;
This tutorial will use meego-ux-components objects like:&lt;br /&gt;
* Book Menus - &lt;br /&gt;
* Buttons&lt;br /&gt;
* AppPage&lt;br /&gt;
For other uses of Meego UX Components, and another tutorial of Book Menus, See: &lt;br /&gt;
* http://wiki.meego.com/MeeGo_UX_Components&lt;br /&gt;
* http://wiki.meego.com/MeeGo_UX_Tutorials&lt;br /&gt;
&lt;br /&gt;
Other QML Tutorials:&lt;br /&gt;
* http://wiki.meego.com/QML_tutorials&lt;br /&gt;
&lt;br /&gt;
== Follow these steps on a chroot / Xephyr system ==&lt;br /&gt;
&lt;br /&gt;
=== Start Qt Creator ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qtcreator &amp;amp;&amp;gt;/dev/null &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create a new project ===&lt;br /&gt;
... screen shots ...&lt;br /&gt;
&lt;br /&gt;
==== The auto-generated QML File looks like this: ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import QtQuick 1.0&lt;br /&gt;
&lt;br /&gt;
Rectangle {&lt;br /&gt;
    width: 360&lt;br /&gt;
    height: 360&lt;br /&gt;
    Text {&lt;br /&gt;
        text: &amp;quot;Hello World&amp;quot;&lt;br /&gt;
        anchors.centerIn: parent&lt;br /&gt;
    }&lt;br /&gt;
    MouseArea {&lt;br /&gt;
        anchors.fill: parent&lt;br /&gt;
        onClicked: {&lt;br /&gt;
            Qt.quit();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Turn off Shadow Build====&lt;br /&gt;
&lt;br /&gt;
==== Build-&amp;gt;Build All ====&lt;br /&gt;
&lt;br /&gt;
=== Run ===&lt;br /&gt;
(CTRL-R or Green &amp;quot;Play&amp;quot; Button)&lt;br /&gt;
&lt;br /&gt;
==== The running app looks like this: ====&lt;br /&gt;
&amp;lt;screen shot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clicking it closes the app (Qt.quit())&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add code to main.qml ===&lt;br /&gt;
&lt;br /&gt;
==== Replace the contents of main.qml with this: ====&lt;br /&gt;
The last 2 Component statements are commented out so the app will run as is before creating more files.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import Qt 4.7&lt;br /&gt;
import MeeGo.Components 0.1&lt;br /&gt;
&lt;br /&gt;
Window {&lt;br /&gt;
    id: window&lt;br /&gt;
&lt;br /&gt;
    bookMenuModel: [ qsTr(&amp;quot;Button Demo&amp;quot;), qsTr(&amp;quot;Book 2&amp;quot;) ]&lt;br /&gt;
    bookMenuPayload: [ gallery, book2 ]&lt;br /&gt;
    bookMenuTitle: qsTr(&amp;quot;Book Menu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    Component.onCompleted: switchBook( gallery )&lt;br /&gt;
&lt;br /&gt;
    //Component { id: gallery; MainPage {} }&lt;br /&gt;
    //Component { id: book2; Book2 {} }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Test / Run ====&lt;br /&gt;
Run the app and see the Book Menu. If you click on one of the menu items, you'll notice an error because of the commented out Component statements.&lt;br /&gt;
&lt;br /&gt;
=== Add code for the Book Page example ===&lt;br /&gt;
==== Adding the Book2 Component ====&lt;br /&gt;
(from the meego-ux-widgetgallery example)&lt;br /&gt;
* (right click on the QML folder in the Projects view and Add New... / QML File / &amp;quot;Book2.qml&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
* Replace the generated file Book2.qml with this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2011 Intel Corporation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is licensed under the terms and conditions of the&lt;br /&gt;
 * LGPL, version 2.1.  The full text of the LGPL Licence is at&lt;br /&gt;
 * http://www.gnu.org/licenses/lgpl.html&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* This file contains relativy empty pages and is meant to demonstrate the&lt;br /&gt;
   book/page concept */&lt;br /&gt;
&lt;br /&gt;
import Qt 4.7&lt;br /&gt;
&lt;br /&gt;
PageDummy {&lt;br /&gt;
    id: pageDummy&lt;br /&gt;
&lt;br /&gt;
    innerText: qsTr(&amp;quot;book 2, page 1&amp;quot;)&lt;br /&gt;
    rectColor: &amp;quot;lightblue&amp;quot;&lt;br /&gt;
    showButton: true&lt;br /&gt;
    buttonLabel: qsTr(&amp;quot;Page 2&amp;quot;)&lt;br /&gt;
    pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    onClicked: { addPage( page2 ) }&lt;br /&gt;
&lt;br /&gt;
    Component{&lt;br /&gt;
        id: page2;&lt;br /&gt;
&lt;br /&gt;
        PageDummy {&lt;br /&gt;
            id: pageDummy2&lt;br /&gt;
&lt;br /&gt;
            innerText: qsTr(&amp;quot;book 2, page 2&amp;quot;)&lt;br /&gt;
            rectColor: &amp;quot;lightgreen&amp;quot;&lt;br /&gt;
            showButton: true&lt;br /&gt;
            buttonLabel: qsTr(&amp;quot;Page 3&amp;quot;)&lt;br /&gt;
            pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: { addPage( page3 )&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    Component{&lt;br /&gt;
        id: page3;&lt;br /&gt;
&lt;br /&gt;
        PageDummy {&lt;br /&gt;
            id: pageDummy3&lt;br /&gt;
&lt;br /&gt;
            innerText: qsTr(&amp;quot;book 2, page 3&amp;quot;)&lt;br /&gt;
            rectColor: &amp;quot;orange&amp;quot;&lt;br /&gt;
            showButton: true&lt;br /&gt;
            buttonLabel: qsTr(&amp;quot;Page 4&amp;quot;)&lt;br /&gt;
            pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: { addPage( page4 )&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    Component{&lt;br /&gt;
        id: page4;&lt;br /&gt;
&lt;br /&gt;
        PageDummy {&lt;br /&gt;
            id: pageDummy4&lt;br /&gt;
&lt;br /&gt;
            innerText: qsTr(&amp;quot;book 2, page 4&amp;quot;)&lt;br /&gt;
            rectColor: &amp;quot;darkgrey&amp;quot;&lt;br /&gt;
            pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Add PageDummy.qml ====&lt;br /&gt;
The file Book2.qml references PageDummy.qml, so create it the same way as Book2.qml&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2011 Intel Corporation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is licensed under the terms and conditions of the&lt;br /&gt;
 * LGPL, version 2.1.  The full text of the LGPL Licence is at&lt;br /&gt;
 * http://www.gnu.org/licenses/lgpl.html&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* This file is just meant as a dummy to quickly create pages for&lt;br /&gt;
   demonstrating the book/page concept. */&lt;br /&gt;
import Qt 4.7&lt;br /&gt;
import MeeGo.Components 0.1&lt;br /&gt;
&lt;br /&gt;
AppPage {&lt;br /&gt;
    id: pageDummy&lt;br /&gt;
&lt;br /&gt;
    property alias innerText: rectText.text //text shown in the rect&lt;br /&gt;
    property alias rectColor: innerRect.color   //color of the rect in the middle&lt;br /&gt;
    property alias showButton: nextButton.visible   //nextButton visible?&lt;br /&gt;
    property alias buttonLabel: nextButton.text    //nextButton label&lt;br /&gt;
    property string bookTitle: &amp;quot;book title&amp;quot; //shown in the title bar&lt;br /&gt;
&lt;br /&gt;
    signal clicked()&lt;br /&gt;
&lt;br /&gt;
    anchors.fill:  parent&lt;br /&gt;
&lt;br /&gt;
    Rectangle { z: -1; anchors.fill: parent; color: &amp;quot;grey&amp;quot; } //background&lt;br /&gt;
&lt;br /&gt;
    Rectangle {&lt;br /&gt;
        id: innerRect&lt;br /&gt;
&lt;br /&gt;
        anchors.fill: parent&lt;br /&gt;
        anchors.margins:  50&lt;br /&gt;
        color: &amp;quot;lightgreen&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Text {&lt;br /&gt;
            id: rectText&lt;br /&gt;
&lt;br /&gt;
            text: &amp;quot;dummy page&amp;quot;&lt;br /&gt;
            anchors.centerIn: parent&lt;br /&gt;
            font.pixelSize: 40&lt;br /&gt;
            color: &amp;quot;black&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    Button {&lt;br /&gt;
        id: nextButton&lt;br /&gt;
&lt;br /&gt;
        visible: false&lt;br /&gt;
        text: &amp;quot;next page &amp;gt;&amp;quot;&lt;br /&gt;
        anchors.right:  innerRect.right&lt;br /&gt;
        anchors.bottom:  innerRect.bottom&lt;br /&gt;
        anchors.margins: 10&lt;br /&gt;
        onClicked: { pageDummy.clicked() }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see the use of the meego-ux-components &amp;quot;Button&amp;quot; and &amp;quot;AppPage&amp;quot; components in PageDummy.qml&lt;br /&gt;
&lt;br /&gt;
==== Now, replace the two commented out Component statements in main.qml with:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    Component {&lt;br /&gt;
        id: gallery;&lt;br /&gt;
        AppPage {id: dummy2}&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Dummy page until MainPage.qml is defined&lt;br /&gt;
    AppPage { id: gallery; }&lt;br /&gt;
    //Component { id: gallery; MainPage {} }&lt;br /&gt;
&lt;br /&gt;
    Component { id: book2; Book2 {} }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the MainPage.qml file isn't created yet, we use a dummy AppPage placeholder temporarily to prevent a run-time error when invoking the menu.&lt;br /&gt;
&lt;br /&gt;
=== Run ===&lt;br /&gt;
You can now click on the Book2 menu and see a new page. &lt;br /&gt;
&lt;br /&gt;
=== Add code for seeing Custom List Views in the MainPage ===&lt;br /&gt;
&lt;br /&gt;
We will use a C++ QAbstractListModel to repersent out list.&lt;br /&gt;
&lt;br /&gt;
==== mymodel.h ====&lt;br /&gt;
Create the file mymodel.h by right-clicking on the simple-app project name and &amp;quot;Add New...&amp;quot; a C++ Header File&lt;br /&gt;
&lt;br /&gt;
Paste this into mymodel.h&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#ifndef MYMODEL_H&lt;br /&gt;
#define MYMODEL_H&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;QAbstractListModel&amp;gt;&lt;br /&gt;
#include &amp;lt;QColor&amp;gt;&lt;br /&gt;
&lt;br /&gt;
struct Data {&lt;br /&gt;
    Data( const char* name, const QString&amp;amp; flag, double population )&lt;br /&gt;
        : name(name), flag(flag), population(population) {}&lt;br /&gt;
    QString name;&lt;br /&gt;
    QString flag;&lt;br /&gt;
    double population;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
const int FlagRole = Qt::UserRole + 1;&lt;br /&gt;
const int PopulationRole = Qt::UserRole + 2;&lt;br /&gt;
class MyModel : public QAbstractListModel&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    MyModel();&lt;br /&gt;
    int rowCount( const QModelIndex&amp;amp; ) const;&lt;br /&gt;
    QVariant data( const QModelIndex&amp;amp; index, int role = Qt::DisplayRole ) const;&lt;br /&gt;
&lt;br /&gt;
    QList&amp;lt; Data &amp;gt; m_data;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#endif // MYMODEL_H&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the mymodel.cpp file with this content:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;mymodel.h&amp;quot;&lt;br /&gt;
#include &amp;lt;QByteArray&amp;gt;&lt;br /&gt;
MyModel::MyModel()&lt;br /&gt;
{&lt;br /&gt;
    m_data&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Denmark&amp;quot;, &amp;quot;qrc:images/denmark.jpg&amp;quot;, 5.4)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Sweden&amp;quot;, &amp;quot;qrc:images/sweden.jpg&amp;quot;, 9.3)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Iceland&amp;quot;, &amp;quot;qrc:images/iceland.jpg&amp;quot;, 3.2)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Norway&amp;quot;, &amp;quot;qrc:images/norway.jpg&amp;quot;, 4.8)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Finland&amp;quot;, &amp;quot;qrc:images/finland.jpg&amp;quot;, 5.3);&lt;br /&gt;
&lt;br /&gt;
    // By default the DisplayRole is mapped to the propery &amp;quot;display&amp;quot;&lt;br /&gt;
    QHash&amp;lt;int, QByteArray&amp;gt; mapping =roleNames();&lt;br /&gt;
    mapping.insert( FlagRole, &amp;quot;flag&amp;quot;);&lt;br /&gt;
    mapping.insert( PopulationRole, &amp;quot;population&amp;quot;);&lt;br /&gt;
    setRoleNames( mapping );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int MyModel::rowCount( const QModelIndex&amp;amp; ) const&lt;br /&gt;
{&lt;br /&gt;
    return m_data.count();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
QVariant MyModel::data(const QModelIndex &amp;amp;index, int role) const&lt;br /&gt;
{&lt;br /&gt;
    if ( !index.isValid() )&lt;br /&gt;
        return QVariant();&lt;br /&gt;
&lt;br /&gt;
    Data data = m_data[index.row()];&lt;br /&gt;
    if ( role == Qt::DisplayRole )&lt;br /&gt;
        return data.name;&lt;br /&gt;
    else if ( role == FlagRole )&lt;br /&gt;
        return data.flag;&lt;br /&gt;
    else if ( role == PopulationRole )&lt;br /&gt;
        return data.population;&lt;br /&gt;
    else&lt;br /&gt;
        return QVariant();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modify main.cpp ====&lt;br /&gt;
Modify main.cpp by replacing its contents with this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;QtGui/QApplication&amp;gt;&lt;br /&gt;
#include &amp;lt;QDeclarativeEngine&amp;gt;&lt;br /&gt;
#include &amp;lt;QDeclarativeContext&amp;gt;&lt;br /&gt;
#include &amp;quot;qmlapplicationviewer.h&amp;quot;&lt;br /&gt;
#include &amp;quot;mymodel.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
    QApplication app(argc, argv);&lt;br /&gt;
&lt;br /&gt;
    MyModel model;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    QmlApplicationViewer viewer;&lt;br /&gt;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);&lt;br /&gt;
    viewer.setMainQmlFile(QLatin1String(&amp;quot;qml/simple-app/main.qml&amp;quot;));&lt;br /&gt;
    viewer.showExpanded();&lt;br /&gt;
&lt;br /&gt;
    // Register the model &amp;quot;myModel&amp;quot; with QML&lt;br /&gt;
    QDeclarativeContext *context = viewer.engine()-&amp;gt;rootContext();&lt;br /&gt;
    context-&amp;gt;setContextProperty(&amp;quot;myModel&amp;quot;, &amp;amp;model);&lt;br /&gt;
&lt;br /&gt;
    return app.exec();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Add the file MainPage.qml ====&lt;br /&gt;
&lt;br /&gt;
A Component called MainPage.qml which will display row of Buttons that act like Tabs in a QTabView.&lt;br /&gt;
&lt;br /&gt;
The area below the buttons are filled with one of two mini-apps (List View sample, and mini file browser)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2011 Intel Corporation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is licensed under the terms and conditions of the&lt;br /&gt;
 * LGPL, version 2.1.  The full text of the LGPL Licence is at&lt;br /&gt;
 * http://www.gnu.org/licenses/lgpl.html&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* The MainPage lets the user switch between different contents which&lt;br /&gt;
   show the widgets available in these components. */&lt;br /&gt;
&lt;br /&gt;
//import Qt 4.7&lt;br /&gt;
import QtQuick 1.0&lt;br /&gt;
import MeeGo.Components 0.1&lt;br /&gt;
&lt;br /&gt;
AppPage {&lt;br /&gt;
    id: mainPage&lt;br /&gt;
&lt;br /&gt;
    // This will be the first app / content displayed in the Button Demo page&lt;br /&gt;
    state: &amp;quot;flags&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    pageTitle: qsTr(&amp;quot;Button Demo&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    // Demo an Action Menu......&lt;br /&gt;
    // Comment the block below to see a new Action Menu&lt;br /&gt;
&lt;br /&gt;
//    actionMenuModel: [ qsTr(&amp;quot;Landscape&amp;quot;),&lt;br /&gt;
//                       qsTr(&amp;quot;Portrait&amp;quot;),&lt;br /&gt;
//                       qsTr(&amp;quot;Inv. Landscape&amp;quot;),&lt;br /&gt;
//                       qsTr(&amp;quot;Inv. Portrait&amp;quot;) ]&lt;br /&gt;
//    actionMenuPayload: [  1, 2, 3, 4 ]&lt;br /&gt;
//    actionMenuTitle: qsTr(&amp;quot;Action Menu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
//    onActionMenuTriggered: {&lt;br /&gt;
&lt;br /&gt;
//        if( selectedItem == 1) {&lt;br /&gt;
//            window.orientation = 1&lt;br /&gt;
//        } else if( selectedItem == 2) {&lt;br /&gt;
//            window.orientation = 2&lt;br /&gt;
//        } else if( selectedItem == 3) {&lt;br /&gt;
//            window.orientation = 3&lt;br /&gt;
//        } else if( selectedItem == 4) {&lt;br /&gt;
//            window.orientation = 0&lt;br /&gt;
//        }&lt;br /&gt;
//    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Item {&lt;br /&gt;
        id: contentButtons&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        // Some Debug output to stderr ...&lt;br /&gt;
        onVisibleChanged: {&lt;br /&gt;
            console.log(&amp;quot;xxxxxxxxxxxxxx 1 Parent wid &amp;quot;, parent.width);&lt;br /&gt;
            console.log(&amp;quot;xxxxxxxxxxxxxx 2 Wid        &amp;quot;, width);&lt;br /&gt;
        }&lt;br /&gt;
        onWidthChanged: {&lt;br /&gt;
            console.log(&amp;quot;wwwwwwwwwwwwww 1 Parent wid &amp;quot;, parent.width);&lt;br /&gt;
            console.log(&amp;quot;wwwwwwwwwwwwww 2 Wid        &amp;quot;, width);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        property int buttonWidth: parent.width * 0.2;&lt;br /&gt;
        property int buttonHeight: 60;&lt;br /&gt;
        property int buttonMargins: 2;&lt;br /&gt;
&lt;br /&gt;
        property string activeButtonImage: &amp;quot;image://themedimage/widgets/common/button/button-default&amp;quot;&lt;br /&gt;
        property string buttonImage: &amp;quot;image://themedimage/widgets/common/button/button&amp;quot;&lt;br /&gt;
        property string buttonImagePressed: &amp;quot;image://themedimage/widgets/common/button/button-default-pressed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        //width: 2 * buttonWidth + 3 * buttonMargins&lt;br /&gt;
        height: buttonHeight&lt;br /&gt;
        anchors.top: parent.top&lt;br /&gt;
        anchors.topMargin:  10&lt;br /&gt;
        anchors.horizontalCenter: parent.horizontalCenter&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Button {&lt;br /&gt;
            id: flagsButton&lt;br /&gt;
            active: true&lt;br /&gt;
            width:  parent.buttonWidth; height: parent.buttonHeight&lt;br /&gt;
&lt;br /&gt;
            // Since there are only two buttons, the right of this button is near the center.&lt;br /&gt;
            anchors { margins: parent.buttonMargins; right: parent.horizontalCenter;}&lt;br /&gt;
            text: qsTr(&amp;quot;Flags&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: {&lt;br /&gt;
                mainPage.state = &amp;quot;flags&amp;quot;&lt;br /&gt;
                active = true&lt;br /&gt;
                browserButton.active = false&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Button {&lt;br /&gt;
            id: browserButton&lt;br /&gt;
&lt;br /&gt;
            width:  parent.buttonWidth; height: parent.buttonHeight&lt;br /&gt;
&lt;br /&gt;
            // This button is to the right of the flags button&lt;br /&gt;
            anchors { margins: parent.buttonMargins; left: flagsButton.right }&lt;br /&gt;
            text: qsTr(&amp;quot;File Browser&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: {&lt;br /&gt;
                mainPage.state = &amp;quot;browser&amp;quot;&lt;br /&gt;
                active = true&lt;br /&gt;
                flagsButton.active = false&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // This item holds the contents of the selected button and fills the rest of the window&lt;br /&gt;
    Item {&lt;br /&gt;
        id: contentSpace&lt;br /&gt;
&lt;br /&gt;
        anchors { top: contentButtons.bottom; bottom: parent.bottom; left: parent.left; right: parent.right }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    // One of these two components will fill the contentSpace Item above.&lt;br /&gt;
    FlagContent    { id: flagContent;    anchors.fill: contentSpace; anchors.top: contentButtons.bottom }&lt;br /&gt;
&lt;br /&gt;
    //Placeholder until BrowserContent.qml is present&lt;br /&gt;
    Rectangle      { id: browserContent; anchors.fill: contentSpace; anchors.top: contentButtons.bottom; color: &amp;quot;red&amp;quot;; }&lt;br /&gt;
    //BrowserContent { id: browserContent; anchors.fill: contentSpace }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Rectangle { z: -1; anchors.fill: parent; color: &amp;quot;grey&amp;quot; } //background&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    states:  [&lt;br /&gt;
        State {&lt;br /&gt;
            name: &amp;quot;flags&amp;quot;&lt;br /&gt;
            PropertyChanges { target: flagContent; visible: true }&lt;br /&gt;
            PropertyChanges { target: browserContent; visible: false }&lt;br /&gt;
        },&lt;br /&gt;
        State {&lt;br /&gt;
            name: &amp;quot;browser&amp;quot;&lt;br /&gt;
            PropertyChanges { target: flagContent; visible: false }&lt;br /&gt;
            PropertyChanges { target: browserContent; visible: true }&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Add the File FlagContent.qml ====&lt;br /&gt;
&lt;br /&gt;
This shows an example of using a QML ListView - which uses a delegate for a row to be displayed&lt;br /&gt;
&lt;br /&gt;
The model statement references a C++ model called &amp;quot;myModel&amp;quot; defined in mymodel.{h,cpp}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import QtQuick 1.0&lt;br /&gt;
&lt;br /&gt;
    ListView {&lt;br /&gt;
        clip: true&lt;br /&gt;
        model: myModel&lt;br /&gt;
        anchors.top: parent.bottom&lt;br /&gt;
        anchors.fill: parent&lt;br /&gt;
        delegate: Rectangle {&lt;br /&gt;
            color: Qt.rgba(0.9,0.9,0.9)&lt;br /&gt;
            height: childrenRect.height&lt;br /&gt;
            width: parent.width&lt;br /&gt;
            Image {&lt;br /&gt;
                id: image&lt;br /&gt;
                source: flag&lt;br /&gt;
                width: 64&lt;br /&gt;
                height: 64&lt;br /&gt;
                fillMode: Image.PreserveAspectFit&lt;br /&gt;
&lt;br /&gt;
                anchors { left:parent.left; leftMargin:30}&lt;br /&gt;
            }&lt;br /&gt;
            Text {&lt;br /&gt;
                text: display + &amp;quot;\n&amp;quot; +&amp;quot;population: &amp;quot; + population + &amp;quot; mill.&amp;quot;&lt;br /&gt;
                anchors { left:image.right; verticalCenter: image.verticalCenter; leftMargin: 5 }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modify main.qml ====&lt;br /&gt;
Remove this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    AppPage { id: gallery; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Uncomment this line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Component { id: gallery; MainPage {} }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Copy Resource Files ====&lt;br /&gt;
Copy the images and .qrc file from the solution directory:&lt;br /&gt;
&lt;br /&gt;
Add this to your simple-app.pro&lt;br /&gt;
RESOURCES += resources.qrc&lt;br /&gt;
&lt;br /&gt;
==== Rebuild and Run ====&lt;br /&gt;
Since we added new .cpp and .h files, it would be a good idea to Build-&amp;gt;Run Qmake; Build-&amp;gt;Rebuild All&lt;br /&gt;
&lt;br /&gt;
Run...&lt;br /&gt;
&lt;br /&gt;
=== Adding code for the File Browser ===&lt;br /&gt;
To see another mini-app for the &amp;quot;Browser&amp;quot; button, copy these files to your project from the solution directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BrowserContent.qml&lt;br /&gt;
FileSystemView.qml&lt;br /&gt;
ImageViewer.qml&lt;br /&gt;
PathDisplay.qml&lt;br /&gt;
&lt;br /&gt;
dirmodel.cpp&lt;br /&gt;
dirmodel.h&lt;br /&gt;
&lt;br /&gt;
main.cpp (new code added to register a Directory Model with QML named &amp;quot;_model&amp;quot; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Replace these two lines in MainPage.qml:====&lt;br /&gt;
&lt;br /&gt;
We were using a generic red rectangle to hold a space for the BrowserContent Component, we can now use it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    Rectangle      { id: browserContent; anchors.fill: contentSpace; anchors.top: contentButtons.bottom; color: &amp;quot;red&amp;quot;; }&lt;br /&gt;
    //BrowserContent { id: browserContent; anchors.fill: contentSpace }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    BrowserContent { id: browserContent; anchors.fill: contentSpace }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Rebuild All ====&lt;br /&gt;
&lt;br /&gt;
==== Run ====&lt;br /&gt;
Clicking on the Browser button should allow you to browse the file system. If you click on a jpg or png, the image will be previewed.&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/QML/Sample_App_Using_CPP_Models</id>
		<title>QML/Sample App Using CPP Models</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/QML/Sample_App_Using_CPP_Models"/>
				<updated>2011-05-06T23:38:09Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: /* Add the File FlagContent.qml */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
This tutorial will demonstrate a simple (but non-trivial) app which uses&lt;br /&gt;
* Meego UX Component widgets&lt;br /&gt;
* C++ models&lt;br /&gt;
* QML List Views&lt;br /&gt;
* QML Components&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes you have the MeeGo SDK installed on Linux&amp;lt;br/&amp;gt;&lt;br /&gt;
See: http://wiki.meego.com/SDK/Docs/1.2/MeeGo_SDK_1.2_Preview&lt;br /&gt;
&lt;br /&gt;
Also assumed: you have a a chroot / Xephyr environment set up.&amp;lt;br/&amp;gt;&lt;br /&gt;
* http://wiki.meego.com/MeeGo_UX_Components_Chroot_Tutorial&lt;br /&gt;
* http://wiki.meego.com/Developing_in_a_MeeGo_Environment&lt;br /&gt;
&lt;br /&gt;
This tutorial will use meego-ux-components objects like:&lt;br /&gt;
* Book Menus - &lt;br /&gt;
* Buttons&lt;br /&gt;
* AppPage&lt;br /&gt;
For other uses of Meego UX Components, and another tutorial of Book Menus, See: &lt;br /&gt;
* http://wiki.meego.com/MeeGo_UX_Components&lt;br /&gt;
* http://wiki.meego.com/MeeGo_UX_Tutorials&lt;br /&gt;
&lt;br /&gt;
Other QML Tutorials:&lt;br /&gt;
* http://wiki.meego.com/QML_tutorials&lt;br /&gt;
&lt;br /&gt;
== Follow these steps on a chroot / Xephyr system ==&lt;br /&gt;
&lt;br /&gt;
=== Start Qt Creator ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qtcreator &amp;amp;&amp;gt;/dev/null &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create a new project ===&lt;br /&gt;
... screen shots ...&lt;br /&gt;
&lt;br /&gt;
==== The auto-generated QML File looks like this: ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import QtQuick 1.0&lt;br /&gt;
&lt;br /&gt;
Rectangle {&lt;br /&gt;
    width: 360&lt;br /&gt;
    height: 360&lt;br /&gt;
    Text {&lt;br /&gt;
        text: &amp;quot;Hello World&amp;quot;&lt;br /&gt;
        anchors.centerIn: parent&lt;br /&gt;
    }&lt;br /&gt;
    MouseArea {&lt;br /&gt;
        anchors.fill: parent&lt;br /&gt;
        onClicked: {&lt;br /&gt;
            Qt.quit();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Turn off Shadow Build====&lt;br /&gt;
&lt;br /&gt;
==== Build-&amp;gt;Build All ====&lt;br /&gt;
&lt;br /&gt;
=== Run ===&lt;br /&gt;
(CTRL-R or Green &amp;quot;Play&amp;quot; Button)&lt;br /&gt;
&lt;br /&gt;
==== The running app looks like this: ====&lt;br /&gt;
&amp;lt;screen shot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clicking it closes the app (Qt.quit())&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add code to main.qml ===&lt;br /&gt;
&lt;br /&gt;
==== Replace the contents of main.qml with this: ====&lt;br /&gt;
The last 2 Component statements are commented out so the app will run as is before creating more files.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import Qt 4.7&lt;br /&gt;
import MeeGo.Components 0.1&lt;br /&gt;
&lt;br /&gt;
Window {&lt;br /&gt;
    id: window&lt;br /&gt;
&lt;br /&gt;
    bookMenuModel: [ qsTr(&amp;quot;Button Demo&amp;quot;), qsTr(&amp;quot;Book 2&amp;quot;) ]&lt;br /&gt;
    bookMenuPayload: [ gallery, book2 ]&lt;br /&gt;
    bookMenuTitle: qsTr(&amp;quot;Book Menu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    Component.onCompleted: switchBook( gallery )&lt;br /&gt;
&lt;br /&gt;
    //Component { id: gallery; MainPage {} }&lt;br /&gt;
    //Component { id: book2; Book2 {} }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Test / Run ====&lt;br /&gt;
Run the app and see the Book Menu. If you click on one of the menu items, you'll notice an error because of the commented out Component statements.&lt;br /&gt;
&lt;br /&gt;
=== Add code for the Book Page example ===&lt;br /&gt;
==== Adding the Book2 Component ====&lt;br /&gt;
(from the meego-ux-widgetgallery example)&lt;br /&gt;
* (right click on the QML folder in the Projects view and Add New... / QML File / &amp;quot;Book2.qml&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
* Replace the generated file Book2.qml with this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2011 Intel Corporation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is licensed under the terms and conditions of the&lt;br /&gt;
 * LGPL, version 2.1.  The full text of the LGPL Licence is at&lt;br /&gt;
 * http://www.gnu.org/licenses/lgpl.html&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* This file contains relativy empty pages and is meant to demonstrate the&lt;br /&gt;
   book/page concept */&lt;br /&gt;
&lt;br /&gt;
import Qt 4.7&lt;br /&gt;
&lt;br /&gt;
PageDummy {&lt;br /&gt;
    id: pageDummy&lt;br /&gt;
&lt;br /&gt;
    innerText: qsTr(&amp;quot;book 2, page 1&amp;quot;)&lt;br /&gt;
    rectColor: &amp;quot;lightblue&amp;quot;&lt;br /&gt;
    showButton: true&lt;br /&gt;
    buttonLabel: qsTr(&amp;quot;Page 2&amp;quot;)&lt;br /&gt;
    pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    onClicked: { addPage( page2 ) }&lt;br /&gt;
&lt;br /&gt;
    Component{&lt;br /&gt;
        id: page2;&lt;br /&gt;
&lt;br /&gt;
        PageDummy {&lt;br /&gt;
            id: pageDummy2&lt;br /&gt;
&lt;br /&gt;
            innerText: qsTr(&amp;quot;book 2, page 2&amp;quot;)&lt;br /&gt;
            rectColor: &amp;quot;lightgreen&amp;quot;&lt;br /&gt;
            showButton: true&lt;br /&gt;
            buttonLabel: qsTr(&amp;quot;Page 3&amp;quot;)&lt;br /&gt;
            pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: { addPage( page3 )&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    Component{&lt;br /&gt;
        id: page3;&lt;br /&gt;
&lt;br /&gt;
        PageDummy {&lt;br /&gt;
            id: pageDummy3&lt;br /&gt;
&lt;br /&gt;
            innerText: qsTr(&amp;quot;book 2, page 3&amp;quot;)&lt;br /&gt;
            rectColor: &amp;quot;orange&amp;quot;&lt;br /&gt;
            showButton: true&lt;br /&gt;
            buttonLabel: qsTr(&amp;quot;Page 4&amp;quot;)&lt;br /&gt;
            pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: { addPage( page4 )&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    Component{&lt;br /&gt;
        id: page4;&lt;br /&gt;
&lt;br /&gt;
        PageDummy {&lt;br /&gt;
            id: pageDummy4&lt;br /&gt;
&lt;br /&gt;
            innerText: qsTr(&amp;quot;book 2, page 4&amp;quot;)&lt;br /&gt;
            rectColor: &amp;quot;darkgrey&amp;quot;&lt;br /&gt;
            pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Add PageDummy.qml ====&lt;br /&gt;
The file Book2.qml references PageDummy.qml, so create it the same way as Book2.qml&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2011 Intel Corporation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is licensed under the terms and conditions of the&lt;br /&gt;
 * LGPL, version 2.1.  The full text of the LGPL Licence is at&lt;br /&gt;
 * http://www.gnu.org/licenses/lgpl.html&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* This file is just meant as a dummy to quickly create pages for&lt;br /&gt;
   demonstrating the book/page concept. */&lt;br /&gt;
import Qt 4.7&lt;br /&gt;
import MeeGo.Components 0.1&lt;br /&gt;
&lt;br /&gt;
AppPage {&lt;br /&gt;
    id: pageDummy&lt;br /&gt;
&lt;br /&gt;
    property alias innerText: rectText.text //text shown in the rect&lt;br /&gt;
    property alias rectColor: innerRect.color   //color of the rect in the middle&lt;br /&gt;
    property alias showButton: nextButton.visible   //nextButton visible?&lt;br /&gt;
    property alias buttonLabel: nextButton.text    //nextButton label&lt;br /&gt;
    property string bookTitle: &amp;quot;book title&amp;quot; //shown in the title bar&lt;br /&gt;
&lt;br /&gt;
    signal clicked()&lt;br /&gt;
&lt;br /&gt;
    anchors.fill:  parent&lt;br /&gt;
&lt;br /&gt;
    Rectangle { z: -1; anchors.fill: parent; color: &amp;quot;grey&amp;quot; } //background&lt;br /&gt;
&lt;br /&gt;
    Rectangle {&lt;br /&gt;
        id: innerRect&lt;br /&gt;
&lt;br /&gt;
        anchors.fill: parent&lt;br /&gt;
        anchors.margins:  50&lt;br /&gt;
        color: &amp;quot;lightgreen&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Text {&lt;br /&gt;
            id: rectText&lt;br /&gt;
&lt;br /&gt;
            text: &amp;quot;dummy page&amp;quot;&lt;br /&gt;
            anchors.centerIn: parent&lt;br /&gt;
            font.pixelSize: 40&lt;br /&gt;
            color: &amp;quot;black&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    Button {&lt;br /&gt;
        id: nextButton&lt;br /&gt;
&lt;br /&gt;
        visible: false&lt;br /&gt;
        text: &amp;quot;next page &amp;gt;&amp;quot;&lt;br /&gt;
        anchors.right:  innerRect.right&lt;br /&gt;
        anchors.bottom:  innerRect.bottom&lt;br /&gt;
        anchors.margins: 10&lt;br /&gt;
        onClicked: { pageDummy.clicked() }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see the use of the meego-ux-components &amp;quot;Button&amp;quot; and &amp;quot;AppPage&amp;quot; components in PageDummy.qml&lt;br /&gt;
&lt;br /&gt;
==== Now, replace the two commented out Component statements in main.qml with:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    Component {&lt;br /&gt;
        id: gallery;&lt;br /&gt;
        AppPage {id: dummy2}&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Dummy page until MainPage.qml is defined&lt;br /&gt;
    AppPage { id: gallery; }&lt;br /&gt;
    //Component { id: gallery; MainPage {} }&lt;br /&gt;
&lt;br /&gt;
    Component { id: book2; Book2 {} }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the MainPage.qml file isn't created yet, we use a dummy AppPage placeholder temporarily to prevent a run-time error when invoking the menu.&lt;br /&gt;
&lt;br /&gt;
=== Run ===&lt;br /&gt;
You can now click on the Book2 menu and see a new page. &lt;br /&gt;
&lt;br /&gt;
=== Add code for seeing Custom List Views in the MainPage ===&lt;br /&gt;
&lt;br /&gt;
We will use a C++ QAbstractListModel to repersent out list.&lt;br /&gt;
&lt;br /&gt;
==== mymodel.h ====&lt;br /&gt;
Create the file mymodel.h by right-clicking on the simple-app project name and &amp;quot;Add New...&amp;quot; a C++ Header File&lt;br /&gt;
&lt;br /&gt;
Paste this into mymodel.h&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#ifndef MYMODEL_H&lt;br /&gt;
#define MYMODEL_H&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;QAbstractListModel&amp;gt;&lt;br /&gt;
#include &amp;lt;QColor&amp;gt;&lt;br /&gt;
&lt;br /&gt;
struct Data {&lt;br /&gt;
    Data( const char* name, const QString&amp;amp; flag, double population )&lt;br /&gt;
        : name(name), flag(flag), population(population) {}&lt;br /&gt;
    QString name;&lt;br /&gt;
    QString flag;&lt;br /&gt;
    double population;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
const int FlagRole = Qt::UserRole + 1;&lt;br /&gt;
const int PopulationRole = Qt::UserRole + 2;&lt;br /&gt;
class MyModel : public QAbstractListModel&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    MyModel();&lt;br /&gt;
    int rowCount( const QModelIndex&amp;amp; ) const;&lt;br /&gt;
    QVariant data( const QModelIndex&amp;amp; index, int role = Qt::DisplayRole ) const;&lt;br /&gt;
&lt;br /&gt;
    QList&amp;lt; Data &amp;gt; m_data;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#endif // MYMODEL_H&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the mymodel.cpp file with this content:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;mymodel.h&amp;quot;&lt;br /&gt;
#include &amp;lt;QByteArray&amp;gt;&lt;br /&gt;
MyModel::MyModel()&lt;br /&gt;
{&lt;br /&gt;
    m_data&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Denmark&amp;quot;, &amp;quot;qrc:images/denmark.jpg&amp;quot;, 5.4)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Sweden&amp;quot;, &amp;quot;qrc:images/sweden.jpg&amp;quot;, 9.3)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Iceland&amp;quot;, &amp;quot;qrc:images/iceland.jpg&amp;quot;, 3.2)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Norway&amp;quot;, &amp;quot;qrc:images/norway.jpg&amp;quot;, 4.8)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Finland&amp;quot;, &amp;quot;qrc:images/finland.jpg&amp;quot;, 5.3);&lt;br /&gt;
&lt;br /&gt;
    // By default the DisplayRole is mapped to the propery &amp;quot;display&amp;quot;&lt;br /&gt;
    QHash&amp;lt;int, QByteArray&amp;gt; mapping =roleNames();&lt;br /&gt;
    mapping.insert( FlagRole, &amp;quot;flag&amp;quot;);&lt;br /&gt;
    mapping.insert( PopulationRole, &amp;quot;population&amp;quot;);&lt;br /&gt;
    setRoleNames( mapping );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int MyModel::rowCount( const QModelIndex&amp;amp; ) const&lt;br /&gt;
{&lt;br /&gt;
    return m_data.count();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
QVariant MyModel::data(const QModelIndex &amp;amp;index, int role) const&lt;br /&gt;
{&lt;br /&gt;
    if ( !index.isValid() )&lt;br /&gt;
        return QVariant();&lt;br /&gt;
&lt;br /&gt;
    Data data = m_data[index.row()];&lt;br /&gt;
    if ( role == Qt::DisplayRole )&lt;br /&gt;
        return data.name;&lt;br /&gt;
    else if ( role == FlagRole )&lt;br /&gt;
        return data.flag;&lt;br /&gt;
    else if ( role == PopulationRole )&lt;br /&gt;
        return data.population;&lt;br /&gt;
    else&lt;br /&gt;
        return QVariant();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modify main.cpp ====&lt;br /&gt;
Modify main.cpp by replacing its contents with this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;QtGui/QApplication&amp;gt;&lt;br /&gt;
#include &amp;lt;QDeclarativeEngine&amp;gt;&lt;br /&gt;
#include &amp;lt;QDeclarativeContext&amp;gt;&lt;br /&gt;
#include &amp;quot;qmlapplicationviewer.h&amp;quot;&lt;br /&gt;
#include &amp;quot;mymodel.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
    QApplication app(argc, argv);&lt;br /&gt;
&lt;br /&gt;
    MyModel model;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    QmlApplicationViewer viewer;&lt;br /&gt;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);&lt;br /&gt;
    viewer.setMainQmlFile(QLatin1String(&amp;quot;qml/simple-app/main.qml&amp;quot;));&lt;br /&gt;
    viewer.showExpanded();&lt;br /&gt;
&lt;br /&gt;
    // Register the model &amp;quot;myModel&amp;quot; with QML&lt;br /&gt;
    QDeclarativeContext *context = viewer.engine()-&amp;gt;rootContext();&lt;br /&gt;
    context-&amp;gt;setContextProperty(&amp;quot;myModel&amp;quot;, &amp;amp;model);&lt;br /&gt;
&lt;br /&gt;
    return app.exec();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Add the file MainPage.qml ====&lt;br /&gt;
&lt;br /&gt;
A Component called MainPage.qml which will display row of Buttons that act like Tabs in a QTabView.&lt;br /&gt;
&lt;br /&gt;
The area below the buttons are filled with one of two mini-apps (List View sample, and mini file browser)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2011 Intel Corporation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is licensed under the terms and conditions of the&lt;br /&gt;
 * LGPL, version 2.1.  The full text of the LGPL Licence is at&lt;br /&gt;
 * http://www.gnu.org/licenses/lgpl.html&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* The MainPage lets the user switch between different contents which&lt;br /&gt;
   show the widgets available in these components. */&lt;br /&gt;
&lt;br /&gt;
//import Qt 4.7&lt;br /&gt;
import QtQuick 1.0&lt;br /&gt;
import MeeGo.Components 0.1&lt;br /&gt;
&lt;br /&gt;
AppPage {&lt;br /&gt;
    id: mainPage&lt;br /&gt;
&lt;br /&gt;
    // This will be the first app / content displayed in the Button Demo page&lt;br /&gt;
    state: &amp;quot;flags&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    pageTitle: qsTr(&amp;quot;Button Demo&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    // Demo an Action Menu......&lt;br /&gt;
    // Comment the block below to see a new Action Menu&lt;br /&gt;
&lt;br /&gt;
//    actionMenuModel: [ qsTr(&amp;quot;Landscape&amp;quot;),&lt;br /&gt;
//                       qsTr(&amp;quot;Portrait&amp;quot;),&lt;br /&gt;
//                       qsTr(&amp;quot;Inv. Landscape&amp;quot;),&lt;br /&gt;
//                       qsTr(&amp;quot;Inv. Portrait&amp;quot;) ]&lt;br /&gt;
//    actionMenuPayload: [  1, 2, 3, 4 ]&lt;br /&gt;
//    actionMenuTitle: qsTr(&amp;quot;Action Menu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
//    onActionMenuTriggered: {&lt;br /&gt;
&lt;br /&gt;
//        if( selectedItem == 1) {&lt;br /&gt;
//            window.orientation = 1&lt;br /&gt;
//        } else if( selectedItem == 2) {&lt;br /&gt;
//            window.orientation = 2&lt;br /&gt;
//        } else if( selectedItem == 3) {&lt;br /&gt;
//            window.orientation = 3&lt;br /&gt;
//        } else if( selectedItem == 4) {&lt;br /&gt;
//            window.orientation = 0&lt;br /&gt;
//        }&lt;br /&gt;
//    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Item {&lt;br /&gt;
        id: contentButtons&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        // Some Debug output to stderr ...&lt;br /&gt;
        onVisibleChanged: {&lt;br /&gt;
            console.log(&amp;quot;xxxxxxxxxxxxxx 1 Parent wid &amp;quot;, parent.width);&lt;br /&gt;
            console.log(&amp;quot;xxxxxxxxxxxxxx 2 Wid        &amp;quot;, width);&lt;br /&gt;
        }&lt;br /&gt;
        onWidthChanged: {&lt;br /&gt;
            console.log(&amp;quot;wwwwwwwwwwwwww 1 Parent wid &amp;quot;, parent.width);&lt;br /&gt;
            console.log(&amp;quot;wwwwwwwwwwwwww 2 Wid        &amp;quot;, width);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        property int buttonWidth: parent.width * 0.2;&lt;br /&gt;
        property int buttonHeight: 60;&lt;br /&gt;
        property int buttonMargins: 2;&lt;br /&gt;
&lt;br /&gt;
        property string activeButtonImage: &amp;quot;image://themedimage/widgets/common/button/button-default&amp;quot;&lt;br /&gt;
        property string buttonImage: &amp;quot;image://themedimage/widgets/common/button/button&amp;quot;&lt;br /&gt;
        property string buttonImagePressed: &amp;quot;image://themedimage/widgets/common/button/button-default-pressed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        //width: 2 * buttonWidth + 3 * buttonMargins&lt;br /&gt;
        height: buttonHeight&lt;br /&gt;
        anchors.top: parent.top&lt;br /&gt;
        anchors.topMargin:  10&lt;br /&gt;
        anchors.horizontalCenter: parent.horizontalCenter&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Button {&lt;br /&gt;
            id: flagsButton&lt;br /&gt;
            active: true&lt;br /&gt;
            width:  parent.buttonWidth; height: parent.buttonHeight&lt;br /&gt;
&lt;br /&gt;
            // Since there are only two buttons, the right of this button is near the center.&lt;br /&gt;
            anchors { margins: parent.buttonMargins; right: parent.horizontalCenter;}&lt;br /&gt;
            text: qsTr(&amp;quot;Flags&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: {&lt;br /&gt;
                mainPage.state = &amp;quot;flags&amp;quot;&lt;br /&gt;
                active = true&lt;br /&gt;
                browserButton.active = false&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Button {&lt;br /&gt;
            id: browserButton&lt;br /&gt;
&lt;br /&gt;
            width:  parent.buttonWidth; height: parent.buttonHeight&lt;br /&gt;
&lt;br /&gt;
            // This button is to the right of the flags button&lt;br /&gt;
            anchors { margins: parent.buttonMargins; left: flagsButton.right }&lt;br /&gt;
            text: qsTr(&amp;quot;File Browser&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: {&lt;br /&gt;
                mainPage.state = &amp;quot;browser&amp;quot;&lt;br /&gt;
                active = true&lt;br /&gt;
                flagsButton.active = false&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // This item holds the contents of the selected button and fills the rest of the window&lt;br /&gt;
    Item {&lt;br /&gt;
        id: contentSpace&lt;br /&gt;
&lt;br /&gt;
        anchors { top: contentButtons.bottom; bottom: parent.bottom; left: parent.left; right: parent.right }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    // One of these two components will fill the contentSpace Item above.&lt;br /&gt;
    FlagContent    { id: flagContent;    anchors.fill: contentSpace; anchors.top: contentButtons.bottom }&lt;br /&gt;
&lt;br /&gt;
    //Placeholder until BrowserContent.qml is present&lt;br /&gt;
    Rectangle      { id: browserContent; anchors.fill: contentSpace; anchors.top: contentButtons.bottom; color: &amp;quot;red&amp;quot;; }&lt;br /&gt;
    //BrowserContent { id: browserContent; anchors.fill: contentSpace }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Rectangle { z: -1; anchors.fill: parent; color: &amp;quot;grey&amp;quot; } //background&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    states:  [&lt;br /&gt;
        State {&lt;br /&gt;
            name: &amp;quot;flags&amp;quot;&lt;br /&gt;
            PropertyChanges { target: flagContent; visible: true }&lt;br /&gt;
            PropertyChanges { target: browserContent; visible: false }&lt;br /&gt;
        },&lt;br /&gt;
        State {&lt;br /&gt;
            name: &amp;quot;browser&amp;quot;&lt;br /&gt;
            PropertyChanges { target: flagContent; visible: false }&lt;br /&gt;
            PropertyChanges { target: browserContent; visible: true }&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Add the File FlagContent.qml ====&lt;br /&gt;
&lt;br /&gt;
This shows an example of using a QML ListView - which uses a delegate for a row to be displayed&lt;br /&gt;
&lt;br /&gt;
The model statement references a C++ model called &amp;quot;myModel&amp;quot; defined in mymodel.{h,cpp}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import QtQuick 1.0&lt;br /&gt;
&lt;br /&gt;
    ListView {&lt;br /&gt;
        clip: true&lt;br /&gt;
        model: myModel&lt;br /&gt;
        anchors.top: parent.bottom&lt;br /&gt;
        anchors.fill: parent&lt;br /&gt;
        delegate: Rectangle {&lt;br /&gt;
            color: Qt.rgba(0.9,0.9,0.9)&lt;br /&gt;
            height: childrenRect.height&lt;br /&gt;
            width: parent.width&lt;br /&gt;
            Image {&lt;br /&gt;
                id: image&lt;br /&gt;
                source: flag&lt;br /&gt;
                width: 64&lt;br /&gt;
                height: 64&lt;br /&gt;
                fillMode: Image.PreserveAspectFit&lt;br /&gt;
&lt;br /&gt;
                anchors { left:parent.left; leftMargin:30}&lt;br /&gt;
            }&lt;br /&gt;
            Text {&lt;br /&gt;
                text: display + &amp;quot;\n&amp;quot; +&amp;quot;population: &amp;quot; + population + &amp;quot; mill.&amp;quot;&lt;br /&gt;
                anchors { left:image.right; verticalCenter: image.verticalCenter; leftMargin: 5 }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modify main.qml ====&lt;br /&gt;
Remove this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    AppPage { id: gallery; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Uncomment this line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Component { id: gallery; MainPage {} }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Copy Resource Files ====&lt;br /&gt;
Copy the images and .qrc file from the solution directory:&lt;br /&gt;
&lt;br /&gt;
Add this to your simple-app.pro&lt;br /&gt;
RESOURCES += resources.qrc&lt;br /&gt;
&lt;br /&gt;
==== Rebuild and Run ====&lt;br /&gt;
Since we added new .cpp and .h files, it would be a good idea to Build-&amp;gt;Run Qmake; Build-&amp;gt;Rebuild All&lt;br /&gt;
&lt;br /&gt;
Run...&lt;br /&gt;
&lt;br /&gt;
=== Adding code for the File Browser ===&lt;br /&gt;
To see another mini-app for the &amp;quot;Browser&amp;quot; button, copy these files to your project from the solution directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BrowserContent.qml&lt;br /&gt;
FileSystemView.qml&lt;br /&gt;
ImageViewer.qml&lt;br /&gt;
PathDisplay.qml&lt;br /&gt;
&lt;br /&gt;
dirmodel.cpp&lt;br /&gt;
dirmodel.h&lt;br /&gt;
&lt;br /&gt;
main.cpp (new code added to register a Directory Model with QML named &amp;quot;_model&amp;quot; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Replace these two lines in MainPage.qml:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    Rectangle      { id: browserContent; anchors.fill: contentSpace; anchors.top: contentButtons.bottom; color: &amp;quot;red&amp;quot;; }&lt;br /&gt;
    //BrowserContent { id: browserContent; anchors.fill: contentSpace }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    BrowserContent { id: browserContent; anchors.fill: contentSpace }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Rebuild All ====&lt;br /&gt;
&lt;br /&gt;
==== Run ====&lt;br /&gt;
Clicking on the Browser button should allow you to browse the file system. If you click on a jpg or png, the image will be previewed.&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/QML/Sample_App_Using_CPP_Models</id>
		<title>QML/Sample App Using CPP Models</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/QML/Sample_App_Using_CPP_Models"/>
				<updated>2011-05-06T23:36:25Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: /* Add the file MainPage.qml */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
This tutorial will demonstrate a simple (but non-trivial) app which uses&lt;br /&gt;
* Meego UX Component widgets&lt;br /&gt;
* C++ models&lt;br /&gt;
* QML List Views&lt;br /&gt;
* QML Components&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes you have the MeeGo SDK installed on Linux&amp;lt;br/&amp;gt;&lt;br /&gt;
See: http://wiki.meego.com/SDK/Docs/1.2/MeeGo_SDK_1.2_Preview&lt;br /&gt;
&lt;br /&gt;
Also assumed: you have a a chroot / Xephyr environment set up.&amp;lt;br/&amp;gt;&lt;br /&gt;
* http://wiki.meego.com/MeeGo_UX_Components_Chroot_Tutorial&lt;br /&gt;
* http://wiki.meego.com/Developing_in_a_MeeGo_Environment&lt;br /&gt;
&lt;br /&gt;
This tutorial will use meego-ux-components objects like:&lt;br /&gt;
* Book Menus - &lt;br /&gt;
* Buttons&lt;br /&gt;
* AppPage&lt;br /&gt;
For other uses of Meego UX Components, and another tutorial of Book Menus, See: &lt;br /&gt;
* http://wiki.meego.com/MeeGo_UX_Components&lt;br /&gt;
* http://wiki.meego.com/MeeGo_UX_Tutorials&lt;br /&gt;
&lt;br /&gt;
Other QML Tutorials:&lt;br /&gt;
* http://wiki.meego.com/QML_tutorials&lt;br /&gt;
&lt;br /&gt;
== Follow these steps on a chroot / Xephyr system ==&lt;br /&gt;
&lt;br /&gt;
=== Start Qt Creator ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qtcreator &amp;amp;&amp;gt;/dev/null &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create a new project ===&lt;br /&gt;
... screen shots ...&lt;br /&gt;
&lt;br /&gt;
==== The auto-generated QML File looks like this: ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import QtQuick 1.0&lt;br /&gt;
&lt;br /&gt;
Rectangle {&lt;br /&gt;
    width: 360&lt;br /&gt;
    height: 360&lt;br /&gt;
    Text {&lt;br /&gt;
        text: &amp;quot;Hello World&amp;quot;&lt;br /&gt;
        anchors.centerIn: parent&lt;br /&gt;
    }&lt;br /&gt;
    MouseArea {&lt;br /&gt;
        anchors.fill: parent&lt;br /&gt;
        onClicked: {&lt;br /&gt;
            Qt.quit();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Turn off Shadow Build====&lt;br /&gt;
&lt;br /&gt;
==== Build-&amp;gt;Build All ====&lt;br /&gt;
&lt;br /&gt;
=== Run ===&lt;br /&gt;
(CTRL-R or Green &amp;quot;Play&amp;quot; Button)&lt;br /&gt;
&lt;br /&gt;
==== The running app looks like this: ====&lt;br /&gt;
&amp;lt;screen shot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clicking it closes the app (Qt.quit())&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add code to main.qml ===&lt;br /&gt;
&lt;br /&gt;
==== Replace the contents of main.qml with this: ====&lt;br /&gt;
The last 2 Component statements are commented out so the app will run as is before creating more files.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import Qt 4.7&lt;br /&gt;
import MeeGo.Components 0.1&lt;br /&gt;
&lt;br /&gt;
Window {&lt;br /&gt;
    id: window&lt;br /&gt;
&lt;br /&gt;
    bookMenuModel: [ qsTr(&amp;quot;Button Demo&amp;quot;), qsTr(&amp;quot;Book 2&amp;quot;) ]&lt;br /&gt;
    bookMenuPayload: [ gallery, book2 ]&lt;br /&gt;
    bookMenuTitle: qsTr(&amp;quot;Book Menu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    Component.onCompleted: switchBook( gallery )&lt;br /&gt;
&lt;br /&gt;
    //Component { id: gallery; MainPage {} }&lt;br /&gt;
    //Component { id: book2; Book2 {} }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Test / Run ====&lt;br /&gt;
Run the app and see the Book Menu. If you click on one of the menu items, you'll notice an error because of the commented out Component statements.&lt;br /&gt;
&lt;br /&gt;
=== Add code for the Book Page example ===&lt;br /&gt;
==== Adding the Book2 Component ====&lt;br /&gt;
(from the meego-ux-widgetgallery example)&lt;br /&gt;
* (right click on the QML folder in the Projects view and Add New... / QML File / &amp;quot;Book2.qml&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
* Replace the generated file Book2.qml with this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2011 Intel Corporation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is licensed under the terms and conditions of the&lt;br /&gt;
 * LGPL, version 2.1.  The full text of the LGPL Licence is at&lt;br /&gt;
 * http://www.gnu.org/licenses/lgpl.html&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* This file contains relativy empty pages and is meant to demonstrate the&lt;br /&gt;
   book/page concept */&lt;br /&gt;
&lt;br /&gt;
import Qt 4.7&lt;br /&gt;
&lt;br /&gt;
PageDummy {&lt;br /&gt;
    id: pageDummy&lt;br /&gt;
&lt;br /&gt;
    innerText: qsTr(&amp;quot;book 2, page 1&amp;quot;)&lt;br /&gt;
    rectColor: &amp;quot;lightblue&amp;quot;&lt;br /&gt;
    showButton: true&lt;br /&gt;
    buttonLabel: qsTr(&amp;quot;Page 2&amp;quot;)&lt;br /&gt;
    pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    onClicked: { addPage( page2 ) }&lt;br /&gt;
&lt;br /&gt;
    Component{&lt;br /&gt;
        id: page2;&lt;br /&gt;
&lt;br /&gt;
        PageDummy {&lt;br /&gt;
            id: pageDummy2&lt;br /&gt;
&lt;br /&gt;
            innerText: qsTr(&amp;quot;book 2, page 2&amp;quot;)&lt;br /&gt;
            rectColor: &amp;quot;lightgreen&amp;quot;&lt;br /&gt;
            showButton: true&lt;br /&gt;
            buttonLabel: qsTr(&amp;quot;Page 3&amp;quot;)&lt;br /&gt;
            pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: { addPage( page3 )&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    Component{&lt;br /&gt;
        id: page3;&lt;br /&gt;
&lt;br /&gt;
        PageDummy {&lt;br /&gt;
            id: pageDummy3&lt;br /&gt;
&lt;br /&gt;
            innerText: qsTr(&amp;quot;book 2, page 3&amp;quot;)&lt;br /&gt;
            rectColor: &amp;quot;orange&amp;quot;&lt;br /&gt;
            showButton: true&lt;br /&gt;
            buttonLabel: qsTr(&amp;quot;Page 4&amp;quot;)&lt;br /&gt;
            pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: { addPage( page4 )&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    Component{&lt;br /&gt;
        id: page4;&lt;br /&gt;
&lt;br /&gt;
        PageDummy {&lt;br /&gt;
            id: pageDummy4&lt;br /&gt;
&lt;br /&gt;
            innerText: qsTr(&amp;quot;book 2, page 4&amp;quot;)&lt;br /&gt;
            rectColor: &amp;quot;darkgrey&amp;quot;&lt;br /&gt;
            pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Add PageDummy.qml ====&lt;br /&gt;
The file Book2.qml references PageDummy.qml, so create it the same way as Book2.qml&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2011 Intel Corporation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is licensed under the terms and conditions of the&lt;br /&gt;
 * LGPL, version 2.1.  The full text of the LGPL Licence is at&lt;br /&gt;
 * http://www.gnu.org/licenses/lgpl.html&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* This file is just meant as a dummy to quickly create pages for&lt;br /&gt;
   demonstrating the book/page concept. */&lt;br /&gt;
import Qt 4.7&lt;br /&gt;
import MeeGo.Components 0.1&lt;br /&gt;
&lt;br /&gt;
AppPage {&lt;br /&gt;
    id: pageDummy&lt;br /&gt;
&lt;br /&gt;
    property alias innerText: rectText.text //text shown in the rect&lt;br /&gt;
    property alias rectColor: innerRect.color   //color of the rect in the middle&lt;br /&gt;
    property alias showButton: nextButton.visible   //nextButton visible?&lt;br /&gt;
    property alias buttonLabel: nextButton.text    //nextButton label&lt;br /&gt;
    property string bookTitle: &amp;quot;book title&amp;quot; //shown in the title bar&lt;br /&gt;
&lt;br /&gt;
    signal clicked()&lt;br /&gt;
&lt;br /&gt;
    anchors.fill:  parent&lt;br /&gt;
&lt;br /&gt;
    Rectangle { z: -1; anchors.fill: parent; color: &amp;quot;grey&amp;quot; } //background&lt;br /&gt;
&lt;br /&gt;
    Rectangle {&lt;br /&gt;
        id: innerRect&lt;br /&gt;
&lt;br /&gt;
        anchors.fill: parent&lt;br /&gt;
        anchors.margins:  50&lt;br /&gt;
        color: &amp;quot;lightgreen&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Text {&lt;br /&gt;
            id: rectText&lt;br /&gt;
&lt;br /&gt;
            text: &amp;quot;dummy page&amp;quot;&lt;br /&gt;
            anchors.centerIn: parent&lt;br /&gt;
            font.pixelSize: 40&lt;br /&gt;
            color: &amp;quot;black&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    Button {&lt;br /&gt;
        id: nextButton&lt;br /&gt;
&lt;br /&gt;
        visible: false&lt;br /&gt;
        text: &amp;quot;next page &amp;gt;&amp;quot;&lt;br /&gt;
        anchors.right:  innerRect.right&lt;br /&gt;
        anchors.bottom:  innerRect.bottom&lt;br /&gt;
        anchors.margins: 10&lt;br /&gt;
        onClicked: { pageDummy.clicked() }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see the use of the meego-ux-components &amp;quot;Button&amp;quot; and &amp;quot;AppPage&amp;quot; components in PageDummy.qml&lt;br /&gt;
&lt;br /&gt;
==== Now, replace the two commented out Component statements in main.qml with:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    Component {&lt;br /&gt;
        id: gallery;&lt;br /&gt;
        AppPage {id: dummy2}&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Dummy page until MainPage.qml is defined&lt;br /&gt;
    AppPage { id: gallery; }&lt;br /&gt;
    //Component { id: gallery; MainPage {} }&lt;br /&gt;
&lt;br /&gt;
    Component { id: book2; Book2 {} }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the MainPage.qml file isn't created yet, we use a dummy AppPage placeholder temporarily to prevent a run-time error when invoking the menu.&lt;br /&gt;
&lt;br /&gt;
=== Run ===&lt;br /&gt;
You can now click on the Book2 menu and see a new page. &lt;br /&gt;
&lt;br /&gt;
=== Add code for seeing Custom List Views in the MainPage ===&lt;br /&gt;
&lt;br /&gt;
We will use a C++ QAbstractListModel to repersent out list.&lt;br /&gt;
&lt;br /&gt;
==== mymodel.h ====&lt;br /&gt;
Create the file mymodel.h by right-clicking on the simple-app project name and &amp;quot;Add New...&amp;quot; a C++ Header File&lt;br /&gt;
&lt;br /&gt;
Paste this into mymodel.h&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#ifndef MYMODEL_H&lt;br /&gt;
#define MYMODEL_H&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;QAbstractListModel&amp;gt;&lt;br /&gt;
#include &amp;lt;QColor&amp;gt;&lt;br /&gt;
&lt;br /&gt;
struct Data {&lt;br /&gt;
    Data( const char* name, const QString&amp;amp; flag, double population )&lt;br /&gt;
        : name(name), flag(flag), population(population) {}&lt;br /&gt;
    QString name;&lt;br /&gt;
    QString flag;&lt;br /&gt;
    double population;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
const int FlagRole = Qt::UserRole + 1;&lt;br /&gt;
const int PopulationRole = Qt::UserRole + 2;&lt;br /&gt;
class MyModel : public QAbstractListModel&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    MyModel();&lt;br /&gt;
    int rowCount( const QModelIndex&amp;amp; ) const;&lt;br /&gt;
    QVariant data( const QModelIndex&amp;amp; index, int role = Qt::DisplayRole ) const;&lt;br /&gt;
&lt;br /&gt;
    QList&amp;lt; Data &amp;gt; m_data;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#endif // MYMODEL_H&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the mymodel.cpp file with this content:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;mymodel.h&amp;quot;&lt;br /&gt;
#include &amp;lt;QByteArray&amp;gt;&lt;br /&gt;
MyModel::MyModel()&lt;br /&gt;
{&lt;br /&gt;
    m_data&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Denmark&amp;quot;, &amp;quot;qrc:images/denmark.jpg&amp;quot;, 5.4)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Sweden&amp;quot;, &amp;quot;qrc:images/sweden.jpg&amp;quot;, 9.3)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Iceland&amp;quot;, &amp;quot;qrc:images/iceland.jpg&amp;quot;, 3.2)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Norway&amp;quot;, &amp;quot;qrc:images/norway.jpg&amp;quot;, 4.8)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Finland&amp;quot;, &amp;quot;qrc:images/finland.jpg&amp;quot;, 5.3);&lt;br /&gt;
&lt;br /&gt;
    // By default the DisplayRole is mapped to the propery &amp;quot;display&amp;quot;&lt;br /&gt;
    QHash&amp;lt;int, QByteArray&amp;gt; mapping =roleNames();&lt;br /&gt;
    mapping.insert( FlagRole, &amp;quot;flag&amp;quot;);&lt;br /&gt;
    mapping.insert( PopulationRole, &amp;quot;population&amp;quot;);&lt;br /&gt;
    setRoleNames( mapping );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int MyModel::rowCount( const QModelIndex&amp;amp; ) const&lt;br /&gt;
{&lt;br /&gt;
    return m_data.count();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
QVariant MyModel::data(const QModelIndex &amp;amp;index, int role) const&lt;br /&gt;
{&lt;br /&gt;
    if ( !index.isValid() )&lt;br /&gt;
        return QVariant();&lt;br /&gt;
&lt;br /&gt;
    Data data = m_data[index.row()];&lt;br /&gt;
    if ( role == Qt::DisplayRole )&lt;br /&gt;
        return data.name;&lt;br /&gt;
    else if ( role == FlagRole )&lt;br /&gt;
        return data.flag;&lt;br /&gt;
    else if ( role == PopulationRole )&lt;br /&gt;
        return data.population;&lt;br /&gt;
    else&lt;br /&gt;
        return QVariant();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modify main.cpp ====&lt;br /&gt;
Modify main.cpp by replacing its contents with this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;QtGui/QApplication&amp;gt;&lt;br /&gt;
#include &amp;lt;QDeclarativeEngine&amp;gt;&lt;br /&gt;
#include &amp;lt;QDeclarativeContext&amp;gt;&lt;br /&gt;
#include &amp;quot;qmlapplicationviewer.h&amp;quot;&lt;br /&gt;
#include &amp;quot;mymodel.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
    QApplication app(argc, argv);&lt;br /&gt;
&lt;br /&gt;
    MyModel model;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    QmlApplicationViewer viewer;&lt;br /&gt;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);&lt;br /&gt;
    viewer.setMainQmlFile(QLatin1String(&amp;quot;qml/simple-app/main.qml&amp;quot;));&lt;br /&gt;
    viewer.showExpanded();&lt;br /&gt;
&lt;br /&gt;
    // Register the model &amp;quot;myModel&amp;quot; with QML&lt;br /&gt;
    QDeclarativeContext *context = viewer.engine()-&amp;gt;rootContext();&lt;br /&gt;
    context-&amp;gt;setContextProperty(&amp;quot;myModel&amp;quot;, &amp;amp;model);&lt;br /&gt;
&lt;br /&gt;
    return app.exec();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Add the file MainPage.qml ====&lt;br /&gt;
&lt;br /&gt;
A Component called MainPage.qml which will display row of Buttons that act like Tabs in a QTabView.&lt;br /&gt;
&lt;br /&gt;
The area below the buttons are filled with one of two mini-apps (List View sample, and mini file browser)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2011 Intel Corporation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is licensed under the terms and conditions of the&lt;br /&gt;
 * LGPL, version 2.1.  The full text of the LGPL Licence is at&lt;br /&gt;
 * http://www.gnu.org/licenses/lgpl.html&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* The MainPage lets the user switch between different contents which&lt;br /&gt;
   show the widgets available in these components. */&lt;br /&gt;
&lt;br /&gt;
//import Qt 4.7&lt;br /&gt;
import QtQuick 1.0&lt;br /&gt;
import MeeGo.Components 0.1&lt;br /&gt;
&lt;br /&gt;
AppPage {&lt;br /&gt;
    id: mainPage&lt;br /&gt;
&lt;br /&gt;
    // This will be the first app / content displayed in the Button Demo page&lt;br /&gt;
    state: &amp;quot;flags&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    pageTitle: qsTr(&amp;quot;Button Demo&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    // Demo an Action Menu......&lt;br /&gt;
    // Comment the block below to see a new Action Menu&lt;br /&gt;
&lt;br /&gt;
//    actionMenuModel: [ qsTr(&amp;quot;Landscape&amp;quot;),&lt;br /&gt;
//                       qsTr(&amp;quot;Portrait&amp;quot;),&lt;br /&gt;
//                       qsTr(&amp;quot;Inv. Landscape&amp;quot;),&lt;br /&gt;
//                       qsTr(&amp;quot;Inv. Portrait&amp;quot;) ]&lt;br /&gt;
//    actionMenuPayload: [  1, 2, 3, 4 ]&lt;br /&gt;
//    actionMenuTitle: qsTr(&amp;quot;Action Menu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
//    onActionMenuTriggered: {&lt;br /&gt;
&lt;br /&gt;
//        if( selectedItem == 1) {&lt;br /&gt;
//            window.orientation = 1&lt;br /&gt;
//        } else if( selectedItem == 2) {&lt;br /&gt;
//            window.orientation = 2&lt;br /&gt;
//        } else if( selectedItem == 3) {&lt;br /&gt;
//            window.orientation = 3&lt;br /&gt;
//        } else if( selectedItem == 4) {&lt;br /&gt;
//            window.orientation = 0&lt;br /&gt;
//        }&lt;br /&gt;
//    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Item {&lt;br /&gt;
        id: contentButtons&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        // Some Debug output to stderr ...&lt;br /&gt;
        onVisibleChanged: {&lt;br /&gt;
            console.log(&amp;quot;xxxxxxxxxxxxxx 1 Parent wid &amp;quot;, parent.width);&lt;br /&gt;
            console.log(&amp;quot;xxxxxxxxxxxxxx 2 Wid        &amp;quot;, width);&lt;br /&gt;
        }&lt;br /&gt;
        onWidthChanged: {&lt;br /&gt;
            console.log(&amp;quot;wwwwwwwwwwwwww 1 Parent wid &amp;quot;, parent.width);&lt;br /&gt;
            console.log(&amp;quot;wwwwwwwwwwwwww 2 Wid        &amp;quot;, width);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        property int buttonWidth: parent.width * 0.2;&lt;br /&gt;
        property int buttonHeight: 60;&lt;br /&gt;
        property int buttonMargins: 2;&lt;br /&gt;
&lt;br /&gt;
        property string activeButtonImage: &amp;quot;image://themedimage/widgets/common/button/button-default&amp;quot;&lt;br /&gt;
        property string buttonImage: &amp;quot;image://themedimage/widgets/common/button/button&amp;quot;&lt;br /&gt;
        property string buttonImagePressed: &amp;quot;image://themedimage/widgets/common/button/button-default-pressed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        //width: 2 * buttonWidth + 3 * buttonMargins&lt;br /&gt;
        height: buttonHeight&lt;br /&gt;
        anchors.top: parent.top&lt;br /&gt;
        anchors.topMargin:  10&lt;br /&gt;
        anchors.horizontalCenter: parent.horizontalCenter&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Button {&lt;br /&gt;
            id: flagsButton&lt;br /&gt;
            active: true&lt;br /&gt;
            width:  parent.buttonWidth; height: parent.buttonHeight&lt;br /&gt;
&lt;br /&gt;
            // Since there are only two buttons, the right of this button is near the center.&lt;br /&gt;
            anchors { margins: parent.buttonMargins; right: parent.horizontalCenter;}&lt;br /&gt;
            text: qsTr(&amp;quot;Flags&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: {&lt;br /&gt;
                mainPage.state = &amp;quot;flags&amp;quot;&lt;br /&gt;
                active = true&lt;br /&gt;
                browserButton.active = false&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Button {&lt;br /&gt;
            id: browserButton&lt;br /&gt;
&lt;br /&gt;
            width:  parent.buttonWidth; height: parent.buttonHeight&lt;br /&gt;
&lt;br /&gt;
            // This button is to the right of the flags button&lt;br /&gt;
            anchors { margins: parent.buttonMargins; left: flagsButton.right }&lt;br /&gt;
            text: qsTr(&amp;quot;File Browser&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: {&lt;br /&gt;
                mainPage.state = &amp;quot;browser&amp;quot;&lt;br /&gt;
                active = true&lt;br /&gt;
                flagsButton.active = false&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // This item holds the contents of the selected button and fills the rest of the window&lt;br /&gt;
    Item {&lt;br /&gt;
        id: contentSpace&lt;br /&gt;
&lt;br /&gt;
        anchors { top: contentButtons.bottom; bottom: parent.bottom; left: parent.left; right: parent.right }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    // One of these two components will fill the contentSpace Item above.&lt;br /&gt;
    FlagContent    { id: flagContent;    anchors.fill: contentSpace; anchors.top: contentButtons.bottom }&lt;br /&gt;
&lt;br /&gt;
    //Placeholder until BrowserContent.qml is present&lt;br /&gt;
    Rectangle      { id: browserContent; anchors.fill: contentSpace; anchors.top: contentButtons.bottom; color: &amp;quot;red&amp;quot;; }&lt;br /&gt;
    //BrowserContent { id: browserContent; anchors.fill: contentSpace }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Rectangle { z: -1; anchors.fill: parent; color: &amp;quot;grey&amp;quot; } //background&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    states:  [&lt;br /&gt;
        State {&lt;br /&gt;
            name: &amp;quot;flags&amp;quot;&lt;br /&gt;
            PropertyChanges { target: flagContent; visible: true }&lt;br /&gt;
            PropertyChanges { target: browserContent; visible: false }&lt;br /&gt;
        },&lt;br /&gt;
        State {&lt;br /&gt;
            name: &amp;quot;browser&amp;quot;&lt;br /&gt;
            PropertyChanges { target: flagContent; visible: false }&lt;br /&gt;
            PropertyChanges { target: browserContent; visible: true }&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Add the File FlagContent.qml ====&lt;br /&gt;
&lt;br /&gt;
This shows an example of using a QML ListView - which uses a delegate for a row to be displayed&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import QtQuick 1.0&lt;br /&gt;
&lt;br /&gt;
    ListView {&lt;br /&gt;
        clip: true&lt;br /&gt;
        model: myModel&lt;br /&gt;
        anchors.top: parent.bottom&lt;br /&gt;
        anchors.fill: parent&lt;br /&gt;
        delegate: Rectangle {&lt;br /&gt;
            color: Qt.rgba(0.9,0.9,0.9)&lt;br /&gt;
            height: childrenRect.height&lt;br /&gt;
            width: parent.width&lt;br /&gt;
            Image {&lt;br /&gt;
                id: image&lt;br /&gt;
                source: flag&lt;br /&gt;
                width: 64&lt;br /&gt;
                height: 64&lt;br /&gt;
                fillMode: Image.PreserveAspectFit&lt;br /&gt;
&lt;br /&gt;
                anchors { left:parent.left; leftMargin:30}&lt;br /&gt;
            }&lt;br /&gt;
            Text {&lt;br /&gt;
                text: display + &amp;quot;\n&amp;quot; +&amp;quot;population: &amp;quot; + population + &amp;quot; mill.&amp;quot;&lt;br /&gt;
                anchors { left:image.right; verticalCenter: image.verticalCenter; leftMargin: 5 }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modify main.qml ====&lt;br /&gt;
Remove this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    AppPage { id: gallery; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Uncomment this line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Component { id: gallery; MainPage {} }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Copy Resource Files ====&lt;br /&gt;
Copy the images and .qrc file from the solution directory:&lt;br /&gt;
&lt;br /&gt;
Add this to your simple-app.pro&lt;br /&gt;
RESOURCES += resources.qrc&lt;br /&gt;
&lt;br /&gt;
==== Rebuild and Run ====&lt;br /&gt;
Since we added new .cpp and .h files, it would be a good idea to Build-&amp;gt;Run Qmake; Build-&amp;gt;Rebuild All&lt;br /&gt;
&lt;br /&gt;
Run...&lt;br /&gt;
&lt;br /&gt;
=== Adding code for the File Browser ===&lt;br /&gt;
To see another mini-app for the &amp;quot;Browser&amp;quot; button, copy these files to your project from the solution directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BrowserContent.qml&lt;br /&gt;
FileSystemView.qml&lt;br /&gt;
ImageViewer.qml&lt;br /&gt;
PathDisplay.qml&lt;br /&gt;
&lt;br /&gt;
dirmodel.cpp&lt;br /&gt;
dirmodel.h&lt;br /&gt;
&lt;br /&gt;
main.cpp (new code added to register a Directory Model with QML named &amp;quot;_model&amp;quot; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Replace these two lines in MainPage.qml:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    Rectangle      { id: browserContent; anchors.fill: contentSpace; anchors.top: contentButtons.bottom; color: &amp;quot;red&amp;quot;; }&lt;br /&gt;
    //BrowserContent { id: browserContent; anchors.fill: contentSpace }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    BrowserContent { id: browserContent; anchors.fill: contentSpace }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Rebuild All ====&lt;br /&gt;
&lt;br /&gt;
==== Run ====&lt;br /&gt;
Clicking on the Browser button should allow you to browse the file system. If you click on a jpg or png, the image will be previewed.&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/QML/Sample_App_Using_CPP_Models</id>
		<title>QML/Sample App Using CPP Models</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/QML/Sample_App_Using_CPP_Models"/>
				<updated>2011-05-06T23:33:31Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
This tutorial will demonstrate a simple (but non-trivial) app which uses&lt;br /&gt;
* Meego UX Component widgets&lt;br /&gt;
* C++ models&lt;br /&gt;
* QML List Views&lt;br /&gt;
* QML Components&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes you have the MeeGo SDK installed on Linux&amp;lt;br/&amp;gt;&lt;br /&gt;
See: http://wiki.meego.com/SDK/Docs/1.2/MeeGo_SDK_1.2_Preview&lt;br /&gt;
&lt;br /&gt;
Also assumed: you have a a chroot / Xephyr environment set up.&amp;lt;br/&amp;gt;&lt;br /&gt;
* http://wiki.meego.com/MeeGo_UX_Components_Chroot_Tutorial&lt;br /&gt;
* http://wiki.meego.com/Developing_in_a_MeeGo_Environment&lt;br /&gt;
&lt;br /&gt;
This tutorial will use meego-ux-components objects like:&lt;br /&gt;
* Book Menus - &lt;br /&gt;
* Buttons&lt;br /&gt;
* AppPage&lt;br /&gt;
For other uses of Meego UX Components, and another tutorial of Book Menus, See: &lt;br /&gt;
* http://wiki.meego.com/MeeGo_UX_Components&lt;br /&gt;
* http://wiki.meego.com/MeeGo_UX_Tutorials&lt;br /&gt;
&lt;br /&gt;
Other QML Tutorials:&lt;br /&gt;
* http://wiki.meego.com/QML_tutorials&lt;br /&gt;
&lt;br /&gt;
== Follow these steps on a chroot / Xephyr system ==&lt;br /&gt;
&lt;br /&gt;
=== Start Qt Creator ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qtcreator &amp;amp;&amp;gt;/dev/null &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create a new project ===&lt;br /&gt;
... screen shots ...&lt;br /&gt;
&lt;br /&gt;
==== The auto-generated QML File looks like this: ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import QtQuick 1.0&lt;br /&gt;
&lt;br /&gt;
Rectangle {&lt;br /&gt;
    width: 360&lt;br /&gt;
    height: 360&lt;br /&gt;
    Text {&lt;br /&gt;
        text: &amp;quot;Hello World&amp;quot;&lt;br /&gt;
        anchors.centerIn: parent&lt;br /&gt;
    }&lt;br /&gt;
    MouseArea {&lt;br /&gt;
        anchors.fill: parent&lt;br /&gt;
        onClicked: {&lt;br /&gt;
            Qt.quit();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Turn off Shadow Build====&lt;br /&gt;
&lt;br /&gt;
==== Build-&amp;gt;Build All ====&lt;br /&gt;
&lt;br /&gt;
=== Run ===&lt;br /&gt;
(CTRL-R or Green &amp;quot;Play&amp;quot; Button)&lt;br /&gt;
&lt;br /&gt;
==== The running app looks like this: ====&lt;br /&gt;
&amp;lt;screen shot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clicking it closes the app (Qt.quit())&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add code to main.qml ===&lt;br /&gt;
&lt;br /&gt;
==== Replace the contents of main.qml with this: ====&lt;br /&gt;
The last 2 Component statements are commented out so the app will run as is before creating more files.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import Qt 4.7&lt;br /&gt;
import MeeGo.Components 0.1&lt;br /&gt;
&lt;br /&gt;
Window {&lt;br /&gt;
    id: window&lt;br /&gt;
&lt;br /&gt;
    bookMenuModel: [ qsTr(&amp;quot;Button Demo&amp;quot;), qsTr(&amp;quot;Book 2&amp;quot;) ]&lt;br /&gt;
    bookMenuPayload: [ gallery, book2 ]&lt;br /&gt;
    bookMenuTitle: qsTr(&amp;quot;Book Menu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    Component.onCompleted: switchBook( gallery )&lt;br /&gt;
&lt;br /&gt;
    //Component { id: gallery; MainPage {} }&lt;br /&gt;
    //Component { id: book2; Book2 {} }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Test / Run ====&lt;br /&gt;
Run the app and see the Book Menu. If you click on one of the menu items, you'll notice an error because of the commented out Component statements.&lt;br /&gt;
&lt;br /&gt;
=== Add code for the Book Page example ===&lt;br /&gt;
==== Adding the Book2 Component ====&lt;br /&gt;
(from the meego-ux-widgetgallery example)&lt;br /&gt;
* (right click on the QML folder in the Projects view and Add New... / QML File / &amp;quot;Book2.qml&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
* Replace the generated file Book2.qml with this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2011 Intel Corporation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is licensed under the terms and conditions of the&lt;br /&gt;
 * LGPL, version 2.1.  The full text of the LGPL Licence is at&lt;br /&gt;
 * http://www.gnu.org/licenses/lgpl.html&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* This file contains relativy empty pages and is meant to demonstrate the&lt;br /&gt;
   book/page concept */&lt;br /&gt;
&lt;br /&gt;
import Qt 4.7&lt;br /&gt;
&lt;br /&gt;
PageDummy {&lt;br /&gt;
    id: pageDummy&lt;br /&gt;
&lt;br /&gt;
    innerText: qsTr(&amp;quot;book 2, page 1&amp;quot;)&lt;br /&gt;
    rectColor: &amp;quot;lightblue&amp;quot;&lt;br /&gt;
    showButton: true&lt;br /&gt;
    buttonLabel: qsTr(&amp;quot;Page 2&amp;quot;)&lt;br /&gt;
    pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    onClicked: { addPage( page2 ) }&lt;br /&gt;
&lt;br /&gt;
    Component{&lt;br /&gt;
        id: page2;&lt;br /&gt;
&lt;br /&gt;
        PageDummy {&lt;br /&gt;
            id: pageDummy2&lt;br /&gt;
&lt;br /&gt;
            innerText: qsTr(&amp;quot;book 2, page 2&amp;quot;)&lt;br /&gt;
            rectColor: &amp;quot;lightgreen&amp;quot;&lt;br /&gt;
            showButton: true&lt;br /&gt;
            buttonLabel: qsTr(&amp;quot;Page 3&amp;quot;)&lt;br /&gt;
            pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: { addPage( page3 )&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    Component{&lt;br /&gt;
        id: page3;&lt;br /&gt;
&lt;br /&gt;
        PageDummy {&lt;br /&gt;
            id: pageDummy3&lt;br /&gt;
&lt;br /&gt;
            innerText: qsTr(&amp;quot;book 2, page 3&amp;quot;)&lt;br /&gt;
            rectColor: &amp;quot;orange&amp;quot;&lt;br /&gt;
            showButton: true&lt;br /&gt;
            buttonLabel: qsTr(&amp;quot;Page 4&amp;quot;)&lt;br /&gt;
            pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: { addPage( page4 )&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    Component{&lt;br /&gt;
        id: page4;&lt;br /&gt;
&lt;br /&gt;
        PageDummy {&lt;br /&gt;
            id: pageDummy4&lt;br /&gt;
&lt;br /&gt;
            innerText: qsTr(&amp;quot;book 2, page 4&amp;quot;)&lt;br /&gt;
            rectColor: &amp;quot;darkgrey&amp;quot;&lt;br /&gt;
            pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Add PageDummy.qml ====&lt;br /&gt;
The file Book2.qml references PageDummy.qml, so create it the same way as Book2.qml&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2011 Intel Corporation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is licensed under the terms and conditions of the&lt;br /&gt;
 * LGPL, version 2.1.  The full text of the LGPL Licence is at&lt;br /&gt;
 * http://www.gnu.org/licenses/lgpl.html&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* This file is just meant as a dummy to quickly create pages for&lt;br /&gt;
   demonstrating the book/page concept. */&lt;br /&gt;
import Qt 4.7&lt;br /&gt;
import MeeGo.Components 0.1&lt;br /&gt;
&lt;br /&gt;
AppPage {&lt;br /&gt;
    id: pageDummy&lt;br /&gt;
&lt;br /&gt;
    property alias innerText: rectText.text //text shown in the rect&lt;br /&gt;
    property alias rectColor: innerRect.color   //color of the rect in the middle&lt;br /&gt;
    property alias showButton: nextButton.visible   //nextButton visible?&lt;br /&gt;
    property alias buttonLabel: nextButton.text    //nextButton label&lt;br /&gt;
    property string bookTitle: &amp;quot;book title&amp;quot; //shown in the title bar&lt;br /&gt;
&lt;br /&gt;
    signal clicked()&lt;br /&gt;
&lt;br /&gt;
    anchors.fill:  parent&lt;br /&gt;
&lt;br /&gt;
    Rectangle { z: -1; anchors.fill: parent; color: &amp;quot;grey&amp;quot; } //background&lt;br /&gt;
&lt;br /&gt;
    Rectangle {&lt;br /&gt;
        id: innerRect&lt;br /&gt;
&lt;br /&gt;
        anchors.fill: parent&lt;br /&gt;
        anchors.margins:  50&lt;br /&gt;
        color: &amp;quot;lightgreen&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Text {&lt;br /&gt;
            id: rectText&lt;br /&gt;
&lt;br /&gt;
            text: &amp;quot;dummy page&amp;quot;&lt;br /&gt;
            anchors.centerIn: parent&lt;br /&gt;
            font.pixelSize: 40&lt;br /&gt;
            color: &amp;quot;black&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    Button {&lt;br /&gt;
        id: nextButton&lt;br /&gt;
&lt;br /&gt;
        visible: false&lt;br /&gt;
        text: &amp;quot;next page &amp;gt;&amp;quot;&lt;br /&gt;
        anchors.right:  innerRect.right&lt;br /&gt;
        anchors.bottom:  innerRect.bottom&lt;br /&gt;
        anchors.margins: 10&lt;br /&gt;
        onClicked: { pageDummy.clicked() }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see the use of the meego-ux-components &amp;quot;Button&amp;quot; and &amp;quot;AppPage&amp;quot; components in PageDummy.qml&lt;br /&gt;
&lt;br /&gt;
==== Now, replace the two commented out Component statements in main.qml with:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    Component {&lt;br /&gt;
        id: gallery;&lt;br /&gt;
        AppPage {id: dummy2}&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Dummy page until MainPage.qml is defined&lt;br /&gt;
    AppPage { id: gallery; }&lt;br /&gt;
    //Component { id: gallery; MainPage {} }&lt;br /&gt;
&lt;br /&gt;
    Component { id: book2; Book2 {} }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the MainPage.qml file isn't created yet, we use a dummy AppPage placeholder temporarily to prevent a run-time error when invoking the menu.&lt;br /&gt;
&lt;br /&gt;
=== Run ===&lt;br /&gt;
You can now click on the Book2 menu and see a new page. &lt;br /&gt;
&lt;br /&gt;
=== Add code for seeing Custom List Views in the MainPage ===&lt;br /&gt;
&lt;br /&gt;
We will use a C++ QAbstractListModel to repersent out list.&lt;br /&gt;
&lt;br /&gt;
==== mymodel.h ====&lt;br /&gt;
Create the file mymodel.h by right-clicking on the simple-app project name and &amp;quot;Add New...&amp;quot; a C++ Header File&lt;br /&gt;
&lt;br /&gt;
Paste this into mymodel.h&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#ifndef MYMODEL_H&lt;br /&gt;
#define MYMODEL_H&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;QAbstractListModel&amp;gt;&lt;br /&gt;
#include &amp;lt;QColor&amp;gt;&lt;br /&gt;
&lt;br /&gt;
struct Data {&lt;br /&gt;
    Data( const char* name, const QString&amp;amp; flag, double population )&lt;br /&gt;
        : name(name), flag(flag), population(population) {}&lt;br /&gt;
    QString name;&lt;br /&gt;
    QString flag;&lt;br /&gt;
    double population;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
const int FlagRole = Qt::UserRole + 1;&lt;br /&gt;
const int PopulationRole = Qt::UserRole + 2;&lt;br /&gt;
class MyModel : public QAbstractListModel&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    MyModel();&lt;br /&gt;
    int rowCount( const QModelIndex&amp;amp; ) const;&lt;br /&gt;
    QVariant data( const QModelIndex&amp;amp; index, int role = Qt::DisplayRole ) const;&lt;br /&gt;
&lt;br /&gt;
    QList&amp;lt; Data &amp;gt; m_data;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#endif // MYMODEL_H&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Create the mymodel.cpp file with this content:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;mymodel.h&amp;quot;&lt;br /&gt;
#include &amp;lt;QByteArray&amp;gt;&lt;br /&gt;
MyModel::MyModel()&lt;br /&gt;
{&lt;br /&gt;
    m_data&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Denmark&amp;quot;, &amp;quot;qrc:images/denmark.jpg&amp;quot;, 5.4)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Sweden&amp;quot;, &amp;quot;qrc:images/sweden.jpg&amp;quot;, 9.3)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Iceland&amp;quot;, &amp;quot;qrc:images/iceland.jpg&amp;quot;, 3.2)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Norway&amp;quot;, &amp;quot;qrc:images/norway.jpg&amp;quot;, 4.8)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Finland&amp;quot;, &amp;quot;qrc:images/finland.jpg&amp;quot;, 5.3);&lt;br /&gt;
&lt;br /&gt;
    // By default the DisplayRole is mapped to the propery &amp;quot;display&amp;quot;&lt;br /&gt;
    QHash&amp;lt;int, QByteArray&amp;gt; mapping =roleNames();&lt;br /&gt;
    mapping.insert( FlagRole, &amp;quot;flag&amp;quot;);&lt;br /&gt;
    mapping.insert( PopulationRole, &amp;quot;population&amp;quot;);&lt;br /&gt;
    setRoleNames( mapping );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int MyModel::rowCount( const QModelIndex&amp;amp; ) const&lt;br /&gt;
{&lt;br /&gt;
    return m_data.count();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
QVariant MyModel::data(const QModelIndex &amp;amp;index, int role) const&lt;br /&gt;
{&lt;br /&gt;
    if ( !index.isValid() )&lt;br /&gt;
        return QVariant();&lt;br /&gt;
&lt;br /&gt;
    Data data = m_data[index.row()];&lt;br /&gt;
    if ( role == Qt::DisplayRole )&lt;br /&gt;
        return data.name;&lt;br /&gt;
    else if ( role == FlagRole )&lt;br /&gt;
        return data.flag;&lt;br /&gt;
    else if ( role == PopulationRole )&lt;br /&gt;
        return data.population;&lt;br /&gt;
    else&lt;br /&gt;
        return QVariant();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modify main.cpp ====&lt;br /&gt;
Modify main.cpp by replacing its contents with this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;QtGui/QApplication&amp;gt;&lt;br /&gt;
#include &amp;lt;QDeclarativeEngine&amp;gt;&lt;br /&gt;
#include &amp;lt;QDeclarativeContext&amp;gt;&lt;br /&gt;
#include &amp;quot;qmlapplicationviewer.h&amp;quot;&lt;br /&gt;
#include &amp;quot;mymodel.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
    QApplication app(argc, argv);&lt;br /&gt;
&lt;br /&gt;
    MyModel model;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    QmlApplicationViewer viewer;&lt;br /&gt;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);&lt;br /&gt;
    viewer.setMainQmlFile(QLatin1String(&amp;quot;qml/simple-app/main.qml&amp;quot;));&lt;br /&gt;
    viewer.showExpanded();&lt;br /&gt;
&lt;br /&gt;
    // Register the model &amp;quot;myModel&amp;quot; with QML&lt;br /&gt;
    QDeclarativeContext *context = viewer.engine()-&amp;gt;rootContext();&lt;br /&gt;
    context-&amp;gt;setContextProperty(&amp;quot;myModel&amp;quot;, &amp;amp;model);&lt;br /&gt;
&lt;br /&gt;
    return app.exec();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Add the file MainPage.qml ====&lt;br /&gt;
&lt;br /&gt;
A Component called MainPage.qml which will display a custom ListView:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2011 Intel Corporation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is licensed under the terms and conditions of the&lt;br /&gt;
 * LGPL, version 2.1.  The full text of the LGPL Licence is at&lt;br /&gt;
 * http://www.gnu.org/licenses/lgpl.html&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* The MainPage lets the user switch between different contents which&lt;br /&gt;
   show the widgets available in these components. */&lt;br /&gt;
&lt;br /&gt;
//import Qt 4.7&lt;br /&gt;
import QtQuick 1.0&lt;br /&gt;
import MeeGo.Components 0.1&lt;br /&gt;
&lt;br /&gt;
AppPage {&lt;br /&gt;
    id: mainPage&lt;br /&gt;
&lt;br /&gt;
    // This will be the first app / content displayed in the Button Demo page&lt;br /&gt;
    state: &amp;quot;flags&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    pageTitle: qsTr(&amp;quot;Button Demo&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    // Demo an Action Menu......&lt;br /&gt;
    // Comment the block below to see a new Action Menu&lt;br /&gt;
&lt;br /&gt;
//    actionMenuModel: [ qsTr(&amp;quot;Landscape&amp;quot;),&lt;br /&gt;
//                       qsTr(&amp;quot;Portrait&amp;quot;),&lt;br /&gt;
//                       qsTr(&amp;quot;Inv. Landscape&amp;quot;),&lt;br /&gt;
//                       qsTr(&amp;quot;Inv. Portrait&amp;quot;) ]&lt;br /&gt;
//    actionMenuPayload: [  1, 2, 3, 4 ]&lt;br /&gt;
//    actionMenuTitle: qsTr(&amp;quot;Action Menu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
//    onActionMenuTriggered: {&lt;br /&gt;
&lt;br /&gt;
//        if( selectedItem == 1) {&lt;br /&gt;
//            window.orientation = 1&lt;br /&gt;
//        } else if( selectedItem == 2) {&lt;br /&gt;
//            window.orientation = 2&lt;br /&gt;
//        } else if( selectedItem == 3) {&lt;br /&gt;
//            window.orientation = 3&lt;br /&gt;
//        } else if( selectedItem == 4) {&lt;br /&gt;
//            window.orientation = 0&lt;br /&gt;
//        }&lt;br /&gt;
//    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Item {&lt;br /&gt;
        id: contentButtons&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        // Some Debug output to stderr ...&lt;br /&gt;
        onVisibleChanged: {&lt;br /&gt;
            console.log(&amp;quot;xxxxxxxxxxxxxx 1 Parent wid &amp;quot;, parent.width);&lt;br /&gt;
            console.log(&amp;quot;xxxxxxxxxxxxxx 2 Wid        &amp;quot;, width);&lt;br /&gt;
        }&lt;br /&gt;
        onWidthChanged: {&lt;br /&gt;
            console.log(&amp;quot;wwwwwwwwwwwwww 1 Parent wid &amp;quot;, parent.width);&lt;br /&gt;
            console.log(&amp;quot;wwwwwwwwwwwwww 2 Wid        &amp;quot;, width);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        property int buttonWidth: parent.width * 0.2;&lt;br /&gt;
        property int buttonHeight: 60;&lt;br /&gt;
        property int buttonMargins: 2;&lt;br /&gt;
&lt;br /&gt;
        property string activeButtonImage: &amp;quot;image://themedimage/widgets/common/button/button-default&amp;quot;&lt;br /&gt;
        property string buttonImage: &amp;quot;image://themedimage/widgets/common/button/button&amp;quot;&lt;br /&gt;
        property string buttonImagePressed: &amp;quot;image://themedimage/widgets/common/button/button-default-pressed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        //width: 2 * buttonWidth + 3 * buttonMargins&lt;br /&gt;
        height: buttonHeight&lt;br /&gt;
        anchors.top: parent.top&lt;br /&gt;
        anchors.topMargin:  10&lt;br /&gt;
        anchors.horizontalCenter: parent.horizontalCenter&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Button {&lt;br /&gt;
            id: flagsButton&lt;br /&gt;
            active: true&lt;br /&gt;
            width:  parent.buttonWidth; height: parent.buttonHeight&lt;br /&gt;
&lt;br /&gt;
            // Since there are only two buttons, the right of this button is near the center.&lt;br /&gt;
            anchors { margins: parent.buttonMargins; right: parent.horizontalCenter;}&lt;br /&gt;
            text: qsTr(&amp;quot;Flags&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: {&lt;br /&gt;
                mainPage.state = &amp;quot;flags&amp;quot;&lt;br /&gt;
                active = true&lt;br /&gt;
                browserButton.active = false&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Button {&lt;br /&gt;
            id: browserButton&lt;br /&gt;
&lt;br /&gt;
            width:  parent.buttonWidth; height: parent.buttonHeight&lt;br /&gt;
&lt;br /&gt;
            // This button is to the right of the flags button&lt;br /&gt;
            anchors { margins: parent.buttonMargins; left: flagsButton.right }&lt;br /&gt;
            text: qsTr(&amp;quot;File Browser&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: {&lt;br /&gt;
                mainPage.state = &amp;quot;browser&amp;quot;&lt;br /&gt;
                active = true&lt;br /&gt;
                flagsButton.active = false&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // This item holds the contents of the selected button and fills the rest of the window&lt;br /&gt;
    Item {&lt;br /&gt;
        id: contentSpace&lt;br /&gt;
&lt;br /&gt;
        anchors { top: contentButtons.bottom; bottom: parent.bottom; left: parent.left; right: parent.right }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    // One of these two components will fill the contentSpace Item above.&lt;br /&gt;
    FlagContent    { id: flagContent;    anchors.fill: contentSpace; anchors.top: contentButtons.bottom }&lt;br /&gt;
&lt;br /&gt;
    //Placeholder until BrowserContent.qml is present&lt;br /&gt;
    Rectangle      { id: browserContent; anchors.fill: contentSpace; anchors.top: contentButtons.bottom; color: &amp;quot;red&amp;quot;; }&lt;br /&gt;
    //BrowserContent { id: browserContent; anchors.fill: contentSpace }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Rectangle { z: -1; anchors.fill: parent; color: &amp;quot;grey&amp;quot; } //background&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    states:  [&lt;br /&gt;
        State {&lt;br /&gt;
            name: &amp;quot;flags&amp;quot;&lt;br /&gt;
            PropertyChanges { target: flagContent; visible: true }&lt;br /&gt;
            PropertyChanges { target: browserContent; visible: false }&lt;br /&gt;
        },&lt;br /&gt;
        State {&lt;br /&gt;
            name: &amp;quot;browser&amp;quot;&lt;br /&gt;
            PropertyChanges { target: flagContent; visible: false }&lt;br /&gt;
            PropertyChanges { target: browserContent; visible: true }&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Add the File FlagContent.qml ====&lt;br /&gt;
&lt;br /&gt;
This shows an example of using a QML ListView - which uses a delegate for a row to be displayed&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import QtQuick 1.0&lt;br /&gt;
&lt;br /&gt;
    ListView {&lt;br /&gt;
        clip: true&lt;br /&gt;
        model: myModel&lt;br /&gt;
        anchors.top: parent.bottom&lt;br /&gt;
        anchors.fill: parent&lt;br /&gt;
        delegate: Rectangle {&lt;br /&gt;
            color: Qt.rgba(0.9,0.9,0.9)&lt;br /&gt;
            height: childrenRect.height&lt;br /&gt;
            width: parent.width&lt;br /&gt;
            Image {&lt;br /&gt;
                id: image&lt;br /&gt;
                source: flag&lt;br /&gt;
                width: 64&lt;br /&gt;
                height: 64&lt;br /&gt;
                fillMode: Image.PreserveAspectFit&lt;br /&gt;
&lt;br /&gt;
                anchors { left:parent.left; leftMargin:30}&lt;br /&gt;
            }&lt;br /&gt;
            Text {&lt;br /&gt;
                text: display + &amp;quot;\n&amp;quot; +&amp;quot;population: &amp;quot; + population + &amp;quot; mill.&amp;quot;&lt;br /&gt;
                anchors { left:image.right; verticalCenter: image.verticalCenter; leftMargin: 5 }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modify main.qml ====&lt;br /&gt;
Remove this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    AppPage { id: gallery; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Uncomment this line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Component { id: gallery; MainPage {} }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Copy Resource Files ====&lt;br /&gt;
Copy the images and .qrc file from the solution directory:&lt;br /&gt;
&lt;br /&gt;
Add this to your simple-app.pro&lt;br /&gt;
RESOURCES += resources.qrc&lt;br /&gt;
&lt;br /&gt;
==== Rebuild and Run ====&lt;br /&gt;
Since we added new .cpp and .h files, it would be a good idea to Build-&amp;gt;Run Qmake; Build-&amp;gt;Rebuild All&lt;br /&gt;
&lt;br /&gt;
Run...&lt;br /&gt;
&lt;br /&gt;
=== Adding code for the File Browser ===&lt;br /&gt;
To see another mini-app for the &amp;quot;Browser&amp;quot; button, copy these files to your project from the solution directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BrowserContent.qml&lt;br /&gt;
FileSystemView.qml&lt;br /&gt;
ImageViewer.qml&lt;br /&gt;
PathDisplay.qml&lt;br /&gt;
&lt;br /&gt;
dirmodel.cpp&lt;br /&gt;
dirmodel.h&lt;br /&gt;
&lt;br /&gt;
main.cpp (new code added to register a Directory Model with QML named &amp;quot;_model&amp;quot; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Replace these two lines in MainPage.qml:====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    Rectangle      { id: browserContent; anchors.fill: contentSpace; anchors.top: contentButtons.bottom; color: &amp;quot;red&amp;quot;; }&lt;br /&gt;
    //BrowserContent { id: browserContent; anchors.fill: contentSpace }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    BrowserContent { id: browserContent; anchors.fill: contentSpace }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Rebuild All ====&lt;br /&gt;
&lt;br /&gt;
==== Run ====&lt;br /&gt;
Clicking on the Browser button should allow you to browse the file system. If you click on a jpg or png, the image will be previewed.&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/QML/Sample_App_Using_CPP_Models</id>
		<title>QML/Sample App Using CPP Models</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/QML/Sample_App_Using_CPP_Models"/>
				<updated>2011-05-06T23:10:02Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: Initial Edit of QML / C++ / Meego UX Components Tutorial&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
This tutorial will demonstrate a simple (but non-trivial) app which uses&lt;br /&gt;
* Meego UX Component widgets&lt;br /&gt;
* C++ models&lt;br /&gt;
* QML List Views&lt;br /&gt;
* QML Components&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes you have the MeeGo SDK installed on Linux&amp;lt;br/&amp;gt;&lt;br /&gt;
See: http://wiki.meego.com/SDK/Docs/1.2/MeeGo_SDK_1.2_Preview&lt;br /&gt;
&lt;br /&gt;
Also assumed: you have a a chroot / Xephyr environment set up.&amp;lt;br/&amp;gt;&lt;br /&gt;
* http://wiki.meego.com/MeeGo_UX_Components_Chroot_Tutorial&lt;br /&gt;
* http://wiki.meego.com/Developing_in_a_MeeGo_Environment&lt;br /&gt;
&lt;br /&gt;
This tutorial will use meego-ux-components objects like:&lt;br /&gt;
* Book Menus - &lt;br /&gt;
* Buttons&lt;br /&gt;
* AppPage&lt;br /&gt;
For other uses of Meego UX Components, and another tutorial of Book Menus, See: &lt;br /&gt;
* http://wiki.meego.com/MeeGo_UX_Components&lt;br /&gt;
* http://wiki.meego.com/MeeGo_UX_Tutorials&lt;br /&gt;
&lt;br /&gt;
Other QML Tutorials:&lt;br /&gt;
* http://wiki.meego.com/QML_tutorials&lt;br /&gt;
&lt;br /&gt;
== Follow these steps on a chroot / Xephyr system ==&lt;br /&gt;
&lt;br /&gt;
=== Start Qt Creator ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qtcreator &amp;amp;&amp;gt;/dev/null &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create a new project ===&lt;br /&gt;
... screen shots ...&lt;br /&gt;
&lt;br /&gt;
==== The auto-generated QML File looks like this: ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import QtQuick 1.0&lt;br /&gt;
&lt;br /&gt;
Rectangle {&lt;br /&gt;
    width: 360&lt;br /&gt;
    height: 360&lt;br /&gt;
    Text {&lt;br /&gt;
        text: &amp;quot;Hello World&amp;quot;&lt;br /&gt;
        anchors.centerIn: parent&lt;br /&gt;
    }&lt;br /&gt;
    MouseArea {&lt;br /&gt;
        anchors.fill: parent&lt;br /&gt;
        onClicked: {&lt;br /&gt;
            Qt.quit();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Turn off Shadow Build====&lt;br /&gt;
&lt;br /&gt;
==== Build-&amp;gt;Build All ====&lt;br /&gt;
&lt;br /&gt;
=== Run ===&lt;br /&gt;
(CTRL-R or Green &amp;quot;Play&amp;quot; Button) ====&lt;br /&gt;
&lt;br /&gt;
==== The running app looks like this: ====&lt;br /&gt;
&amp;lt;screen shot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clicking it closes the app (Qt.quit())&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add code to main.qml ===&lt;br /&gt;
&lt;br /&gt;
==== Replace the contents of main.qml with this: ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import Qt 4.7&lt;br /&gt;
import MeeGo.Components 0.1&lt;br /&gt;
&lt;br /&gt;
Window {&lt;br /&gt;
    id: window&lt;br /&gt;
&lt;br /&gt;
    bookMenuModel: [ qsTr(&amp;quot;Button Demo&amp;quot;), qsTr(&amp;quot;Book 2&amp;quot;) ]&lt;br /&gt;
    bookMenuPayload: [ gallery, book2 ]&lt;br /&gt;
    bookMenuTitle: qsTr(&amp;quot;Book Menu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    Component.onCompleted: switchBook( gallery )&lt;br /&gt;
&lt;br /&gt;
    //Component { id: gallery; MainPage {} }&lt;br /&gt;
    //Component { id: book2; Book2 {} }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Test / Run ====&lt;br /&gt;
Run the app and see the Book Menu. If you click on one of the menu items, you'll notice an error because of the commented out Component statements.&lt;br /&gt;
&lt;br /&gt;
Adding the Book2 Component (from the meego-ux-widgetgallery example)&lt;br /&gt;
(right click on the QML folder in the Projects view and Add New... / QML File / &amp;quot;Book2.qml&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Replace the generated file Book2.qml with this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2011 Intel Corporation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is licensed under the terms and conditions of the&lt;br /&gt;
 * LGPL, version 2.1.  The full text of the LGPL Licence is at&lt;br /&gt;
 * http://www.gnu.org/licenses/lgpl.html&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* This file contains relativy empty pages and is meant to demonstrate the&lt;br /&gt;
   book/page concept */&lt;br /&gt;
&lt;br /&gt;
import Qt 4.7&lt;br /&gt;
&lt;br /&gt;
PageDummy {&lt;br /&gt;
    id: pageDummy&lt;br /&gt;
&lt;br /&gt;
    innerText: qsTr(&amp;quot;book 2, page 1&amp;quot;)&lt;br /&gt;
    rectColor: &amp;quot;lightblue&amp;quot;&lt;br /&gt;
    showButton: true&lt;br /&gt;
    buttonLabel: qsTr(&amp;quot;Page 2&amp;quot;)&lt;br /&gt;
    pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    onClicked: { addPage( page2 ) }&lt;br /&gt;
&lt;br /&gt;
    Component{&lt;br /&gt;
        id: page2;&lt;br /&gt;
&lt;br /&gt;
        PageDummy {&lt;br /&gt;
            id: pageDummy2&lt;br /&gt;
&lt;br /&gt;
            innerText: qsTr(&amp;quot;book 2, page 2&amp;quot;)&lt;br /&gt;
            rectColor: &amp;quot;lightgreen&amp;quot;&lt;br /&gt;
            showButton: true&lt;br /&gt;
            buttonLabel: qsTr(&amp;quot;Page 3&amp;quot;)&lt;br /&gt;
            pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: { addPage( page3 )&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    Component{&lt;br /&gt;
        id: page3;&lt;br /&gt;
&lt;br /&gt;
        PageDummy {&lt;br /&gt;
            id: pageDummy3&lt;br /&gt;
&lt;br /&gt;
            innerText: qsTr(&amp;quot;book 2, page 3&amp;quot;)&lt;br /&gt;
            rectColor: &amp;quot;orange&amp;quot;&lt;br /&gt;
            showButton: true&lt;br /&gt;
            buttonLabel: qsTr(&amp;quot;Page 4&amp;quot;)&lt;br /&gt;
            pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: { addPage( page4 )&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    Component{&lt;br /&gt;
        id: page4;&lt;br /&gt;
&lt;br /&gt;
        PageDummy {&lt;br /&gt;
            id: pageDummy4&lt;br /&gt;
&lt;br /&gt;
            innerText: qsTr(&amp;quot;book 2, page 4&amp;quot;)&lt;br /&gt;
            rectColor: &amp;quot;darkgrey&amp;quot;&lt;br /&gt;
            pageTitle: qsTr(&amp;quot;Dummy book 2&amp;quot;)&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The file Book2.qml references PageDummy.qml, so create it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2011 Intel Corporation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is licensed under the terms and conditions of the&lt;br /&gt;
 * LGPL, version 2.1.  The full text of the LGPL Licence is at&lt;br /&gt;
 * http://www.gnu.org/licenses/lgpl.html&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* This file is just meant as a dummy to quickly create pages for&lt;br /&gt;
   demonstrating the book/page concept. */&lt;br /&gt;
import Qt 4.7&lt;br /&gt;
import MeeGo.Components 0.1&lt;br /&gt;
&lt;br /&gt;
AppPage {&lt;br /&gt;
    id: pageDummy&lt;br /&gt;
&lt;br /&gt;
    property alias innerText: rectText.text //text shown in the rect&lt;br /&gt;
    property alias rectColor: innerRect.color   //color of the rect in the middle&lt;br /&gt;
    property alias showButton: nextButton.visible   //nextButton visible?&lt;br /&gt;
    property alias buttonLabel: nextButton.text    //nextButton label&lt;br /&gt;
    property string bookTitle: &amp;quot;book title&amp;quot; //shown in the title bar&lt;br /&gt;
&lt;br /&gt;
    signal clicked()&lt;br /&gt;
&lt;br /&gt;
    anchors.fill:  parent&lt;br /&gt;
&lt;br /&gt;
    Rectangle { z: -1; anchors.fill: parent; color: &amp;quot;grey&amp;quot; } //background&lt;br /&gt;
&lt;br /&gt;
    Rectangle {&lt;br /&gt;
        id: innerRect&lt;br /&gt;
&lt;br /&gt;
        anchors.fill: parent&lt;br /&gt;
        anchors.margins:  50&lt;br /&gt;
        color: &amp;quot;lightgreen&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        Text {&lt;br /&gt;
            id: rectText&lt;br /&gt;
&lt;br /&gt;
            text: &amp;quot;dummy page&amp;quot;&lt;br /&gt;
            anchors.centerIn: parent&lt;br /&gt;
            font.pixelSize: 40&lt;br /&gt;
            color: &amp;quot;black&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    Button {&lt;br /&gt;
        id: nextButton&lt;br /&gt;
&lt;br /&gt;
        visible: false&lt;br /&gt;
        text: &amp;quot;next page &amp;gt;&amp;quot;&lt;br /&gt;
        anchors.right:  innerRect.right&lt;br /&gt;
        anchors.bottom:  innerRect.bottom&lt;br /&gt;
        anchors.margins: 10&lt;br /&gt;
        onClicked: { pageDummy.clicked() }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will see the use of the meego-ux-components &amp;quot;Button&amp;quot; and &amp;quot;AppPage&amp;quot; components in PageDummy.qml&lt;br /&gt;
&lt;br /&gt;
Now, replace the two commented out Component statements in main.qml with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    Component {&lt;br /&gt;
        id: gallery;&lt;br /&gt;
        AppPage {id: dummy2}&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Dummy page until MainPage.qml is defined&lt;br /&gt;
    AppPage { id: gallery; }&lt;br /&gt;
    //Component { id: gallery; MainPage {} }&lt;br /&gt;
&lt;br /&gt;
    Component { id: book2; Book2 {} }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the MainPage.qml file isn't created yet, use a dummy AppPage placeholder temprarily to prevent a run-time error when invoking the menu.&lt;br /&gt;
&lt;br /&gt;
You can now click on the Book2 menu and see a new page. &lt;br /&gt;
&lt;br /&gt;
Continue with the Tutorial for seeing custom List Views in the MainPage...&lt;br /&gt;
&lt;br /&gt;
Now, we're going to create a Component called MainPage.qml which will display a custom ListView:&lt;br /&gt;
&lt;br /&gt;
We will use a C++ QAbstractListModel to repersent out list.&lt;br /&gt;
&lt;br /&gt;
Create the file mymodel.h by right-clicking on the simple-app project name and &amp;quot;Add New...&amp;quot; a C++ Header File&lt;br /&gt;
&lt;br /&gt;
Paste this into mymodel.h&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#ifndef MYMODEL_H&lt;br /&gt;
#define MYMODEL_H&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;QAbstractListModel&amp;gt;&lt;br /&gt;
#include &amp;lt;QColor&amp;gt;&lt;br /&gt;
&lt;br /&gt;
struct Data {&lt;br /&gt;
    Data( const char* name, const QString&amp;amp; flag, double population )&lt;br /&gt;
        : name(name), flag(flag), population(population) {}&lt;br /&gt;
    QString name;&lt;br /&gt;
    QString flag;&lt;br /&gt;
    double population;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
const int FlagRole = Qt::UserRole + 1;&lt;br /&gt;
const int PopulationRole = Qt::UserRole + 2;&lt;br /&gt;
class MyModel : public QAbstractListModel&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    MyModel();&lt;br /&gt;
    int rowCount( const QModelIndex&amp;amp; ) const;&lt;br /&gt;
    QVariant data( const QModelIndex&amp;amp; index, int role = Qt::DisplayRole ) const;&lt;br /&gt;
&lt;br /&gt;
    QList&amp;lt; Data &amp;gt; m_data;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#endif // MYMODEL_H&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the mymodel.cpp file with this content:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;mymodel.h&amp;quot;&lt;br /&gt;
#include &amp;lt;QByteArray&amp;gt;&lt;br /&gt;
MyModel::MyModel()&lt;br /&gt;
{&lt;br /&gt;
    m_data&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Denmark&amp;quot;, &amp;quot;qrc:images/denmark.jpg&amp;quot;, 5.4)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Sweden&amp;quot;, &amp;quot;qrc:images/sweden.jpg&amp;quot;, 9.3)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Iceland&amp;quot;, &amp;quot;qrc:images/iceland.jpg&amp;quot;, 3.2)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Norway&amp;quot;, &amp;quot;qrc:images/norway.jpg&amp;quot;, 4.8)&lt;br /&gt;
        &amp;lt;&amp;lt; Data(&amp;quot;Finland&amp;quot;, &amp;quot;qrc:images/finland.jpg&amp;quot;, 5.3);&lt;br /&gt;
&lt;br /&gt;
    // By default the DisplayRole is mapped to the propery &amp;quot;display&amp;quot;&lt;br /&gt;
    QHash&amp;lt;int, QByteArray&amp;gt; mapping =roleNames();&lt;br /&gt;
    mapping.insert( FlagRole, &amp;quot;flag&amp;quot;);&lt;br /&gt;
    mapping.insert( PopulationRole, &amp;quot;population&amp;quot;);&lt;br /&gt;
    setRoleNames( mapping );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int MyModel::rowCount( const QModelIndex&amp;amp; ) const&lt;br /&gt;
{&lt;br /&gt;
    return m_data.count();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
QVariant MyModel::data(const QModelIndex &amp;amp;index, int role) const&lt;br /&gt;
{&lt;br /&gt;
    if ( !index.isValid() )&lt;br /&gt;
        return QVariant();&lt;br /&gt;
&lt;br /&gt;
    Data data = m_data[index.row()];&lt;br /&gt;
    if ( role == Qt::DisplayRole )&lt;br /&gt;
        return data.name;&lt;br /&gt;
    else if ( role == FlagRole )&lt;br /&gt;
        return data.flag;&lt;br /&gt;
    else if ( role == PopulationRole )&lt;br /&gt;
        return data.population;&lt;br /&gt;
    else&lt;br /&gt;
        return QVariant();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modify main.cpp by replacing its contents with this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;QtGui/QApplication&amp;gt;&lt;br /&gt;
#include &amp;lt;QDeclarativeEngine&amp;gt;&lt;br /&gt;
#include &amp;lt;QDeclarativeContext&amp;gt;&lt;br /&gt;
#include &amp;quot;qmlapplicationviewer.h&amp;quot;&lt;br /&gt;
#include &amp;quot;mymodel.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
    QApplication app(argc, argv);&lt;br /&gt;
&lt;br /&gt;
    MyModel model;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    QmlApplicationViewer viewer;&lt;br /&gt;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);&lt;br /&gt;
    viewer.setMainQmlFile(QLatin1String(&amp;quot;qml/simple-app/main.qml&amp;quot;));&lt;br /&gt;
    viewer.showExpanded();&lt;br /&gt;
&lt;br /&gt;
    // Register the model &amp;quot;myModel&amp;quot; with QML&lt;br /&gt;
    QDeclarativeContext *context = viewer.engine()-&amp;gt;rootContext();&lt;br /&gt;
    context-&amp;gt;setContextProperty(&amp;quot;myModel&amp;quot;, &amp;amp;model);&lt;br /&gt;
&lt;br /&gt;
    return app.exec();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, add the file MainPage.qml&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2011 Intel Corporation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is licensed under the terms and conditions of the&lt;br /&gt;
 * LGPL, version 2.1.  The full text of the LGPL Licence is at&lt;br /&gt;
 * http://www.gnu.org/licenses/lgpl.html&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* The MainPage lets the user switch between different contents which&lt;br /&gt;
   show the widgets available in these components. */&lt;br /&gt;
&lt;br /&gt;
//import Qt 4.7&lt;br /&gt;
import QtQuick 1.0&lt;br /&gt;
import MeeGo.Components 0.1&lt;br /&gt;
&lt;br /&gt;
AppPage {&lt;br /&gt;
    id: mainPage&lt;br /&gt;
&lt;br /&gt;
    // This will be the first app / content displayed in the Button Demo page&lt;br /&gt;
    state: &amp;quot;flags&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    pageTitle: qsTr(&amp;quot;Button Demo&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    // Demo an Action Menu......&lt;br /&gt;
    // Comment the block below to see a new Action Menu&lt;br /&gt;
&lt;br /&gt;
//    actionMenuModel: [ qsTr(&amp;quot;Landscape&amp;quot;),&lt;br /&gt;
//                       qsTr(&amp;quot;Portrait&amp;quot;),&lt;br /&gt;
//                       qsTr(&amp;quot;Inv. Landscape&amp;quot;),&lt;br /&gt;
//                       qsTr(&amp;quot;Inv. Portrait&amp;quot;) ]&lt;br /&gt;
//    actionMenuPayload: [  1, 2, 3, 4 ]&lt;br /&gt;
//    actionMenuTitle: qsTr(&amp;quot;Action Menu&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
//    onActionMenuTriggered: {&lt;br /&gt;
&lt;br /&gt;
//        if( selectedItem == 1) {&lt;br /&gt;
//            window.orientation = 1&lt;br /&gt;
//        } else if( selectedItem == 2) {&lt;br /&gt;
//            window.orientation = 2&lt;br /&gt;
//        } else if( selectedItem == 3) {&lt;br /&gt;
//            window.orientation = 3&lt;br /&gt;
//        } else if( selectedItem == 4) {&lt;br /&gt;
//            window.orientation = 0&lt;br /&gt;
//        }&lt;br /&gt;
//    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Item {&lt;br /&gt;
        id: contentButtons&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        // Some Debug output to stderr ...&lt;br /&gt;
        onVisibleChanged: {&lt;br /&gt;
            console.log(&amp;quot;xxxxxxxxxxxxxx 1 Parent wid &amp;quot;, parent.width);&lt;br /&gt;
            console.log(&amp;quot;xxxxxxxxxxxxxx 2 Wid        &amp;quot;, width);&lt;br /&gt;
        }&lt;br /&gt;
        onWidthChanged: {&lt;br /&gt;
            console.log(&amp;quot;wwwwwwwwwwwwww 1 Parent wid &amp;quot;, parent.width);&lt;br /&gt;
            console.log(&amp;quot;wwwwwwwwwwwwww 2 Wid        &amp;quot;, width);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        property int buttonWidth: parent.width * 0.2;&lt;br /&gt;
        property int buttonHeight: 60;&lt;br /&gt;
        property int buttonMargins: 2;&lt;br /&gt;
&lt;br /&gt;
        property string activeButtonImage: &amp;quot;image://themedimage/widgets/common/button/button-default&amp;quot;&lt;br /&gt;
        property string buttonImage: &amp;quot;image://themedimage/widgets/common/button/button&amp;quot;&lt;br /&gt;
        property string buttonImagePressed: &amp;quot;image://themedimage/widgets/common/button/button-default-pressed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        //width: 2 * buttonWidth + 3 * buttonMargins&lt;br /&gt;
        height: buttonHeight&lt;br /&gt;
        anchors.top: parent.top&lt;br /&gt;
        anchors.topMargin:  10&lt;br /&gt;
        anchors.horizontalCenter: parent.horizontalCenter&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Button {&lt;br /&gt;
            id: flagsButton&lt;br /&gt;
            active: true&lt;br /&gt;
            width:  parent.buttonWidth; height: parent.buttonHeight&lt;br /&gt;
&lt;br /&gt;
            // Since there are only two buttons, the right of this button is near the center.&lt;br /&gt;
            anchors { margins: parent.buttonMargins; right: parent.horizontalCenter;}&lt;br /&gt;
            text: qsTr(&amp;quot;Flags&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: {&lt;br /&gt;
                mainPage.state = &amp;quot;flags&amp;quot;&lt;br /&gt;
                active = true&lt;br /&gt;
                browserButton.active = false&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Button {&lt;br /&gt;
            id: browserButton&lt;br /&gt;
&lt;br /&gt;
            width:  parent.buttonWidth; height: parent.buttonHeight&lt;br /&gt;
&lt;br /&gt;
            // This button is to the right of the flags button&lt;br /&gt;
            anchors { margins: parent.buttonMargins; left: flagsButton.right }&lt;br /&gt;
            text: qsTr(&amp;quot;File Browser&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            onClicked: {&lt;br /&gt;
                mainPage.state = &amp;quot;browser&amp;quot;&lt;br /&gt;
                active = true&lt;br /&gt;
                flagsButton.active = false&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // This item holds the contents of the selected button and fills the rest of the window&lt;br /&gt;
    Item {&lt;br /&gt;
        id: contentSpace&lt;br /&gt;
&lt;br /&gt;
        anchors { top: contentButtons.bottom; bottom: parent.bottom; left: parent.left; right: parent.right }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    // One of these two components will fill the contentSpace Item above.&lt;br /&gt;
    FlagContent    { id: flagContent;    anchors.fill: contentSpace; anchors.top: contentButtons.bottom }&lt;br /&gt;
&lt;br /&gt;
    //Placeholder until BrowserContent.qml is present&lt;br /&gt;
    Rectangle      { id: browserContent; anchors.fill: contentSpace; anchors.top: contentButtons.bottom; color: &amp;quot;red&amp;quot;; }&lt;br /&gt;
    //BrowserContent { id: browserContent; anchors.fill: contentSpace }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Rectangle { z: -1; anchors.fill: parent; color: &amp;quot;grey&amp;quot; } //background&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    states:  [&lt;br /&gt;
        State {&lt;br /&gt;
            name: &amp;quot;flags&amp;quot;&lt;br /&gt;
            PropertyChanges { target: flagContent; visible: true }&lt;br /&gt;
            PropertyChanges { target: browserContent; visible: false }&lt;br /&gt;
        },&lt;br /&gt;
        State {&lt;br /&gt;
            name: &amp;quot;browser&amp;quot;&lt;br /&gt;
            PropertyChanges { target: flagContent; visible: false }&lt;br /&gt;
            PropertyChanges { target: browserContent; visible: true }&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Add the File FlagContent.qml...&lt;br /&gt;
&lt;br /&gt;
This shows an example of using a QML ListView - which uses a delegate for a row to be displayed&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import QtQuick 1.0&lt;br /&gt;
&lt;br /&gt;
    ListView {&lt;br /&gt;
        clip: true&lt;br /&gt;
        model: myModel&lt;br /&gt;
        anchors.top: parent.bottom&lt;br /&gt;
        anchors.fill: parent&lt;br /&gt;
        delegate: Rectangle {&lt;br /&gt;
            color: Qt.rgba(0.9,0.9,0.9)&lt;br /&gt;
            height: childrenRect.height&lt;br /&gt;
            width: parent.width&lt;br /&gt;
            Image {&lt;br /&gt;
                id: image&lt;br /&gt;
                source: flag&lt;br /&gt;
                width: 64&lt;br /&gt;
                height: 64&lt;br /&gt;
                fillMode: Image.PreserveAspectFit&lt;br /&gt;
&lt;br /&gt;
                anchors { left:parent.left; leftMargin:30}&lt;br /&gt;
            }&lt;br /&gt;
            Text {&lt;br /&gt;
                text: display + &amp;quot;\n&amp;quot; +&amp;quot;population: &amp;quot; + population + &amp;quot; mill.&amp;quot;&lt;br /&gt;
                anchors { left:image.right; verticalCenter: image.verticalCenter; leftMargin: 5 }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Modify main.qml to remove this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    AppPage { id: gallery; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Uncomment this line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Component { id: gallery; MainPage {} }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since we added new .cpp and .h files, it would be a good idea to Build-&amp;gt;Run Qmake; Build-&amp;gt;Rebuild All&lt;br /&gt;
&lt;br /&gt;
Copy the images and .qrc file from the solution directory:&lt;br /&gt;
&lt;br /&gt;
Add this to your simple-app.pro&lt;br /&gt;
RESOURCES += resources.qrc&lt;br /&gt;
&lt;br /&gt;
Rebuild...&lt;br /&gt;
&lt;br /&gt;
Run...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see another mini-app for the &amp;quot;Browser&amp;quot; button, copy these files to your project from the solution directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BrowserContent.qml&lt;br /&gt;
FileSystemView.qml&lt;br /&gt;
ImageViewer.qml&lt;br /&gt;
PathDisplay.qml&lt;br /&gt;
&lt;br /&gt;
dirmodel.cpp&lt;br /&gt;
dirmodel.h&lt;br /&gt;
&lt;br /&gt;
main.cpp (new code added to register a Directory Model with QML named &amp;quot;_model&amp;quot; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replace these two lines in MainPage.qml:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    Rectangle      { id: browserContent; anchors.fill: contentSpace; anchors.top: contentButtons.bottom; color: &amp;quot;red&amp;quot;; }&lt;br /&gt;
    //BrowserContent { id: browserContent; anchors.fill: contentSpace }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    BrowserContent { id: browserContent; anchors.fill: contentSpace }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rebuild All&lt;br /&gt;
&lt;br /&gt;
Run&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/MeeGo_UX_Components_Chroot_Tutorial</id>
		<title>MeeGo UX Components Chroot Tutorial</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/MeeGo_UX_Components_Chroot_Tutorial"/>
				<updated>2011-04-28T23:03:42Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: /* Steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
This tutorial will take the developer through the process of building from source the [[SDK/Docs/1.2/MeeGo_SDK_1.2_Preview|meego-ux-components package]] in a chroot development environment on Linux.&lt;br /&gt;
&lt;br /&gt;
This tutorial is based on the [[SDK/Docs/1.2/MeeGo_SDK_1.2_Preview|MeeGo SDK 1.2 Preview (with Tablet)]] release.&lt;br /&gt;
&lt;br /&gt;
This tutorial was created with a specific Tablet Build (04-01-2011) and has specific instructions related to that build. Specifically, a git checkout of a tag is required.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
* Linux Only&lt;br /&gt;
* [[SDK/Docs/1.2/MeeGo_SDK_1.2_Preview_for_Linux| MeeGo SDK 1.2]] installed&lt;br /&gt;
* [[Developing_in_a_Meego_Environment|Install / Setup mic-chroot]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Steps ==&lt;br /&gt;
&lt;br /&gt;
Step 1. Get the latest source of the meego-ux-components&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/meego.gitorious&lt;br /&gt;
git clone http://git.gitorious.org/meego-ux/meego-ux-components.git&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 2. Download the 4/1 version of the QEMU image:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://download.meego.com/trunk-daily/builds/1.1.90/1.1.99.1.20110401.1/images/meego-tablet-ia32-qemu/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 3. Un-tar to get the .raw image&lt;br /&gt;
&lt;br /&gt;
Step 4. Make a fs copy of the image:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo mic-chroot -s ./chroot0405 -v&lt;br /&gt;
Downloads/meego-tablet-ia32-qemu-1.1.99.1.20110405.3.img&lt;br /&gt;
&amp;lt;exit the chroot&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 5. mount --bind your source directory to a directory in the fs chroot&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# once, after creating the chroot0405 directory&lt;br /&gt;
sudo mkdir chroot0405/home/meego-ux-components&lt;br /&gt;
&lt;br /&gt;
#repeat after each reboot, or add to system .profile&lt;br /&gt;
sudo mount -B ~/meego.gitorious/meego-ux-components ~/chroot0405/home/meego-ux-components&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 5. start the chroot&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo mic-chroot ./chroot0401&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 6. Before building the sources, you need to git checkout a version&lt;br /&gt;
that will work with the 4/1 tablet image:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git checkout 0.2.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 7. startmeego to get all the MeeGO services started:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# You may have to allow connections to your X server&lt;br /&gt;
# you can test this by running xclock in the chroot&lt;br /&gt;
xhost +&lt;br /&gt;
&lt;br /&gt;
startmeego &amp;amp;&lt;br /&gt;
## Note - it will be helpful to edit the script&lt;br /&gt;
/usr/bin/startmeego-debug-tablet&lt;br /&gt;
## Change: Xephyr $DISP -screen 1024x600&lt;br /&gt;
## To: Xephyr $DISP -screen 1280x800&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 8. Start Qt Creator (in the mic-chroot terminal)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qtcreator &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 9: Install packages needed to build meego-ux-components&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
zypper in libXdamage-devel&lt;br /&gt;
zypper in libXcomposite-devel&lt;br /&gt;
zypper in libX11-devel&lt;br /&gt;
zypper in kcalcore-devel&lt;br /&gt;
zypper in qt-mobility-devel&lt;br /&gt;
zypper in libqtopengl-devel&lt;br /&gt;
zypper in libcontentaction-devel&lt;br /&gt;
zypper in contextkit-devel&lt;br /&gt;
zypper in mlite&lt;br /&gt;
zypper in libexif-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 10. Build and Install&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# In Qt Creator: Build-&amp;gt;Build All&lt;br /&gt;
&lt;br /&gt;
# from the chroot terminal (Until install / deploy step in Qt Creator is tested)&lt;br /&gt;
cd ../meego-ux-components-build-desktop #If shadow build was checked&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 11. Run meego-ux-widgetgallery in a separate window&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qmlviewer /usr/share/meego-ux-widgetgallery/main.qml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 12. Run meego-ux-widgetgallery in the Xephyr startmeego window&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export DISPLAY=:2&lt;br /&gt;
qmlviewer /usr/share/meego-ux-widgetgallery/main.qml&lt;br /&gt;
&lt;br /&gt;
Step 13. Run meego-ux-widgetgallery directly from the MeeGo environment&lt;br /&gt;
# in the Xephyr Window, hit the Home (Windows) key&lt;br /&gt;
# Choose the App Viewer&lt;br /&gt;
# Click on Terminal&lt;br /&gt;
# run this command in the terminal window:&lt;br /&gt;
qmlviewer /usr/share/meego-ux-widgetgallery/main.qml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 14. You can also copy an existing .desktop file and change the exec&lt;br /&gt;
statement to meego-ux-widgetgallery if you want to click on an icon to&lt;br /&gt;
start it.&lt;br /&gt;
&lt;br /&gt;
== Todo ==&lt;br /&gt;
* Automate the creation / startup of the chroot - in the the above steps, design a script which can perform steps 2 - 5, 7, 9, 14&lt;br /&gt;
* Also document how to set up the SDK to run this application on a device.&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorial]]&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/MeeGo_UX_Components_Chroot_Tutorial</id>
		<title>MeeGo UX Components Chroot Tutorial</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/MeeGo_UX_Components_Chroot_Tutorial"/>
				<updated>2011-04-28T22:40:44Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: /* Steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
This tutorial will take the developer through the process of building from source the [[SDK/Docs/1.2/MeeGo_SDK_1.2_Preview|meego-ux-components package]] in a chroot development environment on Linux.&lt;br /&gt;
&lt;br /&gt;
This tutorial is based on the [[SDK/Docs/1.2/MeeGo_SDK_1.2_Preview|MeeGo SDK 1.2 Preview (with Tablet)]] release.&lt;br /&gt;
&lt;br /&gt;
This tutorial was created with a specific Tablet Build (04-01-2011) and has specific instructions related to that build. Specifically, a git checkout of a tag is required.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
* Linux Only&lt;br /&gt;
* [[SDK/Docs/1.2/MeeGo_SDK_1.2_Preview_for_Linux| MeeGo SDK 1.2]] installed&lt;br /&gt;
* [[Developing_in_a_Meego_Environment|Install / Setup mic-chroot]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Steps ==&lt;br /&gt;
&lt;br /&gt;
Step 1. Get the latest source of the meego-ux-components&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/meego.gitorious&lt;br /&gt;
git clone http://git.gitorious.org/meego-ux/meego-ux-components.git&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 2. Download the 4/1 version of the QEMU image:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://download.meego.com/trunk-daily/builds/1.1.90/1.1.99.1.20110401.1/images/meego-tablet-ia32-qemu/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 3. Un-tar to get the .raw image&lt;br /&gt;
&lt;br /&gt;
Step 4. Make a fs copy of the image:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo mic-chroot -s ./chroot0405 -v&lt;br /&gt;
Downloads/meego-tablet-ia32-qemu-1.1.99.1.20110405.3.img&lt;br /&gt;
&amp;lt;exit the chroot&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 5. mount --bind your source directory to a directory in the fs chroot&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# once, after creating the chroot0405 directory&lt;br /&gt;
sudo mkdir chroot0405/home/meego-ux-components&lt;br /&gt;
&lt;br /&gt;
#repeat after each reboot, or add to system .profile&lt;br /&gt;
sudo mount -B ~/meego.gitorious/meego-ux-components ~/chroot0405/home/meego-ux-components&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 5. start the chroot&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo mic-chroot ./chroot0401&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 6. Before building the sources, you need to git checkout a version&lt;br /&gt;
that will work with the 4/1 tablet image:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git checkout 0.2.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 7. startmeego to get all the MeeGO services started:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
startmeego &amp;amp;&lt;br /&gt;
## Note - it will be helpful to edit the script&lt;br /&gt;
/usr/bin/startmeego-debug-tablet&lt;br /&gt;
## Change: Xephyr $DISP -screen 1024x600&lt;br /&gt;
## To: Xephyr $DISP -screen 1280x800&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 8. Start Qt Creator (in the mic-chroot terminal)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qtcreator &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 9: Install packages needed to build meego-ux-components&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
zypper in libXdamage-devel&lt;br /&gt;
zypper in libXcomposite-devel&lt;br /&gt;
zypper in libX11-devel&lt;br /&gt;
zypper in kcalcore-devel&lt;br /&gt;
zypper in qt-mobility-devel&lt;br /&gt;
zypper in libqtopengl-devel&lt;br /&gt;
zypper in libcontentaction-devel&lt;br /&gt;
zypper in contextkit-devel&lt;br /&gt;
zypper in mlite&lt;br /&gt;
zypper in libexif-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 10. Build and Install&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# In Qt Creator: Build-&amp;gt;Build All&lt;br /&gt;
&lt;br /&gt;
# from the chroot terminal (Until install / deploy step in Qt Creator is tested)&lt;br /&gt;
cd ../meego-ux-components-build-desktop #If shadow build was checked&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 11. Run meego-ux-widgetgallery in a separate window&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qmlviewer /usr/share/meego-ux-widgetgallery/main.qml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 12. Run meego-ux-widgetgallery in the Xephyr startmeego window&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export DISPLAY=:2&lt;br /&gt;
qmlviewer /usr/share/meego-ux-widgetgallery/main.qml&lt;br /&gt;
&lt;br /&gt;
Step 13. Run meego-ux-widgetgallery directly from the MeeGo environment&lt;br /&gt;
# in the Xephyr Window, hit the Home (Windows) key&lt;br /&gt;
# Choose the App Viewer&lt;br /&gt;
# Click on Terminal&lt;br /&gt;
# run this command in the terminal window:&lt;br /&gt;
qmlviewer /usr/share/meego-ux-widgetgallery/main.qml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 14. You can also copy an existing .desktop file and change the exec&lt;br /&gt;
statement to meego-ux-widgetgallery if you want to click on an icon to&lt;br /&gt;
start it.&lt;br /&gt;
&lt;br /&gt;
== Todo ==&lt;br /&gt;
* Automate the creation / startup of the chroot - in the the above steps, design a script which can perform steps 2 - 5, 7, 9, 14&lt;br /&gt;
* Also document how to set up the SDK to run this application on a device.&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorial]]&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/SDK/Docs/1.2/Using_Qt_Simulator</id>
		<title>SDK/Docs/1.2/Using Qt Simulator</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/SDK/Docs/1.2/Using_Qt_Simulator"/>
				<updated>2011-04-18T19:30:28Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using the Qt Simulator for MeeGo Development ==&lt;br /&gt;
&lt;br /&gt;
There are a number of ways to develop applications for MeeGo devices&lt;br /&gt;
&lt;br /&gt;
* On Windows or Linux desktop with a hardware device attached to the MeeGo SDK&lt;br /&gt;
* On Windows or Linux desktop (32 bit only) running the QEMU emulator&lt;br /&gt;
* On a Linux desktop runing in a chroot / Xephyr environment&lt;br /&gt;
* Directly on a device - the MeeGo SDK and development toolchain are installed on a tablet (with keyboard / mouse attached) or netbook.&lt;br /&gt;
* On a Windows or Linux desktop running in the Qt Simulator&lt;br /&gt;
&lt;br /&gt;
This post will describe the advantages and disadvantages of using the Qt Simulator for MeeGo development.&lt;br /&gt;
&lt;br /&gt;
There is a limited set of applications that could take advantage of the Qt Simulator - especially on Windows platforms.&lt;br /&gt;
&lt;br /&gt;
After reading the two sections below on which MeeGo apps can and can't be developed with the Qt Simulator, you can make a decision on wether to use it. If so, there is a tutorial on how to use it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== When to Use the Qt Simulator ===&lt;br /&gt;
&lt;br /&gt;
* When you are developing the User Experience (UX) of an application and want to test it on various devices.&lt;br /&gt;
&lt;br /&gt;
* You do NOT need to use meegolabs.ux.components or meego.ux.components (see disadvantages below)&lt;br /&gt;
&lt;br /&gt;
* You are developing a QML component to be used in other MeeGo applications (like a file browser component)&lt;br /&gt;
&lt;br /&gt;
* If your application under development needs to read or write data to the MeeGo infrastructure, you can create a temporary model for you application to isolate it &lt;br /&gt;
&lt;br /&gt;
=== When NOT to Use the Qt Simulator ===&lt;br /&gt;
==== When you are debugging your applications's interactions with other MeeGo applications that communicate through various middleware components ==== &lt;br /&gt;
such as:&lt;br /&gt;
* libsocialweb&lt;br /&gt;
* sensors&lt;br /&gt;
* pulseaudio&lt;br /&gt;
* messaging framework&lt;br /&gt;
* MeeGo touch framework&lt;br /&gt;
&lt;br /&gt;
* When you are debugging your applications's interaction with the application launcher (appgrid)&lt;br /&gt;
&lt;br /&gt;
==== When you are developing an OpenGL application ====&lt;br /&gt;
&lt;br /&gt;
==== Most MeeGo apps use can't be built in the Qt Simulator environment, because they use MeeGo.Labs.Components: ====&lt;br /&gt;
&lt;br /&gt;
Since this component hasn't been ported to the Qt Simulator environment, it can't be simulated by the Qt Simulator.&lt;br /&gt;
&lt;br /&gt;
Application developers will need a work-around to this if they are going to use either meegolabs-ux-components or meego-ux-components.&lt;br /&gt;
&lt;br /&gt;
It's a known issue that dbus doesn't work on Qt Simulator.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://bugreports.qt.nokia.com/browse/QTSIM-12&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A quick attempt to build the email app. ====&lt;br /&gt;
&lt;br /&gt;
One look at the .pro file for MeeGo.Labs.Components reveals that this app must be developed on a Linux platform, Emulated with QEMU or directly.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TEMPLATE = lib&lt;br /&gt;
TARGET = Components&lt;br /&gt;
QT += declarative \&lt;br /&gt;
    network \&lt;br /&gt;
    dbus \&lt;br /&gt;
    sql&lt;br /&gt;
CONFIG += qt \&lt;br /&gt;
    plugin \&lt;br /&gt;
    dbus \&lt;br /&gt;
    link_pkgconfig \&lt;br /&gt;
    mobility&lt;br /&gt;
PKGCONFIG += gconf-2.0 \&lt;br /&gt;
    qmfmessageserver \&lt;br /&gt;
    qmfclient \&lt;br /&gt;
    libpulse \&lt;br /&gt;
    libpulse-mainloop-glib \&lt;br /&gt;
    libexif \&lt;br /&gt;
    libkcalcoren \&lt;br /&gt;
    mlite \&lt;br /&gt;
    xdamage \&lt;br /&gt;
    QtPublishSubscribe \&lt;br /&gt;
    contextsubscriber-1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installing the Qt Simulator / Resources needed. ===&lt;br /&gt;
&lt;br /&gt;
One advantage of using the Qt Simulator is that it will run on Windows and Linux 64 bit platforms.&lt;br /&gt;
&lt;br /&gt;
To install, simply check the appropriate Simulator Qt 4.7.2 checkbox in the &amp;quot;Select Components&amp;quot; screen of the SDK installer.&lt;br /&gt;
&lt;br /&gt;
[[file: install-sim.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Simulator will require an additional 1.2 Gig on your development workstation. Less (550 Meg) if you install on Windows and already have Visual Studio 2008 installed.&lt;br /&gt;
&lt;br /&gt;
Note: On Windows, the MeeGo SDK with one target installed, QEMU, Qt Simulator and the Mingw development environment (Microsoft Visual Studio not installed) takes approx 6.5 Gig of disk space.&lt;br /&gt;
&lt;br /&gt;
=== Using the Simulator ===&lt;br /&gt;
&lt;br /&gt;
In your Project tool in Qt Creator, you would click the '+' in the Project Chooser (top) to add a Qt Simulator target. If the Qt Simulator wasn't installed, it won't be an option when clicking the '+'&lt;br /&gt;
&lt;br /&gt;
[[file: build-sim.png|800px]]&lt;br /&gt;
&lt;br /&gt;
You may also create or open a new project and choose your targets:&lt;br /&gt;
&lt;br /&gt;
[[file: sim-open-project.png|800px]]&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulator ===&lt;br /&gt;
&lt;br /&gt;
Choose the Simulator target in the Projects tool, or in the Target Chooser (above the Green Run button)&lt;br /&gt;
&lt;br /&gt;
Run...&lt;br /&gt;
&lt;br /&gt;
A sample app running in the Qt Simulator. This app uses a very small C++ model and QML:&lt;br /&gt;
&lt;br /&gt;
[[file: sim-meego-control.png]]&lt;br /&gt;
[[file: sim-meego-skin.png|800px]]&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/File:Sim-open-project.png</id>
		<title>File:Sim-open-project.png</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/File:Sim-open-project.png"/>
				<updated>2011-04-18T19:27:08Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/SDK/Docs/1.2/Using_Qt_Simulator</id>
		<title>SDK/Docs/1.2/Using Qt Simulator</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/SDK/Docs/1.2/Using_Qt_Simulator"/>
				<updated>2011-04-18T19:22:08Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using the Qt Simulator for MeeGo Development ==&lt;br /&gt;
&lt;br /&gt;
There are a number of ways to develop applications for MeeGo devices&lt;br /&gt;
&lt;br /&gt;
* On Windows or Linux desktop with a hardware device attached to the MeeGo SDK&lt;br /&gt;
* On Windows or Linux desktop (32 bit only) running the QEMU emulator&lt;br /&gt;
* On a Linux desktop runing in a chroot / Xephyr environment&lt;br /&gt;
* Directly on a device - the MeeGo SDK and development toolchain are installed on a tablet (with keyboard / mouse attached) or netbook.&lt;br /&gt;
* On a Windows or Linux desktop running in the Qt Simulator&lt;br /&gt;
&lt;br /&gt;
This post will describe the advantages and disadvantages of using the Qt Simulator for MeeGo development.&lt;br /&gt;
&lt;br /&gt;
There is a limited set of applications that could take advantage of the Qt Simulator - especially on Windows platforms.&lt;br /&gt;
&lt;br /&gt;
After reading the two sections below on which MeeGo apps can and can't be developed with the Qt Simulator, you can make a decision on wether to use it. If so, there is a tutorial on how to use it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== When to Use the Qt Simulator ===&lt;br /&gt;
&lt;br /&gt;
* When you are developing the User Experience (UX) of an application and want to test it on various devices.&lt;br /&gt;
&lt;br /&gt;
* You do NOT need to use meegolabs.ux.components or meego.ux.components (see disadvantages below)&lt;br /&gt;
&lt;br /&gt;
* You are developing a QML component to be used in other MeeGo applications (like a file browser component)&lt;br /&gt;
&lt;br /&gt;
* If your application under development needs to read or write data to the MeeGo infrastructure, you can create a temporary model for you application to isolate it &lt;br /&gt;
&lt;br /&gt;
=== When NOT to Use the Qt Simulator ===&lt;br /&gt;
==== When you are debugging your applications's interactions with other MeeGo applications that communicate through various middleware components ==== &lt;br /&gt;
such as:&lt;br /&gt;
* libsocialweb&lt;br /&gt;
* sensors&lt;br /&gt;
* pulseaudio&lt;br /&gt;
* messaging framework&lt;br /&gt;
* MeeGo touch framework&lt;br /&gt;
&lt;br /&gt;
* When you are debugging your applications's interaction with the application launcher (appgrid)&lt;br /&gt;
&lt;br /&gt;
==== When you are developing an OpenGL application ====&lt;br /&gt;
&lt;br /&gt;
==== Most MeeGo apps use can't be built in the Qt Simulator environment, because they use MeeGo.Labs.Components: ====&lt;br /&gt;
&lt;br /&gt;
Since this component hasn't been ported to the Qt Simulator environment, it can't be simulated by the Qt Simulator.&lt;br /&gt;
&lt;br /&gt;
Application developers will need a work-around to this if they are going to use either meegolabs-ux-components or meego-ux-components.&lt;br /&gt;
&lt;br /&gt;
It's a known issue that dbus doesn't work on Qt Simulator.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://bugreports.qt.nokia.com/browse/QTSIM-12&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A quick attempt to build the email app. ====&lt;br /&gt;
&lt;br /&gt;
One look at the .pro file for MeeGo.Labs.Components reveals that this app must be developed on a Linux platform, Emulated with QEMU or directly.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TEMPLATE = lib&lt;br /&gt;
TARGET = Components&lt;br /&gt;
QT += declarative \&lt;br /&gt;
    network \&lt;br /&gt;
    dbus \&lt;br /&gt;
    sql&lt;br /&gt;
CONFIG += qt \&lt;br /&gt;
    plugin \&lt;br /&gt;
    dbus \&lt;br /&gt;
    link_pkgconfig \&lt;br /&gt;
    mobility&lt;br /&gt;
PKGCONFIG += gconf-2.0 \&lt;br /&gt;
    qmfmessageserver \&lt;br /&gt;
    qmfclient \&lt;br /&gt;
    libpulse \&lt;br /&gt;
    libpulse-mainloop-glib \&lt;br /&gt;
    libexif \&lt;br /&gt;
    libkcalcoren \&lt;br /&gt;
    mlite \&lt;br /&gt;
    xdamage \&lt;br /&gt;
    QtPublishSubscribe \&lt;br /&gt;
    contextsubscriber-1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installing the Qt Simulator / Resources needed. ===&lt;br /&gt;
&lt;br /&gt;
One advantage of using the Qt Simulator is that it will run on Windows and Linux 64 bit platforms.&lt;br /&gt;
&lt;br /&gt;
To install, simply check the appropriate Simulator Qt 4.7.2 checkbox in the &amp;quot;Select Components&amp;quot; screen of the SDK installer.&lt;br /&gt;
&lt;br /&gt;
[[file: install-sim.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Simulator will require an additional 1.2 Gig on your development workstation. Less (550 Meg) if you install on Windows and already have Visual Studio 2008 installed.&lt;br /&gt;
&lt;br /&gt;
Note: On Windows, the MeeGo SDK with one target installed, QEMU, Qt Simulator and the Mingw development environment (Microsoft Visual Studio not installed) takes approx 6.5 Gig of disk space.&lt;br /&gt;
&lt;br /&gt;
=== Using the Simulator ===&lt;br /&gt;
&lt;br /&gt;
In your Project tool in Qt Creator, you would click the '+' in the Project Chooser (top) to add a Qt Simulator target. If the Qt Simulator wasn't installed, it won't be an option when clicking the '+'&lt;br /&gt;
&lt;br /&gt;
[[file: build-sim.png|800px]]&lt;br /&gt;
&lt;br /&gt;
A sample app running in the Qt Simulator. This app uses a very small C++ model and QML:&lt;br /&gt;
&lt;br /&gt;
[[file: sim-meego-control.png]]&lt;br /&gt;
[[file: sim-meego-skin.png|800px]]&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/SDK/Docs/1.2/Using_Qt_Simulator</id>
		<title>SDK/Docs/1.2/Using Qt Simulator</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/SDK/Docs/1.2/Using_Qt_Simulator"/>
				<updated>2011-04-18T19:19:53Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using the Qt Simulator for MeeGo Development ==&lt;br /&gt;
&lt;br /&gt;
There are a number of ways to develop applications for MeeGo devices&lt;br /&gt;
&lt;br /&gt;
* On Windows or Linux desktop with a hardware device attached to the MeeGo SDK&lt;br /&gt;
* On Windows or Linux desktop (32 bit only) running the QEMU emulator&lt;br /&gt;
* On a Linux desktop runing in a chroot / Xephyr environment&lt;br /&gt;
* Directly on a device - the MeeGo SDK and development toolchain are installed on a tablet (with keyboard / mouse attached) or netbook.&lt;br /&gt;
* On a Windows or Linux desktop running in the Qt Simulator&lt;br /&gt;
&lt;br /&gt;
This post will describe the advantages and disadvantages of using the Qt Simulator for MeeGo development.&lt;br /&gt;
&lt;br /&gt;
There is a very limited set of applications that could take advantage of the Qt Simulator - especially on Windows platforms.&lt;br /&gt;
&lt;br /&gt;
After reading the two sections below on which MeeGo apps can and can't be developed with the Qt Simulator, you can make a decision on wether to use it. If so, there is a tutorial on how to use it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== When to Use the Qt Simulator ===&lt;br /&gt;
&lt;br /&gt;
* When you are developing the User Experience (UX) of an application and want to test it on various devices.&lt;br /&gt;
&lt;br /&gt;
* You do NOT need to use meegolabs.ux.components or meego.ux.components (see disadvantages below)&lt;br /&gt;
&lt;br /&gt;
* If your application under development needs to read or write data to the MeeGo infrastructure, you can create a temporary model for you application to isolate it &lt;br /&gt;
&lt;br /&gt;
=== When NOT to Use the Qt Simulator ===&lt;br /&gt;
==== When you are debugging your applications's interactions with other MeeGo applications that communicate through various middleware components ==== &lt;br /&gt;
such as:&lt;br /&gt;
* libsocialweb&lt;br /&gt;
* sensors&lt;br /&gt;
* pulseaudio&lt;br /&gt;
* messaging framework&lt;br /&gt;
* MeeGo touch framework&lt;br /&gt;
&lt;br /&gt;
* When you are debugging your applications's interaction with the application launcher (appgrid)&lt;br /&gt;
&lt;br /&gt;
==== When you are developing an OpenGL application ====&lt;br /&gt;
&lt;br /&gt;
==== Most MeeGo apps use can't be built in the Qt Simulator environment, because they use MeeGo.Labs.Components: ====&lt;br /&gt;
&lt;br /&gt;
Since this component hasn't been ported to the Qt Simulator environment, it can't be simulated by the Qt Simulator.&lt;br /&gt;
&lt;br /&gt;
Application developers will need a work-around to this if they are going to use either meegolabs-ux-components or meego-ux-components.&lt;br /&gt;
&lt;br /&gt;
It's a known issue that dbus doesn't work on Qt Simulator.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://bugreports.qt.nokia.com/browse/QTSIM-12&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A quick attempt to build the email app. ====&lt;br /&gt;
&lt;br /&gt;
One look at the .pro file for MeeGo.Labs.Components reveals that this app must be developed on a Linux platform, Emulated with QEMU or directly.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TEMPLATE = lib&lt;br /&gt;
TARGET = Components&lt;br /&gt;
QT += declarative \&lt;br /&gt;
    network \&lt;br /&gt;
    dbus \&lt;br /&gt;
    sql&lt;br /&gt;
CONFIG += qt \&lt;br /&gt;
    plugin \&lt;br /&gt;
    dbus \&lt;br /&gt;
    link_pkgconfig \&lt;br /&gt;
    mobility&lt;br /&gt;
PKGCONFIG += gconf-2.0 \&lt;br /&gt;
    qmfmessageserver \&lt;br /&gt;
    qmfclient \&lt;br /&gt;
    libpulse \&lt;br /&gt;
    libpulse-mainloop-glib \&lt;br /&gt;
    libexif \&lt;br /&gt;
    libkcalcoren \&lt;br /&gt;
    mlite \&lt;br /&gt;
    xdamage \&lt;br /&gt;
    QtPublishSubscribe \&lt;br /&gt;
    contextsubscriber-1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installing the Qt Simulator / Resources needed. ===&lt;br /&gt;
&lt;br /&gt;
One advantage of using the Qt Simulator is that it will run on Windows and Linux 64 bit platforms.&lt;br /&gt;
&lt;br /&gt;
To install, simply check the appropriate Simulator Qt 4.7.2 checkbox in the &amp;quot;Select Components&amp;quot; screen of the SDK installer.&lt;br /&gt;
&lt;br /&gt;
[[file: install-sim.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Simulator will require an additional 1.2 Gig on your development workstation. Less (550 Meg) if you install on Windows and already have Visual Studio 2008 installed.&lt;br /&gt;
&lt;br /&gt;
Note: On Windows, the MeeGo SDK with one target installed, QEMU, Qt Simulator and the Mingw development environment (Microsoft Visual Studio not installed) takes approx 6.5 Gig of disk space.&lt;br /&gt;
&lt;br /&gt;
=== Using the Simulator ===&lt;br /&gt;
&lt;br /&gt;
In your Project tool in Qt Creator, you would click the '+' in the Project Chooser (top) to add a Qt Simulator target. If the Qt Simulator wasn't installed, it won't be an option when clicking the '+'&lt;br /&gt;
&lt;br /&gt;
[[file: build-sim.png|800px]]&lt;br /&gt;
&lt;br /&gt;
A sample app running in the Qt Simulator. This app uses a very small C++ model and QML:&lt;br /&gt;
&lt;br /&gt;
[[file: sim-meego-control.png]]&lt;br /&gt;
[[file: sim-meego-skin.png|800px]]&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/SDK/Docs/1.2/Using_Qt_Simulator</id>
		<title>SDK/Docs/1.2/Using Qt Simulator</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/SDK/Docs/1.2/Using_Qt_Simulator"/>
				<updated>2011-04-18T19:19:08Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using the Qt Simulator for MeeGo Development ==&lt;br /&gt;
&lt;br /&gt;
There are a number of ways to develop applications for MeeGo devices&lt;br /&gt;
&lt;br /&gt;
* On Windows or Linux desktop with a hardware device attached to the MeeGo SDK&lt;br /&gt;
* On Windows or Linux desktop (32 bit only) running the QEMU emulator&lt;br /&gt;
* On a Linux desktop runing in a chroot / Xephyr environment&lt;br /&gt;
* Directly on a device - the MeeGo SDK and development toolchain are installed on a tablet (with keyboard / mouse attached) or netbook.&lt;br /&gt;
* On a Windows or Linux desktop running in the Qt Simulator&lt;br /&gt;
&lt;br /&gt;
This post will describe the advantages and disadvantages of using the Qt Simulator for MeeGo development.&lt;br /&gt;
&lt;br /&gt;
There is a very limited set of applications that could take advantage of the Qt Simulator - especially on Windows platforms.&lt;br /&gt;
&lt;br /&gt;
After reading the two sections below on which MeeGo apps can and can't be developed with the Qt Simulator, you can make a decision on wether to use it. If so, there is a tutorial on how to use it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== When to Use the Qt Simulator ===&lt;br /&gt;
&lt;br /&gt;
* When you are developing the User Experience (UX) of an application and want to test it on various devices.&lt;br /&gt;
&lt;br /&gt;
* You do NOT need to use meegolabs.ux.components or meego.ux.components (see disadvantages below)&lt;br /&gt;
&lt;br /&gt;
* If your application under development needs to read or write data to the MeeGo infrastructure, you can create a temporary model for you application to isolate it &lt;br /&gt;
&lt;br /&gt;
=== When NOT to Use the Qt Simulator ===&lt;br /&gt;
==== When you are debugging your applications's interactions with other MeeGo applications that communicate through various middleware components ==== &lt;br /&gt;
such as:&lt;br /&gt;
* libsocialweb&lt;br /&gt;
* sensors&lt;br /&gt;
* pulseaudio&lt;br /&gt;
* messaging framework&lt;br /&gt;
* MeeGo touch framework&lt;br /&gt;
&lt;br /&gt;
* When you are debugging your applications's interaction with the application launcher (appgrid)&lt;br /&gt;
&lt;br /&gt;
==== When you are developing an OpenGL application ====&lt;br /&gt;
&lt;br /&gt;
==== Most MeeGo apps use can't be built in the Qt Simulator environment, because they use MeeGo.Labs.Components: ====&lt;br /&gt;
&lt;br /&gt;
Since this component hasn't been ported to the Qt Simulator environment, it can't be simulated by the Qt Simulator.&lt;br /&gt;
&lt;br /&gt;
Application developers will need a work-around to this if they are going to use either meegolabs-ux-components or meego-ux-components.&lt;br /&gt;
&lt;br /&gt;
It's a known issue that dbus doesn't work on Qt Simulator.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://bugreports.qt.nokia.com/browse/QTSIM-12&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A quick attempt to build the email app. ====&lt;br /&gt;
&lt;br /&gt;
One look at the .pro file for MeeGo.Labs.Components reveals that this app must be developed on a Linux platform, Emulated with QEMU or directly.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TEMPLATE = lib&lt;br /&gt;
TARGET = Components&lt;br /&gt;
QT += declarative \&lt;br /&gt;
    network \&lt;br /&gt;
    dbus \&lt;br /&gt;
    sql&lt;br /&gt;
CONFIG += qt \&lt;br /&gt;
    plugin \&lt;br /&gt;
    dbus \&lt;br /&gt;
    link_pkgconfig \&lt;br /&gt;
    mobility&lt;br /&gt;
PKGCONFIG += gconf-2.0 \&lt;br /&gt;
    qmfmessageserver \&lt;br /&gt;
    qmfclient \&lt;br /&gt;
    libpulse \&lt;br /&gt;
    libpulse-mainloop-glib \&lt;br /&gt;
    libexif \&lt;br /&gt;
    libkcalcoren \&lt;br /&gt;
    mlite \&lt;br /&gt;
    xdamage \&lt;br /&gt;
    QtPublishSubscribe \&lt;br /&gt;
    contextsubscriber-1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installing the Qt Simulator / Resources needed. ===&lt;br /&gt;
&lt;br /&gt;
One advantage of using the Qt Simulator is that it will run on Windows and Linux 64 bit platforms.&lt;br /&gt;
&lt;br /&gt;
To install, simply check the appropriate Simulator Qt 4.7.2 checkbox in the &amp;quot;Select Components&amp;quot; screen of the SDK installer.&lt;br /&gt;
&lt;br /&gt;
[[file: install-sim.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Simulator will require an additional 1.2 Gig on your development workstation. Less (550 Meg) if you install on Windows and already have Visual Studio 2008 installed.&lt;br /&gt;
&lt;br /&gt;
Note: On Windows, the MeeGo SDK with one target installed, QEMU, Qt Simulator and the Mingw development environment (Microsoft Visual Studio not installed) takes approx 6.5 Gig of disk space.&lt;br /&gt;
&lt;br /&gt;
=== Using the Simulator ===&lt;br /&gt;
&lt;br /&gt;
In your Project tool in Qt Creator, you would click the '+' in the Project Chooser (top) to add a Qt Simulator target. If the Qt Simulator wasn't installed, it won't be an option when clicking the '+'&lt;br /&gt;
&lt;br /&gt;
[[file: build-sim.png|800px]]&lt;br /&gt;
&lt;br /&gt;
A sample app running in the Qt Simulator. This app uses a very small C++ model and QML:&lt;br /&gt;
&lt;br /&gt;
[[file: sim-meego-control.png]]&lt;br /&gt;
[[file: sim-meego-skin.png]]&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/File:Sim-meego-control.png</id>
		<title>File:Sim-meego-control.png</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/File:Sim-meego-control.png"/>
				<updated>2011-04-18T19:18:18Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: Qt Simulator Control Panel with MeeGo Skin&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Qt Simulator Control Panel with MeeGo Skin&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/File:Sim-meego-skin.png</id>
		<title>File:Sim-meego-skin.png</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/File:Sim-meego-skin.png"/>
				<updated>2011-04-18T19:16:43Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: Simple App in MeeGo Simulator Skin&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Simple App in MeeGo Simulator Skin&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/SDK/Docs/1.2/Using_Qt_Simulator</id>
		<title>SDK/Docs/1.2/Using Qt Simulator</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/SDK/Docs/1.2/Using_Qt_Simulator"/>
				<updated>2011-04-18T19:14:36Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: Created page with &amp;quot;== Using the Qt Simulator for MeeGo Development ==  There are a number of ways to develop applications for MeeGo devices  * On Windows or Linux desktop with a hardware device att...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using the Qt Simulator for MeeGo Development ==&lt;br /&gt;
&lt;br /&gt;
There are a number of ways to develop applications for MeeGo devices&lt;br /&gt;
&lt;br /&gt;
* On Windows or Linux desktop with a hardware device attached to the MeeGo SDK&lt;br /&gt;
* On Windows or Linux desktop (32 bit only) running the QEMU emulator&lt;br /&gt;
* On a Linux desktop runing in a chroot / Xephyr environment&lt;br /&gt;
* Directly on a device - the MeeGo SDK and development toolchain are installed on a tablet (with keyboard / mouse attached) or netbook.&lt;br /&gt;
* On a Windows or Linux desktop running in the Qt Simulator&lt;br /&gt;
&lt;br /&gt;
This post will describe the advantages and disadvantages of using the Qt Simulator for MeeGo development.&lt;br /&gt;
&lt;br /&gt;
There is a very limited set of applications that could take advantage of the Qt Simulator - especially on Windows platforms.&lt;br /&gt;
&lt;br /&gt;
After reading the two sections below on which MeeGo apps can and can't be developed with the Qt Simulator, you can make a decision on wether to use it. If so, there is a tutorial on how to use it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== When to Use the Qt Simulator ===&lt;br /&gt;
&lt;br /&gt;
* When you are developing the User Experience (UX) of an application and want to test it on various devices.&lt;br /&gt;
&lt;br /&gt;
* You do NOT need to use meegolabs.ux.components or meego.ux.components (see disadvantages below)&lt;br /&gt;
&lt;br /&gt;
* If your application under development needs to read or write data to the MeeGo infrastructure, you can create a temporary model for you application to isolate it &lt;br /&gt;
&lt;br /&gt;
=== When NOT to Use the Qt Simulator ===&lt;br /&gt;
==== When you are debugging your applications's interactions with other MeeGo applications that communicate through various middleware components ==== &lt;br /&gt;
such as:&lt;br /&gt;
* libsocialweb&lt;br /&gt;
* sensors&lt;br /&gt;
* pulseaudio&lt;br /&gt;
* messaging framework&lt;br /&gt;
* MeeGo touch framework&lt;br /&gt;
&lt;br /&gt;
* When you are debugging your applications's interaction with the application launcher (appgrid)&lt;br /&gt;
&lt;br /&gt;
==== When you are developing an OpenGL application ====&lt;br /&gt;
&lt;br /&gt;
==== Most MeeGo apps use can't be built in the Qt Simulator environment, because they use MeeGo.Labs.Components: ====&lt;br /&gt;
&lt;br /&gt;
Since this component hasn't been ported to the Qt Simulator environment, it can't be simulated by the Qt Simulator.&lt;br /&gt;
&lt;br /&gt;
Application developers will need a work-around to this if they are going to use either meegolabs-ux-components or meego-ux-components.&lt;br /&gt;
&lt;br /&gt;
It's a known issue that dbus doesn't work on Qt Simulator.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://bugreports.qt.nokia.com/browse/QTSIM-12&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A quick attempt to build the email app. ====&lt;br /&gt;
&lt;br /&gt;
One look at the .pro file for MeeGo.Labs.Components reveals that this app must be developed on a Linux platform, Emulated with QEMU or directly.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TEMPLATE = lib&lt;br /&gt;
TARGET = Components&lt;br /&gt;
QT += declarative \&lt;br /&gt;
    network \&lt;br /&gt;
    dbus \&lt;br /&gt;
    sql&lt;br /&gt;
CONFIG += qt \&lt;br /&gt;
    plugin \&lt;br /&gt;
    dbus \&lt;br /&gt;
    link_pkgconfig \&lt;br /&gt;
    mobility&lt;br /&gt;
PKGCONFIG += gconf-2.0 \&lt;br /&gt;
    qmfmessageserver \&lt;br /&gt;
    qmfclient \&lt;br /&gt;
    libpulse \&lt;br /&gt;
    libpulse-mainloop-glib \&lt;br /&gt;
    libexif \&lt;br /&gt;
    libkcalcoren \&lt;br /&gt;
    mlite \&lt;br /&gt;
    xdamage \&lt;br /&gt;
    QtPublishSubscribe \&lt;br /&gt;
    contextsubscriber-1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installing the Qt Simulator / Resources needed. ===&lt;br /&gt;
&lt;br /&gt;
One advantage of using the Qt Simulator is that it will run on Windows and Linux 64 bit platforms.&lt;br /&gt;
&lt;br /&gt;
To install, simply check the appropriate Simulator Qt 4.7.2 checkbox in the &amp;quot;Select Components&amp;quot; screen of the SDK installer.&lt;br /&gt;
&lt;br /&gt;
[[file: install-sim.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Simulator will require an additional 1.2 Gig on your development workstation. Less (550 Meg) if you install on Windows and already have Visual Studio 2008 installed.&lt;br /&gt;
&lt;br /&gt;
Note: On Windows, the MeeGo SDK with one target installed, QEMU, Qt Simulator and the Mingw development environment (Microsoft Visual Studio not installed) takes approx 6.5 Gig of disk space.&lt;br /&gt;
&lt;br /&gt;
=== Using the Simulator ===&lt;br /&gt;
&lt;br /&gt;
In your Project tool in Qt Creator, you would click the '+' in the Project Chooser (top) to add a Qt Simulator target. If the Qt Simulator wasn't installed, it won't be an option when clicking the '+'&lt;br /&gt;
&lt;br /&gt;
[[file: build-sim.png|800px]]&lt;br /&gt;
&lt;br /&gt;
A sample app&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/File:Build-sim.png</id>
		<title>File:Build-sim.png</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/File:Build-sim.png"/>
				<updated>2011-04-18T19:06:55Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: Choosing a Qt Simulator Build&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Choosing a Qt Simulator Build&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/File:Install-sim.png</id>
		<title>File:Install-sim.png</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/File:Install-sim.png"/>
				<updated>2011-04-18T19:03:47Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: Installing Qt Simulator&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Installing Qt Simulator&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/MeeGo_UX_Components_Chroot_Tutorial</id>
		<title>MeeGo UX Components Chroot Tutorial</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/MeeGo_UX_Components_Chroot_Tutorial"/>
				<updated>2011-04-11T22:31:05Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
This tutorial will take the developer through the process of building from source the [[SDK/Docs/1.2/MeeGo_SDK_1.2_Preview|meego-ux-components package]] in a chroot development environment on Linux.&lt;br /&gt;
&lt;br /&gt;
This tutorial is based on the [[SDK/Docs/1.2/MeeGo_SDK_1.2_Preview|MeeGo SDK 1.2 Preview (with Tablet)]] release.&lt;br /&gt;
&lt;br /&gt;
This tutorial was created with a specific Tablet Build (04-01-2011) and has specific instructions related to that build. Specifically, a git checkout of a tag is required.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
* Linux Only&lt;br /&gt;
* [[SDK/Docs/1.2/MeeGo_SDK_1.2_Preview_for_Linux| MeeGo SDK 1.2]] installed&lt;br /&gt;
* [[Developing_in_a_Meego_Environment|Install / Setup mic-chroot]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Steps ==&lt;br /&gt;
&lt;br /&gt;
Step 1. Get the latest source of the meego-ux-components&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/meego.gitorious&lt;br /&gt;
git clone http://git.gitorious.org/meego-ux/meego-qml-launcher.git&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 2. Download the 4/1 version of the QEMU image:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://download.meego.com/trunk-daily/builds/1.1.90/1.1.99.1.20110401.1/images/meego-tablet-ia32-qemu/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 3. Un-tar to get the .raw image&lt;br /&gt;
&lt;br /&gt;
Step 4. Make a fs copy of the image:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo mic-chroot -s ./chroot0405 -v&lt;br /&gt;
Downloads/meego-tablet-ia32-qemu-1.1.99.1.20110405.3.img&lt;br /&gt;
&amp;lt;exit the chroot&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 5. mount --bind your source directory to a directory in the fs chroot&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo mount -B /home/dlawlor/meego.gitorious/meego-ux-components&lt;br /&gt;
meego-ux-components&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 5. start the chroot&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo mic-chroot ./chroot0401&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 6. Before building the sources, you need to git checkout a version&lt;br /&gt;
that will work with the 4/1 tablet image:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git checkout 0.2.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 7. startmeego to get all the MeeGO services started:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
startmeego &amp;amp;&lt;br /&gt;
## Note - it will be helpful to edit the script&lt;br /&gt;
/usr/bin/startmeego-debug-tablet&lt;br /&gt;
## Change: Xephyr $DISP -screen 1024x600&lt;br /&gt;
## To: Xephyr $DISP -screen 1280x800&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 8. Start Qt Creator (in the mic-chroot terminal)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qtcreator &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 9: Install packages needed to build meego-ux-components&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
zypper in libXdamage-devel&lt;br /&gt;
zypper in libXcomposite-devel&lt;br /&gt;
zypper in libX11-devel&lt;br /&gt;
zypper in kcalcore-devel&lt;br /&gt;
zypper in qt-mobility-devel&lt;br /&gt;
zypper in libqtopengl-devel&lt;br /&gt;
zypper in libcontentaction-devel&lt;br /&gt;
zypper in contextkit-devel&lt;br /&gt;
zypper in mlite&lt;br /&gt;
zypper in libexif-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 10. Build and Install&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# In Qt Creator: Build-&amp;gt;Build All&lt;br /&gt;
&lt;br /&gt;
# from the chroot terminal (Until install / deploy step in Qt Creator is tested)&lt;br /&gt;
cd ../meego-ux-components-build-desktop #If shadow build was checked&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 11. Run meego-ux-widgetgallery in a separate window&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qmlviewer /usr/share/meego-ux-widgetgallery/main.qml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 12. Run meego-ux-widgetgallery in the Xephyr startmeego window&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export DISPLAY=:2&lt;br /&gt;
qmlviewer /usr/share/meego-ux-widgetgallery/main.qml&lt;br /&gt;
&lt;br /&gt;
Step 13. Run meego-ux-widgetgallery directly from the MeeGo environment&lt;br /&gt;
# in the Xephyr Window, hit the Home (Windows) key&lt;br /&gt;
# Choose the App Viewer&lt;br /&gt;
# Click on Terminal&lt;br /&gt;
# run this command in the terminal window:&lt;br /&gt;
qmlviewer /usr/share/meego-ux-widgetgallery/main.qml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 14. You can also copy an existing .desktop file and change the exec&lt;br /&gt;
statement to meego-ux-widgetgallery if you want to click on an icon to&lt;br /&gt;
start it.&lt;br /&gt;
&lt;br /&gt;
== Todo ==&lt;br /&gt;
* Automate the creation / startup of the chroot - in the the above steps, design a script which can perform steps 2 - 5, 7, 9, 14&lt;br /&gt;
* Also document how to set up the SDK to run this application on a device.&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/MeeGo_UX_Components_Chroot_Tutorial</id>
		<title>MeeGo UX Components Chroot Tutorial</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/MeeGo_UX_Components_Chroot_Tutorial"/>
				<updated>2011-04-11T22:06:42Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
This tutorial will take the developer through the process of building from source the [[SDK/Docs/1.2/MeeGo_SDK_1.2_Preview|meego-ux-components package]] in a chroot development environment on Linux.&lt;br /&gt;
&lt;br /&gt;
This tutorial is based on the [[SDK/Docs/1.2/MeeGo_SDK_1.2_Preview|MeeGo SDK 1.2 Preview (with Tablet)]] release.&lt;br /&gt;
&lt;br /&gt;
This tutorial was created with a specific Tablet Build (04-01-2011) and has specific instructions related to that build. Specifically, a git checkout of a tag is required.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
* Linux Only&lt;br /&gt;
* [[SDK/Docs/1.2/MeeGo_SDK_1.2_Preview_for_Linux| MeeGo SDK 1.2]] installed&lt;br /&gt;
* [[Developing_in_a_Meego_Environment|Install / Setup mic-chroot]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Steps ==&lt;br /&gt;
&lt;br /&gt;
Step 1. Get the latest source of the meego-ux-components&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/meego.gitorious&lt;br /&gt;
git clone http://git.gitorious.org/meego-ux/meego-qml-launcher.git&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 2. Download the 4/1 version of the QEMU image:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://download.meego.com/trunk-daily/builds/1.1.90/1.1.99.1.20110401.1/images/meego-tablet-ia32-qemu/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 3. Un-tar to get the .raw image&lt;br /&gt;
&lt;br /&gt;
Step 4. Make a fs copy of the image:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo mic-chroot -s ./chroot0405 -v&lt;br /&gt;
Downloads/meego-tablet-ia32-qemu-1.1.99.1.20110405.3.img&lt;br /&gt;
&amp;lt;exit the chroot&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 5. mount --bind your source directory to a directory in the fs chroot&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo mount -B /home/dlawlor/meego.gitorious/meego-ux-components&lt;br /&gt;
meego-ux-components&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 5. start the chroot&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo mic-chroot ./chroot0401&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 6. Before building the sources, you need to git checkout a version&lt;br /&gt;
that will work with the 4/1 tablet image:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git checkout 0.2.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 7. startmeego to get all the MeeGO services started:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
startmeego &amp;amp;&lt;br /&gt;
## Note - it will be helpful to edit the script&lt;br /&gt;
/usr/bin/startmeego-debug-tablet&lt;br /&gt;
## Change: Xephyr $DISP -screen 1024x600&lt;br /&gt;
## To: Xephyr $DISP -screen 1280x800&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 8. Start Qt Creator (in the mic-chroot terminal)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qtcreator &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 9: Install packages needed to build meego-ux-components&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
zypper in libXdamage-devel&lt;br /&gt;
zypper in libXcomposite-devel&lt;br /&gt;
zypper in libX11-devel&lt;br /&gt;
zypper in kcalcore-devel&lt;br /&gt;
zypper in qt-mobility-devel&lt;br /&gt;
zypper in libqtopengl-devel&lt;br /&gt;
zypper in libcontentaction-devel&lt;br /&gt;
zypper in contextkit-devel&lt;br /&gt;
zypper in mlite&lt;br /&gt;
zypper in libexif-devel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 10. Install&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ../meego-ux-components-build-desktop #If shadow build was checked&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 11. Run meego-ux-widgetgallery in a separate window&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qmlviewer /usr/share/meego-ux-widgetgallery/main.qml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 12. Run meego-ux-widgetgallery in the Xephyr startmeego window&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export DISPLAY=:2&lt;br /&gt;
qmlviewer /usr/share/meego-ux-widgetgallery/main.qml&lt;br /&gt;
&lt;br /&gt;
#. Run meego-ux-widgetgallery directly from the MeeGo environment&lt;br /&gt;
# in the Xephyr Window, hit the Home (Windows) key&lt;br /&gt;
# Choose the App Viewer&lt;br /&gt;
# Click on Terminal&lt;br /&gt;
# run this command in the terminal window:&lt;br /&gt;
qmlviewer /usr/share/meego-ux-widgetgallery/main.qml&lt;br /&gt;
&lt;br /&gt;
# you can also copy an existing .desktop file and change the exec&lt;br /&gt;
statement to meego-ux-widgetgallery if you want to click on an icon to&lt;br /&gt;
start it.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/MeeGo_UX_Components_Chroot_Tutorial</id>
		<title>MeeGo UX Components Chroot Tutorial</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/MeeGo_UX_Components_Chroot_Tutorial"/>
				<updated>2011-04-11T21:27:29Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
This tutorial will take the developer through the process of building from source the [[SDK/Docs/1.2/MeeGo_SDK_1.2_Preview|meego-ux-components package]] in a chroot development environment on Linux.&lt;br /&gt;
&lt;br /&gt;
This tutorial is based on the [[SDK/Docs/1.2/MeeGo_SDK_1.2_Preview|MeeGo SDK 1.2 Preview (with Tablet)]] release.&lt;br /&gt;
&lt;br /&gt;
This tutorial was created with a specific Tablet Build (04-01-2011) and has specific instructions related to that build. Specifically, a git checkout of a tag is required.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
* Linux Only&lt;br /&gt;
* [[SDK/Docs/1.2/MeeGo_SDK_1.2_Preview_for_Linux| MeeGo SDK 1.2]] installed&lt;br /&gt;
* [[Developing_in_a_Meego_Environment|Install / Setup mic-chroot]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Steps ==&lt;br /&gt;
&lt;br /&gt;
Step 1. Get the latest source of the meego-ux-components&lt;br /&gt;
cd ~/meego.gitorious&lt;br /&gt;
git clone http://git.gitorious.org/meego-ux/meego-qml-launcher.git&lt;br /&gt;
&lt;br /&gt;
Step 2. Download the 4/1 version of the QEMU image:&lt;br /&gt;
http://download.meego.com/trunk-daily/builds/1.1.90/1.1.99.1.20110401.1/images/meego-tablet-ia32-qemu/&lt;br /&gt;
&lt;br /&gt;
Step 3. Un-tar to get the .raw image&lt;br /&gt;
&lt;br /&gt;
Step 4. Make a fs copy of the image:&lt;br /&gt;
sudo mic-chroot -s ./chroot0405 -v&lt;br /&gt;
Downloads/meego-tablet-ia32-qemu-1.1.99.1.20110405.3.img&lt;br /&gt;
&amp;lt;exit the chroot&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 5. mount --bind your source directory to a directory in the fs chroot&lt;br /&gt;
sudo mount -B /home/dlawlor/meego.gitorious/meego-ux-components&lt;br /&gt;
meego-ux-components&lt;br /&gt;
&lt;br /&gt;
Step 5. start the chroot&lt;br /&gt;
sudo mic-chroot ./chroot0401&lt;br /&gt;
&lt;br /&gt;
Step 6. Before building the sources, you need to git checkout a version&lt;br /&gt;
that will work with the 4/1 tablet image:&lt;br /&gt;
git checkout 0.2.1&lt;br /&gt;
&lt;br /&gt;
Step 7. startmeego to get all the MeeGO services started:&lt;br /&gt;
startmeego &amp;amp;&lt;br /&gt;
## Note - it will be helpful to edit the script&lt;br /&gt;
/usr/bin/startmeego-debug-tablet&lt;br /&gt;
## Change: Xephyr $DISP -screen 1024x600&lt;br /&gt;
## To: Xephyr $DISP -screen 1280x800&lt;br /&gt;
&lt;br /&gt;
Step 8. Start Qt Creator (in the mic-chroot terminal)&lt;br /&gt;
qtcreator &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Step 9: Install packages needed to build meego-ux-components&lt;br /&gt;
zypper in libXdamage-devel&lt;br /&gt;
zypper in libXcomposite-devel&lt;br /&gt;
zypper in libX11-devel&lt;br /&gt;
zypper in kcalcore-devel&lt;br /&gt;
zypper in qt-mobility-devel&lt;br /&gt;
zypper in libqtopengl-devel&lt;br /&gt;
zypper in libcontentaction-devel&lt;br /&gt;
zypper in contextkit-devel&lt;br /&gt;
zypper in mlite&lt;br /&gt;
zypper in libexif-devel&lt;br /&gt;
&lt;br /&gt;
#. Install&lt;br /&gt;
cd ../meego-ux-components-build-desktop #If shadow build was checked&lt;br /&gt;
make install&lt;br /&gt;
&lt;br /&gt;
#. Run meego-ux-widgetgallery in a separate window&lt;br /&gt;
qmlviewer /usr/share/meego-ux-widgetgallery/main.qml&lt;br /&gt;
&lt;br /&gt;
#. Run meego-ux-widgetgallery in the Xephyr startmeego window&lt;br /&gt;
export DISPLAY=:2&lt;br /&gt;
qmlviewer /usr/share/meego-ux-widgetgallery/main.qml&lt;br /&gt;
&lt;br /&gt;
#. Run meego-ux-widgetgallery directly from the MeeGo environment&lt;br /&gt;
# in the Xephyr Window, hit the Home (Windows) key&lt;br /&gt;
# Choose the App Viewer&lt;br /&gt;
# Click on Terminal&lt;br /&gt;
# run this command in the terminal window:&lt;br /&gt;
qmlviewer /usr/share/meego-ux-widgetgallery/main.qml&lt;br /&gt;
&lt;br /&gt;
# you can also copy an existing .desktop file and change the exec&lt;br /&gt;
statement to meego-ux-widgetgallery if you want to click on an icon to&lt;br /&gt;
start it.&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/MeeGo_UX_Components_Chroot_Tutorial</id>
		<title>MeeGo UX Components Chroot Tutorial</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/MeeGo_UX_Components_Chroot_Tutorial"/>
				<updated>2011-04-11T21:14:23Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: Building and Running MeeGo UX Components in a Linux chroot environment&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
This tutorial will take the developer through the process of building from source the [[SDK/Docs/1.2/MeeGo_SDK_1.2_Preview|meego-ux-components package]] in a chroot development environment on Linux.&lt;br /&gt;
&lt;br /&gt;
This tutorial is based on the [[/SDK/Docs/1.2/MeeGo_SDK_1.2_Preview|MeeGo SDK 1.2 Preview (with Tablet)]] release&lt;br /&gt;
&lt;br /&gt;
== Pre-requisites ==&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/MeeGo_UX_Components</id>
		<title>MeeGo UX Components</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/MeeGo_UX_Components"/>
				<updated>2011-03-31T21:37:10Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: /* Install the MeeGo UX Components */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Overview=&lt;br /&gt;
This page will walk you through the process of creating an application with the QML based MeeGo UX Components.  The MeeGo UX Components provide a set UI elements allowing you to quickly build applications which tightly integrate with the MeeGo user experience.&lt;br /&gt;
&lt;br /&gt;
=Install the MeeGo UX Components=&lt;br /&gt;
You can install the MeeGo UX components either from the zypper (recommended) or directly form the latest version of the source code.  This code assumes you are working either on a MeeGo system [[SDK/Docs/1.2/MeeGo_SDK_1.2_Preview_for_Windows|(Windows]] | [[SDK/Docs/1.2/MeeGo_SDK_1.2_Preview_for_Linux|Linux)]], within the [[SDK/Qemu|MeeGo SDK QEMU environment]], or within a [[Developing_in_a_Meego_Environment#Step_1:_Chrooting_into_the_development_image|MeeGo chroot configuration]].&lt;br /&gt;
&lt;br /&gt;
==Zypper==&lt;br /&gt;
To install the MeeGo UX Components via zypper:&lt;br /&gt;
 zypper install meego-ux-components-devel&lt;br /&gt;
&lt;br /&gt;
==From Source==&lt;br /&gt;
We'll first clone the source from the upstream repository location on Gitorious:&lt;br /&gt;
 git clone git://meego.gitorious.org/meego-ux/meego-ux-components&lt;br /&gt;
 cd meego-ux-components&lt;br /&gt;
 qmake&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
NOTE:  If you haven't been doing active development from sources, you may need several development dependency packages.  The easiest way to get those dependencies installed is to use zypper to install the sources for meego-u-components first.  You can then pull from GIT for the tip of development.  This command tells zypper to install the source for meego-ux-components, which will install any build dependencies as well:&lt;br /&gt;
 zypper si meego-ux-components&lt;br /&gt;
&lt;br /&gt;
=Seeing the MeeGo UX Components=&lt;br /&gt;
&lt;br /&gt;
Next lets test the install and verify that the widgets are installed.  The default location for the sample applications using the components are:&lt;br /&gt;
 /usr/share/meego-ux-app-photos&lt;br /&gt;
 /usr/share/meego-ux-tutorial&lt;br /&gt;
 /usr/share/meego-ux-widgetgallery&lt;br /&gt;
&lt;br /&gt;
We will run the widget gallery using the qmlviewer:&lt;br /&gt;
 $ qmlviewer /usr/share/meego-ux-widgetgallery/main.qml&lt;br /&gt;
&lt;br /&gt;
=Building your first application=&lt;br /&gt;
Now that the MeeGo UX Components are installed on your system, you can begin developing a new application using the components.  &lt;br /&gt;
&lt;br /&gt;
# Launch Qt Creator.&lt;br /&gt;
# Select 'Create Project'&lt;br /&gt;
# Under Projects select 'Qt Quick Project'&lt;br /&gt;
# 'QML Application' will be selected for the template type.&lt;br /&gt;
# Click 'Choose...'&lt;br /&gt;
# Give the project a name, for example &amp;quot;thatwaseasy&amp;quot;.  Click 'Next'&lt;br /&gt;
# Click 'Finish'  Qt Creator will now create the project and provide an initial QML file&lt;br /&gt;
&lt;br /&gt;
Let's run it to see what it does.  Click the green arrow in the lower left corner of Qt Creator.  This will run the application.  After a few moments a new window will appear with the text 'Hello world'  Now let's add a MeeGo UX button and when it is pressed, we will change the text to say &amp;quot;That was easy!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=Adding MeeGo UX Components=&lt;br /&gt;
Installed with the MeeGo UX Components are a set of QML files provided as a tutorial.  You can find the contents of the first file in:&lt;br /&gt;
 /usr/share/meego-ux-tutorial/step1/main.qml.&lt;br /&gt;
&lt;br /&gt;
Open that file in Qt Creator, copy its contents, and replace the contents of the QML file that Qt Creator generated for you.&lt;br /&gt;
&lt;br /&gt;
You can now run that first step by clicking on the green arrow (or pressing CTRL-R on the keyboard)  Save your changes when prompted.&lt;br /&gt;
&lt;br /&gt;
You can explore the other tutorial steps and see what they each do.  Experiment with the various components you see in the widgets gallery.&lt;br /&gt;
&lt;br /&gt;
=Screen Shots of the Meego UX Components=&lt;br /&gt;
&lt;br /&gt;
[[File:Meego-ux-widgetgallery-1.png|800px]]&lt;br /&gt;
::(Initial view - showing the list of widgets)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Meego-ux-widgetgallery-Buttons.png|800px]]&lt;br /&gt;
::(Showing Button Widgets)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Meego-ux-widgetgallery-ModalDialogs.png|800px]]&lt;br /&gt;
::(Showing Modal Dialog Widgets)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Meego-ux-widgetgallery-date-picker.png|800px]]&lt;br /&gt;
::(Showing Date Picker Widget in action)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Meego-ux-widgetgallery-messagebox.png|800px]]&lt;br /&gt;
::(Showing ModalMessageBox in action)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Meego-ux-widgetgallery-progressbar.png|800px]]&lt;br /&gt;
::(Showing ProgressBar widget in action after clicking the Start button)&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/MeeGo_UX_Components</id>
		<title>MeeGo UX Components</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/MeeGo_UX_Components"/>
				<updated>2011-03-30T22:44:52Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: /* Install the MeeGo UX Components */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Overview=&lt;br /&gt;
This page will walk you through the process of creating an application with the QML based MeeGo UX Components.  The MeeGo UX Components provide a set UI elements allowing you to quickly build applications which tightly integrate with the MeeGo user experience.&lt;br /&gt;
&lt;br /&gt;
=Install the MeeGo UX Components=&lt;br /&gt;
You can install the MeeGo UX components either from the zypper (recommended) or directly form the latest version of the source code.  This code assumes you are working either on a [http://wiki.meego.com/SDK/Docs/1.2/MeeGo_SDK_1.2_Preview_for_Windows MeeGo system], within the [http://wiki.meego.com/SDK/Qemu MeeGo SDK QEMU environment], or within a [http://wiki.meego.com/Developing_in_a_Meego_Environment#Step_1:_Chrooting_into_the_development_image MeeGo chroot configuration].&lt;br /&gt;
&lt;br /&gt;
==Zypper==&lt;br /&gt;
To install the MeeGo UX Components via zypper:&lt;br /&gt;
 zypper install meego-ux-components-devel&lt;br /&gt;
&lt;br /&gt;
==From Source==&lt;br /&gt;
We'll first clone the source from the upstream repository location on Gitorious:&lt;br /&gt;
 git clone git://meego.gitorious.org/meego-ux/meego-ux-components&lt;br /&gt;
 cd meego-ux-components&lt;br /&gt;
 qmake&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
NOTE:  If you haven't been doing active development from sources, you may need several development dependency packages.  The easiest way to get those dependencies installed is to use zypper to install the sources for meego-u-components first.  You can then pull from GIT for the tip of development.  This command tells zypper to install the source for meego-ux-components, which will install any build dependencies as well:&lt;br /&gt;
 zypper si meego-ux-components&lt;br /&gt;
&lt;br /&gt;
=Seeing the MeeGo UX Components=&lt;br /&gt;
&lt;br /&gt;
Next lets test the install and verify that the widgets are installed.  The default location for the sample applications using the components are:&lt;br /&gt;
 /usr/share/meego-ux-app-photos&lt;br /&gt;
 /usr/share/meego-ux-tutorial&lt;br /&gt;
 /usr/share/meego-ux-widgetgallery&lt;br /&gt;
&lt;br /&gt;
We will run the widget gallery using the qmlviewer:&lt;br /&gt;
 $ qmlviewer /usr/share/meego-ux-widgetgallery/main.qml&lt;br /&gt;
&lt;br /&gt;
=Building your first application=&lt;br /&gt;
Now that the MeeGo UX Components are installed on your system, you can begin developing a new application using the components.  &lt;br /&gt;
&lt;br /&gt;
# Launch Qt Creator.&lt;br /&gt;
# Select 'Create Project'&lt;br /&gt;
# Under Projects select 'Qt Quick Project'&lt;br /&gt;
# 'QML Application' will be selected for the template type.&lt;br /&gt;
# Click 'Choose...'&lt;br /&gt;
# Give the project a name, for example &amp;quot;thatwaseasy&amp;quot;.  Click 'Next'&lt;br /&gt;
# Click 'Finish'  Qt Creator will now create the project and provide an initial QML file&lt;br /&gt;
&lt;br /&gt;
Let's run it to see what it does.  Click the green arrow in the lower left corner of Qt Creator.  This will run the application.  After a few moments a new window will appear with the text 'Hello world'  Now let's add a MeeGo UX button and when it is pressed, we will change the text to say &amp;quot;That was easy!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=Adding MeeGo UX Components=&lt;br /&gt;
Installed with the MeeGo UX Components are a set of QML files provided as a tutorial.  You can find the contents of the first file in:&lt;br /&gt;
 /usr/share/meego-ux-tutorial/step1/main.qml.&lt;br /&gt;
&lt;br /&gt;
Open that file in Qt Creator, copy its contents, and replace the contents of the QML file that Qt Creator generated for you.&lt;br /&gt;
&lt;br /&gt;
You can now run that first step by clicking on the green arrow (or pressing CTRL-R on the keyboard)  Save your changes when prompted.&lt;br /&gt;
&lt;br /&gt;
You can explore the other tutorial steps and see what they each do.  Experiment with the various components you see in the widgets gallery.&lt;br /&gt;
&lt;br /&gt;
=Screen Shots of the Meego UX Components=&lt;br /&gt;
&lt;br /&gt;
[[File:Meego-ux-widgetgallery-1.png|800px]]&lt;br /&gt;
::(Initial view - showing the list of widgets)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Meego-ux-widgetgallery-Buttons.png|800px]]&lt;br /&gt;
::(Showing Button Widgets)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Meego-ux-widgetgallery-ModalDialogs.png|800px]]&lt;br /&gt;
::(Showing Modal Dialog Widgets)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Meego-ux-widgetgallery-date-picker.png|800px]]&lt;br /&gt;
::(Showing Date Picker Widget in action)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Meego-ux-widgetgallery-messagebox.png|800px]]&lt;br /&gt;
::(Showing ModalMessageBox in action)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Meego-ux-widgetgallery-progressbar.png|800px]]&lt;br /&gt;
::(Showing ProgressBar widget in action after clicking the Start button)&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/MeeGo_UX_Components</id>
		<title>MeeGo UX Components</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/MeeGo_UX_Components"/>
				<updated>2011-03-30T22:26:28Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: /* Install the MeeGo UX Components */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Overview=&lt;br /&gt;
This page will walk you through the process of creating an application with the QML based MeeGo UX Components.  The MeeGo UX Components provide a set UI elements allowing you to quickly build applications which tightly integrate with the MeeGo user experience.&lt;br /&gt;
&lt;br /&gt;
=Install the MeeGo UX Components=&lt;br /&gt;
You can install the MeeGo UX components either from the zypper (recommended) or directly form the latest version of the source code.  This code assumes you are working either on a [http://wiki.meego.com/SDK/Docs/1.2/MeeGo_SDK_1.2_Preview_for_Windows MeeGo system], within the [http://link-to-sdk-qemu-info.com MeeGo SDK QEMU environment], or within a [http://link-to-meego-chroot-info.com MeeGo chroot configuration].&lt;br /&gt;
&lt;br /&gt;
==Zypper==&lt;br /&gt;
To install the MeeGo UX Components via zypper:&lt;br /&gt;
 zypper install meego-ux-components-devel&lt;br /&gt;
&lt;br /&gt;
==From Source==&lt;br /&gt;
We'll first clone the source from the upstream repository location on Gitorious:&lt;br /&gt;
 git clone git://meego.gitorious.org/meego-ux/meego-ux-components&lt;br /&gt;
 cd meego-ux-components&lt;br /&gt;
 qmake&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
NOTE:  If you haven't been doing active development from sources, you may need several development dependency packages.  The easiest way to get those dependencies installed is to use zypper to install the sources for meego-u-components first.  You can then pull from GIT for the tip of development.  This command tells zypper to install the source for meego-ux-components, which will install any build dependencies as well:&lt;br /&gt;
 zypper si meego-ux-components&lt;br /&gt;
&lt;br /&gt;
=Seeing the MeeGo UX Components=&lt;br /&gt;
&lt;br /&gt;
Next lets test the install and verify that the widgets are installed.  The default location for the sample applications using the components are:&lt;br /&gt;
 /usr/share/meego-ux-app-photos&lt;br /&gt;
 /usr/share/meego-ux-tutorial&lt;br /&gt;
 /usr/share/meego-ux-widgetgallery&lt;br /&gt;
&lt;br /&gt;
We will run the widget gallery using the qmlviewer:&lt;br /&gt;
 $ qmlviewer /usr/share/meego-ux-widgetgallery/main.qml&lt;br /&gt;
&lt;br /&gt;
=Building your first application=&lt;br /&gt;
Now that the MeeGo UX Components are installed on your system, you can begin developing a new application using the components.  &lt;br /&gt;
&lt;br /&gt;
# Launch Qt Creator.&lt;br /&gt;
# Select 'Create Project'&lt;br /&gt;
# Under Projects select 'Qt Quick Project'&lt;br /&gt;
# 'QML Application' will be selected for the template type.&lt;br /&gt;
# Click 'Choose...'&lt;br /&gt;
# Give the project a name, for example &amp;quot;thatwaseasy&amp;quot;.  Click 'Next'&lt;br /&gt;
# Click 'Finish'  Qt Creator will now create the project and provide an initial QML file&lt;br /&gt;
&lt;br /&gt;
Let's run it to see what it does.  Click the green arrow in the lower left corner of Qt Creator.  This will run the application.  After a few moments a new window will appear with the text 'Hello world'  Now let's add a MeeGo UX button and when it is pressed, we will change the text to say &amp;quot;That was easy!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=Adding MeeGo UX Components=&lt;br /&gt;
Installed with the MeeGo UX Components are a set of QML files provided as a tutorial.  You can find the contents of the first file in:&lt;br /&gt;
 /usr/share/meego-ux-tutorial/step1/main.qml.&lt;br /&gt;
&lt;br /&gt;
Open that file in Qt Creator, copy its contents, and replace the contents of the QML file that Qt Creator generated for you.&lt;br /&gt;
&lt;br /&gt;
You can now run that first step by clicking on the green arrow (or pressing CTRL-R on the keyboard)  Save your changes when prompted.&lt;br /&gt;
&lt;br /&gt;
You can explore the other tutorial steps and see what they each do.  Experiment with the various components you see in the widgets gallery.&lt;br /&gt;
&lt;br /&gt;
=Screen Shots of the Meego UX Components=&lt;br /&gt;
&lt;br /&gt;
[[File:Meego-ux-widgetgallery-1.png|800px]]&lt;br /&gt;
::(Initial view - showing the list of widgets)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Meego-ux-widgetgallery-Buttons.png|800px]]&lt;br /&gt;
::(Showing Button Widgets)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Meego-ux-widgetgallery-ModalDialogs.png|800px]]&lt;br /&gt;
::(Showing Modal Dialog Widgets)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Meego-ux-widgetgallery-date-picker.png|800px]]&lt;br /&gt;
::(Showing Date Picker Widget in action)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Meego-ux-widgetgallery-messagebox.png|800px]]&lt;br /&gt;
::(Showing ModalMessageBox in action)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Meego-ux-widgetgallery-progressbar.png|800px]]&lt;br /&gt;
::(Showing ProgressBar widget in action after clicking the Start button)&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/File:Meego-ux-widgetgallery-progressbar.png</id>
		<title>File:Meego-ux-widgetgallery-progressbar.png</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/File:Meego-ux-widgetgallery-progressbar.png"/>
				<updated>2011-03-30T18:55:03Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: Showing ProgressBar widget in action after clicking the Start button&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Showing ProgressBar widget in action after clicking the Start button&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/File:Meego-ux-widgetgallery-messagebox.png</id>
		<title>File:Meego-ux-widgetgallery-messagebox.png</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/File:Meego-ux-widgetgallery-messagebox.png"/>
				<updated>2011-03-30T18:54:13Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: Showing ModalMessageBox in action&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Showing ModalMessageBox in action&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/File:Meego-ux-widgetgallery-date-picker.png</id>
		<title>File:Meego-ux-widgetgallery-date-picker.png</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/File:Meego-ux-widgetgallery-date-picker.png"/>
				<updated>2011-03-30T18:53:16Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: Showing Date Picker Widget in action&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Showing Date Picker Widget in action&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/File:Meego-ux-widgetgallery-ModalDialogs.png</id>
		<title>File:Meego-ux-widgetgallery-ModalDialogs.png</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/File:Meego-ux-widgetgallery-ModalDialogs.png"/>
				<updated>2011-03-30T18:52:26Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: Showing Modal Dialog Widgets&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Showing Modal Dialog Widgets&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/File:Meego-ux-widgetgallery-Buttons.png</id>
		<title>File:Meego-ux-widgetgallery-Buttons.png</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/File:Meego-ux-widgetgallery-Buttons.png"/>
				<updated>2011-03-30T18:51:23Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: Showing Button Widgets&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Showing Button Widgets&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/File:Meego-ux-widgetgallery-1.png</id>
		<title>File:Meego-ux-widgetgallery-1.png</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/File:Meego-ux-widgetgallery-1.png"/>
				<updated>2011-03-30T18:49:44Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: Initial view - showing the list of widgets&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Initial view - showing the list of widgets&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/MeeGo_UX_Components</id>
		<title>MeeGo UX Components</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/MeeGo_UX_Components"/>
				<updated>2011-03-30T01:11:41Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: How to build otc-components (using as much of the MeeGo SDK as possible)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Build the application in Qt Creator ==&lt;br /&gt;
Build only. No deployment as of yet.&lt;br /&gt;
&lt;br /&gt;
==== Get the source code to the otc-components ====&lt;br /&gt;
&amp;lt;pre&amp;gt; git clone ssh://git@git.meego.com/otc-components &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Patch for examples/meego-ux-widgetgallery/meego-ux-widgetgallery.pro ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
diff --git a/examples/meego-ux-widgetgallery/meego-ux-widgetgallery.pro b/examples/meego-ux-widgetgallery/meego-ux-widgetgallery.pro&lt;br /&gt;
index cf05e7d..7c4a5ef 100644&lt;br /&gt;
--- a/examples/meego-ux-widgetgallery/meego-ux-widgetgallery.pro&lt;br /&gt;
+++ b/examples/meego-ux-widgetgallery/meego-ux-widgetgallery.pro&lt;br /&gt;
@@ -3,7 +3,10 @@ TEMPLATE = subdirs&lt;br /&gt;
 TARGET = meego-ux-widgetgallery&lt;br /&gt;
 &lt;br /&gt;
 qmlfiles.files += *.qml images/&lt;br /&gt;
-qmlfiles.path += $$INSTALL_ROOT/usr/share/$$TARGET&lt;br /&gt;
+#qmlfiles.path += $$INSTALL_ROOT/usr/share/$$TARGET&lt;br /&gt;
+&lt;br /&gt;
+# workaround for INSTALL_ROOT not finding my sysroot&lt;br /&gt;
+qmlfiles.path += $$[QT_INSTALL_IMPORTS]/../../../../usr/share/$$TARGET&lt;br /&gt;
 &lt;br /&gt;
 INSTALLS += qmlfiles&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Patch for src/src.pro ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
diff --git a/src/src.pro b/src/src.pro&lt;br /&gt;
index 45b3e33..550402f 100644&lt;br /&gt;
--- a/src/src.pro&lt;br /&gt;
+++ b/src/src.pro&lt;br /&gt;
@@ -57,4 +57,8 @@ HEADERS += \&lt;br /&gt;
 &lt;br /&gt;
 qmldir.files += $$QML_SOURCES&lt;br /&gt;
 qmldir.path  += $$[QT_INSTALL_IMPORTS]/MeeGo/Components&lt;br /&gt;
-INSTALLS += target qmldir&lt;br /&gt;
+&lt;br /&gt;
+debug_source.files += $$SOURCES $$HEADERS&lt;br /&gt;
+debug_source.path  += $$[QT_INSTALL_IMPORTS]/MeeGo/Components/src&lt;br /&gt;
+&lt;br /&gt;
+INSTALLS += target qmldir debug_source&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Open this project with Qt Creator and choose the Tablet build from 3/26/11 for the build environment ====&lt;br /&gt;
Please un-check shadow build&lt;br /&gt;
&lt;br /&gt;
Build -&amp;gt; Build All&lt;br /&gt;
&lt;br /&gt;
Screenshot showing the current sysroot in Qt Creator&lt;br /&gt;
[[File:qt-tablet-components-settings.png]]&lt;br /&gt;
&lt;br /&gt;
== Now you have to drop out of the SDK to complete the task... ==&lt;br /&gt;
&lt;br /&gt;
==== In the otc-components source directory ====&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
this copies the files that need to be on your device or emulator to the sysroot&lt;br /&gt;
&lt;br /&gt;
==== Now you have to get these files to your device. ====&lt;br /&gt;
(Here are the non-network instructions)&lt;br /&gt;
mic-chroot to the Tablet 3/25 sysroot&lt;br /&gt;
&amp;lt;pre&amp;gt; Ex. sudo mic-chroot -v /usr/lib/madde/linux-i686/sysroots/meego-tablet-ia32-oss-madde-sysroot-1.1.90.8.20110323.1-fs&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
cd to root of the sysroot&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd / &lt;br /&gt;
tar cvfz widget-gallerly.tgz usr/lib/qt4/imports/MeeGo/Components/ usr/share/meego-ux-widgetgallery&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Copy this tar file to your device and cd to / on your device and untar ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /&lt;br /&gt;
tar xvfz &amp;lt;some-dir-on-device&amp;gt;/widget-gallerly.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Now run the widget gallery ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  make sure you're logged in as user meego, NOT root&lt;br /&gt;
 &lt;br /&gt;
meego-qml-launcher --opengl --fullscreen --app meego-ux-widgetgallery&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/File:Qt-tablet-components-settings.png</id>
		<title>File:Qt-tablet-components-settings.png</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/File:Qt-tablet-components-settings.png"/>
				<updated>2011-03-30T01:08:06Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: qt-tablet-components-settings.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;qt-tablet-components-settings.png&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	<entry>
		<id>http://wiki.meego.com/MeeGo_UX_Components</id>
		<title>MeeGo UX Components</title>
		<link rel="alternate" type="text/html" href="http://wiki.meego.com/MeeGo_UX_Components"/>
				<updated>2011-03-30T01:06:22Z</updated>
		
		<summary type="html">&lt;p&gt;Dlawlor: Created page with &amp;quot;== Build the application in Qt Creator == Build only. No deployment as of yet.  ==== Get the source code to the otc-components ==== &amp;lt;pre&amp;gt; git clone ssh://git@git.meego.com/otc-co…&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Build the application in Qt Creator ==&lt;br /&gt;
Build only. No deployment as of yet.&lt;br /&gt;
&lt;br /&gt;
==== Get the source code to the otc-components ====&lt;br /&gt;
&amp;lt;pre&amp;gt; git clone ssh://git@git.meego.com/otc-components &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Patch for examples/meego-ux-widgetgallery/meego-ux-widgetgallery.pro ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
diff --git a/examples/meego-ux-widgetgallery/meego-ux-widgetgallery.pro b/examples/meego-ux-widgetgallery/meego-ux-widgetgallery.pro&lt;br /&gt;
index cf05e7d..7c4a5ef 100644&lt;br /&gt;
--- a/examples/meego-ux-widgetgallery/meego-ux-widgetgallery.pro&lt;br /&gt;
+++ b/examples/meego-ux-widgetgallery/meego-ux-widgetgallery.pro&lt;br /&gt;
@@ -3,7 +3,10 @@ TEMPLATE = subdirs&lt;br /&gt;
 TARGET = meego-ux-widgetgallery&lt;br /&gt;
 &lt;br /&gt;
 qmlfiles.files += *.qml images/&lt;br /&gt;
-qmlfiles.path += $$INSTALL_ROOT/usr/share/$$TARGET&lt;br /&gt;
+#qmlfiles.path += $$INSTALL_ROOT/usr/share/$$TARGET&lt;br /&gt;
+&lt;br /&gt;
+# workaround for INSTALL_ROOT not finding my sysroot&lt;br /&gt;
+qmlfiles.path += $$[QT_INSTALL_IMPORTS]/../../../../usr/share/$$TARGET&lt;br /&gt;
 &lt;br /&gt;
 INSTALLS += qmlfiles&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Patch for src/src.pro ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
diff --git a/src/src.pro b/src/src.pro&lt;br /&gt;
index 45b3e33..550402f 100644&lt;br /&gt;
--- a/src/src.pro&lt;br /&gt;
+++ b/src/src.pro&lt;br /&gt;
@@ -57,4 +57,8 @@ HEADERS += \&lt;br /&gt;
 &lt;br /&gt;
 qmldir.files += $$QML_SOURCES&lt;br /&gt;
 qmldir.path  += $$[QT_INSTALL_IMPORTS]/MeeGo/Components&lt;br /&gt;
-INSTALLS += target qmldir&lt;br /&gt;
+&lt;br /&gt;
+debug_source.files += $$SOURCES $$HEADERS&lt;br /&gt;
+debug_source.path  += $$[QT_INSTALL_IMPORTS]/MeeGo/Components/src&lt;br /&gt;
+&lt;br /&gt;
+INSTALLS += target qmldir debug_source&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Open this project with Qt Creator and choose the Tablet build from 3/26/11 for the build environment ====&lt;br /&gt;
Please un-check shadow build&lt;br /&gt;
&lt;br /&gt;
Build -&amp;gt; Build All&lt;br /&gt;
&lt;br /&gt;
== Now you have to drop out of the SDK to complete the task... ==&lt;br /&gt;
&lt;br /&gt;
==== In the otc-components source directory ====&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
this copies the files that need to be on your device or emulator to the sysroot&lt;br /&gt;
&lt;br /&gt;
==== Now you have to get these files to your device. ====&lt;br /&gt;
(Here are the non-network instructions)&lt;br /&gt;
mic-chroot to the Tablet 3/25 sysroot&lt;br /&gt;
&amp;lt;pre&amp;gt; Ex. sudo mic-chroot -v /usr/lib/madde/linux-i686/sysroots/meego-tablet-ia32-oss-madde-sysroot-1.1.90.8.20110323.1-fs&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
cd to root of the sysroot&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd / &lt;br /&gt;
tar cvfz widget-gallerly.tgz usr/lib/qt4/imports/MeeGo/Components/ usr/share/meego-ux-widgetgallery&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Copy this tar file to your device and cd to / on your device and untar ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /&lt;br /&gt;
tar xvfz &amp;lt;some-dir-on-device&amp;gt;/widget-gallerly.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Now run the widget gallery ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  make sure you're logged in as user meego, NOT root&lt;br /&gt;
 &lt;br /&gt;
meego-qml-launcher --opengl --fullscreen --app meego-ux-widgetgallery&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dlawlor</name></author>	</entry>

	</feed>