Difference between revisions of "Qt development with linuxmce"

From LinuxMCE
Jump to: navigation, search
(Raspberry Pi / MD specifics)
 
(One intermediate revision by the same user not shown)
Line 15: Line 15:
  
  
Once you have setup your linuxmce box according to the article above,you will be ready to start development
+
Once you have setup your linuxmce box according to the article above,you will be ready to start development. We should note here that in the case of most of the Qt applications developed specifically for linuxMCE, the shared lib approach commonly taken by other DCE device is not used. Instead of linking against libraries, the headers are included as needed. Why do it this way?
 +
Well in the case of IOS and Android, and a few other embedded devices, this would make life more difficult than it actually needs to be. For the purposes of development when using x86 based machines, it also makes sense. So, please dont ask for this to change, unless you can demonstrate a patch that solves the problems as mentioned.
  
 +
For certain embedded builds of Qt, we will try to, in the future, create a tgz with the needed cross-compiled Qt libraries.
  
 
== Working from your own linux machine ==
 
== Working from your own linux machine ==
 
Working from one's own linux machine can be beneficial from the standpoint using the most familiar development environment. Some things must be take into consideration however.
 
Working from one's own linux machine can be beneficial from the standpoint using the most familiar development environment. Some things must be take into consideration however.
*If your device is a plugin, this method is not open to you. Plugins run in the router memory space and this means they cannot be run from remote machines. It wouldnt even be wise to try.
+
*If your device is a plugin, this method is not open to you. Plugins run in the router memory space and this means they cannot be run from remote machines. It wouldn't even be wise to try.
 
*Passing command line parameters to the device, will allow you to run it from your machine, but connected to the router.
 
*Passing command line parameters to the device, will allow you to run it from your machine, but connected to the router.
 
** Pass '-r <yourcoreip>' for the router. It defaults to 192.168.80.1
 
** Pass '-r <yourcoreip>' for the router. It defaults to 192.168.80.1
Line 32: Line 34:
 
Both of these are useful, but debugging and gui functionality will be limited.
 
Both of these are useful, but debugging and gui functionality will be limited.
  
== QOrbiter Specifics ==
+
== Working on an embedded device ==
 
+
You will need:
=== Desktop ===
+
*A version of Qt compiled for your target platform
 
+
*A cross-compiler toolchain
=== Android ===
+
 
+
=== iOS ===
+
 
+
=== Raspberry Pi / MD specifics ===
+
When working on the raspberry pi, or a media director, one must note that they need to utilize the device profiles in Qt Creator. What these profiles do is establish template for connecting to and uploading files to another machine or embedded device. The benefit of this is that it allows you run the application on the target device, while benefiting from the development machine normally used.
+
 
+
'''You must be compiling against the Qt Version ON the device. We hope to provide links in the future with the necessary build.'''
+
 
+
Device setup is done in the 'devices' tab under the options in Qt Creator.
+
The wizard will walk you through creating the profile for a given device.
+
 
+
====Raspberry Pi=====
+
Please note that the pi will also require a cross-compiler setup.
+

Latest revision as of 00:25, 5 April 2016

This article will explain how to utilize the Qt development framework with linuxmce. Currently, there are a few different types of devices that utilize the Qt framework within linuxmce

  • Hue Controller - For controlling Phillips Hue color changing LED lights using QtNetwork to interface with the JSON api of the device.
  • linuxmceTag - A simple command line media scanner which scans video files, and then does its best to lookup information via online api's to fill in metadata
  • QOrbiter - Graphical user interface for linuxmce, allowing one to have classic orbiter functionality.

General Requirements

These are the general requirements for working with Qt and linuxmce to develop devices

  • Qt Development SDK - http://www.qt.io/download/
    • Choose the open source version. This will allow you to download the source as needed, libraries, and the IDE, Qt Creator.
    • If you are targeting Qt4, you would best apt-get install qt4-dev-tools. This will pull in Qt4 libraries and the Qt Creator for qt4. Please note if creating a new project, you will be politely asked to use Qt5. Qt4 based projects are scheduled to be moved to Qt5.
  • A functioning linuxmce installation, VM or otherwise.


Once you have setup your linuxmce box according to the article above,you will be ready to start development. We should note here that in the case of most of the Qt applications developed specifically for linuxMCE, the shared lib approach commonly taken by other DCE device is not used. Instead of linking against libraries, the headers are included as needed. Why do it this way? Well in the case of IOS and Android, and a few other embedded devices, this would make life more difficult than it actually needs to be. For the purposes of development when using x86 based machines, it also makes sense. So, please dont ask for this to change, unless you can demonstrate a patch that solves the problems as mentioned.

For certain embedded builds of Qt, we will try to, in the future, create a tgz with the needed cross-compiled Qt libraries.

Working from your own linux machine

Working from one's own linux machine can be beneficial from the standpoint using the most familiar development environment. Some things must be take into consideration however.

  • If your device is a plugin, this method is not open to you. Plugins run in the router memory space and this means they cannot be run from remote machines. It wouldn't even be wise to try.
  • Passing command line parameters to the device, will allow you to run it from your machine, but connected to the router.
    • Pass '-r <yourcoreip>' for the router. It defaults to 192.168.80.1
    • Pass '-d <devicenumber>' for the device number.

Working on your core

Working on the core can be beneficial from the standpoint of

  • no need to move file(s) across network
  • compile in native environment

Both of these are useful, but debugging and gui functionality will be limited.

Working on an embedded device

You will need:

  • A version of Qt compiled for your target platform
  • A cross-compiler toolchain