Meego Wiki
Views

MeeGo UX Components

From MeeGo wiki
(Difference between revisions)
Jump to: navigation, search
m (simple typo fix in widgetallery)
(added link to tutorials page)
Line 8: Line 8:
=API Documentation=
=API Documentation=
Eventually, API docs will be generated automatically from the tip of the git repository at http://apidocs.meego.com.  For now, there is a snapshot of the docs [[Components_API_Snapshot|here]].
Eventually, API docs will be generated automatically from the tip of the git repository at http://apidocs.meego.com.  For now, there is a snapshot of the docs [[Components_API_Snapshot|here]].
 +
 +
=Basic Tutorials=
 +
Some basic tutorials for MeeGo UX Components can be found [[MeeGo UX Tutorials|here]].
=Installing MeeGo UX Components=
=Installing MeeGo UX Components=

Revision as of 08:18, 26 April 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

Eventually, API docs will be generated automatically from the tip of the git repository at http://apidocs.meego.com. For now, there is a snapshot of the docs here.

Basic Tutorials

Some basic tutorials for MeeGo UX Components can be found here.

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.

Personal tools