defs
Posts: 10
Joined: Wed Jul 27, 2016 1:23 pm

GUI Qt suggestions

Wed Aug 24, 2016 4:40 pm

Hi,

I would like to make GUI with my RPi3 and I want that RPi boots automatic to this app and that my custom splash screen is shown during booting. Is qt and qml good approach to achive this (qml together with c++ for hardware etc i2c, gpio)?

I succeeded to install QT4 and QT5 on RPi3 and made some test apps, and it seems that QT4 works better because it doesn't need Open GL to be enabled. But all of this must be run under X11 desktop environment so I suppose it is better to use EGLFS. However, I found this tutorial: https://wiki.qt.io/RaspberryPi2EGLFS but didn't succeed to compile qt on my virtual Ubuntu PC machine (I am getting a lot of errors during compilation). Is it possible to use EGLFS qt applications without cross-compiling?

Also, I made splash screen with help of this tutorial: http://blog.fraggod.net/2015/11/28/rasp ... creen.html and it works perfectly but I don't understand few things about that. What thing can close splash screen? It now lasts to the part where tty1 is opened and user pi is logged in. How can I extend duration of my splash screen until my app is completely loaded (either is auto started under terminal or X11)?

User avatar
topguy
Posts: 6527
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: GUI Qt suggestions

Thu Aug 25, 2016 5:38 pm

>> Is it possible to use EGLFS qt applications without cross-compiling?

It should have worked out of the box with Qt5 but the version in raspbian is not compiled correctly ( or they chose to get OpenGL working instead )

Alternatives:
- Install libraries already compiled by someone else. For example from here https://twolife.be/raspbian/. ( I have made a script here: https://github.com/Topguy/Raspberry-Qt5 ... e_setup.sh that you might follow. Best used on a totally clean Jessie installation, because I give no guarantee that your sd-card will boot afterwards and I havent tested it for at least 6 months. )

- It is possible to compile Qt5 direclty on the RPi3 but it takes some hours.

- Use a buildroot with Qt5 and eglfs: https://github.com/Metrological/buildroot

defs
Posts: 10
Joined: Wed Jul 27, 2016 1:23 pm

Re: GUI Qt suggestions

Mon Aug 29, 2016 6:17 pm

I succeeded to install qtbase for cross-compilation. It was important to use fresh image of raspbian jessie, I had some qt libraries installed and it was a major problem.

Now, I have some problems with modules. I want QML and QUICK module.

am not sure how to add new module for cross-compiling according to this tutorial:
https://wiki.qt.io/RaspberryPi2EGLFS

There is step 13 which says:

Code: Select all

13. Build other Qt modules as desired, the steps are the same always:

~/raspi/qt5/bin/qmake -r
make
make install
but where can I get source for wanted module?

I tried to clone this repo : https://code.qt.io/cgit/qt/qt5.git,
then went to qtdeclarative folder and run first two commands from step 13.:

Code: Select all

~/raspi/qt5/bin/qmake -r
make
but after few minutes I got error:

Code: Select all

../qsgdefaultdistancefieldglyphcache.cpp: In member function ‘virtual void QSGDefaultDistanceFieldGlyphCache::requestGlyphs(const QSet<unsigned int>&)’:
scenegraph/qsgdefaultdistancefieldglyphcache.cpp:107:100: error: ‘QT_DISTANCEFIELD_TILESIZE’ was not declared in this scope
         QSize glyphSize(glyphWidth + padding * 2, QT_DISTANCEFIELD_TILESIZE(doubleGlyphResolution()) + padding * 2);
                                                                                                    ^
Makefile:32437: recipe for target '.obj/qsgdefaultdistancefieldglyphcache.o' failed
make[2]: *** [.obj/qsgdefaultdistancefieldglyphcache.o] Error 1
make[2]: Leaving directory '/home/user/gitSources/qt5/qtdeclarative/src/quick'
Makefile:93: recipe for target 'sub-quick-make_first-ordered' failed
make[1]: *** [sub-quick-make_first-ordered] Error 2
make[1]: Leaving directory '/home/user/gitSources/qt5/qtdeclarative/src'
Makefile:45: recipe for target 'sub-src-make_first' failed
make: *** [sub-src-make_first] Error 2
What am I doing wrong?

User avatar
topguy
Posts: 6527
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: GUI Qt suggestions

Tue Aug 30, 2016 7:26 am

It doesnt look like your doing anything wrong, maybe the code is wrong ? Did you pick a specific release branch from the Git-repo or just checked out master ?

defs
Posts: 10
Joined: Wed Jul 27, 2016 1:23 pm

Re: GUI Qt suggestions

Tue Aug 30, 2016 9:00 am

I done this:

Code: Select all

$ git clone https://code.qt.io/qt/qt5.git                     # cloning the repo
$ cd qt5
$ git checkout v5.7.0                                         # checking out the specific release or branch
$ git submodule update --init                                 # updating each submodule to match the supermodule

User avatar
topguy
Posts: 6527
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: GUI Qt suggestions

Tue Aug 30, 2016 10:29 am

The guide you linked to chose a slightly different method for checking out 5.6.

Code: Select all

git clone git://code.qt.io/qt/qtbase.git -b 5.6
I dont know if that should matter but you should try to make sure that what you have in "qtdeclarative" actually is for 5.7.[/s]

I see some guides specify to use the "init-repository" script to set-up the submodules, I havent looked at it so cant say if it does much more than that "git submodule" command.

defs
Posts: 10
Joined: Wed Jul 27, 2016 1:23 pm

Re: GUI Qt suggestions

Tue Aug 30, 2016 12:06 pm

I succeeded, I downloaded only declarative :
https://github.com/qt/qtdeclarative

and followed step 13.

Return to “Graphics programming”