summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qhighdpiscaling_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Add more logging to QHighDpiScalingTor Arne Vestbø2022-09-091-0/+4
| | | | | Change-Id: I12d0184b8fda86bed5b78dfb45a5d8dfb7da44bc Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix build without highdpiscaling featureIlya Fedin2022-08-231-0/+3
| | | | | | | Fixes: QTBUG-104925 Pick-to: 6.4 Change-Id: Ieb5dd2194c54a61733c427c8a0ddf7576147d6ea Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Fix painting clipping glitches with fractional scalingEirik Aavitsland2022-03-021-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In QPainter, clipping can only be done on whole pixels. The various ways of specifying a clipping rectangle to the QPainter API have been inconsistent in how fractional rectangles (either specified directly, or as a result of fractional scaling) are mapped (rounded) to integer coordinates. Also, the mappings have not made sure to keep the edge-to-edge property of clip rects under scaling. This is particularly important when scaling QRegions with multiple rects, as QRegion is designed on the assumption that an area can be described as a set of edge-to-edge rects. The fix rounds a clip rect identically with a fill rect. (Indeed, a followup plan would be to merge QRasterPaintEngine's toNormalizedFillRect() with the rectangle rounding function in this commit). Notably, a QRectF clip is now interpreted the same as a QPainterPath clip describing the same area. This modifies d9cc1499954829faf9486fb72056e29f1bad58e3 Task-number: QTBUG-100329 Fixes: QTBUG-95957 Task-number: QTBUG-100343 Pick-to: 6.3 Change-Id: Iaae6464b9b17f8bf3adc69007f6ef8d623bf2c80 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Handle WM_GETDPISCALEDSIZEMorten Johan Sørvig2021-10-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By handling WM_GETDPISCALEDSIZE we can keep QWindow’s device independent size constant across DPI changes. This is done by scaling QPlatformWindow’s native size such that the change of scale factor and change of QPlatformWindow size cancels out. Qt now handles DPI change using two events: WM_GETDPISCALEDSIZE: Compute the new size for the window. WM_DPICHANGED: Apply the new DPI and window geometry. The reason for this complication is that Windows retains control over the window position during the DPI change, in order to e.g. accurately track the cursor position during a screen change. The default WM_GETDPISCALEDSIZE implementation (provided by Windows) scales the win32 window size linearly with the DPI change. We want to use linear scaling as well, however the win32 window size includes the margins, which do not change linearly as the DPI changes. Instead, scale the QPlatformWindow size, and then add the new margins. Pick-to: 6.2 Change-Id: I4f225be8fad56b1fa77e9e3cfd6538a206589d73 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Parse QT_SCREEN_SCALE_FACTORS spec only onceMorten Johan Sørvig2021-05-031-1/+9
| | | | | | | | | | Move parsing to initHighDpiScaling() and store the parsed factors in a vector. The factors are later applied in updateHighDpiScaling() where the factor list is compared to the screen list. Change-Id: I59fc67b84932dbe69868a3683686a91e51333104 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix build without features.highdpiTasuku Suzuki2021-04-141-3/+11
| | | | | | | Add four template functions missing in stub. Change-Id: I7ca126f866a76efc26167340ff2e35a60775078b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Don’t store screen scale factors in GLOBAL_STATICMorten Johan Sørvig2021-03-151-0/+1
| | | | | | | | | | | | | Use a normal static variable, like the other high-dpi variables. Clear the stored factors in initHighDpiScaling(). This makes auto-testing possible where the application object is recreated for each test case and should start with a clean slate. Change-Id: I1831c856b5d7a2c522e62c7ed0657da771c3144f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Read high-dpi env. variables in initHighDpiScaling()Morten Johan Sørvig2021-03-151-1/+4
| | | | | | | | | | | | | | | | | | | Move all environment access to initHighDpiScaling(), which makes it so that all environment access happens at one point in time during QGuiApplication construction. Replace the “qt.scaling” logging category with “qt.highdpi”, and log each recognized env. variable. Further logging of DPI and computed scale factors will be introduced later on. This also enables auto-testing of the environment variable settings, since the auto-test can now control when the environment is read by (re-)creating the application object. Change-Id: I4e62a9c0050438357a58ace5b50fb7c5950c87ce Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove the deprecated m_logicalDpi declarationWeng Xuetian2020-12-081-1/+0
| | | | | Change-Id: I8d9d59f010874e5a45084afcf55640078d5eba24 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Rename “pixelDensity” variablesMorten Johan Sørvig2020-10-231-2/+2
| | | | | | | | | | | | | QHighDpiScaling now computes scale factors based on QPlatformScreen::logicalDpi(), instead of by calling QPlatformScreen::pixelDensity() as done earlier. We forgot the rename the internal state variables, update them to indicate that platform screen DPI is used. Change-Id: Ib718a6176e0ac138395eea13b292f75f69dac3ad Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Update QHighDpiScaling internal documentationMorten Johan Sørvig2020-10-201-4/+0
| | | | | | | | Document new conversion functions and how the new public API (rounding) effects QHighDpiScaling operation. Change-Id: I801fc065cdb4904811a009510b08cac630b83fe7 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* high-dpi: Re-implement mapToGlobal and mapFromGlobalMorten Johan Sørvig2020-10-201-2/+0
| | | | | | | | | | | | | | | | | | | | (This code is required to handle corner cases such as a QWindow covering multiple screens, where the normal code path does not give correct results.) Move the map[to|from]Global implementation from qhighdpiscaling.cpp, and implement it in terms of [to|from]NativeGlobalPosition. These functions implement the required screenAt()-type searching. The implementation strategy for both mapping functions is to first map to the native coordinate system, perform the globalPos addition or subtraction, and then map the result back to device independent coordinates. Task-number: QTBUG-81695 Change-Id: I44e9e68651634650964e839b1e564b50f434553f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QHighDpi: window geometry scaling functionsMorten Johan Sørvig2020-10-201-0/+16
| | | | | | | | | | | | | | | | | | Add functions which scales window geometry: framNativeWindowGeometry() toNativeWindowGeometry() These correctly handles top-level and child windows, where top-level window positions scale around the screen origin while child window positions scale around (0, 0). Modify call cites to use the new functions. We no longer need the isTopLevel checks at the call site. Change-Id: I0158672d46a3f52dfc7d37d021fc5cebd7859200 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QHighDpi: global geometry scaling functionsMorten Johan Sørvig2020-10-201-0/+16
| | | | | | | | | | | | | Add functions for scaling global coordinates: toNativeGlobalPosition() fromNativeGlobalPosition() These correctly handle the cases where a window spans several screens. Change-Id: I268762499cd8d86a3c417342ddaf2fb6dab4dd20 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QHighDpi: Add screenForPosition()Morten Johan Sørvig2020-10-201-10/+32
| | | | | | | | | | | | | | | | | Implement support for using the screen at a given position when determining the scale factor and origin. Add QHighDpiScaling::screenForPosition(), which searches for a screen at the specified device independent or native coordinates. The function returns the QScreen or nullptr if no screen was found. Add QHighDpiScaling::Point, used for representing an invalid, device independent, or native point. Change-Id: I58e4e3eebb8cdd5171e59f97833a00e7f8d9ecd6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QHighDpi: revert window-on-multiple-screens handlingMorten Johan Sørvig2020-10-201-2/+1
| | | | | | | | | | | | | | Make fromNativePixels() use QWindow:screen() for determining which screen's scale factor to use, even if the point-to-be-scaled is on a different screen. We'll add API for handling the window-on-multiple-screens case in subsequent commits. Task-number: QTBUG-81695 Change-Id: Ib9f40a5a636b2487204c14301ad0190727dcf4ac Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Simplify QHighDpi::fromNativeLocalExposedRegion()Alexander Volkov2020-09-231-7/+3
| | | | | | | ... by using QRectF::toAlignedRect(). Change-Id: I310b2f0ad87c541aa0d63d6a8061783aff791abb Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Fix build without features.highdpiscalingTasuku Suzuki2020-09-041-2/+2
| | | | | | | Broken since 37d5aaa4b42f9c837f0d27edb9da2185971d02be Change-Id: Id741f23ccae4f619e6a389ee71b3e7fe0c599989 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix under non-integer scaling incorrect update areaTang HaiXiang2020-07-251-1/+1
| | | | | | | | | | | Given some decimal scaling, the clipping of the QRegion/QRect passed to the QRegion/QRect done inside paintEvent cannot handle the decimal scaling. Solved by only converting QRect to a certain QRectF and calling QRectF overload instead of QRect. Fixes: QTBUG-82601 Fixes: QTBUG-64854 Pick-to: 5.15 Change-Id: I0d8f4193aabfc0d917612db68d2a39ebb726fa2f Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Change QWindow/QWidget::map(To/From)(Global/Parent) to operate in floatFriedemann Kleint2020-07-141-2/+2
| | | | | | | | | | | | | | | Change the functions to operate in float and add the QPoint versions as overload calling them. This is more in-line with the event accessors using float and allows for removing some workarounds using a delta when converting touch points. Leave QPlatformWindow::map(To/From)Global() as is for now and add helpers for float. Change-Id: I2d46b8dbda8adff26539e358074b55073dc80b6f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use QList instead of QVector in gui implementationJarek Kobus2020-07-071-4/+4
| | | | | | | Task-number: QTBUG-84469 Change-Id: I366e845249203d80d640355a7780ac2f91a762f1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add ; to Q_UNUSEDLars Schmertmann2020-07-071-1/+1
| | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: I3f0b6717956ca8fa486bed9817b89dfa19f5e0e1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use QList instead of QVector in guiJarek Kobus2020-06-291-5/+5
| | | | | | | | Applied to headers only. Source file to be changed separately. Task-number: QTBUG-84469 Change-Id: Ic08a899321eaffc46b8461aaee3dbaa4d2c727a9 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix build without features.highdpiscalingTasuku Suzuki2020-06-181-0/+9
| | | | | | Change-Id: I9fee7303d53be228546accbcdf29a63b52e3f625 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Fix range-loop implicit copy warningMorten Johan Sørvig2020-03-131-1/+1
| | | | | | | | | | | | | Make the copy explicit. qhighdpiscaling_p.h:282:24: warning: loop variable 'rect' has type 'const QRectF &' but is initialized with type 'const QRect' resulting in a copy [-Wrange-loop-analysis] for (const QRectF &rect : pixelRegion) { ^ Change-Id: I4080ff42c41e464d081ab2b01cb2d010867b041b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* qhighdpiscaling: Add missing parameter to logicalDpi()Timo Aarnipuro2019-10-041-1/+1
| | | | | | | Fixes build with -no-feature-highdpiscaling. Change-Id: Ie3208992f739ac1a2ddea54bcca067666e9367e8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add high-DPI scale factor rounding policy C++ APIMorten Johan Sørvig2019-08-231-10/+0
| | | | | | | | | | | | | | | | This API enables tuning of how Qt rounds fractional scale factors, and corresponds to the QT_SCALE_FACTOR_ROUNDING_POLICY environment variable New API: Qt::HighDPiScaleFactorRoundingPolicy QGuiApplication::setHighDpiScaleFactorRoundingPolicy() QGuiApplication::highDpiScaleFactorRoundingPolicy() Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io> Task-number: QTBUG-53022 Change-Id: Ic360f26a173caa757e4ebde35ce08a6b74290b7d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Update QT_SCREEN_SCALE_FACTORSFriedemann Kleint2019-08-231-1/+1
| | | | | | | | | | | | | | | | Store name->factor associations in a global QHash instead of on the QScreen object, making them survive QScreen object deletion, for example on disconnect/ connect cycles. Make factors set with QT_SCREEN_SCALE_FACTORS override the screen factors computed from platform plugin DPI values. This matches the use case for QT_SCREEN_SCALE_FACTORS (but not the general scale factors combine by multiplication”principle) Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io> Task-number: QTBUG-53022 Change-Id: I12771249314ab0c073e609d62f57ac0d18d3b6ce Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Update Dpi and scale factor computationMorten Johan Sørvig2019-08-231-0/+29
| | | | | | | | | | | | | | | | | | | Remove pixelScale() in favor of logicalBaseDpi(). Compute scale factor based on logical DPI and logical base DPI, or optionally based on the physical DPI. Add policies for running the scale factor and adjusting the logical DPI reported to the application. The policies are set via environment variables: QT_SCALE_FACTOR_ROUNDING_POLICY=Round|Ceil|Floor|RoundPreferFloor|PassThrough QT_DPI_ADJUSTMENT_POLICY=AdjustDpi|DontAdjustDpi|AdjustUpOnly QT_USE_PHYSICAL_DPI=0|1 Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io> Task-number: QTBUG-53022 Change-Id: I4846f223186df665eb0a9c827eaef0a96d1f458f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Compute logical DPI on a per-screen basisMorten Johan Sørvig2019-08-231-1/+1
| | | | | | | | | | | | | | | The logical DPI reported to applications is the platform screen logical DPI divided by the platform screen scale factor. Use the screen in question when calculating the DPI instead of the values from the main screen. QHighDpiScaling::logicalDpi now takes a QScreen pointer. Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io> Task-number: QTBUG-53022 Change-Id: I0f62b5878c37e3488e9a8cc48aef183ff822d0c4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-08-131-3/+17
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/win32-clang-msvc/qmake.conf src/corelib/tools/qlist.h src/gui/painting/qcompositionfunctions.cpp src/gui/painting/qtriangulator_p.h src/gui/text/qfontengine_p.h src/network/kernel/qhostinfo_p.h src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io> Change-Id: Ib8a0308cf77224c4fbdcf56778fdac4a43e37798
| * QHighDPI: Fix broken scaling of QPoint(F)Friedemann Kleint2019-08-011-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For some reason, the overload resolution of the High DPI scale() functions introduced by b6ded193ee64ffe67df6d22e7a23aa1ea9e02ec7 chose the wrong overloads for QPointF and/or QPoint; it fell back to the generic template intended for qreal, QSize, etc, ignoring the origin. Remove the template and spell out all overloads. Fixes: QTBUG-77255 Change-Id: I5661f16f7326f65156f646f430f5a0c71d5302d2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-07-011-9/+28
|\| | | | | | | | | | | | | | | Conflicts: src/network/ssl/qsslsocket_openssl.cpp src/platformsupport/vkconvenience/qvkconvenience.cpp Change-Id: I97ce6ed185f7fdad8102cc58d3cfec0119fd7bb4
| * QHighDpi::fromNativePixels: use correct screenMorten Johan Sørvig2019-06-191-9/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calls like QHighDpi::fromNativePixels(point, window) would return device independent coordinates outside any screen in cases where the window is spanning multiple screens and the native point was not on the main screen. Correct this by looking up the correct screen and use its scale factor and origin when scaling coordinates. Task-number: QTBUG-73231 Change-Id: I01a3a42f42121b8d9f4ced2bb0fb023d6ae6bfe7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-06-251-209/+55
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/gui/painting/qdrawhelper.cpp src/gui/text/qdistancefield.cpp src/gui/text/qdistancefield_p.h src/network/ssl/qsslsocket_openssl.cpp src/plugins/platforms/android/qandroidinputcontext.cpp src/widgets/styles/qstylesheetstyle.cpp Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io> Change-Id: Ia7daad21f077ea889898f17734ec46303e71fe6b
| * QHighDpi: Replace fromNative()/toNative() with scale()Morten Johan Sørvig2019-05-141-209/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need one scale() function for each type: the scale factor can be inverted by the caller for the fromNative case. Add a generic templated implementation which will handle simple types. Add add specialization functions for compound types that don't have operator*(), as well as for position types (e.g. QPoint) which account for the origin. There's no need for fromNativePixels() and toNativePixels() overloads for each type; replace with generic implementations which call scale(). Do the same thing for fromNativeLocalPosition(). Some user code is calling fromNative()/toNative() directly, so leave a definition of those functions around for now. Also leave a couple of one-off scaling functions which do not fit the pattern. Also fix “narrowing conversion scaleFactor to int” warning for the QMargins scale function. Change-Id: Ia67accbb670a80dc1747c2e264b97aab75b1251b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Fix gui build without feature.highdpiscalingTasuku Suzuki2019-05-261-0/+2
|/ | | | | | Change-Id: Ic206cb6fa1b9fae1db9923ef6596852e93b3cbe5 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QHighDpi: Remove fromNativePixels()/toNativePixels() overloadsMorten Johan Sørvig2019-05-221-116/+35
| | | | | | | | | | | | Replace QWindow / QScreen / QPlatformScreen overloads with template functions that take a generic context argument. The API now no longer supports implicit conversions from QPointer<QWindow> to QWindow *, add explicit data() call to usage in qxcbdrag.cpp. Change-Id: I63d7f16f6356873280df58f4e7c924bf0b0eca5b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QHighDpi: Simplify top-level window handling codeMorten Johan Sørvig2019-05-141-40/+21
| | | | | | | | | | | | | Introduce origin(QWindow *), which returns the point around which coordinates should be scaled: the screen origin for top-level windows, and (0, 0) for child windows. The code paths for top-level and child windows can then be combined. Change-Id: I6b9cdbd9e7c2d9406e9137e325c4eb5c79e3ac9a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix QWindow::mapToGlobal()/mapFromGlobal() for multi-screen windowsMorten Johan Sørvig2019-05-131-1/+3
| | | | | | | | | | | | | | | | | | Make these functions handle the case where a window spans multiple screens, and high-DPI scaling is enabled, and the local position (in the window) is not on the window primary screen (as returned by QWindow::screen()). This is done by detecting the case, and then calculating the correct position using the native coordinate system. [ChangeLog][QtGui] QWindow::mapToGlobal()/mapFromGlobal() now handle windows spanning screens correctly. Done-with: Friedemann Kleint<Friedemann.Kleint@qt.io> Task-number: QTBUG-73231 Change-Id: I3c31b741344d9e85e4f5d9e60bae75acce2db741 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix QHighDpi::fromNativeLocalExposedRegion rounding errorsBłażej Szczygieł2017-11-081-1/+2
| | | | | | | | | | | | | | | | | | | | Ceiling width/height fails to take into account rects that do no have their top left position on an exact point boundary. Example: QRect(0,0 20x20) and QRect(1,1 20x20) with scale 2.0 would give the same result of QRect(0,0 10x10). The correct rects are QRect(0,0 10x10) and QRect(0,0 11x11), so that we are sure to repaint all pixels within the exposed region. Before 5138fada0b9c, rects were also rounded incorrectly. The old method would give the result of QRect(0,0 11x11) in both cases, causing the exposed region to be larger than a window. Amends 5138fada0b9ce3968b23ec11df5f0d4e67544c43 Task-number: QTBUG-63943 Change-Id: I9f3dddf649bdc506c23bce1b6704860d61481459 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix QHighDpi::fromNativeLocalExposedRegion rounding errorsTor Arne Vestbø2017-07-191-4/+4
| | | | | | | | | | | | | | | | | | | | Calling bottom/right/bottomRight on a QRect is discouraged, as it does not give the true bottom-right corner of the rectangle, instead giving a point one unit to the left and top of the true bottom right. Dividing this point by a scale factor of e.g. 2, and then using qCeil on the bottom right x and y coordinates would result in a pointRegion that was 1x1 * scaleFactor larger than it should, manifesting as rendering issues at later stages. We can get away from the whole problem by initially converting the QRect to a QRectF, and basing the pointRegion's rect on the scaled size instead of bottom-right coordinates. Change-Id: I4d4895660655cfa8749c93c7d2573ae79cd7898b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add qtguiglobal.h and qtguiglobal_p.hLars Knoll2016-07-031-1/+1
| | | | | | | | | | | | | | | | | | | | The new modular configuration system requires one global header per module, that is included by all other files in this module. A similar scheme and naming convention is already being used for many other modules (e.g. printsupport, qml, quick). That header will later on #include the configuration file for Qt Gui. For now it defines the Q_GUI_EXPORT macro for this library. In addition, add a private global header, qtguiglobal_p.h, that can later on include the private config header for Qt Gui for things we don't want to export to the world. Change-Id: Id9ce2a4f3d2962c3592c35e3d080574789195f24 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-03-221-2/+4
|\ | | | | | | | | | | | | | | | | | | Conflicts: configure mkspecs/common/wince/qplatformdefs.h src/plugins/platforms/directfb/qdirectfbbackingstore.cpp src/plugins/platforms/xcb/qxcbbackingstore.cpp Change-Id: Ied4d31264a9afca9514b51a7eb1494c28712793c
| * QtGui: de-duplicate calls and cache resultsAnton Kudryavtsev2016-03-131-2/+4
| | | | | | | | | | | | | | Change-Id: Iaf232c31d6780b49dc6a3d0faafb9717f3c36e65 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-03-011-1/+1
|\| | | | | | | Change-Id: Ic7aaa06f4a14b1aed61faa1a6e7f527ee0eeb96b
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-291-1/+1
| |\ | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/corelib/io/qprocess/tst_qprocess.cpp Change-Id: Ib6955eb874b516b185b45d6c38cec646fbaa95f4
| | * Fix QHighDpi::fromNative(QRect, QScreen *, QPoint).Friedemann Kleint2016-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Call fromNative() instead of toNative(). Task-number: QTBUG-46615 Change-Id: I1e648a2680126d1f560e71573f7346b053fe676b Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* | | QtGui: use new QRegion::begin()/end() instead of rect()Marc Mutz2016-02-281-5/+3
|/ / | | | | | | | | | | | | Saves ~1100b in text size on optimized GCC 5.3 Linux AMD64 builds. Change-Id: I928be44314dde06d5fdd2486a3417870bda64af4 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>