m (→Install the MeeGo UX Components) |
(→Adding MeeGo UX Components) |
||
| (15 intermediate revisions not shown) | |||
| Line 1: | Line 1: | ||
| - | =Overview= | + | ==Overview== |
| - | + | 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. | |
| - | + | 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. | |
| - | + | ||
| - | == | + | 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 [[MeeGo UX Tutorials|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 [[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]]. | ||
| + | |||
| + | ===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 | zypper install meego-ux-components-devel | ||
| - | ==From Source== | + | ===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: | We'll first clone the source from the upstream repository location on Gitorious: | ||
git clone git://meego.gitorious.org/meego-ux/meego-ux-components | 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 | cd meego-ux-components | ||
qmake | qmake | ||
make | make | ||
sudo make install | 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 [[MeeGo_UX_Components_WidgetGallery|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. | Now that the MeeGo UX Components are installed on your system, you can begin developing a new application using the components. | ||
| Line 42: | Line 64: | ||
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!" | 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: | 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. | /usr/share/meego-ux-tutorial/step1/main.qml. | ||
| Line 52: | Line 73: | ||
You can explore the other tutorial steps and see what they each do. Experiment with the various components you see in the widgets gallery. | 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]] |
Contents |
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 docs are generated automatically from the tip of the git repository at http://apidocs.meego.com.
There are basic tutorials for 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 (Windows | Linux), within the MeeGo SDK QEMU environment, or within a MeeGo chroot configuration.
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
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
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
To see the components in action and to verify correct installation, we can use the three example programs provided:
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
Now that the MeeGo UX Components are installed on your system, you can begin developing a new application using the components.
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.
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.
Guides and roadmap for migrating from MeeGo.Labs.Components to MeeGo.Components