@Bonnie said in Qframe lines and QTextEdit scrollbar are not drawn correctly:
I tried your code and the frame is drawn without problem, so this part doesn't seem to be the reason.
Thank you very much for your effort.
I changed the screen scaling settings from 125% to 100% and the widgets were drawn correctly.
In the documentation I found these pages about high DPI:
enum class Qt::HighDpiScaleFactorRoundingPolicy
High DPI, this side says:
Qt will automatically account for the display resolution when using higher level APIs such as Qt Widgets and Qt Quick, and applications only need to provide high-resolution assets, such as images and icons.
I searched for high dpi using the forum's search function.
The return value from main_window.devicePixelRatio(); was 1.25, which corresponds to my system setting. But with the scaling 1.25 the problem remains.
Edit:
QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::Round); QApplication app(argc, argv);If the static member function setHighDpiScaleFactorRoundingPolicy before QApplication app (argc, argv); is called, everything was drawn as expected. highDpiScaleFactorRoundingPolicy() previously returned 5, which corresponds to Qt :: HighDpiScaleFactorRoundingPolicy::PassThrough.