运行期间,还有我想获取多显示器的色深,我这样写
- QDesktopWidget* desktopWidget = QApplication::desktop();
- int nMonitorCount = desktopWidget->screenCount();
- qDebug()<<"nMonitorCount"<<nMonitorCount;
- for( int i=0; i< nMonitorCount; i++ )
- {
- QRect screenRect = desktopWidget->screenGeometry(i);
- QPixmap pix = desktopWidget->grab(screenRect);
- int depth = pix.toImage().depth();
- qDebug()<<"depth = "<<depth;
- }
可是结果总是第一个显示器的色深,第二个得不到,不知道为什么。