简体   繁体   English

QDesktopWidget在屏幕分辨率更改或监视计数时不发出任何信号

[英]QDesktopWidget doesn't emit any signal at screen resolution change or monitors count

I'm testing on Mac OS 10.9.1 with Qt 4.8.5 The same code works on Windows and I'm pretty sure it worked before update from the MacOS 10.8. 我正在使用Qt 4.8.5在Mac OS 10.9.1上进行测试。相同的代码在Windows上也可以运行,并且我确信在从MacOS 10.8更新之前它可以正常工作。

private slots:

void desktopResized(int screen);
void desktopScreenCountChanged(int newCount);

...

bool result = connect(qApp->desktop(), SIGNAL(resized(int)), SLOT(desktopResized(int)));
Q_ASSERT(result);
connect(qApp->desktop(), SIGNAL(screenCountChanged(int)), SLOT(desktopScreenCountChanged(int)));

Slots just never get called on change of monitor resolution. 插槽永远不会因更改显示器分辨率而被调用。 Does anyone have the same problem, any solution? 有谁有同样的问题,有解决方案吗? Thanks 谢谢

[UPDATE] The bug is resolved in Qt 5.2.1 [更新]该错误已在Qt 5.2.1中解决

There is a bug report about this. 有关于此的错误报告 Hasn't been evaluated yet though 尚未经过评估

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM