Difference between revisions of "Qml"
Langstonius (Talk | contribs) |
Langstonius (Talk | contribs) |
||
Line 43: | Line 43: | ||
main.qml | main.qml | ||
− | + | ==DCE to QT == | |
While this concept applies to Qt, it may or may not translate to other toolkits and languages. That being said, the basic principle is as follows | While this concept applies to Qt, it may or may not translate to other toolkits and languages. That being said, the basic principle is as follows | ||
− | + | ==QT to QML== |
Revision as of 17:26, 1 June 2011
QML is a declarative language designed to describe the user interface of a program: both what it looks like, and how it behaves. In QML, a user interface is specified as a tree of objects with properties.
Contents
LinuxMCE User Interface and QML
One of the immediate goals of the Linuxmce project is to move its ui to a more flexible toolkit for a variety of reasons. It has been decided that Qt / Qt quick (QML) will be the main toolkit in which this new user interface will be constructed. With that in mind, there are some core principles and reading one should become familiar with to maximize your time.
Core Reading
These documents are not all that QML encompasses, but they represent a solid start in understanding its basis. For LinuxMCE related documentation, you will need to look to the code and start picking apart relevant parts as you proceed.
- http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeintroduction.html Introduction to QML
- http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeanimation.html * Multi-page doc covering intermediate and advanced topics
- DCE Device code, specifically lmce_launch_manager_old, Orbiter, and various plugin code.
Key Software
- Qt Creator 2.0.1
- LinuxMCE 1004
Example
QML Light Switch http://svn.linuxmce.org/trac.cgi/browser/branches/LinuxMCE-0810/src/QML_Light_Switch
This is an example of a device that employs the following:
- A device template, #2181 that describes what commands it has, its device data, and other information. You can see many examples in your own 1004 install.
- DCEGen and Sql2Cpp to generate the device template defines and code for it to communicate to the DCErouter.
- A custom c++ device to mimic a light switch. In this case, its a device that also doubling as a QML UI test.
- A QML user interface that could be completly different and still do the same things as long as it hooked into the proper event
Connecting the Dots
After you have
- Generated your code stubs and run sql2cpp
- have a basic version of your device that compiles and runs in some fashion
It is then time to connect the two devices together to make one singular DCE device. For example purposes, i will give brief class definitions
QML_Light_Switch_Base .h/.cpp
This is one of the auto generated classes by DCEgen. Its purpose is to provide the neccesary base (virtual?) classes that are utilized buy the class 'QML_Light_Switch'. You will more than likely not need to modify this file, but you will need to make sure its included in the project.
- Required by: QML_Light_Switch
QML_Light_Switch .h/.cpp
qtlightswitch .h/.cpp
switchManager .h/.cpp
main.cpp
main.qml
DCE to QT
While this concept applies to Qt, it may or may not translate to other toolkits and languages. That being said, the basic principle is as follows