From b265e8fb05b3d55022aad8e48a470d82fac7ffd1 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Thu, 17 Oct 2002 13:31:04 +0000 Subject: [PATCH] Better DPI, Cleaner c-tor. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5433 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/ChangeLog | 7 ++++++- src/frontends/qt2/QBrowseBox.C | 7 +++---- src/frontends/qt2/QBrowseBox.h | 5 ++--- src/frontends/qt2/lyx_gui.C | 2 +- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 6a65cff188..33ff673428 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,9 +1,14 @@ +2002-10-17 Angus Leeming + + * lyx_gui.C (getDPI): use an average of DpiX and DpiY. + + * QBrowseBox.[Ch] (c-tor): remove unneeded arguments. 2002-10-17 André Pönitz * QBrowseBox.[Ch]: fix style issues -2002-10-16 Angus Leeming +2002-10-17 Angus Leeming * ui/moc/Makefile.am: * moc/Makefile.am: add a distclean-local target to remove *_moc.C. diff --git a/src/frontends/qt2/QBrowseBox.C b/src/frontends/qt2/QBrowseBox.C index 04e616f04d..86cdd25c73 100644 --- a/src/frontends/qt2/QBrowseBox.C +++ b/src/frontends/qt2/QBrowseBox.C @@ -2,7 +2,7 @@ * \file QBrowseBox.C * * Original file taken from klyx 0.10 sources: - * $Id: QBrowseBox.C,v 1.4 2002/10/17 09:51:18 poenitz Exp $ + * $Id: QBrowseBox.C,v 1.5 2002/10/17 13:31:04 leeming Exp $ * * \author Kalle Dalheimer ? * @@ -25,8 +25,7 @@ #include "QBrowseBox.h" -QBrowseBox::QBrowseBox(int rows, int cols, QWidget * parent, - char const * name, WFlags fl) +QBrowseBox::QBrowseBox(int rows, int cols) : QGridView() { setNumRows(rows); @@ -157,7 +156,7 @@ void QBrowseBox::keyPressEvent(QKeyEvent * e) } -void QBrowseBox::mouseReleaseEvent(QMouseEvent * e) +void QBrowseBox::mouseReleaseEvent(QMouseEvent *) { qWarning("mouse release"); emit selected( activecell_.x(), activecell_.y()); diff --git a/src/frontends/qt2/QBrowseBox.h b/src/frontends/qt2/QBrowseBox.h index aa41dc6b80..6372874ad9 100644 --- a/src/frontends/qt2/QBrowseBox.h +++ b/src/frontends/qt2/QBrowseBox.h @@ -3,7 +3,7 @@ * \file QBrowseBox.h * * Original file taken from klyx 0.10 sources: - * $Id: QBrowseBox.h,v 1.2 2002/10/17 09:51:18 poenitz Exp $ + * $Id: QBrowseBox.h,v 1.3 2002/10/17 13:31:04 leeming Exp $ * * \author Kalle Dalheimer ? * @@ -27,8 +27,7 @@ class QBrowseBox : public QGridView { Q_OBJECT public: - QBrowseBox(int rows, int cols, QWidget * parent = 0, - char const * name = 0, WFlags f = 0); + QBrowseBox(int rows, int cols); ~QBrowseBox(); void insertItem(QString const & text, int x, int y); diff --git a/src/frontends/qt2/lyx_gui.C b/src/frontends/qt2/lyx_gui.C index 0ee6c1dc10..21dfd72618 100644 --- a/src/frontends/qt2/lyx_gui.C +++ b/src/frontends/qt2/lyx_gui.C @@ -67,7 +67,7 @@ float getDPI() { QWidget w; QPaintDeviceMetrics pdm(&w); - return pdm.logicalDpiY(); + return 0.5 * (pdm.logicalDpiX() + pdm.logicalDpiY()); } }