title: How to get the DPI of the display screen in Qt
body: <p>I need to get the DPI value of display in Qt. I am able to get it in Qt 5.0 using the following:</p>
  <pre><code>#include &lt;QScreen&gt;
  
  ......
  ......
  QScreen *srn = QApplication::screens().at(0);
  qreal dotsPerInch = (qreal)srn-&gt;logicalDotsPerInch();
  </code></pre>
  <p>But the same code throws a compilation error in Qt version  4.x. My project is developed in Qt version 4.x. So I need the equivalent of the above code in Qt version 4.x.</p>