]> git.lyx.org Git - features.git/commitdiff
Implement getDPI
authorDekel Tsur <dekelts@tau.ac.il>
Mon, 14 Oct 2002 20:20:34 +0000 (20:20 +0000)
committerDekel Tsur <dekelts@tau.ac.il>
Mon, 14 Oct 2002 20:20:34 +0000 (20:20 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5399 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt2/ChangeLog
src/frontends/qt2/lyx_gui.C

index 44125c9f3c15f223130670d6695c7420e9b3ea18..d75da6cbdc2e2914a9b5594d96539b49f16f3d7f 100644 (file)
@@ -1,3 +1,7 @@
+2002-10-14  Dekel Tsur  <dekelts@tau.ac.il>
+
+       * lyx_gui.C (getDPI): Implemented.
+
 2002-10-12  Dekel Tsur  <dekelts@tau.ac.il>
 
        * qfont_loader.C (available): Implemented.
index 317a371ca8bd018ffdfc864d3f6d285a59ff98d6..0ee6c1dc1062d71296d3fabe124fe5613fe031ab 100644 (file)
@@ -48,6 +48,8 @@
 #include "io_callback.h"
 
 #include <qapplication.h>
+#include <qwidget.h> 
+#include <qpaintdevicemetrics.h> 
 
 #ifndef CXX_GLOBAL_CSTD
 using std::exit;
@@ -60,8 +62,14 @@ using std::endl;
 extern BufferList bufferlist;
 
 namespace {
-       /// good ol' "easy to use" Qt again
-       float getDPI() { return 95; }
+
+float getDPI()
+{ 
+       QWidget w;
+       QPaintDeviceMetrics pdm(&w);
+       return pdm.logicalDpiY();
+}
+
 }
 
 // FIXME: wrong place !