Update the BUGS.md

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
Yuhang Zhao 2020-05-25 10:06:49 +08:00
parent a2fde746f5
commit 901d212630
1 changed files with 10 additions and 0 deletions

10
BUGS.md
View File

@ -39,3 +39,13 @@ Qt 5.6 series have this issue. Update your Qt version.
在 Windows 7 上,窗口右边和底边有白边。 在 Windows 7 上,窗口右边和底边有白边。
Qt 5.6 系列存在这个问题。请升级您的 Qt 版本。 Qt 5.6 系列存在这个问题。请升级您的 Qt 版本。
## Widgets or Qt Quick elements are in wrong position when DPI changes / DPI改变后控件错位
When the DPI changes and the application is still running or the window of the application was moved to a different monitor which has a different DPI, the widgets (Qt Widgets application) or Qt Quick elements (Qt Quick application) are in wrong position.
This is a Qt bug and hasn't been fixed till Qt 5.15. Its root cause is the window is not repainted, the widgets or Qt Quick elements are in right position actually. The temporary solution is either ignore this issue (all Qt applications have this issue and most of them don't handle this) or resize the window manually for one pixel (so the user won't see a visual change) to trigger a repaint. Don't use platform-specific native APIs such as `RedrawWindow` to do this because Qt has take over the painting of the window so you have to let Qt to do the repaint.
当DPI改变或窗口被移动到一个DPI不同的显示器后控件位置不正确看起来或许像是花屏了
这是Qt自身的bug并且直到5.15都还没有被修复。这个bug是窗口没有重绘导致的控件的位置实际上是正确的只是画面没有刷新看起来像是错位了。临时的解决方案有两个一个是直接忽略这个问题所有Qt程序都存在这个问题但绝大多数都没有对这个问题进行处理我怀疑大多数开发者也不知道这个地方有问题另一个是手动调整窗口的尺寸来触发重绘最好只调整一个像素这样的话能触发重绘但用户基本看不到这个过程。不要使用诸如`RedrawWindow`这样的平台原生API来重绘因为Qt程序的界面全都是自绘的窗口的绘制已经完全被Qt接管了你这样手动调用API是无效的必须要Qt自己去重绘才能生效。