Meego Wiki
Views

MeeGo UX Components

From MeeGo wiki
(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
-
== Build the application in Qt Creator ==
+
=Overview=
-
Build only. No deployment as of yet.
+
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.
-
=== Get the source code to the meego-ux-components ===
+
=Install the MeeGo UX Components=
-
<pre>git clone git://meego.gitorious.org/meego-ux/meego-ux-components</pre>
+
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://link-to-download-meego-image.com 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].
-
=== Patch for examples/meego-ux-widgetgallery/meego-ux-widgetgallery.pro ===
+
==Zypper==
-
<pre>
+
To install the MeeGo UX Components via zypper:
-
diff --git a/examples/meego-ux-widgetgallery/meego-ux-widgetgallery.pro b/examples/meego-ux-widgetgallery/meego-ux-widgetgallery.pro
+
  zypper install meego-ux-components-devel
-
index cf05e7d..7c4a5ef 100644
+
-
--- a/examples/meego-ux-widgetgallery/meego-ux-widgetgallery.pro
+
-
+++ b/examples/meego-ux-widgetgallery/meego-ux-widgetgallery.pro
+
-
@@ -3,7 +3,10 @@ TEMPLATE = subdirs
+
-
  TARGET = meego-ux-widgetgallery
+
-
+
-
qmlfiles.files += *.qml images/
+
-
-qmlfiles.path += $$INSTALL_ROOT/usr/share/$$TARGET
+
-
+#qmlfiles.path += $$INSTALL_ROOT/usr/share/$$TARGET
+
-
+
+
-
+# workaround for INSTALL_ROOT not finding my sysroot
+
-
+qmlfiles.path += $$[QT_INSTALL_IMPORTS]/../../../../usr/share/$$TARGET
+
-
+
-
INSTALLS += qmlfiles
+
-
</pre>
+
-
=== Patch for src/src.pro ===
+
==From Source==
-
<pre>
+
We'll first clone the source from the upstream repository location on Gitorious:
-
diff --git a/src/src.pro b/src/src.pro
+
git clone git://meego.gitorious.org/meego-ux/meego-ux-components
-
index 45b3e33..550402f 100644
+
cd meego-ux-components
-
--- a/src/src.pro
+
  qmake
-
+++ b/src/src.pro
+
  make
-
@@ -57,4 +57,8 @@ HEADERS += \
+
  sudo make install
-
   
+
NOTE:  If you haven't been doing active development from sources, you may need several development dependency packagesThe 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 developmentThis command tells zypper to install the source for meego-ux-components, which will install any build dependencies as well:
-
  qmldir.files += $$QML_SOURCES
+
zypper si meego-ux-components
-
  qmldir.path += $$[QT_INSTALL_IMPORTS]/MeeGo/Components
+
-
-INSTALLS += target qmldir
+
-
+
+
-
+debug_source.files += $$SOURCES $$HEADERS
+
-
+debug_source.path += $$[QT_INSTALL_IMPORTS]/MeeGo/Components/src
+
-
+
+
-
+INSTALLS += target qmldir debug_source
+
-
</pre>
+
-
=== Open this project with Qt Creator and choose the Tablet build from 3/26/11 for the build environment ===
+
=Seeing the MeeGo UX Components=
-
Please un-check shadow build
+
-
Build -> Build All
+
Next lets test the install and verify that the widgets are installed.  The default location for the sample applications using the components are:
 +
/usr/share/meego-ux-app-photos
 +
/usr/share/meego-ux-tutorial
 +
/usr/share/meego-ux-widgetgallery
-
Screenshot showing the current sysroot in Qt Creator
+
We will run the widget gallery using the qmlviewer:
-
[[File:qt-tablet-components-settings.png]]
+
$ qmlviewer /usr/share/meego-ux-widgetgallery/main.qml
-
== Now you have to drop out of the SDK to complete the task... ==
+
=Building your first application=
 +
Now that the MeeGo UX Components are installed on your system, you can begin developing a new application using the components.
-
=== In the otc-components source directory ===
+
# Launch Qt Creator.
-
<pre>sudo make install</pre>
+
# Select 'Create Project'
-
this copies the files that need to be on your device or emulator to the sysroot
+
# Under Projects select 'Qt Quick Project'
 +
# 'QML Application' will be selected for the template type.
 +
# Click 'Choose...'
 +
# Give the project a name, for example "thatwaseasy".  Click 'Next'
 +
# Click 'Finish'  Qt Creator will now create the project and provide an initial QML file
-
=== Now you have to get these files to your device. ===
+
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 "That was easy!"
-
(Here are the non-network instructions)
+
-
mic-chroot to the Tablet 3/25 sysroot
+
-
<pre> Ex. sudo mic-chroot -v /usr/lib/madde/linux-i686/sysroots/meego-tablet-ia32-oss-madde-sysroot-1.1.90.8.20110323.1-fs
+
-
</pre>
+
-
cd to root of the sysroot
+
=Adding MeeGo UX Components=
-
<pre>
+
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:
-
cd /
+
/usr/share/meego-ux-tutorial/step1/main.qml.
-
tar cvfz widget-gallerly.tgz usr/lib/qt4/imports/MeeGo/Components/ usr/share/meego-ux-widgetgallery
+
-
</pre>
+
-
=== Copy this tar file to your device and cd to / on your device and untar ===
+
Open that file in Qt Creator, copy its contents, and replace the contents of the QML file that Qt Creator generated for you.
-
<pre>
+
-
cd /
+
-
tar xvfz <some-dir-on-device>/widget-gallerly.tgz
+
-
</pre>
+
-
=== Now run the widget gallery ===
+
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.
-
<pre>
+
 
-
  make sure you're logged in as user meego, NOT root
+
You can explore the other tutorial steps and see what they each do.  Experiment with the various components you see in the widgets gallery.
-
+
 
-
meego-qml-launcher --opengl --fullscreen --app meego-ux-widgetgallery
+
=Screen Shots of the Meego UX Components=
-
</pre>
+
 
 +
[[File:Meego-ux-widgetgallery-1.png|800px]]
 +
::(Initial view - showing the list of widgets)
 +
 
 +
 
 +
[[File:Meego-ux-widgetgallery-Buttons.png|800px]]
 +
::(Showing Button Widgets)
 +
 
 +
 
 +
[[File:Meego-ux-widgetgallery-ModalDialogs.png|800px]]
 +
::(Showing Modal Dialog Widgets)
 +
 
 +
 
 +
[[File:Meego-ux-widgetgallery-date-picker.png|800px]]
 +
::(Showing Date Picker Widget in action)
 +
 
 +
 
 +
[[File:Meego-ux-widgetgallery-messagebox.png|800px]]
 +
::(Showing ModalMessageBox in action)
 +
 
 +
 
 +
[[File:Meego-ux-widgetgallery-progressbar.png|800px]]
 +
::(Showing ProgressBar widget in action after clicking the Start button)

Revision as of 22:05, 30 March 2011

Contents

Overview

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.

Install the MeeGo UX Components

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, within the MeeGo SDK QEMU environment, or within a MeeGo chroot configuration.

Zypper

To install the MeeGo UX Components via zypper:

zypper install meego-ux-components-devel

From Source

We'll first clone the source from the upstream repository location on Gitorious:

git clone git://meego.gitorious.org/meego-ux/meego-ux-components
cd meego-ux-components
qmake
make
sudo make install

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:

zypper si meego-ux-components

Seeing the MeeGo UX Components

Next lets test the install and verify that the widgets are installed. The default location for the sample applications using the components are:

/usr/share/meego-ux-app-photos
/usr/share/meego-ux-tutorial
/usr/share/meego-ux-widgetgallery

We will run the widget gallery using the qmlviewer:

$ qmlviewer /usr/share/meego-ux-widgetgallery/main.qml

Building your first application

Now that the MeeGo UX Components are installed on your system, you can begin developing a new application using the components.

  1. Launch Qt Creator.
  2. Select 'Create Project'
  3. Under Projects select 'Qt Quick Project'
  4. 'QML Application' will be selected for the template type.
  5. Click 'Choose...'
  6. Give the project a name, for example "thatwaseasy". Click 'Next'
  7. Click 'Finish' Qt Creator will now create the project and provide an initial QML file

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 "That was easy!"

Adding MeeGo UX Components

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:

/usr/share/meego-ux-tutorial/step1/main.qml.

Open that file in Qt Creator, copy its contents, and replace the contents of the QML file that Qt Creator generated for you.

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.

You can explore the other tutorial steps and see what they each do. Experiment with the various components you see in the widgets gallery.

Screen Shots of the Meego UX Components

Meego-ux-widgetgallery-1.png

(Initial view - showing the list of widgets)


Meego-ux-widgetgallery-Buttons.png

(Showing Button Widgets)


Meego-ux-widgetgallery-ModalDialogs.png

(Showing Modal Dialog Widgets)


Meego-ux-widgetgallery-date-picker.png

(Showing Date Picker Widget in action)


Meego-ux-widgetgallery-messagebox.png

(Showing ModalMessageBox in action)


Meego-ux-widgetgallery-progressbar.png

(Showing ProgressBar widget in action after clicking the Start button)
Personal tools