| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Change-Id: Iadaca71328404bd6c526af5095b32e5e35548182
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
| |
Main use case is for KDE Plasma, which needs to know about real
window system coordinates. Can also be used by applications that
do all the scaling manually, and that do not want to have Qt
scale the coordinate systems and painters.
Change-Id: Ic595131c5e2fb4c0af95e9b5bd3e40beee86760b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
|
|
|
|
|
| |
Change-Id: I0fce05998ba6092c4dd1d64790c56c0668383477
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Assume that the logical DPI for the primary screen is sane, and
keep font sizes constant as screens are scaled. The global scale
factor will act as a zoom level, and will cause all fonts to be bigger.
Note that since we do not change logicalDpi after application startup,
the manual test sliders will not match what happens
with auto scaling. We may want to fix that...
Change-Id: I5a3daa57c2dacf0158836492d31573723e49399a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We don't want to turn off font hinting based on whether auto-scaling is on,
otherwise Qt Creator will look bad on a low-DPI screen. Instead, we turn it
off only if we have at least one screen that is scaled.
QHighDpiScaling::isActive() now means that there is actual scaling going on.
There is currently no need for the old meaning, so this change does not include
QHighDpiScaling::isEnabled().
Note that nothing can save us from the case where there is one high-DPI and
one low-DPI screen. In that case we choose looking bad on the low-DPI screen
instead of looking like crap on the high-DPI screen. Also note that our font
system we doesn't allow us to change our minds on hinting later when screens
are plugged in or removed.
Change-Id: I14a4ec7a49f4ba74a4c74684c7b951d0a71b951d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
|
|
|
|
|
|
|
|
|
| |
This is a seriously dirty hack, but without
this, screen geometries will be wrong when scale
factors are changed after application startup.
Change-Id: Ia39164303ef648ec3752d7f4b9db06477a2d3fb4
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
| |
Move to the class documentation in the cpp file,
focus on documenting the class and not necessarily
high-dpi scaling in general.
Change-Id: I4f04398904325b2f9061db8d3a82cd362276e977
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This increases the uniformity of the to/fromNativePixels
functions by removing a special case, and avoids pulling
the qwindow_p.h details into qhihgdpiscaling.cpp.
Keep the logic of constraining the device-independent
size.
Change-Id: Id0dae30a7c0170ff2e5d21b94d56719cc900c726
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
|
|
|
|
|
|
|
|
| |
Also clean up the env. variable definitions.
Change-Id: If51ab515d7d7d6be9b984417ce7262a83ea48a66
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
|
|
|
|
|
|
|
| |
For compatibility with Qt 5.5 (and 5.4)
Change-Id: I30fe0e493849f116983299f36061d443a522eec3
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
| |
Previously, setting a scale factor on a screen would also
turn on pixel density scaling. Scaling everything twice is not
twice as good...
Change-Id: I617b76a717c8f83089d534604b3596754c42dad4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Overall goal is to simplify, separate concerns, and
improve cross-platform-ness and testability.
QT_SCALE_FACTOR is now a pure cross-platform global
scale factor setter has no "auto". "auto" requires
input from the platform plugin via QPlatformScreen::
pixelDensity() and gets a separate environment variable:
QT_AUTO_SCREEN_SCALE_FACTOR
The effective scale factor (aka devicePixelRatio) is now
computed as the product of the global, screen, and
window scale factors. This matches how devicePixelRatio
is computed in general (the window system devicePixelRatio
is also a factor), and makes QT_SCALE_FACTOR
work consistently regardless if there is a window
scale factor set or not. This also means we can remove
the if/else casing from the nativePixels conversion
functions.
Add QHighDpiScaling initializer which reads the environment
variables and sets the "active" variables. Call it
during QGuiApplication construction, before the platform
plugin is created
Add per-screen scale factor setting capability to
the manual test. This makes it possible to test
this logic on all platforms. The command line argument
is --screen-scale-factor.
Change-Id: I054337cbae37a01cdd731d26d9cb628fcecdb652
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Various fixes, including:
* Resize backingstore properly if screen has changed
* Trigger resize event on screen change if necessary
* Fix yet another race condition in screen detection
* Trying to fix screen mapping
Not completely finished, but I think it's better to
keep in sync, and not diverge too much.
|
| |
|
|
|
|
|
|
|
| |
To enable, set QT_SCALE_FACTOR=auto
Tons of bugs, since this does not port all the QT_DEVICE_PIXEL_RATIO
fixes from xcb.
|
|
|
|
| |
...and use fromDevicePixels instead of toDeviceIndependentPixels
|
|
|
|
|
| |
./highdpi --window-scale-factor --mainwindow
Also fix a couple of scaling logic bugs.
|
|
|
|
| |
Change-Id: Ia94ba9a8961f1a31635135545ded0078a93de380
|
|
|
|
|
|
| |
Drop the "HIGHDPI" term
Change-Id: I55cb4de34f302dee7897d70ce6693fea9d66926f
|
|
|
|
|
|
|
|
| |
The qHighDpi functions now take an optional Window *
The scale factor can be set with QHighDpiScaling::
setWindowFactor(QWindow *, factor)
Change-Id: I34c80d2e031c257504d789ac5135de731d29929a
|
|
Add coordinate scaling support to the QWindow/
QWindowSystemInterface layer. The scale factor can
be set with the QT_HIGHDPI_SCALE_FACTOR environment
variable.
Setting a scale factor different than the default (1)
now has the following effects:
QWindow::devicePixelRatio is set accordingly, enabling
the high-dpi code paths.
QWindow and related classes now return geometry in
device independent pixels. This includes screen,
desktop and window geometry as well as event coordinates.
The platform plugins continue to operate in device
pixels, unaware of the scaling.
Task-number: QTBUG-38858
Change-Id: I85b0d1bc682b25196f6db286e672a64f8da0ae5c
|