在main函数第一行加入:
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
鼠标不按下也响应移动事件:
setMouseTracking(true);