Meego Wiki
Views

MeeGo UX Components

From MeeGo wiki
Revision as of 21:09, 19 April 2011 by Btdrucke (Talk | contribs)
Jump to: navigation, search

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).

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

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