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.

AddDevice: 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=
[[Category:Devices]]
 
= 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.
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=
= 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.
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=
= 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.
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 EGLFS and DirectFB plugin.


==Adding qmake/device support to qtbase==
== 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++
# Create a directory in mkspecs/devices/linux-ARCHITECTURE-VENDOR-BOARD-g++
# Place a qmake.conf and qplatformdefs.h.
# 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.
The qmake.conf selects the name of the compiler/linker, include paths, you can also handle options that are passed via &quot;-device VAR=NAME&amp;quot; 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
== Platform initialization hooks ==
# Edit qmake.conf to include the following variables:


===Adding hooks for <span class="caps">EGLFS</span>===
=== Adding hooks for DirectFB/EGL ===


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.
You might have an EGL 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.


=Automatic Testing (Continous Integration)=
# Create mkspecs/devices/linux-ARCHITECTURE-VENDOR-BOARD-g+''/qdirectfb_hooks_BOARD.cpp<br /># Edit qmake.conf to include the following variables:
<br /><code><br />QT_CONFIG''= directfb_egl<br />DIRECTFB_PLATFORM_HOOKS_SOURCES = $$PWD/qdirectfb_hooks_BOARD.cpp<br />DIRECTFB_PLATFORM_INCLUDEPATH = ADDITIONAL_INCLUDEPATHS<br />DIRECTFB_PLATFORM_LIBS = ADDITIONAL_LIBS<br />DIRECTFB_PLATFORM_LIBDIR = ADDITIONAL_LIBDIRS<br /></code>


'''<span class="caps">TODO</span>'''
=== Adding hooks for EGLFS ===


===Categories:===
You might want to use EGLFS (EGL Fullscreen) but you require platform specific initialization to select the output, resolution, etc. The EGLFS hooks allow you to do just that.


* [[:Category:Devices|Devices]]
= Automatic Testing (Continous Integration) =

Revision as of 10:01, 24 February 2015


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 EGLFS and DirectFB plugin.

Adding qmake/device support to qtbase

  1. Create a directory in mkspecs/devices/linux-ARCHITECTURE-VENDOR-BOARD-g++
  2. 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 VAR=NAME&quot; on configure. The qplatformdefs.h normally just includes the generic files.

Platform initialization hooks

Adding hooks for DirectFB/EGL

You might have an EGL 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.

  1. Create mkspecs/devices/linux-ARCHITECTURE-VENDOR-BOARD-g+/qdirectfb_hooks_BOARD.cpp
    # Edit qmake.conf to include the following variables:


<br />QT_CONFIG''= directfb_egl<br />DIRECTFB_PLATFORM_HOOKS_SOURCES = $$PWD/qdirectfb_hooks_BOARD.cpp<br />DIRECTFB_PLATFORM_INCLUDEPATH = ADDITIONAL_INCLUDEPATHS<br />DIRECTFB_PLATFORM_LIBS = ADDITIONAL_LIBS<br />DIRECTFB_PLATFORM_LIBDIR = ADDITIONAL_LIBDIRS<br />

Adding hooks for EGLFS

You might want to use EGLFS (EGL Fullscreen) but you require platform specific initialization to select the output, resolution, etc. The EGLFS hooks allow you to do just that.

Automatic Testing (Continous Integration)