summaryrefslogtreecommitdiff
path: root/vcl/qt5/Qt5System.cxx
diff options
context:
space:
mode:
authorLuca Carlon <carlon.luca@gmail.com>2020-02-29 13:39:29 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2020-03-09 14:19:49 +0100
commit358991e3b0a49bb201c2f1e4be900ee99aac9aa8 (patch)
tree320852cd425045cbd1eff4198357bbaa05f348fe /vcl/qt5/Qt5System.cxx
parent2c5655d72401e6b6e917ece381e879b30680d20f (diff)
tdf#127687 Qt5 introduce basic HiDPI scaling
For tdf#124292, Qt's own HiDPI scaling was explicitly disabled, but it turns out, you can't really scale QStyle painting then. This patch series had a 2nd approach also used by Gtk+ currently, which relied on the scaling of ths Cairo surface, which works surprisingly good, but has to lie about the real DPI value, so nothing is scaled twice. Also all icons are then scaled instead of rendered with the proper resolution. When HiDPI support in Qt is enabled, and the application is started using QT_SCALE_FACTOR=1.25, Qt simply lowers the reported resolution, keeps the logical DPI value of 96 and changes the devicePixelRatio to the specified value. But LO still expects the real DPI values and sizes, so we have to multiply a lot of rectangles, sizes and positions. The current result is far from perfect, which you can see with the various graphics glitches, but it at least doesn't crash anymore in the ControlType::Editbox sizing code. The main problem is all the up and downscaling in the getNativeControlRegion code, so LO knows the size of the widgets for the correct layouting, since there seem to be no API to get the scaled values from Qt / QStyle. Change-Id: I687b1df6ef27724ce68326d256e9addccd72e759 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86239 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/qt5/Qt5System.cxx')
-rw-r--r--vcl/qt5/Qt5System.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/vcl/qt5/Qt5System.cxx b/vcl/qt5/Qt5System.cxx
index 4e00a0dd6283..d769f7118ea5 100644
--- a/vcl/qt5/Qt5System.cxx
+++ b/vcl/qt5/Qt5System.cxx
@@ -27,7 +27,7 @@ tools::Rectangle Qt5System::GetDisplayScreenPosSizePixel(unsigned int nScreen)
SAL_WNODEPRECATED_DECLARATIONS_PUSH
QRect qRect = QApplication::desktop()->screenGeometry(nScreen);
SAL_WNODEPRECATED_DECLARATIONS_POP
- return toRectangle(qRect);
+ return toRectangle(scaledQRect(qRect, qApp->devicePixelRatio()));
}
int Qt5System::ShowNativeDialog(const OUString&, const OUString&, const std::vector<OUString>&)