Implement getDPI

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5399 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Dekel Tsur 2002-10-14 20:20:34 +00:00
parent 6bc60cc596
commit 8c9ad457e9
2 changed files with 14 additions and 2 deletions

View 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> 2002-10-12 Dekel Tsur <dekelts@tau.ac.il>
* qfont_loader.C (available): Implemented. * qfont_loader.C (available): Implemented.

View File

@ -48,6 +48,8 @@
#include "io_callback.h" #include "io_callback.h"
#include <qapplication.h> #include <qapplication.h>
#include <qwidget.h>
#include <qpaintdevicemetrics.h>
#ifndef CXX_GLOBAL_CSTD #ifndef CXX_GLOBAL_CSTD
using std::exit; using std::exit;
@ -60,8 +62,14 @@ using std::endl;
extern BufferList bufferlist; extern BufferList bufferlist;
namespace { 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 ! // FIXME: wrong place !