summaryrefslogtreecommitdiffstats
path: root/qt-gui.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-10 09:24:06 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-10 10:47:37 -0700
commitfe6237b2733d50b36f0c2d6de515b86891581dd4 (patch)
tree393d43438ef2492d363c01af8e627fc6ee92b6f8 /qt-gui.cpp
parentc129902793446cda9137f2b44c59d5840e4eeaec (diff)
downloadsubsurface-fe6237b2733d50b36f0c2d6de515b86891581dd4.tar.gz
Implement the get_screen_dpi function
This is sadly known to be incorrect on most systems. But it's as incorrect as it was on Gtk so should work equally well to get roughly the right sizes for printing - once we implement printing, that is :-) Also removed a qDebug that snuck in in commit 6fc4d72079dd ("Enable defautl_filename in settings"). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-gui.cpp')
-rw-r--r--qt-gui.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/qt-gui.cpp b/qt-gui.cpp
index 5d858d733..d70e00379 100644
--- a/qt-gui.cpp
+++ b/qt-gui.cpp
@@ -28,6 +28,7 @@
#include <QTextCodec>
#include <QTranslator>
#include <QSettings>
+#include <QDesktopWidget>
class Translator: public QTranslator
{
@@ -83,7 +84,6 @@ void init_ui(int *argcp, char ***argvp)
if (v.isValid()) {
QString name = v.toString();
prefs.default_filename = strdup(name.toUtf8());
- qDebug("default filename %s", prefs.default_filename);
}
settings.endGroup();
@@ -200,4 +200,9 @@ QString get_pressure_string(pressure_t pressure, bool showunit)
}
}
+double get_screen_dpi()
+{
+ QDesktopWidget *mydesk = application->desktop();
+ return mydesk->physicalDpiX();
+}
#include "qt-gui.moc"