Calling QWindow::setVisible doesn't have the same semantics, so we
split off QWidget::setVisible into QWidgetPrivate::setVisible and
call that instead from QWidgetWindow.
Task-number QTBUG-67504
Change-Id: Ie50938d4a1d33ad4b59c742e75e3ca30f1b19399
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
For some reason, QCalendarWidget gets filtered press events that were
intended for Qt Virtual Keyboard's input panel (QQuickView), so we have
to make sure that the window is indeed a QWidget - no static_cast.
Change-Id: Ibc9dce956918ac50d1fed8231a445b7338aef09c
Fixes: QTBUG-72925
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Use xilink for ICC and lld-link for Clang.
Change-Id: I13c74339ae9e3e5c97210afd20a53c7e474b873b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The silent and blacklisted selftests of testlib end in a qFatal(), to
test its messaging is handled correctly. However, this prevents hooks
in main() from saving coverage data when we're gathering that. So use
a transient signal handler that longjmp()s back to a setjmp() just
before the qFatal() to let the test complete normally (but, since
qFatal() does something different on MS-Win, don't apply this to it).
Note that testlib's internal FatalSignalHandler handles all fatal
signals *except* SIGABRT, so this isn't over-riding it. (In any case,
this restores the prior signal handler in setjmp()'s catch branch.)
Added missing expected_silent.tap test output while checking that this
change doesn't affect (the rest of) the test output.
Change-Id: I7e460581ad93e26639c066b3229438a66fd299de
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Still do a begin/end reset model in place, which is probably not the
best code but since it's a test and it works it should be enough
Change-Id: Iffaf8d69d5be64ef5e1e359e3d90a1e8174fc13b
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
With verbosity level 0, only the resolved properties are included
in the debug output, which is useful when debugging font resolving.
With verbosity level 1, the family, size, and weights are included,
plus any resolved property that is different from the default value.
Verbosity level 2, the QDebug default, has been kept unchanged,
except removing quotes and spaces by adding nospace() and qPrintable.
Verbosity level 3 includes all properties, regardless of whether or
not they have been resolved.
Levels 1 and 3 also include the resolve mask, to aid debugging.
This gives the following results for a QFont set to 100pt:
QFont(100pt)
QFont(".SF NS Text", 100pt, Weight::Normal, resolveMask=SizeResolved)
QFont(.SF NS Text,100,-1,5,50,0,0,0,0,0)
QFont(".SF NS Text", 100pt, StyleHint::AnyStyle, StyleStrategy::PreferDefault,
Weight::Normal, StyleNormal, underline=false, overline=false, strikeOut=false,
fixedPitch=false, AnyStretch, kerning=true, MixedCase, letterSpacing=0
(PercentageSpacing), PreferDefaultHinting, styleName="", resolveMask=SizeResolved)
Change-Id: Ib4aebd7346ef4a2946cc4450c12730cf7844c3bc
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
to make it work with our new docker-based test server.
Change-Id: I76345a2d3d768b8a571f2c85e69f6a21e9a96d7e
Reviewed-by: Ryan Chu <ryan.chu@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The Mir display server is now Wayland compatible, so a
dedicated Mir client library is no longer necessary.
[ChangeLog][Platform Specific Changes][Mir] The Mir platform plugin has been
removed: use the Wayland plugin when connecting to a Mir display server.
Change-Id: Ibc77698dd45a1afaf29f0d57b5e5cf7bd91735f5
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Top level windows already get their geometry changes via windowDidMove
and windowDidResize.
Change-Id: Ie6370aa290ef48c8b3ac770e77adb57ce43cbb47
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
We don't need to react to updateTrackingAreas, as we only have a
single tracking area that we can add once and forget. By asking
AppKit to track all events in the visible rect, we can also pass
a zero-rect for the tracking area.
Change-Id: I2545712adc49b51904d5adc11f1faca36901b49d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Core Text doesn't actually have a concept of DPI internally, as it
doesn't rasterize anything by itself, it just generates vector paths
that get passed along to Core Graphics.
In practice this means Core Text operates in the classical macOS
logical DPI of 72, with one typographic point corresponding to one
point in the Core Graphics coordinate system, which for a normal
bitmap context then corresponds to one pixel -- or two pixels for
a "retina" context with a 2x scale transform.
Scaling the font point sizes given to HarfBuzz to an assumed DPI
of 96 is problematic with this in mind, as fonts with optical
features such as 'trak' tables for tracking, or color glyphs,
will then base the metrics off of the wrong point size compared
to what the client asked for.
This in turn causes mismatches between the metrics of the shaped
text and the actual rasterization, which doesn't include the 72
to 96 DPI scaling.
If a 96 DPI is needed, such as on the Web, the scaling should be
done outside of HarfBuzz, allowing the client to keep the DPI of
the shaping in sync with the rasterization.
The recommended way to do that is by scaling the font point size,
not by applying a transform to the target Core Graphics context,
to let Core Text choose the right optical features of the target
point size, as described in WWDC 2015 session 804:
https://developer.apple.com/videos/play/wwdc2015/804/
GitHub-PR: https://github.com/harfbuzz/harfbuzz/pull/1484
Change-Id: I830f0cd7a82552422bbe09226e2d571e246fe3f4
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Switch to always using FT_Render_Glyph for all glyph types.
Change-Id: I9427bbffd30a8d1ca92d7ab9a92df8761f6b89c3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Test fails on minimal and offscreen platforms.
Task-number: QTBUG-73522
Task-number: QTQAINFRA-2630
Change-Id: I6260454be35a8bbac1ab683d89fb7b262d3b69ab
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Remove wrong code changing the Bido level of line separators. This
lead to wrong ordering of the string in case the line separator was
meant to be ignored and the string should be rendered in one line. Line
breaks are anyways already reset to the paragraph level by the algorithm
and reordering is done on a line by line basis, so this will work
correctly when doing proper line breaking.
Secondly fix a small bug found while testing the above change, where
we wouldn't set the correct levels for boundary neutrals and explicit
embedding chars because we did that processing before we were fully
done with the BiDi algorithm.
Change-Id: Id88f91cd58d2ab29be864aef34ca1727c1586611
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
The algorithm has been treating DirB inconsistently so far.
initScriptAnalysisAndIsolatePairs was treating it differently
than generateDireationalRuns leading to assertions.
It wasn't visible in our test data, as DirB is in almost all cases the
paragraph separator, where we split strings anyway.
Change-Id: I7dc0e7bbcf30ee84d8781ea06097da023e371f05
Fixes: QTBUG-73238
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Nothing references this, not even commented out debug code, and some
functions doesn't even have implementations.
Change-Id: I344de26a650b1180f0da78eaece5bd5688fdcd95
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Add a simple private QBasicMutexLocker class, and let the
QOrderedMutexLocker operate on a QBasicMutex.
This allows the compiler to inline more things when handling
connections and speeds up activate() a bit more.
without change with change
string based connect: 3621 3368
pointer based connect: 4341 3919
not connected: 433 437
disconnected: 551 538
Change-Id: If979337891178aaeb0b3340b6d4f68b6f86b0260
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The main difference is that QObject itself also holds on reference
on the structure.
Also rename the orphaned flag to objectDeleted for clarity.
Change-Id: Ief9b9ff9c8b9cc3630dcfd29806ed24cd07150e4
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Adn create that data structure on demand on the heap.
This reduces the size of QObjectPrivate if there are no
connections. If we have connections, it'll use the same
amount of allocations and memory as before.
Change-Id: I900f6980a2cd8a5f72c3ad18697b5dd49100217d
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Squeezes another percent of performance out of
QMetaObject::activate().
Change-Id: I620b8c578681280efcc9bec50cfb1020d2afc928
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Refactor activate(), so that we eliminate almost all
checks for signal hooks in the common case.
Here are the benchmark numbers showing the improvement
for 100M signal emissions
without change with change
string based connect: 3836 3693
pointer based connect: 4571 4510
not connected: 479 433
disconnected: 559 522
Change-Id: I394e6ea5d5bc96e298e8cc0c763eed78c8041876
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Measurements show that it's just almost as fast to simply query
the connectionlist directly and avoid both the memory
overhead of the bitfield and the associated bookkeeping.
For connected signals, the difference is not relevant at all.
With a signal that was never connected, removing the bitfield will
cause signal emission to be ~2.5% faster. And if you ever disconnect
from a signal, the bitfields might not be accurate and this can
cause a major slowdown.
Here are some numbers to validate this. All times are measured
in ms for 100M signal emissions:
without change with change
string based connect: 3817 3836
pointer based connect: 4552 4571
not connected: 493 479
disconnected: 2113 559
Change-Id: Ia2c85036afaa7f991b883c8ff812f69cf4580f7e
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: hjk <hjk@qt.io>
And simply emit the signal spy and tracing callbacks in
that code path as well.
Change-Id: I17f65055c7044caf1be58fac94bb7fe3487f3060
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Change-Id: I0f4b372ad3a0cd5e6730ed2e23e738fb06b2aad5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Constructing a QStringRef directly from the string, offset and a
length is UB if the offset + length exceeds the string's length.
Thanks to Robert Loehning and libFuzzer for finding this.
QString::midRef (as correctly used in both changed uses of QStringRef,
since 432d3b6962) takes care of that for us. Changed one UB case and
a matching but correct case, for consistency.
In the process, deduplicate a QStringList look-up.
Added tests to exercise the code (but the one that exercises the
formerly UB case doesn't crash before the fix, so isn't very useful;
the invalid read is only outside the array it's scanning, not outside
allocated memory).
Change-Id: I7051bbbc0267dd7ec0a8f75eee2034d0b7eb75a2
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The timeout will never be larger than numeric_limits<quint64>::max(),
especially on platforms with 32-bit longs.
Instead, test if the timeout is exactly numeric_limits<unsigned long>::max(),
which matches the ULONG_MAX value which is documented
to indicate no timeout.
Change-Id: Ib663eddb5703797c50c04fd4eae60bd64f379d1c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Most people expect dynamic opengl the default, when configuring Qt on
Windows and are not too happy if they have to reconfigure and rebuild when
they they find out, that the default is ANGLE.
Dynamic OpenGL is the way to go as the user can easily decide what to use
by setting the QT_OPENGL environment variable. Besides that, our packages
are built using dynamic OpenGL on Windows
[ChangeLog][configure] The default OpenGL configuration changed from ANGLE
to dynamic OpenGL.
Change-Id: Ia5688249e6d0a4d3ebe8cbe22e02fe290d9f0a4c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Consistently use space before line continuation marker.
Change-Id: Ib87d45f76b6fd174c78a04335f06b4dbed1bed13
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Adds QColorSpace and QColorTransform classes,
and parsing of a common subset of ICC profiles
found in images, and also parses the ICC profiles
in PNG and JPEGs.
For backwards compatibility no automatic color
handling is done by this patch.
[ChangeLog][QtGui] A QColorSpace class has been added,
and color spaces are now parsed from PNG and JPEG images.
No automatic color space conversion is done however, and
applications must request it.
Change-Id: Ic09935f84640a716467fa3a9ed1e73c02daf3675
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
WINAPI_PARTITION_PHONE_APP is defined for all our winrt mkspecs nowadays
so the code can be used unconditionally.
Change-Id: I4f2b60a0b9bba5b407ebbc213c44a0e5b4057855
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Our bundled ANGLE library only partially supports OpenGL ES > 3.0 so warn
users that there might be dragons.
Change-Id: I16711fe9f449e85dd8b2369e1fcec6c9f81d5ae0
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
Even though our ANGLE versions only partially supports OpenGL ES > 3.0,
there are users who want to use functionality that is available. By
setting major and minor version we can support this use case.
Fixes: QTBUG-72762
Change-Id: I9a1d3009355693baa971deb3c4bbf14c595edf0b
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
Our current ANGLE version (chromium/3280) relies on validation to be done
when doing the rendering, as the validation at the same time completes the
caching. Skipping the validation caused asserts and rendering issues.
The part of the validation that failed before is now deactivated in Qt's
copy of ANGLE as it is not relevant for our use case, so that validation
can be re-enabled now.
This reverts commit a1dec825f9.
Fixes: QTBUG-73317
Change-Id: I5fd176eaa0bc28d93ca93019b7092211fe5bcce5
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
We run into validation issues when using the ES2 code path when blitting
widgets on winrt. By using ES3 we not only avoid this issue, but there
might also be performance gains.
We now call window()->format() instead of window()->requestedFormat as the
latter will not respect the values that were set on initialization of the
native window (which is done in QWinRTWindow's constructor).
Change-Id: I5ed7a9326691375f9c9cb5d8d22ee8d1b643fbd0
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
configure.json: Make the “thread” feature be allowed
for wasm but disabled by default.
Change qmake.conf and wasm.prf to enable Emscripten
pthreads mode:
- Add USE_PTHREADS=1 linker flag
- Add PTHREAD_POOL_SIZE linker flag with a default pool size (4).
- Add TOTAL_MEMORY linker flag to set available memory (1GB)
It is possible to override options such as PTHREAD_POOL_SIZE
from the application .pro file using QMAKE_WASM_PTHREAD_POOL_SIZE
To change TOTAL_MEMORY, use QMAKE_WASM_TOTAL_MEMORY
Make qtloader.js work in pthreads mode:
- The Module.instantiateWasm callback must provide the module
in addition to the instance to Emscripten.
- Set Module.mainScriptUrlOrBlob so that the pthreads web workers
can access the main script
Task-number: QTBUG-64625
Change-Id: I1ab5a559ec97c27c5fc24500ba5f863bcd275141
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
The source map location can be configured by setting
QMAKE_WASM_SOURCE_MAP_BASE in the .pro file. Fall back
to “http://localhost:8000” if not set.
Task-number: QTBUG-72002
Change-Id: I9da80dacdefc272f267e5db4caac274d93ba4479
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>