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 !