Ejemplo n.º 1
0
static void test_systemdisplayinfo(void)
{
  QSystemDisplayInfo displayinfo;
  QDesktopWidget wid;
  for( int display = 0; display < wid.screenCount(); ++display )
  {
    qDebug() << "";
    qDebug() << "Display:" << display;
    int depth = displayinfo.colorDepth(display);
    qDebug() << "  displayinfo.colorDepth() ->" << depth;
    int value = displayinfo.displayBrightness(display);
    qDebug() << "  displayinfo.displayBrightness() ->" << value;
    QSystemDisplayInfo::DisplayOrientation orientation = displayinfo.orientation(display);
    qDebug() << "  displayinfo.orientation() ->" << orientation;
    float contrast = displayinfo.contrast(display);
    qDebug() << "  displayinfo.getContrast() ->" << contrast;
    int dpiWidth = displayinfo.getDPIWidth(display);
    qDebug() << "  displayinfo.getDPIWidth() ->" << dpiWidth;
    int dpiHeight = displayinfo.getDPIHeight(display);
    qDebug() << "  displayinfo.getDPIHeight() ->" << dpiHeight;
    int physicalHeight = displayinfo.physicalHeight(display);
    qDebug() << "  displayinfo.physicalHeight() ->" << physicalHeight;
    int physicalWidth = displayinfo.physicalWidth(display);
    qDebug() << "  displayinfo.physicalWidth() ->" << physicalWidth;
    QSystemDisplayInfo::BacklightState state = displayinfo.backlightStatus(display);
    qDebug() << "  displayinfo.backlightStatus() ->" << state;

  }
}
Ejemplo n.º 2
0
void tst_QSystemDisplayInfo::tst_getDPIHeight()
{
    QSystemDisplayInfo di;
    QVERIFY(di.getDPIHeight(0) > -1);
}