Wrong coordinates in a Qt Application - c++

I created a Qt Application with Qt Creator 3.3.1, using Qt embedded 4.8.6 for a Cortex A5.
It runs on a board with Linux embedded and a touchscreen.
The filesystem was created with Buildroot 2015.08.
I'm using a resistive touchscreen calibrated with ts_calibrate.
The Qt Application works, but I often get the wrong coordinates. For example, when I push on a button, sometimes the program takes the coordinates related to another point of the touchscreen, giving the idea that the button pushed doesn't work properly.
My Qt enviroment variable are:
export TSLIB_CALIBFILE='/etc/pointercal'
export TSLIB_CONFFILE='/etc/ts.conf'
export TSLIB_PLUGINDIR='/usr/lib/ts'
export TSLIB_TSDEVICE=`cat /etc/ts.dev 2>/dev/null`
export QWS_DISPLAY=LinuxFB:mmWidth=800:mmHeight=480
export QWS_MOUSE_PROTO=Tslib:/dev/input/event0
If I try to use another Qt Application (for example the Qt demos created with Buildroot) I get the same problem.
Is it a bug of Qt 4.8.6 or something?
Can anyone help me? Thank you

Sounds like playing with your activated filters or their parameters in ts.conf might help.
Since you asked your question, there is tslib 1.2 and (if you need multitouch) tslib 1.3-rc3, both with new and improved filters, see tslib's project page

Related

Application Qt and Qwt won't run from menu

Greetings for the first time:
Usually I can work my way through problems like this but I think I need help for this one.
I have developed a small utility for myself to plot some data using Qt and Qwt under Mint. When I run the application from Qt Creator everything works fine. Once I added (export LD_LIBRARY_PATH="/usr/local/qwt-6.1.3/lib") to my .bashrc file, I can invoke the application from the terminal with “./PlotAccountsChange” and it woks. Also the ldd command shows all dependencies have been found.
The problem I am having is that the application can not be invoked from the Nemo file manager, or from the menu system if I add the link to the executable in the menu, or from a link to the executable placed on the desktop. In all of these cases I get no indication at all, just nothing happens. Any other application that I have created using Qt but that doesn’t use Qwt invokes without problems.
Thank you, regards,
B Kace

Add GUI to a QT Project with Arduino

So here is my question I have been trying to create a small "software" which would control my arduino card. For this I decide to use qt so I used this tutorial to add arduino to qt :
http://www.lucidarme.me/?p=3287
I am very sorry the page is only in French. I basicly get 3 files config files and includes for my arduino. And a Makefile. The problem I have is that I want to add GUI such as Windows but whenever I add a gui file to my project it says it cannot find the "QMainWindow". However I think the problem is deeper and that it doesn't find any Qt class.
I think this is because I don't have any pro files but I tried adding one and it didn't work. I hope you guys understood my problem I am very new to QT ...
Thank you !
The GUI project is completely unrelated to anything Arduino. The page you linked to shows how to use Qt Creator as an IDE to work on Arduino projects, as a replacement to the Arduino IDE. This has nothing to do with GUIs or Qt, you'd be reusing Qt Creator as a general-purpose IDE that it is.
What you need and want is to create a standard Qt project in Qt Creator and go from there. You can also leverage Qt to "simulate" Arduino code without running real Arduino hardware, see this answer for an example.

Qt camera example does not find the laptop's webcam

I'm using Debian Jessie and dmesg | grep video returns:
[ 22.280407] Linux video capture interface: v2.00
[ 22.790704] uvcvideo: Found UVC 1.00 device Lenovo EasyCamera (13d3:5170)
[ 22.796546] usbcore: registered new interface driver uvcvideo
The example compiles fine but upon launch i get a dialog telling me that the camera service is missing. I'm using Qt 5.5.0. This question points to a similar issue but it's for windows. Also I've installed Qt using the installer provided at it's web site. I've tested my webcam with Cheese application and it works but QCameraInfo::availableCameras() returns nothing.
I don't know if this is a definitive answer, but in my experience the dreaded "camera service is missing" comes down to exactly what the message says; for some reason the media back-end that Qt uses to get video input from a camera is broken or miss-configured in some way. In my case I had this problem in the following situations:
1. Building Qt from source
Qt build system SILENTLY DISABLES FEATURES if you don't have all the dependencies that it requires to include them in the build. Make sure to read this official article very carefully for your platform. I lost count of the times this has ruined my <insert favourite period of time such as day/week/year here >, and not only for the multimedia module...
2. Missing some gstreamer packages on my Ubuntu
I develop for Linux & Debian mostly, and on those platforms Qt depends on gstreamer backend. gstreamer is basically a plugin architecture in the core with every single feature added as plugins, and with endless possibilities of manual intervention through configuration files. See where is this is going? Clue: make sure you have all the plugins you want installed and configured properly. Here is a link to some gstreamer tools you can use. Same probably goes for other back-ends on other platforms.
And a pro tip in the end: Since both Qt5.5 gstreamer0.1 (old) and gstreamer1.0 (new) are supported as back-ends, and since Qt5.6 the new one is default. This will give you some room for experimenting, for example if the old does not work, you can try the new etc.
Hope this was useful!

Cannot Connect to QML Emluation Layer (QML Puppet)

I just made the fresh QT installation and when I create empty QT Quick project or open any of existing QT Quick examples, my QML designer doesn't work. It shows "Cannot Connect to QML Emluation Layer (QML Puppet)" error.
I tried to reinstall QT, reboot, installed additional QT kit versions and tried to switch between 32bit/64bit default/opengl versions of the kit and nothing seems to work for me. I was able to successfully run the designer ONCE, and after I closed it and tried to re-open the file it stopped working again. I also tried to search, but didn't find any solution. I also tried to ask on QT forums, but didn't receive any answer.
My system is Windows 7, with Visual Studio 2013 installed. Thanks for your help!
Do this:
Go to QT Creator Preferences (Menu Bar | Tools > Options)
Select QT Quick Option (Options headings - left side).
Click the QT Quick Designer tab.
Under QML Emulation Layer grouping, select "Use QML Emulation Layer that is built with selected QT".
No need to choose a path,
And click OK.
It will rebuild your designer view.
Worked for me.
Possibly related to this bug. Just try this workaround: in the Options
dialog go to “Qt Quick / Qt Quick Designer / QML Emulation Layer” and
disable the checkbox “Always use the QML emulation layer prived by Qt
Creator”. That will cause a rebuild of the emulation layer with the
used Qt version in the current project. That layer does not crash.
This workaround only works with Desktop Kits. – BaCaRoZzo Mar 30
This worked for me on Ubuntu 14.04.
Go to Tools->Options->Qt Quick.
In QML Emulation Layer, make sure
the path is correct for "Use fallback QML emulation layer".
Since I was reinstalling Qt, the new installation had the old path of Qt which gave rise to this issue.
If failed anyway, use "Qt Design studio" instead and build it again, it worked for me.
I recommend to uninstall Qt first and then reinstall it with "Qt Design Studio" box checked.
On Ubuntu 20 LTS, you can run it on: /home/Qt/Tools/QtDesignStudio/bin/qtdesignstudio
Good luck.

Error executing cross-compiled codes in raspberry pi

I am having problems with a Qt GUI application I created. Basically I created the application in my ubuntu to check if it compiles and works properly, however, if I set up the cross compiler (followed a tutorial and tried a hello world which works properly) and execute my code in the pi the UI does not display properly and basically I cant do anything:
· Text disappears from buttons
· Mouse disappears from screen (therefore cant click buttons)
· Cant navigate buttons using tab key
Any clues? maybe I cant use .ui files in the pi and have to use qml? Thank you in advance.
2 Screenshots of what I get with the pi and what the program should actually look like (ignore the second LCD display):
what I get http://imageshack.us/a/img17/9986/img20130508093318.jpg
I’ve been told that Qt5 has different rendering platforms, the standard for my compiled version is “eglfs”, which is fullscreen EGL accelerated mobile application style. I need to run it another platform for example xcb or x11 with the command “./myprogram -platform xcb”. Unfortunatelly i only have the following platform options and none of them work: eglfs,linuxfb,minimal,minimalegl,offscreen. I dont now how to install these, i’ll google it see if i can find anything.
http://www.raspberrypi.org/phpBB3/viewtopic.php?t=26590&p=321556