Forum > QT

Weird Qt5 lags when creating windows

<< < (2/3) > >>

zeljko:
Maybe gprof or valgrind can help, really don't know. Besides that, I'm not sure that libQt5Pas is problem here. Are you sure that you've correctly compiled qt5 ws and your app with -dQtUseNativeEventLoop ? In this case it uses Qt5 event loop, so in that case it should work in same way as C++ Qt5 app. Also, what qt style you use on your desktop ?

Obi:

--- Quote from: zeljko on February 10, 2022, 03:17:48 pm ---Are you sure that you've correctly compiled qt5 ws and your app with -dQtUseNativeEventLoop ? In this case it uses Qt5 event loop, so in that case it should work in same way as C++ Qt5 app.

--- End quote ---

I added this flag to the libqt5pas compilation flags, while the compiler cursed for "-d", I changed it to "-D" - and the library was built with it. I am not a Lazarus programmer, I can do something wrong. I'm trying to find out the source of the problem, since the developer of Double Commander himself has no idea where the lags come from. By the way, I see the same problem in CudaText, another application on Lazarus/FPC.


--- Quote from: zeljko on February 10, 2022, 03:17:48 pm ---Also, what qt style you use on your desktop ?

--- End quote ---

qt5ct, but with the windows style, as I mentioned above, it didn’t work faster.

zeljko:
One more check please: can you disable QTSCROLLABLEFORMS in qtdefines.inc ?
Define QTSCROLLABLEFORMS means QAbstractScrollArea is central widget of form, when disabled it's pure QWidget, so without scrollbars (lighter).
You can also comment line 41 in qtobject.inc
QCoreApplication_setAttribute(QtAA_DontCreateNativeWidgetSiblings, True);

rebuild and test ...

Obi:
I commented out QTSCROLLABLEFORMS first and didn't notice any difference. That is, the form did not draw faster. Then, leaving QTSCROLLABLEFORMS commented out, I commented out the line
QCoreApplication_setAttribute(QtAA_DontCreateNativeWidgetSiblings, True);
and again didn't notice any difference.

BUT. I've noticed that form content draws much faster when the mouse cursor is OUTSIDE the application window. I reverted all my changes, compiled the vanilla library code, checked again. And indeed, if the mouse cursor is inside the application window, rendering is slow, as in the video from the first post of this thread. And if I move the mouse outside the application window (the application itself remains active, I do not click on the on-screen button with the mouse, but press Enter on the keyboard), the rendering speed increases significantly. It becomes not directly instantaneous, but at the level of Qt4, which, in principle, satisfies me.

Does this tell you the reasons for this behavior?

zeljko:
Thanks, I don't know why it differs in rendering when mouse is inside form, but that's the way to go obviously :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version