QML_NO_TOUCH_COMPRESSION windows installer



  • Based on https://forum.qt.io/topic/76941/qquickitem-touchevent-rate I am setting QML_NO_TOUCH_COMPRESSION to get a bigger touch event rate on my application when developing.
    Now I need to deploy my app and I find a new problem, QT uses internally QML_NO_TOUCH_COMPRESSION to initialize statically a variable:

    static bool qquickwindow_no_touch_compression =
    qEnvironmentVariableIsSet("QML_NO_TOUCH_COMPRESSION");
    

    In case of Windows deployments, Do I have to force to have QML_NO_TOUCH_COMPRESSION in the environment variables? For example, my installer create that environment variable. Is there another way?


  • Lifetime Qt Champion

    Hi,

    IIRC, you can call qputenv before creating your QApplication/QGuiAppilcation object.



  • Many thanks for the answer.

    Doing this:

    qInfo() << "Touch Compresion" << qEnvironmentVariableIsSet("QML_NO_TOUCH_COMPRESSION");
    qputenv("QML_NO_TOUCH_COMPRESSION", "1");
    QGuiApplication app(argc, argv);
    qInfo() << "Touch Compresion" << qEnvironmentVariableIsSet("QML_NO_TOUCH_COMPRESSION");
    

    I get:

    Touch Compresion false
    Touch Compresion true
    

    But the compression of touch events are done because of qquickwindow_no_touch_compression is initializated statically in a .cpp file out of a function/method, so that action(set qquickwindow_no_touch_compression) will be done before first main instruction.

    This looks like fixed in qt5.9: http://code.qt.io/cgit/qt/qtdeclarative.git/tree/src/quick/items/qquickwindow.cpp?h=5.9, as in that case qquickwindow_no_touch_compression will be initialized when getting the first touch event.

    I am using 5.7.1, I think I am forced to set the environment variable in the installer.


Log in to reply