0

I have a Qt-based program (using eglfs platform), and 2 monitors, one LVDS and the other one is connected by HDMI. The LVDS monitor is a touch screen. The screen of HDMI is placed to the right of the LVDS screen, both of them have resolution of 1024x768. If I touch on the LVDS on the position of (X;Y), the system thinks I have touched on (X*2;Y). I have tried this command:

xinput set-prop "eGalax Inc. eGalaxTouch EXC3000-5207-45.00.00" --type=float "Coordinate Transformation Matrix" 0.5 0 0 0 1 0 0 0 1

This works if the software is not Qt-based (like an xterm window), but my Qt software is still wrong. What is the problem, how can I fix it?

1 Answer 1

0

If your using eglfs I believe you might need to configure some of the screen positions/locations via a JSON file passed to the QT_QPA_EGLFS_KMS_CONFIG environment variable.

Check the documentation on eglfs here https://doc.qt.io/qt-5/embedded-linux.html

For the screen position and touch position read the Display Output and Touch input in systems with multiple screens on KMS/DRM.

On another note, if you don't want to define external variables to the application all the time you can do the following on your C/C++ main, before your QGuiApplication app(argc, argv); is called.


    int main(int argc, char* argv[])
    {
        qputenv("QT_QPA_EGLFS_KMS_CONFIG", <path to your qpa json file>);
        
        QGuiApplication app(argc, argv);
        
        ...

Hope this helps

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .