![]() |
#1 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Aug 2020
Location: The Netherlands
Device: Kobo Glo
|
Qt Programming on Kobo
Hello everyone,
I recently found out you could run Qt apps on Kobo devices and I was very interested, having some experience in Qt I decided to try it out. I managed to get a working toolchain using the guide from the UltimateMangaReader GitHub. Using Qt Creator I took the default widget application and tried to compile it, everything goes fine untill I try to run it on the actual device. It throws the following error with Code:
QT_DEBUG_PLUGINS=1 Code:
QFactoryLoader::QFactoryLoader() checking directory path "/mnt/onboard/.adds/qt-linux-5.15.0-kobo/plugins/platforms" ... QFactoryLoader::QFactoryLoader() looking at "/mnt/onboard/.adds/qt-linux-5.15.0-kobo/plugins/platforms/libkobo.so" Found metadata in lib /mnt/onboard/.adds/qt-linux-5.15.0-kobo/plugins/platforms/libkobo.so, metadata= { "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3", "MetaData": { "Keys": [ "kobo" ] }, "archreq": 0, "className": "KoboPlatformIntegrationPlugin", "debug": false, "version": 331520 } Got keys from plugin meta data ("kobo") QFactoryLoader::QFactoryLoader() checking directory path "/mnt/onboard/.adds/test/platforms" ... qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "" This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: kobo. Aborted Code:
export ADDSPATH=/mnt/onboard/.adds export EXECPATH=${ADDSPATH}/test export QTPATH=${ADDSPATH}/qt-linux-5.15.0-kobo export QT_DEBUG_PLUGINS=1 sh ${EXECPATH}/exit_nickel.sh LD_LIBRARY_PATH=${QTPATH}/lib:lib: QT_QPA_PLATFORM=kobo:touchscreen_rotate=auto:touchscreen_invert_x=auto:touchscreen_invert_y=auto:logicaldpitarget=108 ${EXECPATH}/test sh ${EXECPATH}/start_nickel.sh Code:
/mnt/onboard/.adds/test/ I was wondering if anyone could help me to get this working because I have no idea now to continue from this point. Thanks in advance. |
![]() |
![]() |
![]() |
#2 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
You're not exporting `QT_QPA_PLATFORM`.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,801
Karma: 6990707
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
|
Try exporting LD_LIBRARY_PATH and QT_QPA_PLATFORM too.
Edit: NiLuJe responded as I was writing this. |
![]() |
![]() |
![]() |
#4 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Oh, I'd missed the LD_LIBRARY_PATH ;p.
|
![]() |
![]() |
![]() |
#5 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Aug 2020
Location: The Netherlands
Device: Kobo Glo
|
Thanks a lot, that worked and it now compiles and runs fine, however, the touch controls are messed up. I have tried several different settings in the QT_QPA_PLATFORM line but it almost seems as if the touch area is shifted off to the left somehow both with high dpi scaling and without. Is there any what to fix this or am I missing something (again)?
Thanks in advance. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
AFAIK, the author of the QPA only has access to a single device, and we know that input on Kobo is... extremely unfun to deal with.
(i.e., PRs welcome to fix the QPA on that front. Looking at Plato or KOReader should give you a hint as to what that might entail.). Last edited by NiLuJe; 08-30-2020 at 01:54 PM. |
![]() |
![]() |
![]() |
#7 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Aug 2020
Location: The Netherlands
Device: Kobo Glo
|
Might it be worth it to use another QPA in that case, and if so, do you know one I can use because I just want to try to create some applications with it and trying to fix the QPA is far beyond my knowledge of Qt.
|
![]() |
![]() |
![]() |
#8 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Nope, the stock QPA is not usable as-is for input either (at all)
![]() |
![]() |
![]() |
![]() |
#9 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
That possibly leaves the vlasovsoft QPA, but I don't recall how up to date it is (if it's even Qt5? Might still be Qt4).
And the tooling is probably gnarlier, regardless. |
![]() |
![]() |
![]() |
#10 |
cosiñeiro
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,390
Karma: 2200169
Join Date: Apr 2014
Device: BQ Cervantes 4
|
@NiLuJe: there's also https://github.com/jdek/qpa-einkfb
He ported quite a few nonQt programs and also provides a buildroot environment tailored for the Kobo. Some background in https://itanimul.li/post/librereader/ I don't know if it works across the whole platform and never tested it, but seems a good repo to lurk. |
![]() |
![]() |
![]() |
#11 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Aug 2020
Location: The Netherlands
Device: Kobo Glo
|
I've looked into the other QPA mentioned but I cannot get it to work at all, so I would like to try and get the one I'm using now to work on at least the Kobo Glo as well.
After some testing I found out that the coordinates Qt reports are incorrect, the y-axis is fine after rotating the touchscreen values but the QPointF values for the x-axis only run from 0 to 0.5 over the entire screen instead of from 0 to 1. Values returned by evtest are fine tho, could this a problem with the QPA, my start script or the touch screen driver? Thanks in advance. |
![]() |
![]() |
![]() |
#12 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Aug 2020
Location: The Netherlands
Device: Kobo Glo
|
Alright, It seems that Qt or is mapping the resolution of the ir touchpad (1600x1200) one to one to the resolution of the screen, which is only 1024×758, therefore half of the screen is not touchable. Is there any way to scale the input of the touch screen to the right size from within Qt or is there some other way?
Other question, is there any other framework like Qt that can be used to create programs for Kobo? As far as I know KOReader and Plato have been written entirely from scratch. Thanks in advance. |
![]() |
![]() |
![]() |
#13 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Someone motivated enough could potentially build something out of the KOReader framework, but I don't think anyone's ever made any real attempt public.
(But I seem to recall both @pazos & @houqp having dipped their toes in that direction for private projects?) The current mess you're in should probably answer why both KOReader & Plato have indeed been written from scratch ^^ ![]() |
![]() |
![]() |
![]() |
#14 |
cosiñeiro
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,390
Karma: 2200169
Join Date: Apr 2014
Device: BQ Cervantes 4
|
I did a weekend project with SDL to turn on a Aura HD with broken IR into a weather clock. Used SDL1.2 because 2.0 droped support for framebuffer output.
The code there is pretty bad but could work as an example. I did that before FBInk was released and certainly would choose FBInk instead for prototyping nowadays. Anyways, here you are: https://github.com/pazos/kobo-clock/tree/master/src. SDL will help if you plan to develop some kind of simple game/UI but won't let you build complex apps like Qt. |
![]() |
![]() |
![]() |
#15 | |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 80
Karma: 63118
Join Date: May 2018
Device: Kobo Aura One
|
Quote:
|
|
![]() |
![]() |
![]() |
Tags |
kobo glo |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to get started with programming? | otanim | Lounge | 5 | 11-28-2017 06:53 AM |
Programming prs-t2 | raikoug | Sony Reader Dev Corner | 2 | 05-05-2013 03:21 AM |
BASIC programming | Zeke | Deals and Resources (No Self-Promotion or Affiliate Links) | 7 | 03-30-2012 04:19 PM |
Kindle - C/C++ programming | sergeyvl12 | Kindle Developer's Corner | 11 | 12-09-2011 02:04 PM |
PRS-500 500 Programming | MarzKrishna | Sony Reader Dev Corner | 1 | 12-17-2009 08:43 PM |