Qt wiki will be updated on October 12th 2023 starting at 11:30 AM (EEST) and the maintenance will last around 2-3 hours. During the maintenance the site will be unavailable.

DevicesAddDevice: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
=Adding device support to Qt=


Qt might not run out of the box for your hardware and the below guide should help you to add support for it. Right now there are still a couple of holes but we are working on it.
=Motivation=
Our goal is to allow you to add support for your device to Qt. The benefit is that your users will be able to build Qt out of the box, the other part is that once your code is in Qt there is the possibility to build and runtime test for your hardware.
=Introduction=
Qt is a portable toolkit but your hardware might be special. The current device support allows you automatically add include- and library-paths and the name of libraries, e.g. the to be used OpenGL libraries. The other part of the device support is to easily change the initialization of the <span class="caps">EGLFS</span> and DirectFB plugin.
==Adding qmake/device support to qtbase==
# Create a directory in mkspecs/devices/linux-<span class="caps">ARCHITECTURE</span>-<span class="caps">VENDOR</span>-<span class="caps">BOARD</span>-g++
# Place a qmake.conf and qplatformdefs.h.
The qmake.conf selects the name of the compiler/linker, include paths, you can also handle options that are passed via “-device <span class="caps">VAR</span>=NAME” on configure. The qplatformdefs.h normally just includes the generic files.
==Platform initialization hooks==
===Adding hooks for DirectFB/EGL===
You might have an <span class="caps">EGL</span> library and some platform specific code to use it on top of DirectFB. Qt’s DirectFB plugin allows to call a hook for the initialization The hook interface is in src/plugins/platforms/directfb/qdirectfb_hooks.h and you can decide to implement it. It might be that the hooks are not enough but they can be easily extended.
# Create mkspecs/devices/linux-<span class="caps">ARCHITECTURE</span>-<span class="caps">VENDOR</span>-<span class="caps">BOARD</span>-g++/qdirectfb_hooks_BOARD.cpp
# Edit qmake.conf to include the following variables:
===Adding hooks for <span class="caps">EGLFS</span>===
You might want to use <span class="caps">EGLFS</span> (<span class="caps">EGL</span> Fullscreen) but you require platform specific initialization to select the output, resolution, etc. The <span class="caps">EGLFS</span> hooks allow you to do just that.
=Automatic Testing (Continous Integration)=
'''<span class="caps">TODO</span>'''
===Categories:===
* [[:Category:Devices|Devices]]

Revision as of 10:56, 24 February 2015