Difference between revisions of "Qml Ui"
Langstonius (Talk | contribs) (→Setting it up) |
Langstonius (Talk | contribs) (→Setting it up) |
||
Line 58: | Line 58: | ||
*Install QT SDK as outlined | *Install QT SDK as outlined | ||
− | + | *If building Qt libraries from source, you may run into dependency issues, but they are easily resolved. | |
After you've started QT SDK, some configuration is required to load the orbiter. First, you need to load the project itself. Navigate through your source tree to QOrbiter/Qorbiter_src. In this directory, you will find a .pro file named QOrbiter_src.pro. Open this and it will load the project into qt Creator. It should go without saying, but read the README! | After you've started QT SDK, some configuration is required to load the orbiter. First, you need to load the project itself. Navigate through your source tree to QOrbiter/Qorbiter_src. In this directory, you will find a .pro file named QOrbiter_src.pro. Open this and it will load the project into qt Creator. It should go without saying, but read the README! | ||
Line 78: | Line 78: | ||
== Setting up for android development == | == Setting up for android development == | ||
− | + | Install necessitas as well as some java specific packages that it will ask you to install if not already installed. Once, done, open the project just like a normal Qt creator project and run it. '''NOTE''' you need to pay attention to the instructions in the necessitas installation guide on running your Qt project, specifically who and what Ministro is and does, and two how to configure the run options. | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | '''NOTE''' | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
=Initial Findings= | =Initial Findings= |
Revision as of 17:23, 1 October 2012
This page is intended to serve as an ongoing development guide in relation to using QML as the engine for LinuxMCE's user interface. We shall outline relevant documents relating to QML as well as specifics for designing a skin. Please note, if you are reading this, then this is in fact an ongoing guide and as such information is apt to change. Personal notes are to be kept in the discussion area of this page, please post only code, links, or other relevant data to UI development. This message will self-destruct in 10 seconds.
Contents
QML KnowledgeBase
An Overview of what QML is http://labs.qt.nokia.com/2009/05/13/qt-declarative-ui/ A document on styling and whats important, skinning - http://developer.qt.nokia.com/wiki/QmlStyling
- http://developer.qt.nokia.com/wiki/JavaScript_programmer
- http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeintroduction.html
- http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeelements.html
Stay tuned to this development space
Downloads & Initial setup
Working with QOrbiter requires pre-requisites depending on platform and what you intend to do. To work on just the design aspect, please follow the 'Design Work' instructions To compile it yourself, check 'compiling from source' To get up and running, you need the following:
Compiling from source=
- Qt libraries for the version you are targeting
- QtSDK http://qt-project.org/downloads
- KDE 10.04
- and KDE 11.04 / 11.10 - Recommended
- KDE 12.04 is currently unsupported by the SDK
- QtSDK http://qt-project.org/downloads
OR
- Build the Qt libraries from source on platforms not supported by the SDK, to build without the SDK, or for Android
- Latest Qt Creator http://origin.releases.qt-project.org/qtcreator/
- Source Availible Here - ftp://ftp.qt.nokia.com/qt/source/
- Android requires Necessitas - Please read the appropriate instructions there to get it installed.
Design Work
If you are looking to do design work on skins only, please use one of the pre-built binary packages to make your life easier.
- KDE 12.04 - Unavailable at this time
- KDE 11.04 - Working
- KDE 10.04 - Requires build and install of qt 4.7.4 libraries first
- Windows - Unavailable at this time
- OSX - Unavailible at this time
- Android Pre ICS
- Android ICS
Setting it up
I installed qt creator into home, although the default location is opt. Installing it into home will allow you get up and running right away but if installed into opt you will need to export some paths as described below.
- SVN Checkout of the current /src tree from the svn
- you need to install subversion
sudo apt-get install subversion
- you then check out the source tree by entering this:
svn co http://svn.linuxmce.org/svn/branches/LinuxMCE-1004/src
and the web part like this
svn co http://svn.linuxmce.org/svn/branches/LinuxMCE-1004/web
If you downloaded the SDK, please run
sudo apt-get install build-essential
before installing Qt SDK. It includes many packages needed
- Install QT SDK as outlined
- If building Qt libraries from source, you may run into dependency issues, but they are easily resolved.
After you've started QT SDK, some configuration is required to load the orbiter. First, you need to load the project itself. Navigate through your source tree to QOrbiter/Qorbiter_src. In this directory, you will find a .pro file named QOrbiter_src.pro. Open this and it will load the project into qt Creator. It should go without saying, but read the README!
Next, open the qOrbiter project and setup the Build Settings. Do this by clicking the "Projects" button from the left side menu. You need to add to the "Additional arguments:" line for qmake under Build Steps. Do this by clicking the "Details" button to the right of qmake: and additional arguments. These are the current options:
"CONFIG+=opengl" :: enables opengl "CONFIG+=ANDROID" :: android
Please ensure you include the quotes for the "CONFIG+= whatever"
For example, after adding the above arguments, my "Effective qmake call:" box looks like this, where [username] is my ubuntu login name:
qmake /home/[username]/src/qOrbiter/qObiter_src/qObiter_src.pro -r -spec linux-g++ "CONFIG+=opengl"
Next, ensure 'shadow build' is checked in this same menu. Then you need to set the path to '../build-output'
Setting up for android development
Install necessitas as well as some java specific packages that it will ask you to install if not already installed. Once, done, open the project just like a normal Qt creator project and run it. NOTE you need to pay attention to the instructions in the necessitas installation guide on running your Qt project, specifically who and what Ministro is and does, and two how to configure the run options.
Initial Findings
All research is being done against the current branch of code in the svn. The Big Idea(tm) is do the following: Create a new orbiter using qml as our ui both for its portability and skinning ease of use.
Initial experiments http://wiki.linuxmce.org/index.php/Qml http://forum.linuxmce.org/index.php?topic=11722.0
If you are interested in playing with skinning only you can find the skinning document QOrbiter Development Page.
UI
- Determine to what level we want QML to control the UI vs the c++ code.
- Provide a set of constant objects for UI designers to connect to for data
- Provide basic qml elements for some design objects. Think buttons specifically. These would be referred to as custom qml 'components'
- Develop a base template for styles to follow. This would allow changes to be made globally that would affect all qml objects loaded.
- determine animations sets for our custom qml objects
Following this idea further, its been decided to attempt to define the orbiter varables and data as a complex Data model. While the disadvantage is the complexity of the model, it will expose essentially a simple api to skin designers to access linuxMCE data in their skin, further removing programmatic responsibilities from the ui.
The initial work in this area includes
- creating the needed subclassed models from QAbstractListModel
- creating a purpose specific orbiter generator as the current orbiter gen does more than is needed and is too tightly coupled to the concept of deign_obj's something we wish to get away from.
C++
There will need be be considerable time invested into understanding and picking apart certain functions of the existing orbiter to determine relevance in any new orbiter. These include not just the orbiter itself, but datagrids and how it interacts with other plugins. We will need to translate the functionality to new methods because of the inherent difference in the two ui toolkits. Things such as screen handlers and the callback system will be replaced with the signal and slots mechanisms of Qt and so must be understood to be replaced.
- Datagrids - Custom DataModel has been implemented.
- Screen Handlers - Handled by native qt functions
- Mouse Handlers - Not needed as of yet