Qt control not working properly in custom Linux - qt

I'm trying to develop a Qt application to a custom linux built with Buildroot for Raspberry PI 4. My goal is to make an GUI through Touch interface and for that I'm using an USB Infrared frame.
My Problem
When I try to interact with a frame, I can move the dial, but when i try to use another dial it behaves like the first pressed dial didn't get released (like when you press mouse 1 and don't release it anymore).
It just stays selected and I can't interact with any other thing in the application.
I run the program using this command :
./dials -platform linuxfb
and here is the frame I am talking about.
What I tried so far
I tried some of the examples provided by Qt that came with buildroot. They seem to work just fine with the mouse in both the Raspberry and in Ubuntu (my PC). Also I tried the same examples in Ubuntu with the touch frame and they also worked flawlessly .
I've set QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS:/dev/input/event1 , if I don't do this it doesn't even move anything.

Related

Qt cross compiled for RaspberryPi 4 - application runs but is not displayed

I'm trying to develop a gui for a RaspberryPi 4 using Qt. I followed the directions shown in this video and managed to get things up and running on the RaspberryPi. The speedometer demo that was demonstrated near the end of the video also works in my case. After getting the demo to work, I began working through the QML tutorials that were on qt.io.
I started with QML Tutorial 1 - Basic Types, and managed to get this to run on the RaspberryPi.
I then moved on to QML Tutorial 2 - QML Components. I attempted to run this application on the RaspberryPi, however, no gui/window displayed on the Pi.
Since I am new to Qt and new to cross-compiling in general, I went through basic troubleshooting steps:
Rebooted the Pi
Rebooted my Ubuntu VM that I am running Qt Creator from.
Deleted the build directory on my Ubuntu VM so that the application would be forced to rebuild everything.
Attempted to rerun the application (still no gui present).
Deleted the application from the Pi
Attempted to rerun the application (still no gui present).
Checked for a pid for the app on my Pi (A pid was present).
killed pid and reran the application, both from the Ubuntu VM as well as directly from the Pi. (Still no gui)
Attempted to run the demo speedometer application that I referred to in the first paragraph. This ran without a hitch.
I then deleted the additional code that QML Tutorial 2 introduced, and reverted back to the code that was only present in QML Tutorial 1. Reran and still did not have a gui.
What am I missing here? It doesn't appear that Qt is throwing any errors (from what I can tell).

Problem when deploying Qt app on Raspberry Pi 4 (Could not queue DRM page flip on screen HDMI1 (Invalid argument))

I've compiled Qt5.15.0 and set up cross-compiler on my host machine (Ubuntu 20.04) and managed to cross-compile a simple Hello World app for my Raspberry Pi 4, however, when I deploy and run it (tried both on Qt Creator and in terminal) I get Could not queue DRM page flip on screen HDMI1 (Invalid argument) I use latest Raspbian image and tried both with lite and full desktop versions.
There are some solutions suggesting to set the environment variables;
QT_QPA_EGLFS_ALWAYS_SET_MODE=1
QT_QPA_EGLFS_KMS_ATOMIC=1
But I had no luck with setting them.
I don't know where the problem is, I'm very new to Qt.
For those who has the same problem here is how I solved;
Somehow I discovered that Raspberry Pi does not set the environment variable QT_QPA_EGLFS_ALWAYS_SET_MODE. You can check that by typing
printenv QT_QPA_EGLFS_ALWAYS_SET_MODE
or
echo $QT_QPA_EGLFS_ALWAYS_SET_MODE
in both cases, you should see 1 as a result if you've set it so.
However I got no response when I typed them.
Then I went and opened .profile and added
QT_QPA_EGLFS_ALWAYS_SET_MODE=1
at the end of the file and rebooted the system. Finally there it was, when I echoed the variable it returned 1, and my programs now work pretty well.
The variables should be set in:
/etc/default/qt
See QTBUG-72539 in the Qt bug tracking.

Running videos on JavaFX in Raspberry Pi Zero

I am trying to run a program which shows a simple video through mediaView and then shows a QR code that is associated with a string that the program generates on javaFX in a Raspberry Pi Zero. I have tried to follow this answer Play a video using JavaFX on Raspberry Pi but I get the following problems:
I try to install Gluon following this tutorial (https://docs.gluonhq.com/embedded/#_setting_up_the_raspberry_pi) but I get the following error message when I try to run a JavaFX application WITHOUT video which simply has a button that when pressed show "Hello World":
Error occurred during initialization of VM
Server VM is only supported on ARMv7+ VFP
It seems that Gluon doesn't work with the Raspberry Pi Zero but I am not sure.I must say that in order to follow the answer mentioned above I fully reinstalled the Raspberry Pi OS so it's up to date and previously I had been able to run JavaFX applications without video but not using Gluon.
Also when trying to install the gstreamer packages they all seem to be outdated and I can't install them.
So I would be very thankful if anyone could tell me how to not only properly install Gluon on Raspberry Pi Zero but also the needed packages in order to run the video. If you see that this is impossible do you have any ideas how to replicate this program in another language in order to make it work on my Raspberry Pi Zero
From that tutorial you have linked it states it is using Java 11 which your Pi Zero (ARMv6) doesn't support.
You will need supported hardware.
EDIT : If you wish to just play videos & use QR on your Pi Zero using JavaFX you can using Java8 instead.

Terminal printing over JavaFX application on Raspberry

Hi guys I'm new to Raspberry coding, for my three year thesis I'm writing a twitter wall application in javafx to be runned on a Raspberry Pi Model B+ v1.2.
I programmed it in eclipse neon under windows 10 and everything works correctly there, but when i moved the .jar on the raspberry initially it wasn't working at all. After a bit of googling i finally managed to make it work, i was on Raspbian Stretch with Desktop at that time and I only installed Gluon JavaFX Embedded SDK on my raspberry. After that the application started to run, a bit lagging and there was a problem with the input devices (which for me isn't really a problem because my app doesn't need any input from the user). The major issue is that whenever the app prints something on the terminal it shows up over the javafx app covering it.
After that i tried to install Raspbian Stretch Lite and after some steps i managed to make the app works, but with the same issue.
To make it works on Raspbian Stretch Lite i installed jdk8, gluon javafx sdk and xwindows (via sudo apt install xorg libgtk2.0-0).
I make a video of it to show you clearly what is the problem: (you can skip to 1 minute to see the issue)
https://drive.google.com/file/d/1EyvdpLuLnGwV3xrvgCqBU8e5T3go3-up
Hope someone can help me, thanks!

Why Qt can not capture touch event after re-plug USB touch device?

Have a good day.
I have a problem about touch device's hot-plug.
I set the environment variable as below.
export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/ts_uinput:rotate=0
The "/dev/input/ts_uinput" is created by ts library's application "ts_uinput".
The touch function can work normally before I re-plug the USB touch device.
If I re-plug the USB touch device, the touch function doesn't work.
The "/dev/input/ts_uinput" still is created after I re-plug the USB touch device.
I also monitor the data in "/dev/input/ts_uinput" and it also has data report.
Why the Qt does not get the touch event after re-plug the USB touch device?
I would boldly guess that this is because Qt (the Qt evdev platform plugin) opens /dev/input/ts_uinput when the app start. When you replug the touch device, the file is recreated but the file handle held by Qt has become invalid. Making it work again would require Qt to close and reopen the handle.
You could try getting more info by enabling debug logs: http://doc.qt.io/qt-5/embedded-linux.html#debugging-input-devices
However, I do not know if this is a bug or a missing feature, you might want to contact the Qt interest mailing list or report a bug.

Resources