05-19-2020, 03:53 PM | #1 |
Junior Member
Posts: 4
Karma: 10
Join Date: May 2020
Device: Kobo Glo HD
|
(Help requested) Getting started with Qt on Kobo
Hello everyone!
I stumbled upon this corner of the internet the last few days and decided I want to dabble in developing a simple application for my Kobo, just for fun. I am a software developer and regularly use C++ with Qt for desktop apps in my job, so seeing that Nickel is built on Qt was a nice surprise To get started, I successfully extracted the toolchain from this docker image: https://github.com/geek1011/NickelTC and setup my Qt Creator Kit to use this toolchain. I've also installed NickelMenu in order to launch my future app. So far so good! I've got a binary compiled with the toolchain, let's run it! I've created the following script based on the launch script from plato: Code:
#! /bin/sh WORKDIR=$(dirname "$0") cd "$WORKDIR" || exit 1 # shellcheck disable=SC2046 export $(grep -sE '^(INTERFACE|WIFI_MODULE|DBUS_SESSION|NICKEL_HOME|LANG)=' /proc/"$(pidof nickel)"/environ) sync killall -TERM nickel hindenburg sickel fickel fmon > /dev/null 2>&1 echo $QT_PLUGIN_PATH >> info.log echo "starting.." >> info.log ./kobo-test-app -qws >> info.log 2>> error.log echo "stopping.." >> info.log ./nickel.sh & Code:
menu_item :main :Start test app :cmd_spawn :/mnt/onboard/.adds/kobo-test-app/kobo-test-app.sh Code:
This application failed to start because it could not find or load the Qt platform plugin "xcb". Reinstalling the application may fix this problem. Aborted Any help would be highly appreciated |
05-19-2020, 05:35 PM | #2 |
Wizard
Posts: 2,760
Karma: 6990705
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
|
Yeah. That issue.
To run Qt apps on the Kobo, a QPA is needed. Kobo provides one (libkobo.so), but it is closely tied to Nickel, and it isn't really possible to use it in the standard way. In short, you'll need to either use an existing e-ink QPA (there are a few on GitHub), write your own, or hijack the running instance of Nickel the way NickelMenu does it. |
Advert | |
|
05-20-2020, 08:41 AM | #3 |
Junior Member
Posts: 4
Karma: 10
Join Date: May 2020
Device: Kobo Glo HD
|
Ah, that's unfortunate, I was hoping I wouldn't have to bother with the drawing itself, but I can see that was maybe a little optimistic.
Your response does make me wonder though: would it be possible to develop "plugins" for NickelMenu, since it already does the hard work of hooking into Nickel. NickelMenu could load this plugin (an .so) dynamically at runtime, hooking it into Nickel and thus a platform would be available for Qt to direct it's drawing calls to. I have no idea if this would be possible at all, I might be able to put some time into researching this in the next couple of days. It would make NickelMenu a new "platform" for Qt apps on the Kobo, which I think would be lovely! I love the way it integrates so cleanly into Nickel. |
05-20-2020, 08:53 AM | #4 | ||
Wizard
Posts: 2,760
Karma: 6990705
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
|
Quote:
I have no idea if this would be possible at all, I might be able to put some time into researching this in the next couple of days.[/QUOTE] If you give me your GitHub username, I'll add you to the semi-private repo where we (me, @NiLuJe, @shermp, others) have been discussing this sort of thing. Quote:
|
||
05-20-2020, 09:06 AM | #5 |
Junior Member
Posts: 4
Karma: 10
Join Date: May 2020
Device: Kobo Glo HD
|
My GitHub username is @LanderN. I'd love to have a look at what you guys are doing, I can't promise I'll be much of a help though, seeing as I don't have the expertise you guys have with all this stuff. (Strictly speaking, I don't even own an eBook reader, it's my girlfriend's ) So I would totally understand if you'd rather not add me to the repo.
|
Advert | |
|
05-20-2020, 10:12 AM | #6 | |
Wizard
Posts: 2,760
Karma: 6990705
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
|
Quote:
|
|
05-20-2020, 10:19 AM | #7 | |
Junior Member
Posts: 4
Karma: 10
Join Date: May 2020
Device: Kobo Glo HD
|
Quote:
|
|
05-23-2020, 02:28 PM | #8 |
Connoisseur
Posts: 80
Karma: 63118
Join Date: May 2018
Device: Kobo Aura One
|
Hey there is also the option to make a standalone Qt app. The advantage is you can use the latest version of Qt. I made a Kobo platfom plugin for that purpose. You can find it here: https://github.com/Rain92/qt5-kobo-platform-plugin. It does need a bit more tinkering since you have to compile Qt yourself, but I have instructions for that in my other repo.
|
05-23-2020, 03:46 PM | #9 |
BLAM!
Posts: 13,480
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
IIRC, the QPA API has only seen mild updates between 5.2 and 5.14, so it could be a good candidate .
EDIT: Mildly curious about input, though. How do you deal with the device-specific translation quirks? Last edited by NiLuJe; 05-23-2020 at 04:00 PM. |
05-24-2020, 04:45 AM | #10 | |
Connoisseur
Posts: 80
Karma: 63118
Join Date: May 2018
Device: Kobo Aura One
|
Quote:
I let Qt's evdevtouch manager take care of touch inupts. The rotation has to be manually specified. For me it works great, but I only have a KA1 for testing. |
|
05-24-2020, 11:52 AM | #11 |
BLAM!
Posts: 13,480
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@OfficerAction: Yeah, I saw that a rotation could be fed, I just hadn't seen a frontend bit to confirm what you were feeding it, exactly .
(I'm *hoping* Qt can actually deal with the various protocol quirks sanely on its own (at least for basic touch events, multi touch gestures might be a tougher ask), but I wouldn't necessarily bet my life on it ^^. IIRC, the Aura One is using roughly Multi Touch B w/o ABS_MT_SLOT and w/ possibly broken timestamps (since boot instead of epoch, AFAIR)). Which leads to my next question: do you deal with rotation in your app, and if so, how? (hardware fb rotations, or a rotated sw viewport?). Last edited by NiLuJe; 05-24-2020 at 12:26 PM. |
05-25-2020, 12:40 PM | #12 | |
Connoisseur
Posts: 80
Karma: 63118
Join Date: May 2018
Device: Kobo Aura One
|
Quote:
For the rotation I just use FB rotation at startup. SW rotation in Qt is also possible but it just seems cleaner that way. Actually for that and the whole Nickel exit and restart sequece I used parts of the Koreader scripts, they helped out a lot |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Free (nook/Kindle/Kobo) It Started With A Kiss [Chick-Lit Love Quest Romantic Comedy] | ATDrake | Deals and Resources (No Self-Promotion or Affiliate Links) | 0 | 12-02-2015 04:03 AM |
Free (nook/Kindle/Kobo) It Started At Sunset Cottage [Chick-Lit Film Romantic Comedy] | ATDrake | Deals and Resources (No Self-Promotion or Affiliate Links) | 0 | 11-17-2015 03:15 PM |
Aura A Problem Getting started with Kobo Aura | doron | Kobo Reader | 2 | 11-03-2015 03:16 AM |
getting started with Kobo | Sue Clothier | Kobo Reader | 7 | 12-30-2011 09:09 AM |
Kobo.com pre-order processing has started | borisb | Kobo Tablets | 11 | 10-27-2011 08:10 PM |