Qt anyone?

Has anyone managed to get a Qt based development environment running on the Jetson? apt-get will get the Qt libraries, but I note that QtCreator is not available (yet?).


Yes I’ve used Qt4 quite a bit on the Jetson…

sudo apt-get install qt4-dev-tools libqt4-dev libqt4-core libqt4-gui libqt4-opengl

As I recall Qt5 is installed by default if you do apt-get qt-sdk.

The only Qt issue I ran into was that initially QGL had been compiled for EGL, but there was a Qt/EGL surface format bug preventing QGLWidget from starting and also my code was setup for GL desktop (not EGL). So I recompiled Qt from source (following these directions http://ubuntuforums.org/archive/index.php/t-669005.html), configured without EGL, and I can provide the working libqt4-opengl.deb if anyone else encounters this.

Best regards,

Fantastic, thanks!


I had to use a mix of QT4 and QT5 to get OpenSceneGraph to compile, kept running into a well-known bug for QT4+previous regarding conflicting type declarations in GL header space.

I will have to compile Qt5.3.0 from source. But I’m still waiting for my TK1 board.

I’ve got QtCreator, qmake, etc. running on mine. This has version 5.2.1

Has anyone used the User Interface Compiler (UIC) in QT on L4T?
If I want to use QT on L4T, should I plan to compile QT from scratch? Or just install packages? Is there a consensus here on what is the right approach?

I compiled 5.3.0 from source. Had to change the sym link of qmake. For some reason it pointed to verion selector.

Next stop qtcreator and then I can compile my project on jetson

how did you installed it?
did you compile from source?

I used it and works perfectly. Not too much differencies between Qt5.2 and Qt5.3…

Well I managed to compile 5.3.1 from source in the end.

qt-sdk installed version is 5.2.1 with limited modules.
The installed Qt was not OK for me since it was missing 2 modules (sensors, and opengl I think)
So in order to port my code to Jetson I had to recompile Qt from source.

I also tried to compile other versions like 5.3.2 and 5.4 from source but no luck so far.
I’m not sure if I’m doing the right thing there. I checkout 5.4 version from submodules where it exists and leave other as they are. Might not be the correct step.

I successfully compiled and installed Qt5.3.1. What I want to do is launching my Qt app as long as the board is turned on (without the graphical Ubuntu UI). However, I can’t launch my app with the parameter -platform -eglfs, it says “Could not initialize egl display”. Any ideas?

Did you compile the Qt with EGL support?

You need to install a bunch of packages on Jetson so that ./configure picks them up and includes them in the Qt

This is what you run as per Qt compile instructions:

sudo apt-add-repository ppa:u-szeged/sedkit && sudo apt-get update && sudo apt-get install sedkit-env-qtwebkit
sudo apt-get install build-essential perl python git
sudo apt-get install “^libxcb.*” libx11-xcb-dev libglu1-mesa-dev libxrender-dev
sudo apt-get install flex bison gperf libicu-dev libxslt-dev ruby

sudo add-apt-repository ppa:gstreamer-developers/ppa && sudo apt-get update
sudo apt-get install libasound2-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev
sudo apt-get install libgstreamer0.10-dev libgstreamer0.10-0-dbg libgstreamer0.10-0 gstreamer0.10-tools gstreamer-tools gstreamer0.10-doc gstreamer0.10-x

This is what I added to get my project compiling:

sudo apt-get install libxkbcommon-dev libxkbcommon-x11-dev libdbus-1-dev
sudo apt-get install libegl1-mesa-dev libgles2-mesa-dev
sudo apt-get install zlib1g zlib1g-dev
sudo apt-get install build-dep gnupg2
sudo apt-get install libgpg-error0 libgpg-error-dev libcrypt11 libcrypt11-dev
sudo apt-get install libmng2 libmng2-dev
sudo apt-get install libc++1 libc+±dev libc++abi1 libc++abi-dev
sudo apt-get install libgles1-mesa-dev libopenvg1-mesa-dev
sudo apt-get install libproperties-cpp-dev libprocess-cpp-dev libprocess-cpp1
sudo apt-get install mesa-common-dev freeglut3 freeglut3-dev libglu1-mesa libglu1-mesa-dev libglui-dev binutils-gold packaging-dev build-essential

My configure:
./configure -release -opensource -confirm-license -nomake tests -nomake examples -qreal float

sudo make -j4 all
then after few hours
sudo make install

and you’re done :)

Thanks for the reply, rmamba!

I followed your instruction and recompiled Qt. I can launch qt application perfectly with -platform xcb in ubuntu GUI mode now. However, I still cannot launch it with -platform eglfs either in GUI mode or in console mode (it says EGL Error : Could not create the egl surface: error = 0x300b and Could not initialize egl display respectively). Do you have any suggestions?

Again, thanks for your detailed instruction!

Is this some free sample you’re trying out?
If it is send me a link and I’ll give i a go on my board.

Also double check that EGL and OpenGL was picked up in the report that configure spits out.
Basically it should say anything except No :)

Here’s the configuration report.

Build options:
Configuration … accessibility accessibility-atspi-bridge alsa audio-backend c++11 clock-gettime clock-monotonic compile_examples concurrent dbus egl eglfs egl_x11 evdev eventfd freetype full-config getaddrinfo getifaddrs glib iconv icu inotify ipv6ifname large-config largefile linuxfb medium-config minimal-config mremap nis no-harfbuzz opengl openvg pcre png posix_fallocate precompile_header qpa qpa reduce_exports release rpath shared small-config system-zlib xcb xcb-glx xcb-plugin xcb-render xcb-sm xcb-xlib xinput2 xlib xrender
Build parts … libs tools
Mode … release
Using C++11 … yes
Using PCH … yes
Target compiler supports:
iWMMXt/Neon … no/auto

Qt modules and options:
Qt D-Bus … yes (loading dbus-1 at runtime)
Qt Concurrent … yes
Qt GUI … yes
Qt Widgets … yes
Large File … yes
QML debugging … yes
Use system proxies … no

Support enabled for:
Accessibility … yes
ALSA … yes
CUPS … no
Evdev … yes
FontConfig … no
FreeType … yes (bundled copy)
Glib … yes
GTK theme … no
HarfBuzz … no
Iconv … yes
ICU … yes
Image formats:
GIF … yes (plugin, using bundled copy)
JPEG … yes (plugin, using bundled copy)
PNG … yes (in QtGui, using bundled copy)
journald … no
mtdev … no
getaddrinfo … yes
getifaddrs … yes
IPv6 ifname … yes
OpenSSL … no
NIS … yes
OpenGL / OpenVG:
EGL … yes
OpenGL … desktop
OpenVG … yes-auto
PCRE … yes (bundled copy)
pkg-config … yes
PulseAudio … no
QPA backends:
DirectFB … no
EGLFS … yes
KMS … no
LinuxFB … yes
XCB … yes (system library)
EGL on X … yes
GLX … yes
MIT-SHM … yes
Xcb-Xlib … yes
Xcursor … yes (loaded at runtime)
Xfixes … yes (loaded at runtime)
Xi … no
Xi2 … yes
Xinerama … yes (loaded at runtime)
Xrandr … yes (loaded at runtime)
Xrender … yes
XKB … yes
XShape … yes
XSync … yes
XVideo … yes
Session management … yes
SQL drivers:
DB2 … no
InterBase … no
MySQL … no
OCI … no
ODBC … no
PostgreSQL … no
SQLite 2 … no
SQLite … yes (plugin, using bundled copy)
TDS … no
udev … no
xkbcommon … yes (system library)
zlib … yes (system library)

I just simply create an empty project, nothing special. Adding -platform xxx means asking Qt to use the following QPA backend, such as XCB and EGLFS, to render the app. I think the default value is xcb in my configuration. In my case, xcb and eglfs both failed to render in console mode (XCB works perfectly in GUI mode anyway). Maybe OpenGL…desktop should be something else?

Also, I am curious about the QtMultimedia module of QML. I wonder if it use hardware acceleration to decode video and audio, but I don’t know how to monitor GPU activity LOL. Have you tried it yet :D ?

I haven’t tried to write any code myself.

Still trying to compile a project that was developed for desktop PCs to work on Tegra.
And I’m fighting through errors trying to make it work, so no time to play with other stuff atm :)

But if you can share your code/program I can give it a go over weekend

Of course!

Well I think I figured out how to open Qt app in command line mode!

  1. change to console mode

Ctrl + Alt + F1

  1. stop lightdm

sudo service lightdm stop

  1. initialze x

export DISPLAY=:0
xinit &

  1. open Qt app


Still failed to open with eglfs but xcb works like a charm!