From 8c9ad457e985b9fc4f42dcd8a3c7f46a2d4494f1 Mon Sep 17 00:00:00 2001 From: Dekel Tsur Date: Mon, 14 Oct 2002 20:20:34 +0000 Subject: [PATCH] Implement getDPI git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5399 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/ChangeLog | 4 ++++ src/frontends/qt2/lyx_gui.C | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 44125c9f3c..d75da6cbdc 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,7 @@ +2002-10-14 Dekel Tsur + + * lyx_gui.C (getDPI): Implemented. + 2002-10-12 Dekel Tsur * qfont_loader.C (available): Implemented. diff --git a/src/frontends/qt2/lyx_gui.C b/src/frontends/qt2/lyx_gui.C index 317a371ca8..0ee6c1dc10 100644 --- a/src/frontends/qt2/lyx_gui.C +++ b/src/frontends/qt2/lyx_gui.C @@ -48,6 +48,8 @@ #include "io_callback.h" #include +#include +#include #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 !