Qt/QML Windows App very slow when grammarly app is running - qt

We are developing a large Qt/QML Application and recently experienced an interesting issue:
The application is unusable slow if "grammarly" is installed. Grammarly seems to use Windows Accessibilty and tries to "read" or process our apps screen. This makes it unusable slow.
Everything works fine if grammarly is closed before starting our app.
Is there a way to fix this in our app? I tried setting"QT_ACCESSIBILITY=0" in the environment, but this did not help.
Do I have rebuild Qt by my own to disable this?
BTW: We are using Qt 5.15.2 opensource.
I anyone wants to try this out:
Grammarly: https://www.grammarly.com/desktop
App "Oxygen": https://ccc.dewetron.com/dl/634d2acf-ff00-457c-ae48-4e56d9c49a3c
Thanks for your answers.

When Qt discovers that an accessibility client is running, then it generates a stream of notifications for those accessibility clients. This does introduce overhead. Some of that overhead might be substantial, as data structures in the application or Qt need to be mapped to a "tree of indexed objects" structure that accessibility frameworks usually operate on.
By disabling this entire machinery via no-op handlers, your application is now no longer accessible. And if grammarly indeed uses accessibility infrastructure to access data in the application, then it will probably also become less useful.
Perhaps there are things that can be optimized in Qt so that accessibility being enabled doesn't result in such a high load. For that to happen, please report a bug to the Qt project and include a reproducer that is representative of what your applications is doing.
https://wiki.qt.io/Reporting_Bugs

I found a working solution for our problem. Install custom empty handler for updates and the QObject root object:
void DummyUpdateHandler(QAccessibleEvent* event)
{
}
void DummyRootObjectHandler(QObject*)
{
}
void initQML(QQuickView* view)
{
#ifdef WIN32
QAccessible::installUpdateHandler(DummyUpdateHandler);
QAccessible::installRootObjectHandler(DummyRootObjectHandler);
#endif
view->setSource(qml_file);
}
The application is no longer slowed down by grammarly or other accessibility tools.
bye Gunther

Related

Qt/QML performance degrading with other OpenGL application running at the same time

I am having a somewhat curious problem I am running into for the second time now writing an application in Qt/QML. I am working on Windows 10 with Qt 5.11.1.
When I run a QML window with a couple of graphical elements in it (mostly Rectangles, Text, Shapes, that sort of stuff), I notice that the update performance degrades and it starts to lag severely behind the data as soon as I start another application that uses OpenGL to render. As long as the QML app runs alone the performance is fine. The other OpenGL app always runs smoothly too, whether it is running alone or together with the QML window.
I am using QtQuick and I understand that it uses OpenGL, hence my connection to the other OpenGL app I run at the same time, but I may be wrong. Both applications however do not communicate with each other at all. The second app uses GPU resources quite intensely, but only to about 50%, while the QML resource usage seems negligible.
The other application apparently uses GLUT, it is a custom in-house app which I cannot share unfortunately. Since I work on a company laptop, updating display drivers or that kind of thing is not an option either, but I assume they are at the latest version.
Does anyone have an idea what might be going on here, or what things to look for?

Kotlin FX - Can a TornadoFx App be deploy as a web app?

I am interested in Kotlin GUI system and I found Tornado FX.
I noticed that we can transform javaFX app as a webapp, so my question is : Can we do the same with Tornado FX and if we can, How should we do that?
Anything you can do with JavaFX, you can do with TornadoFX, as it is basically a higher level API on top of JavaFX.
JavaFX itself has no rendering capability that targets the web, but JPro has rather geniously made that possible by "rendering" the JavaFX UI as SVG directly to the browser using WebSockets.
Infact, TornadoFX has special support to make it easier to create JPro based apps.
Your starting point would be https://www.jpro.one/
The TornadoFX guide contains information about how to use JPro as well:
https://github.com/edvin/tornadofx-guide/blob/master/part2/Scopes.md#using-tornadofx-with-jpro
JPro is a commercial offering, starting av 99 EURO per month for one server with 8GB memory at the time of writing (2018-11-20). Each user would get their own instance of the application, though still running within the same JVM.
While this system works remarkably well, it is best suited for situations where there is low latency and preferably high bandwidth between the client and the server, as every event will be transferred over the WebSocket connection. It would typically be a bad choice for a public facing web page, but it is doable. In fact, http://jpro.one is actually a JavaFX app!
Disclaimer: I am not affiliated with JPro, I'm merely telling you about the (only) way to make JavaFX apps available through the browser.

Approaches to provide a Qt Gui via Web?

Sometimes I stumble upon frameworks that used to provide a web interface for Qt applications (like e.g. https://github.com/alberthier/qtwui)
Is there today a Qt5 way (or even better PyQt5) to run a Qt application on a server while accessing the UI via web?
I know several conceptions, but from my point of view they are not ready for production.
Emscripten: http://blog.qt.io/blog/2015/09/25/qt-for-native-client-and-emscripten
QML Web: https://github.com/qmlweb/qmlweb
WebGL streaming is one way forward, as it allows to run both QML and widget-based UIs in the browser.

Using Qt QWebPage in a Windows QtService

I am using QtService to write a web page thumbnail rendering service. Is it possible to include sufficient of the Gui libraries to keep QtWebKit happy without running into the restriction on interactive services?
I have the websnap sample from websnap.cpp and this somehow convinces the QWebPage component that a Gui is available without actually displaying the widget. When I try to duplicate the environment in the service it complains that there in no gui for the widget.
I strongly suspect that QtService and QWebPage are fundamentally incompatible but have not yet given up hope that there is a workaround.
I am not even sure what it is that the websnap sample does that keeps QWebPage happy (is it just because its linked with the Gui library?)
I am very new to the Qt library so the answer may be obvious to someone with more experience.
Thanks,
Andy
Althought QtWebKit can work in headless environment (without any visible widgets), it still requires graphics libraries etc to be present and functional. Otherwise, how would it compute font metrics, render the text, and so on? Thus, you always need QtGui.
PS: I wrote the websnap example :)

Connect to internet with Qt for symbian

I'm creating a Qt Symbian application and need to connect to internet. In some way I need to let the user choose a connection when the app starts. I could use Qt Mobility to get it working but when Nokia approves I wan't do publish my application on Ovi Store. As the Qt Mobility is not included in Qt 4.6 it might be a problem to publish my app later. So for this reason I'm thinking of using native APIs instead.
The idea is to use: qt_SetDefaultIap() to set the connection on start. I have been looking at this to actually understand what it is doing. If I have two connections that the app could use, one with WIFI and one through mobile internet, which one will qt_SetDefaultIap() choose? And can I in some way with native api make the user choose a connection on start up? (qt_SetDefaultIap seems to just set a default connection on its own, without user choice)
Thanks!
Qt 4.7 is now released, and although not all of the Mobility APIs have made it into the core, QNetworkSession has.
Mrbiggerm: it looks like you've found the sym_iap_util.h file that's included in the QFtp example code in the Qt SDK. Rather than calling qt_SetDefaultIap(), try calling qt_OfferIapDialog(), and passing its return value to qt_SetDefaultIapName(). That should do what you're after. (Although this is a bit of a hack, it's often a preferred option as it presents a native S60 UI rather than making you implement your own list of access points.)
Do you expect to finish your program before Qt 4.7 release (I don't know the exact release date, but I'd estimate it will be around July), which AFAIK will contain Qt Mobility?
If the answer is no, don't worry about releasing issues, use custom build of QtMobility for development, wait for 4.7 and don't worry about releasing issues.
If the answer is yes, what stops you from deploying your program with custom QtMobility build? Internally it uses the same native API calls you want to use, not some super secret Nokia API, so there should be no problem with code validation (in fact, there will probably be less problems, since you won't have a chance to screw up code covered by QtMobility libraries).

Resources