DiscussionsIssue archiveVisualization and 3D Viewer

Archived discussion

Misalignment issues for using QT6

Visualization and 3D ViewerFri, 08/12/2022 - 17:492 replies

Browse this forum
QuestionAuthor

Hi
When occt 7.6 is used with Qt viewer windows has misalignment with windows. Or the mouse pointer and marker locations are different. It does not happen with Qt 5.15.2
Attached is the screen of the sample occt viewer. (Location of mouse pointer is different from market on screen). I also compiled Mayo viewer (https://github.com/fougue/mayo.git) with Qt6.3 and Occt 7.6. The viewport size is smaller than windows which did not happen with Qt 5.15.2.
How can it be corrected?

Thanks
Author

Discussion

2 archived replies

Posts are displayed in their archived order.

01Commenter-1

Are you using Qt auto scaling?
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
or
qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "1");

I believe this causes a difference between mouse position and the location detected by the viewer.

02Author

Hello, Thanks for the comment.
Sorry for late replay.
No I am not using this scaling value.
When the Mayo (https://github.com/fougue/mayo) is compiled with Qt 6, OpenGL windows does not fill up the available space in the parent Qt window. With Qt 5 , it went well. (without changing any code in both cases)