Meego Wiki
Views

MeeGo UX Components

From MeeGo wiki
(Difference between revisions)
Jump to: navigation, search
(How to build otc-components (using as much of the MeeGo SDK as possible))
(Adding MeeGo UX Components)
 
(18 intermediate revisions not shown)
Line 1: Line 1:
-
== Build the application in Qt Creator ==
+
==Overview==
-
Build only. No deployment as of yet.
+
The '''meego-ux-components''' package [[http://meego.gitorious.org/meego-ux/meegolabs-ux-components git]/[http://build.meego.com/package/show?package=meego-ux-components&project=Trunk OBS]] provides visual components for third-party developers to use to quickly create applications adhering to the MeeGo UX look-and-feel.  These components are supported and are an official part of the MeeGo API for developers.
-
==== Get the source code to the otc-components ====
+
Many components in this package first appeared in the '''meegolabs-ux-components''' package [[http://meego.gitorious.org/meego-ux/meegolabs-ux-components git]/[http://build.meego.com/package/show?package=meegolabs-ux-components&project=Trunk OBS]].  Code in this package includes experimental code and early versions with unstable APIs.  There is no guarantee of support for these components nor will they necessarily maintain consistent software interfaces.
-
<pre> git clone ssh://git@git.meego.com/otc-components </pre>
+
-
==== Patch for examples/meego-ux-widgetgallery/meego-ux-widgetgallery.pro ====
+
Currently some component code versions exists in both meegolabs-ux-components and meego-ux-components. In order to avoid confusion for third party developers and to decrease the burden of maintaining two branches and keeping them in sync, we are deprecating code in meegolabs-ux-components where it is already available in meego-ux-components (See [[Components Migration]]).
-
<pre>
+
-
diff --git a/examples/meego-ux-widgetgallery/meego-ux-widgetgallery.pro b/examples/meego-ux-widgetgallery/meego-ux-widgetgallery.pro
+
-
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 ====
+
==API Documentation==
-
<pre>
+
API docs are generated automatically from the tip of the git repository at http://apidocs.meego.com.
-
diff --git a/src/src.pro b/src/src.pro
+
-
index 45b3e33..550402f 100644
+
-
--- a/src/src.pro
+
-
+++ b/src/src.pro
+
-
@@ -57,4 +57,8 @@ HEADERS += \
+
-
+
-
qmldir.files += $$QML_SOURCES
+
-
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 ====
+
==Basic Tutorials==
-
Please un-check shadow build
+
There are [[MeeGo UX Tutorials|basic tutorials for the MeeGo UX components]].
-
Build -> Build All
+
==Installing 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 [[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]].
-
Screenshot showing the current sysroot in Qt Creator
+
===Using Zypper===
-
[[File:qt-tablet-components-settings.png]]
+
To use MeeGo UX components for your project, you will need to install the development version of the package.  Using zypper:
 +
zypper install meego-ux-components-devel
-
== Now you have to drop out of the SDK to complete the task... ==
+
===From a Source Package===
 +
First ensure that you have an enabled Trunk source zypper repo.  Bring in a source archive and all the needed build-time dependencies with:
 +
zypper source-install meego-ux-components
-
==== In the otc-components source directory ====
+
===From a Git Repo===
-
<pre>sudo make install</pre>
+
We'll first clone the source from the upstream repository location on Gitorious:
-
this copies the files that need to be on your device or emulator to the sysroot
+
git clone git://meego.gitorious.org/meego-ux/meego-ux-components
-
==== Now you have to get these files to your device. ====
+
The easiest way to prepare your development environment with all the build-time dependencies is to install the source package as described above.
-
(Here are the non-network instructions)
+
If you don't want to do that, read the README file for instructions on installing dependent packages manually. Finally, make and install:
-
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
+
cd meego-ux-components
-
<pre>
+
qmake
-
cd /
+
make
-
tar cvfz widget-gallerly.tgz usr/lib/qt4/imports/MeeGo/Components/ usr/share/meego-ux-widgetgallery
+
sudo make install
-
</pre>
+
 +
==Examples of Using Components==
-
==== Copy this tar file to your device and cd to / on your device and untar ====
+
To see the components in action and to verify correct installation, we can use the three example programs provided:
-
<pre>
+
-
cd /
+
-
tar xvfz <some-dir-on-device>/widget-gallerly.tgz
+
-
</pre>
+
-
==== Now run the widget gallery ====
+
* meego-ux-components-widgetgallery - A gallery of components which demonstrate each components and interactively lets you change component properties.  See [[MeeGo_UX_Components_WidgetGallery|screen shots]].
-
<pre>
+
* meego-ux-components-app-photos - An example application that uses MeeGo UX components 
-
  make sure you're logged in as user meego, NOT root
+
* meego-ux-components-tutorial - An on-line tutorial on how to use MeeGo UX Components
-
   
+
 
-
meego-qml-launcher --opengl --fullscreen --app meego-ux-widgetgallery
+
To run on a development system, use meego-qml-launcher.  Your application should have a file at ''/usr/share/<application-name>/main.qml''.  This tool exports theme information to QML applications (font sizes, colors, dimensions, etc) and also ensures that your application is treated as a system-wide singleton.  That is, if the app is already running, meego-qml-launcher will send a "raise" dbus signal instead of launching a second instance.
-
</pre>
+
 
 +
  $ meego-qml-launcher --fullscreen --app meego-ux-components-widgetgallery
 +
 
 +
When running on target hardware, you can add the --opengl option to use hardware graphics acceleration. 
 +
 
 +
$ meego-qml-launcher --opengl --fullscreen --app meego-ux-components-widgetgallery
 +
 
 +
==Using Components in a New Application==
 +
Now that the MeeGo UX Components are installed on your system, you can begin developing a new application using the components. 
 +
 
 +
# Launch Qt Creator.
 +
# Select 'Create Project'
 +
# 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
 +
 
 +
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!"
 +
 
 +
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.
 +
 
 +
==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.
 +
 
 +
==Migration to Components==
 +
[[Components_Migration|Guides and roadmap]] for migrating from MeeGo.Labs.Components to MeeGo.Components
 +
 
 +
 
 +
[[Category:Qml]]
 +
[[Category:Qt]]

Latest revision as of 05:22, 27 May 2011

Contents

Overview

The meego-ux-components package [git/OBS] provides visual components for third-party developers to use to quickly create applications adhering to the MeeGo UX look-and-feel. These components are supported and are an official part of the MeeGo API for developers.

Many components in this package first appeared in the meegolabs-ux-components package [git/OBS]. Code in this package includes experimental code and early versions with unstable APIs. There is no guarantee of support for these components nor will they necessarily maintain consistent software interfaces.

Currently some component code versions exists in both meegolabs-ux-components and meego-ux-components. In order to avoid confusion for third party developers and to decrease the burden of maintaining two branches and keeping them in sync, we are deprecating code in meegolabs-ux-components where it is already available in meego-ux-components (See Components Migration).

API Documentation

API docs are generated automatically from the tip of the git repository at http://apidocs.meego.com.

Basic Tutorials

There are basic tutorials for the MeeGo UX components.

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

Using Zypper

To use MeeGo UX components for your project, you will need to install the development version of the package. Using zypper:

zypper install meego-ux-components-devel

From a Source Package

First ensure that you have an enabled Trunk source zypper repo. Bring in a source archive and all the needed build-time dependencies with:

zypper source-install meego-ux-components

From a Git Repo

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

git clone git://meego.gitorious.org/meego-ux/meego-ux-components

The easiest way to prepare your development environment with all the build-time dependencies is to install the source package as described above. If you don't want to do that, read the README file for instructions on installing dependent packages manually. Finally, make and install:

cd meego-ux-components
qmake
make
sudo make install

Examples of Using Components

To see the components in action and to verify correct installation, we can use the three example programs provided:

  • meego-ux-components-widgetgallery - A gallery of components which demonstrate each components and interactively lets you change component properties. See screen shots.
  • meego-ux-components-app-photos - An example application that uses MeeGo UX components
  • meego-ux-components-tutorial - An on-line tutorial on how to use MeeGo UX Components

To run on a development system, use meego-qml-launcher. Your application should have a file at /usr/share/<application-name>/main.qml. This tool exports theme information to QML applications (font sizes, colors, dimensions, etc) and also ensures that your application is treated as a system-wide singleton. That is, if the app is already running, meego-qml-launcher will send a "raise" dbus signal instead of launching a second instance.

$ meego-qml-launcher --fullscreen --app meego-ux-components-widgetgallery

When running on target hardware, you can add the --opengl option to use hardware graphics acceleration.

$ meego-qml-launcher --opengl --fullscreen --app meego-ux-components-widgetgallery

Using Components in a New 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!"

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.

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.

Migration to Components

Guides and roadmap for migrating from MeeGo.Labs.Components to MeeGo.Components

Personal tools