Except for the case of syncing in response to an expose event,
where the platform asked us to flush a specific region, we
should strive to only flush parts that have been repainted.
And we should flush those parts to their nearest native child,
instead of unconditionally flushing the root/top level widget
as well.
By allowing drawWidget to schedule the flush we automatically
flush the minimal region, to the right widgets.
Change-Id: I73c143761d4a0da6991433b41dea0a0bc83a448a
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
The enum GraphicsItemChange::ItemMatrixChange is deprecated since Qt4
times. The corresponding matrix functions were also marked as deprecated
in 5.13 but the enum was forgotten. Therefore also mark it as deprecated
so it can be removed with Qt6.
Change-Id: I39bec89af14aaefe2e504f5a890ef314574766a1
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
qmlfiles are the same for all ABIs, and installing them for all leads to race condition
Change-Id: I69fe062f59f1d7c028dff5212e2f2fac7e71398d
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
This configure parameter is useful to compile Qt only for a selected ABIs.
The old parameter, -android-arch, does the same thing, it's kept for compatibility.
[ChangeLog][Android] -android-abis configure script parameter useful to compile Qt
only for a selected Android ABIs.
Change-Id: I1f418c7e0914dd83b98d763e8cd8c09841e20fdf
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
- add missing explicit
- drop static from member functions that aren't static in the regular version
(ie. all functions)
As a drive-by, remove redundant inline keyword where it doesn't cause
wanton inconsistency with surrounding code.
Change-Id: I5aed73c3afa85d98d97b57c2c1874b1a5e664960
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This is private API for the time being. Without this the QRhi*
classes show up in the class list in the docs.
Change-Id: I662abb9cc8eaae13ffe9266bd6313faa8e138353
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Multi arch build in one go is need to support the new .aab packaging format.
By default the users apps are built for all Android ABIs: arm64-v8a armeabi-v7a x86_64 x86
The user can pass ANDROID_ABIS to qmake to filter the ABIs during development,
e.g. qmake ANDROID_ABIS="arm64-v8a armeabi-v7a" will build only for arm ABIs.
[ChangeLog][Android] Android multi arch build in one go,
needed to support the new .aab packaging format.
Change-Id: I3a64caf9621c2a195863976a62a57cdf47e6e3b5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
It is no longer needed after qt_dirtyRegion was removed in e2a1fb901.
Change-Id: I120df76b08808842b304cb8de10de23ccd0e2845
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Including renaming the member touched by this function. This leaves the
logic for appendDirtyOnScreenWidget, which still needs investigating.
Change-Id: I405a5e3757f0a79992f88d9f70867aeb7b9764d8
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Change-Id: Icf177a5b559bd1c108a66ee14a51fb23cd36e083
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
As was recently discovered, the debug_and_release CONFIG value is
always true on Windows, even if the feaure is disabled when specifying
-debug or -release when configuring Qt.
In order for the generated CMake Config files to be correct, we need
to use the true feature value.
Amends 44602224bf.
Change-Id: I42be684e8ad2a5ce72cb2e9d36f81de7589112c6
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
If Qt is configured with -release or -debug we must set CMAKE_DEBUG_TYPE
or CMAKE_RELEASE_TYPE, but not both.
This was broken by 82a2c7df which fixed the issue for iOS
simulator_and_device builds.
We have the following situation for both relevant CONFIG values:
debug_and_release build_all
iOS simulator_and_device unset set
Windows -release set unset
Windows -debug-and-release set set
Trivia: On Windows, when configuring with -release (or -debug) then
the *feature* debug_and_release is not set.
The *CONFIG* *value* however, is unconditionally set in
msvc-desktop.conf.
Fixes: QTBUG-77754
Change-Id: I326ecb024056bc189be5fa03ec6f59bc71226544
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
QColorConstant is a C++11 version of Qt::GlobalColor, except that instead
of Qt::red being an enum, QColorConstants::red is an actual QColor instance,
a bit like in the Qt 3 days.
In addition, the SVG names that QColor understands are also available,
with the same values. Technically, when building a QColor from a color
name, QColor ignores casing and whitespaces; we stick to the SVG/CSS
official color names (which are lowercase), and prefix them with Svg
to clarify where they come from. For instance, note how SVG's gray
is not Qt::gray.
[ChangeLog][QtGui][[QColor] Added QColorConstants, a namespace
containing constexpr QColor instances.
Change-Id: Ic9fab26a9a537fcc43cc230da28f4c6314a32438
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
... except four instances in QCoreApplication that would conflict with
another change.
Replace a locally-defined MutexUnlocker with a call to unlock() +
qScopedGuard'ed lock() to avoid having to spell out the locker type
while we can't depend on C++17 CTAD, yet.
In QSettings, move the new mutex locker into and out of
initDefaultPaths(), such as is idiomatic for std::unique_lock, but
wasn't possible with QMutexLocker (which is not movable).
Change-Id: I23056e13ecaa76159db583c7dccc6e05715e0788
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Through some misconceptions about ComPtr I ended up thinking that it did
not call AddRef internally on creation. But it does. This lead to always
having > 1 ref-counter.
Also stop the monitor on destruction if it hasn't already been stopped.
As was already done for QNetworkStatusMonitorPrivate.
Change-Id: Ic72a2f5cb3325f86c018f90b497caaec834cb214
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
We can't use qt_scoped_lock/qt_unique_lock here, so port to
std::unique_lock and std::lock_guard for now.
This is in preparation of deprecating QMutexLocker in favor
of std::unique_lock and std::scoped_lock.
In QFutureInterface, change the return type of mutex() from
QMutex* to QMutex&, so we don't need to deref when passing
to std::lock_guard. We need to keep the old method around
for BC reasons, so the new one needs an artificial function
argument for disambiguation. This will vanish come Qt 6.
Change-Id: I1a0f0205952a249512ec2dbd3f0f48dd209b1636
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The test requires High DPI scaling to be disabled since it
captures widgets.
Turn it off initially and introduce a member variable
containing a suitable size depending on the screen to make the
test pass on High DPI screens without violating minimum window
widths on Windows.
Change-Id: Ida9f306cff6abd48ee5de7001c7670a0da60c6c2
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
- Fix includes
- Add window titles
- Introduce nullptr
- Remove unneeded C-style casts in QCOMPARE
- Replace remaining C-style casts
- Use range-based for
- Fix static invocation
- Fix class structure, add override, use member initialization
- Fix top level widget leaks and add a check
- Silence debug output by using a logging category
- Use Qt 5 connection syntax
Task-number: QTBUG-76497
Change-Id: I77532a517353d04d1da43ce844988ee0ac2ffc7d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
- Replaced the usages of deprecated QWheelEvent::delta() and
QWheelEvent::orientation() with QWheelEvent::angleDelta().
In most of the examples it is acceptable to use only the vertical
component of angle delta.
- Made the docs APIs to build conditionally, based on the
deprecation version.
Task-number: QTBUG-76491
Task-number: QTBUG-76540
Change-Id: Id4230d483f724af49e4b6349b44881c3944de2a2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Is pretty common on some architectures so we can avoid swizzling by
supporting it.
Fixes: QTBUG-45671
Change-Id: Ic7a21b5bfb374bf7496fd2b2b1252c2f1ed47705
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
For tst_QFrame and tst_QOpenGLWidget, force scaling off
since they do screen captures which would fail with
scaling activated due to different device pixel ratios.
For tst_QGraphicsItem and tst_QHeaderView, force
scaling on for Windows since some tests otherwise fail
due to violation of the minimum size constraints of
framed windows on Windows.
The tests will then pass regardless of any environment
setting of the scaling variables on a developer
machine.
Change-Id: Iefa4e84b433f7e51dce4e416546a9eda8ee6d0f1
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Pass the style option to dpiScaled() in order to get
the correct screen DPI. The style option contains the
font, which again contains the current DPI value.
Add QFontMetrics::fontDpi() accessors to get the DPI
from the QFont. This DPI will/should be updated on screen
change.
Replace hardcoded Q_OS_MAC DPI with hardcoded base
DPI. This makes per-screen DPI testable on macOS, too.
Task-number: QTBUG-45055
Change-Id: I75f8b37d45eb50c3334b46b8469a546d29712f1b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
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>
Replace by QT_ENABLE_HIGHDPI_SCALING.
QT_AUTO_SCREEN_SCALE_FACTOR has the usability problem that it mixes
enabling the high-DPI scaling mode with the method of getting screen
scale factors (“auto”). Due to this, it ends up with a slightly
strange name.
QT_ENABLE_HIGHDPI_SCALING matches the C++ option
(Qt::AA_EnableHighDPiScaling), and leaves the scale factor acquisition
method unspecified, possibly to be set by some other means (like
QT_SCREEN_SCALE_FACTORS).
Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io>
Task-number: QTBUG-53022
Change-Id: I30033d91175a00db7837efc9c48c33396f5f0449
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
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>
This makes it possible to test the effects of setting
Qt::AA_HighDpiScaling/QT_AUTO_SCREEN_SCALE_FACTOR, with different DPI
values on all platforms.
This also makes it possible to access the actual DPI values reported
by the OS/WS via the QPlatformScreen API.
A drawback is that there is no single place to check the environment
variable; currently done in three places. This may be
further simplified later on.
Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io>
Task-number: QTBUG-53022
Change-Id: Idd6463219d3ae58fe0ab72c17686cce2eb9dbadd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This test displays a summary of relevant DPI and scale
factor/devicePixelRatio values:
- DPI and DPR as seen by the application
- Input from QPlatformScreen
- Input from environment variables.
Task-number: QTBUG-53022
Change-Id: I340391624b202e342f22902ffbd7228fe7fbe94b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
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>
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>
The test contained outdated baseline images for
1) Windows Vista: They were only used for OS version Vista
and do not match any more.
2) macOS: They were apparently were not in use any more
Remove the testing and image comparison code.
Task-number: QTBUG-76493
Change-Id: I91cec5113db8d1845b43f97ad2987e63d9f86ac7
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>