Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt applications not working in my Kobo device. #1

Open
snoman88 opened this issue Mar 14, 2022 · 4 comments
Open

Qt applications not working in my Kobo device. #1

snoman88 opened this issue Mar 14, 2022 · 4 comments

Comments

@snoman88
Copy link

snoman88 commented Mar 14, 2022

Hi
I successfully loaded this image , and wrote sample codes(Just loads a form with a label and a button) using QtCreator and built it.
It worked fine in my desktop.
I launched my app in Kobo device via NickelMenu, but application crushed just after loading.

Desktop: MS-Windows 10 + WSL2 + Ubuntu
Kobo: Kobo Aura One (ver. 4.31.19086)

Can you help to solve this problem?

@snoman88
Copy link
Author

Finally, I succeeded launching applications.
I copied libraries from docker image to Kobo device: Qt 5.15 libraries and plugins(Original Qt version is Qt 5.2.1 in my Kobo device), and some necessary libraries from '/home/user/x-tools/arm...../sysroot/lib' and '/home/user/x-tools/arm.../sysroot/usr/lib'.
Additionally, I defined some environment variables(LD_LIBRARY_PATH, QT_PLUGIN_PATH, QT_QPA_PLATFORM_PLUGIN_PATH, QT_QPA_PLATFORM, etc).

But still there are some issues. My test program has only a button and if button clicked, displays a messagebox asks that want to close. After program is launched, screen is covered by very big text and images. It seems that the text and images on the original screen have been enlarged.

@veso266
Copy link

veso266 commented Jul 4, 2022

@snoman88 did you solve it
I am in the same boat as you

How did you get your build from docker to kobo? (I mean from docker back to host, then I guess you used NickelMenu to somehow launch your app?)
To what did you define QT_PLUGIN_PATH, QT_QPA_PLATFORM_PLUGIN_PATH, QT_QPA_PLATFORM

@bzar
Copy link

bzar commented Jul 19, 2022

Trying this as well. I'm getting a window (just one button to close the window) with QT_QPA_PLATFORM=kobo QT_QPA_PLATFORM_PLUGIN_PATH=/usr/local/Kobo/platforms QT_PLUGIN_PATH=/usr/local/Qt-5.2.1-arm/plugins LD_LIBRARY_PATH=/usr/local/Qt-5.2.1-arm/lib/ /mnt/onboard/bin/my-application-here, but button text is not rendering correctly and the button does nothing. I can click the UI elements under the window to close it though.

@veso266 If you made the instructed /tmp volume mount you can use that to get from docker to host, then use ftp/usb to transfer it to Kobo.

@bzar
Copy link

bzar commented Jul 21, 2022

Okay, I got an application running. I made a lib directory in then onboard storage, copied all the .so.5 files from the docker image's kobo Qt build and some other necessary libraries from the cross compilation toolkit (crypto, freetype, harfbuzz, pcre2-16, png16, ssl, stdc++, z) there. I also copied the fonts, plugins and qml directories. I cross-compiled the included platform plugin using the cross-compilation toolchain and copied it under lib/platform. Then I ran my QML application QT_QPA_PLATFORM=kobo:logicaldpitarget=108 QT_QPA_PLATFORM_PLUGIN_PATH=/mnt/onboard/lib/platform QT_PLUGIN_PATH=/mnt/onboard/lib/plugins LD_LIBRARY_PATH=/mnt/onboard/lib/ QML2_IMPORT_PATH=/mnt/onboard/lib/qml my-application-path-here

With all this in place the image enlargement described by @snoman88 doesn't happen anymore and the application seems to be the correct size (I use a QML UI since it allows me to nicely react to the screen size).

Now my only issues are that any taps on the screen are shared between the underlying nickel UI and my application, and both attempt to draw on the screen, resulting in a mishmash of nickel and my application. If I tap on my test application's quit button and guess where nickel's bottom buttons are I can launch my application, close it, and get back to regular behavior. I could probably get around these issues if I got a handle on the platform integration object in my application, but I'm not sure how to do that yet. I use NickelMenu's cmd_spawn to run the application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants