Compare commits

...

87 Commits
dev ... 5.12.7

Author SHA1 Message Date
Dimitrios Apostolou
4903e45231 Blacklist test that times out on windows
It seems something is going on with infrastructure and all windows VMs are
slower. Blacklisting until we figure it out.

Task-number: QTBUG-82717
Change-Id: Icab430125747df0a2d0ea4da8093a33ae75c5f13
(cherry picked from commit 19aa8de06cf43aa375aeb2609003beb71ad4cac0)
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2020-04-23 11:31:13 +03:00
Antti Kokko
1bf5d3af1a Add changes file for Qt 5.12.7
Change-Id: I09407d3a542fe73e7788785b4d8ff952cbbfb9ed
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-01-24 07:54:31 +02:00
Andy Shaw
3f31b643b1 Fix CVE-2019-19880 in SQLite
Fixes: QTBUG-81565
Change-Id: I6bf2364e696315e5262d1abfa2f0b6947f14a33b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f59ef938ce384b80819bcea660cf8626ff1789e7)
2020-01-24 05:54:04 +00:00
Thiago Macieira
eb192256e7 QLibrary/Unix: do not attempt to load a library relative to $PWD
I added the code in commit 5219c37f7c98f37f078fee00fe8ca35d83ff4f5d to
find libraries in a haswell/ subdir of the main path, but we only need
to do that transformation if the library is contains at least one
directory seprator. That is, if the user asks to load "lib/foo", then we
should try "lib/haswell/foo" (often, the path prefix will be absolute).

When the library name the user requested has no directory separators, we
let dlopen() do the transformation for us. Testing on Linux confirms
glibc does so:

$ LD_DEBUG=libs /lib64/ld-linux-x86-64.so.2 --inhibit-cache ./qml -help |& grep Xcursor
   1972475:     find library=libXcursor.so.1 [0]; searching
   1972475:       trying file=/usr/lib64/haswell/avx512_1/libXcursor.so.1
   1972475:       trying file=/usr/lib64/haswell/libXcursor.so.1
   1972475:       trying file=/usr/lib64/libXcursor.so.1
   1972475:     calling init: /usr/lib64/libXcursor.so.1
   1972475:     calling fini: /usr/lib64/libXcursor.so.1 [0]

Fixes: QTBUG-81272
Change-Id: I596aec77785a4e4e84d5fffd15e89689bb91ffbb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e6f1fde24f77f63fb16b2df239f82a89d2bf05dd)
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2020-01-23 21:53:55 -08:00
Tor Arne Vestbø
e2f35fa684 QWidget: React to platform surface being created or destroyed
The platform window may create or destroy its surface from other entry
points than the QWidget API, in which case QWidget needs to sync up
its own state to match. In particular WA_WState_Created and the winId
needs to be recomputed.

Fixes: QTBUG-69289
Fixes: QTBUG-77350
Fixes: QTBUG-80859
Change-Id: I769e58ead3c2efcf8c451c363108848feade9388
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
(cherry picked from commit 009abcd7b66738bece6cf354776dfb2ef401636b)
Reviewed-by: Liang Qi <liang.qi@qt.io>
2020-01-23 13:45:56 +01:00
Kari Oikarinen
9d43d55b21 Merge 5.12 into 5.12.7
Change-Id: Ibc8bb93b238b79c7beacbb69ed2f691333af3af4
2020-01-23 11:53:12 +02:00
Rolf Eike Beer
303e9168eb eglfs: find correct framebuffer index even if device node is symlink
Using the Vivante driver on a board with different device trees I found the need
to let udev point me to the framebuffer actually connected to HDMI by adding a
symlink. Since the extraction of the framebuffer index failed and always
returned 0 the GUI still always showed up on the first framebuffer.

Change-Id: Ib4aa0fdd6e85d296c17fd977921cbc78e52dcdcf
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit dd23313d66846022894b56ad25b6c2c0fdb54762)
2020-01-22 18:10:11 +01:00
Andy Shaw
5e32c51b7a Fix CVE-2019-19646 in SQLite
Task-number: QTBUG-81020
Change-Id: I7176db20d4a44b1fb443a6108675f719e9643343
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3b697f496303bd005ae9d1d2c974efeed259d8a3)
2020-01-21 05:49:37 +00:00
Jani Heikkinen
182868f4d0 Bump copyright year
Change-Id: I9468ef21a2cf03cf07c38f012a2aa9bae6d02a03
Reviewed-by: Johanna Äijälä <johanna.aijala@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 1e42c97cf055ac20352d20150e2786c14565ea2b)
Reviewed-by: Akseli Salovaara <akseli.salovaara@qt.io>
2020-01-20 08:17:46 +00:00
Jani Heikkinen
b84e1f0526 Update enterprise license agreement v4.2.1
Task-number: QTBUG-80661
Change-Id: Ic730a83465dffa2b1076c03a47d6f97a3a9a53a5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 860d10247425937de1dd48976e3677ced0f509d2)
2020-01-19 06:58:50 +00:00
Pasi Petäjäjärvi
a649475339 Add touch input device mapping support via QT_QPA_EGLFS_KMS_CONFIG
To be feature parity with evdev touch which already supports this

Change-Id: Ie7f9c868ea888725b24c3855106e1c0c0ba943a9
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 6224130cc821b0ef0dbdda80837e872c7996b916)
2020-01-18 09:37:31 +02:00
Thiago Macieira
567837a742 QObject: make the connectedSignals member use QAtomicInteger
The bitfield is always mutated under a mutex lock, so there's no need
for atomic bit operations. This is needed because there's one
outstanding access (in isSignalConnected()) that is done outside the
mutex.

Not needed in 5.14 because commit a5a859e721e7a1d0c5a3ec6abe2db55d9144bb36
removed the bit field altogether.

Fixes: QTBUG-81376
Patch-By: Chris Thornton
Change-Id: Idc3fae4d0f614c389d27fffd15ea1d372968f8f1
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2020-01-15 13:26:00 -08:00
Tor Arne Vestbø
07c33ab76f Guard against null-nativeParent in QWidgetBackingStore::markDirtyOnScreen
The back port in 1e310b5a4508f removed the check in two of the call sites
for this function, that in 5.14 were handled elsewhere, but for 5.12 caused
us to not guard against null-nativeParent windows anymore.

Change-Id: I698c5a0b6a54bbee37b533fcafa75129768c5db1
Fixes: QTBUG-81315
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-01-15 15:45:23 +01:00
Jani Heikkinen
bdccc51bc1 Fix configure after updating qt license file
License file (LICENSE.QT-LICENSE-AGREEMENT-4.0) was recently updated to
version 4.2 and that broke the configure.

Remove qt license file version number from file name to avoid configure
update need when license file is updated

Change-Id: I77b4a4e7c6e590bbbce79d1c86cbcfb965841eae
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit a5cbff60f063d271500e31eba5bd236741d2367b)
Reviewed-by: Akseli Salovaara <akseli.salovaara@qt.io>
2020-01-15 05:18:32 +00:00
Jani Heikkinen
044ac31b24 Update Qt enterprise license agreement file to version 4.2
Change-Id: I4c42f92bda472aad5b0a0ebb92c6a982f1f64714
Reviewed-by: Akseli Salovaara <akseli.salovaara@qt.io>
(cherry picked from commit 0b2f13924263ad37e1654a856deb26601d09c4b4)
2020-01-15 05:18:25 +00:00
Morten Johan Sørvig
3f23d27dd5 Use QPointer for QWindow pointers in QGuiApplication
Guard against stale pointers; Use QPointer instead of
raw pointers for QGuiApplicationPrivate state variables.

Change-Id: Ie4f980f13dafe9729c1898b8fac7d26a87d2ca59
Fixes: QTBUG-80355
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-01-14 15:11:42 +00:00
Andy Shaw
cb5f69882e Fix CVE-2019-19645 in SQLite
Task-number: QTBUG-81020
Change-Id: I58b1dd9e7a90ba998c3af7f25a4627d8bdd70970
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1e89c132e1280276e1d3a82ec3464afec8c14c3a)
2020-01-13 21:51:09 +00:00
Alexander Volkov
3271df912b QKeySequence: Add missing names for multimedia keys
Task-number: QTBUG-40030
Change-Id: Ib34bcbf42d6dd1206209c2d76444fd8c777278fe
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit fcbf15c97bac91a889eccaa0cfad10093fd052f0)
2020-01-13 16:00:21 +03:00
Andy Shaw
1253069f65 Fix CVE-2019-19603 in SQLite
This includes the patch needed to fix this CVE and a supporting one to
include a new function added that it depends on.

Task-number: QTBUG-80903
Change-Id: Ic7639d50c89a3ee7d45426588c3ab0efd0eebb72
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a75d238b3194ae4973be7f6ce0508a526d4aa49e)
2020-01-12 12:45:59 +01:00
Thiago Macieira
5839535c9f ucstrncmp: Fix UBSan report of array overflowing
The expression "a + offset + N" will eventually calculate an address
past the end of a, since we are comparing to end. That's undefined
behavior. Instead, calculate end - a and compare that to offset + N.

This commit subtracts "a" from both sides of the inequalities and swaps
the two sides to make them obey Qt coding style. Testing with GCC 9
(which is the only one I care about) shows the compiler generates the
same code.

Fixes: QTBUG-81218
Change-Id: Id84da383373844f3a4b0fffd15e7c1ab904daccd
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
(cherry picked from commit 64359ad710756e7cca5ca553521b2aada18fb0fe)
2020-01-11 07:33:11 -08:00
Andy Shaw
440a6ac65f Fix CVE-2019-19242 in SQLite
Task-number: QTBUG-80903
Change-Id: I78a72a574da5cf3503950afe47146ae6424f00c6
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit dcef0b96eef04c4e17c2e51ea71aea1f78625864)
2020-01-10 08:03:46 +01:00
Joerg Bornemann
ed54545d0d Fix dependency resolution for extra compilers in VS projects
De-duplicate the code that calls the extra compiler's depend_command by
using the central function callExtraCompilerDependCommand. This one
actually tries to resolve dependencies unlike the removed code that
blindly resolved relative paths to the build directory.

This fixes dependencies reported by uic which need to be resolved
against what is in DEPENDPATH.

Fixes: QTBUG-80579
Change-Id: If482e50ff3eff716fefffee82004acc076b3a547
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
(cherry picked from commit 9d7ed92f6e63cd2d1a1388874e54b37b5cfd01b7)
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-01-09 19:44:09 +01:00
Joerg Bornemann
96df877ebc De-duplicate code for calling extra compiler depend_command
Flesh out copy-and-pasted code into a function and adjust the coding
style on the go.

This refactoring is needed for a subsequent fix.

Change-Id: I9b8a87d6dd5c33cc1ed9f613fe85daca52309369
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
(cherry picked from commit af7e0e735777d7f7d1606049e5261106a092665a)
2020-01-09 19:44:04 +01:00
Andy Shaw
9c80104cfd sqlite: Update to v3.30.1
Since the patch applied previously is no longer required, we have
removed that too.

[ChangeLog][QtSQL][sqlite] Updated to v3.30.1

Fixes: QTBUG-79416
Change-Id: Ifc3fcc6e1768f80e97a5e0ab4b2aeabddf2ced9d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
(cherry picked from commit 11acbc2c9928603dae6b4e2f1ca8b745e766f92b)
2020-01-08 12:36:12 +00:00
Qt Forward Merge Bot
3dd88d367f Merge "Merge remote-tracking branch 'origin/5.12.6' into 5.12" 2020-01-08 09:52:30 +01:00
Qt Forward Merge Bot
9eac4b1faf Merge remote-tracking branch 'origin/5.12.6' into 5.12
Change-Id: Idcbf469ddcd6824f97a56c5e3a2e5fcc1d9706cf
2020-01-07 11:51:48 +01:00
Tor Arne Vestbø
0b4bfe1757 macOS: Skip uninitialized buffers in IOSurface backingstore
Task-number: QTBUG-80972
Change-Id: Ifb8eb84d6b802556ccd52ac129a91e142e265a81
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 77f1d0bfa542e166deaa196b3b3b854d33a3a1b7)
2020-01-07 11:40:04 +01:00
Tor Arne Vestbø
25e20ae39e macOS: Handle missing color space information in IOSurface backingstore
Fixes: QTBUG-80972
Change-Id: Iab3f1a9cf03251340e5f32bcc73103428e93282d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 105e662221cc90d5002e06c97febf50c5c601336)
2020-01-07 11:40:00 +01:00
Tor Arne Vestbø
2a0186420c macOS: Don't throw away backingstore buffers when backing properties change
Clients such as QtWidgets that do their own dirty tracking will assume
they can just flush in response to the expose event, without repainting
anything. Since we have no way at the moment to inform these clients that
the backingstore content might be invalid we can't just throw it away.

It turns out that to pick up changes in color spaces we can just tag
the existing buffers with the new color space, so we don't need to
throw it away. And for the older surface-backed mode we tag the color
space on flush, so we didn't need to invalidate anything in the first
place.

Fixes: QTBUG-80844
Task-number: QTBUG-77749
Change-Id: Icb1ceb178894bb43887cdf03fb855d2d614b5ab0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 7ac4e55cb979dff890f1575e771e5f2def9e3131)
(squashed in commit c027d9b61e15)
2020-01-07 11:39:57 +01:00
Michal Klocek
28b138cbc2 Add check for global share context for QOpenGLWidget initialize
Fixes: QTBUG-78863
Change-Id: I678f66a2057fb9c98863e19eb09042306e72f68a
(cherry picked from commit ce2fc51914f809369d5096e7a0621229dd9eaef9)
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-12-19 16:44:57 +02:00
Andy Shaw
277b8dde1a Fix CVE-2019-19244 in SQLite
Fixes: QTBUG-80635
Change-Id: I718349e28ec76ea164dd50f2a985f2074dd6bdbd
Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
(cherry picked from commit a7108ec6cfb6411e40a4012f3e6d3b5d5fb9631d)
2019-12-11 14:24:13 +00:00
Alexander Volkov
7110eb7ca1 Avoid crash in menu that was previously shown as submenu
Reset sloppyState for the previous submenu, so that if it
will be shown as a menu, it will not use an incorrect pointer.

Fixes: QTBUG-80528
Change-Id: If2ba8c3a664983ee76eb90d2c9a8096e2bd0a4e6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 8339ce2155752eb8fa0f49f3fe4b24f9643ae463)
2019-12-10 14:29:06 +03:00
Laszlo Agocs
d96bbd999f Fix depth in renderText()
Fixes: QTBUG-31156
Change-Id: I3cbb3f9c5dfbcb182dbe283b0bf0f05a031970a5
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
(cherry picked from commit c625d923853d01ad668dd3e8ebd55b7e5a6bcdb8)
2019-12-09 12:32:51 +01:00
Lars Schmertmann
b8e404f6d0 Remove dead code to fix a lint warning
Obsolete SDK_INT Version Check
------------------------------
This check flags version checks that are not necessary,
because the minSdkVersion (or surrounding known API level)
is already at least as high as the version checked for.

The mindSdkVersion in templates/AndroidManifest.xml is 16 for Qt 5.12
and androiddeployqt also ensures that the minSdkVersion is not below 16.

Change-Id: Ifdb6f773dccdb75c35119df833c976b7b76b3356
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-12-06 14:22:05 +01:00
Volker Hilsheimer
13bbb1d9b9 Fix sizeHint of QProgressDialog to have enough space for window margins
Some styles, notably QMacStyle, use different margins for widgets and
for windows. For these margins to be returned correctly, we have to
tell the style that we want them for a toplevel widget. This was
done correctly when laying out the dialog, but not when calculating the
sizeHint, leading to a default size of the dialog that was too small
to fit the text.

As a drive-by, change variable names in the sizeHint method to be a
bit more readable.

Change-Id: Ib4168c7be176fa816241ebcc5f9235db4a7f982f
Fixes: QTBUG-80272
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-12-03 17:05:57 +01:00
Tor Arne Vestbø
6cddd0e8cf iOS: Guard against request for textInputView without focus window
Change-Id: I7b8df07fffef1cc948f6720685234540a20ccc81
Fixes: QTBUG-79316
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 9ac156c90b92a981f70929e081c64083b14e9a57)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-12-03 09:18:32 +00:00
Liang Qi
1e5566c2e9 Revert "Fix build with -no-feature-printer"
This reverts commit de8bd9ec6b21e3b43b08c4c2588b5116a7ca8ece.

We need to keep the empty printsupport library for ios at least.

Fixes: QTBUG-79124
Task-number: QTBUG-80323
Change-Id: I543a76a897eec2c9bc51a3f2d080be3a9cc07871
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-12-02 13:18:37 +01:00
Kai Koehne
13c19db171 Fix regression in how "pkg-config --static" output is handled
Change a1ea49878927dfe2 did replace different pkg-config calls for
-L, -l arguments to one. Anyhow, it also removed the eval() call that
ensured that the return string was split by whitespace, meaning that
paths couldn't resolve anymore properly if multiple arguments were
returned.

Fixes: QTBUG-79668
Change-Id: I4091fea6891ef79836e05f8e87ffa9d69863a8f5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 99e43db7cea1c838993c151d2d40fc2874a94256)
2019-11-27 11:40:46 +00:00
Tor Arne Vestbø
1e6a680f83 CoreText: Modernize style hint fallback lookup
The DefaultFontFallbacks.plist system file that we used for looking up
style fallbacks does not exists in macOS 10.15, nor did it ever exists
on iOS. Instead of relying on this file, we hard-code a set of default
families, that we then look up the fallbacks for.

The result of QFont::defaultFamily() on macOS is now:

  QFont::Helvetica --> "Helvetica"
  QFont::Times --> "Times New Roman"
  QFont::Courier --> "American Typewriter"
  QFont::OldEnglish --> ""
  QFont::System --> "Lucida Grande"
  QFont::AnyStyle --> "Lucida Grande"
  QFont::Cursive --> "Apple Chancery"
  QFont::Monospace --> "Menlo"
  QFont::Fantasy --> "Zapfino"

And on iOS:

  QFont::Helvetica --> "Helvetica"
  QFont::Times --> "Times New Roman"
  QFont::Courier --> "American Typewriter"
  QFont::OldEnglish --> ""
  QFont::System --> "Helvetica"
  QFont::AnyStyle --> "Helvetica"
  QFont::Cursive --> ""
  QFont::Monospace --> "Menlo"
  QFont::Fantasy --> "Zapfino"

Fixes: QTBUG-78240
Change-Id: Ie9bc13c9c1031d89f024199e4736a046c568a48d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
(cherry picked from commit 7f0faddf9fe25adc0a3e0827e21c030d6a7a1035)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-11-27 11:38:27 +00:00
Alexey Edelev
89bd5a7e73 Replace get_filename_component usage with REGEX_REPLACE
Replace get_filename_component usage with custom string
REGEX_REPLACE to avoid cutting non-ending suffices while
moc generation

Fixes: QTBUG-80295
Change-Id: I8cdb729370c6d884f6638d172ee523fdc2df5404
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-11-27 09:58:28 +01:00
Laszlo Agocs
a5a37a7529 eglfs: kms: Read page flip events on a dedicated thread
Task-number: QTBUG-74953
Change-Id: I9a630c9245d8b0afe40ade9199cf4f1d358275da
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
(cherry picked from commit 14bb413309092adc53e8451daff5690c4698c07d)
2019-11-26 14:37:05 +01:00
Laszlo Agocs
5705133066 eglfs: kms: Make threaded atomic drm work
The atomic modesetting support was not prepared for page flips being
issued from different (per-screen) threads.

This could be seen with the threaded render loop of Qt Quick: having a
QQuickWindow per screen means having a dedicated render thread for each
screen. QKmsDevice used simply instance variables to keep track of the
request. This leads to the commit failing with EBUSY sooner or later.

Make the atomic request and related variables thread local.

This prevents failing drmModeAtomicCommit() with 2 or more screens and
the threaded render loop. It does not fix other potential issues when
waiting for page flips to complete, that is to be tackled separately.

Task-number: QTBUG-74953
Change-Id: I2dac10d5e9bdc0cb556ac78c9643c96d40d692e4
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
(cherry picked from commit 5bd48047de4abecc47187d938c5e6ed8b8304aaf)
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-11-26 14:37:01 +01:00
Andy Shaw
d1b009cbbb Remove the unregistered recognizer from the main list
This amends 1320b2f64412f0d86bd09c66c22df845e13a94a1 to keep the
behavior of removing from the main list but without re-introducing the
memory leak.

Fixes: QTBUG-77770
Change-Id: I91fa6cb71fab8d60baa35417fdb34322af11dbbb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 7d73d4b9a93b3132c1a24aa3ae77f0a307e821fd)
2019-11-15 15:03:13 +00:00
Andre de la Rocha
2812f0861c Windows QPA: Fix close button not working on Windows 7
A previous change modified hit testing in the non-client area of
fixed-size windows, in order to prevent showing a resize cursor when
the windows are not resizable (QTBUG-77220). The change assigned
HTCAPTION for any point over the entire title bar, including the top
bar buttons, which on Windows 7 classic or basic desktop caused these
buttons to become unresponsive. The present fix changes this behavior
to redefine only the outer sizing frame, while letting the rest of the
title bar be handled by DefWindowProc().

Fixes: QTBUG-78262
Change-Id: Id6e821a805c8333a67988f87c3727bed0c93290e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit a8ec52d5e76bc769ed63be1ad543be8f687e5dac)
2019-11-13 12:48:33 +01:00
Olivier Goffart
52b739776d Do not load plugin from the $PWD
I see no reason why this would make sense to look for plugins in the current
directory. And when there are plugins there, it may actually be wrong

Change-Id: I5f5aa168021fedddafce90effde0d5762cd0c4c5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit bf131e8d2181b3404f5293546ed390999f760404)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-11-13 10:46:36 +01:00
Andy Shaw
f0b93f7a4b iOS: Account for UITextInteraction when building against 12.x or lower
In iOS 13.0 we can handle UITextInteraction as normal, but in lower
versions it is not available to utilize at compile time. So we have to
check for the other types instead and return if it is not one of those.

Change-Id: Icbc5558e677ed40c03f30a174e2d79b87f489f68
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 3916b8a28bc9c55e10f4de611ed76e17017494aa)
2019-11-08 15:57:07 +00:00
Frederik Gladhorn
fa2323e37b Bump version 2019-11-07 13:06:44 +01:00
Kari Oikarinen
1930af194c Merge 5.12 into 5.12.6
Change-Id: I281538c2c9fc5d97a4b65d8add80e4eb1407ab7d
2019-11-07 09:27:42 +02:00
Antti Kokko
f73cd386c3 Add changes file for Qt 5.12.6
Change-Id: Iff5f92f9d947a8b557aab87a36b3a91e335d1a4b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-11-06 11:55:06 +01:00
Joerg Bornemann
515e9a1427 Ignore non-existent .ui file dependencies
Commit 80dea664 broke .ui files with global includes that are not part
of the project, because we blindly added every file path that falls
out of 'uic -d' as dependency.

Introduce the extra compiler CONFIG flag dep_existing_only to bring
back the old behavior that ignores non-existent dependencies and set
it for uic.

Change-Id: I6eaa82817c932a98ebac6d08115a9815d4b9dd21
Fixes: QTBUG-78144
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
(cherry picked from commit 90779d96adfa51a3fc00b6c0d93168b4bbfcf983)
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-11-06 08:03:39 +00:00
Andy Shaw
40b33adb7a Ensure that child windows are visible again when showing their parent
When a window is closed, then it will cause the child windows to be
closed as well as a result. Therefore in order to ensure that they are
shown again as a result, we need to remove the WA_WState_ExplicitShowHide
attribute if the widget was not already hidden before. This enables us to
test for this attribute when calling showChildren(), so that if the
window has a windowHandle then we can make sure that this widget is shown
again.

Fixes: QTBUG-73021
Change-Id: I1186242b889899dfcd38d782a67567348e2055ee
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit ccd3bf0871b81dfc09bb469b161f32dfb47ee53e)
2019-10-31 08:53:41 +00:00
Frederik Gladhorn
15f29c3a24 Bump version 2019-10-30 15:26:06 +01:00
Eirik Aavitsland
7bbbfc38ce Update bundled libjpeg-turbo to version 2.0.3
[ChangeLog][Third-Party Code] libjpeg-turbo was updated to version 2.0.3

Squashed cherry pick of:
e14e8427faae670c662efede723edc2db4c875cb
97e78b0e1f0396cdee0319bafaf8ce1d6eb74f64
f3dbe98dca58731ff98dff3cc9111a8252f8e1e6

Change-Id: I9f9b8b3a913fd5843759c0610f43b22c5bee67dc
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-10-30 11:04:01 +01:00
Andy Shaw
c6d07c5418 Only call ShowCaret if Windows 10 1709 or later is used
This amends cc873ec23a98ac32d10ac5fa569792fde2f6b2c8 which worked around
a problem that was showing up on earlier versions of Windows. This
extends the workaround up to Windows 10 1703 as the problem was still
occurring up to that version.

Fixes: QTBUG-79143
Change-Id: Ib7eace17fb8e3817c556e2bcd462e37834b1cbcf
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
(cherry picked from commit be73bdc5d2491d036e5a6334dada453ed808dbc0)
2019-10-30 08:14:22 +00:00
Ville Voutilainen
a4a5b4288e Fix a -Wclass-memaccess problem in qjson
qtbase/src/corelib/serialization/qjson_p.h:230:38: error: ‘void* memcpy(void*, const void*, size_t)’ copying an object of type ‘QJsonPrivate::qle_ushort’ {aka ‘class QSpecialInteger<QLittleEndianStorageType<short unsigned int> >’} with ‘private’ member ‘QSpecialInteger<QLittleEndianStorageType<short unsigned int> >::val’ from an array of ‘const class QChar’; use assignment or copy-initialization instead [-Werror=class-memaccess]
  230 |           str.length()*sizeof(ushort));
      |                                      ^

Change-Id: Ie58e7fe4bae3003227364012ad56ab23bd560d8c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
(cherry picked from commit 9367d966e6c10c95b92f2b55e2cead7e85d80cfe)
2019-10-28 13:52:49 +03:00
Eskil Abrahamsen Blomfeldt
8476ac456e Revert "Release left button before showing the popup context menu"
This partially reverts commit 5e8b16f0e4247cc978b08480450526cfa3b25029.
Releasing the mouse button synthetically made it impossible
to use tap and hold gestures. When investigating, it seems
that other changes have fixed the original issue that
5e8b16f0e4247cc978b08480450526cfa3b25029 was meant to address,
so this is no longer needed.

[ChangeLog][Android] Fixed regression that made it impossible for an
application to use the tap-and-hold gesture.

Fixes: QTBUG-72408
Change-Id: I53f687d047a4ad0fdf3c8c96a00ed1b11d09f047
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
(cherry picked from commit d3398207d0384e786f466662fa40c6fb86844fb6)
2019-10-25 14:29:57 +02:00
Friedemann Kleint
cb90cdbd65 Windows/MinGW: Fix posted events timer not stopping
Specify the type of the enum value SendPostedEventsWindowsTimerId
to be UINT_PTR to work with the g++ interpretation of enumeration
signedness and use the correct type for the returned timer id.

Fixes: QTBUG-78491
Change-Id: I7b3f306d3f60da7a21500ece5243ac90854ccf1a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d35de9e1b250ce46739dcb6afb9ae8a0247195c7)
2019-10-24 11:29:50 +02:00
Eskil Abrahamsen Blomfeldt
e1e4b1b780 Remove DirectWrite warning when loading bitmap fonts
We use DirectWrite to determine whether a font is a color font
or not, so all fonts go through DirectWrite initially. However,
the load call will fail for bitmap fonts, causing us to output
lots of pointless warnings each time such a font was in use.

Instead, we only output this warning if we actually plan to
load the font through DirectWrite later. If the load fails,
we can assume it is not a color font and do not need to output
any warning for this.

[ChangeLog][Windows][Text] Removed confusing DirectWrite warning
when loading bitmap fonts.

Task-number: QTBUG-57180
Change-Id: Iaac8117745ef05a1dff23b346dbe0c6dbfb315f7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit c4a524f3a129ad9ab6d08cd8de2dc917e3d78fc5)
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-10-21 13:56:27 +00:00
Tor Arne Vestbø
197dfcd36f macOS: Optionally flush sub-layers via sub-image copies of the backingstore
When we're flushing the backingstore to sub-views with their own layers
we don't want to pay the cost of uploading the whole backingstore to the
GPU in the case where we're dealing with a discrete GPU.

To work around this we make a copy of the appropriate part of the surfcace.

This results in additional copies of the data, and will need further
investigation to limit these.

Task-number: QTBUG-77447
Change-Id: I318ae80e433dd7b0a55fd5a598b19f114d8bd28e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit eaf4911db29a82b3d94826a8ff09afe075a2b636)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-18 13:42:51 +02:00
Andy Shaw
45237fa54c iOS: Account for when the older SDK is used when building
Since the pre-built versions of Qt at this point are still built against
the iOS 12.x SDKs, then we need to account for this in order to have the
workaround implemented in e00d888daefbfbd5f17e0772421773f8e295087b still
working when deployed to an iOS 13 based device.

Change-Id: I649a453c549ee272de64624d68f9382276fcba64
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 631efee29371246ba1a1d9d007b23ca08b867191)
2019-10-18 11:40:28 +00:00
Joerg Bornemann
f470cc2da9 Fix assert in VS project generator
We must check whether outputs or inputVars are non-empty before
accessing them.

This amends commit 68866b1a.

Task-number: QTBUG-79178
Change-Id: Iecf6dc705bac9bef5133ae2e5ceeace5f859f175
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit d3d5eadf2432ddc874eabbb2d2f56c4b9ff8830f)
2019-10-16 13:31:34 +02:00
Volker Hilsheimer
31f07f3114 Fix for compilers that don't allow casting nullptr_t to an integer
Visual Studio 14.0 toolchain at least seems to be broken enough to
somehow interpret the cast from nullptr to a quintptr as being
ill-formed, inspite of it being valid C++.

Change-Id: Ifb29be3af82764cb31fa65409f7e1000ea419498
Fixes: QTBUG-79080
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2019-10-14 20:07:27 +02:00
Timur Pocheptsov
28798478ba DTLS auto-test(s) - fix a buggy logic with pending datagrams
Fixes: QTBUG-79128
Change-Id: Ifebd5b056541b7732b15b5cf063ad22ab754a64c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-10-11 02:32:37 +00:00
Edward Welbourne
1fd2124de7 Include likely-adjusted uiLanguages for the system locale
QLocale::uiLanguages() on the system locale uses whatever the system
locale's query(QSystemLocale::UILanguages,...) returns. On Android,
this is just a list of locales. However, for non-system locales, we
also include some results of removing likely sub-tags from the locale
name, where equivalent. Thus zh-CN would also get zh and zh-Hans-CN
added to it; however, if the system locale is zh-Hans-CN, the shorter
forms are omitted. So post-process the system locale list in the same
way, albeit tweaked to avoid duplicates and rearranged so that we can
insert likely-adjusted entries between what they adjust and what
followed it.

Added QLocalePrivate::rawName() in the process, since it looks likely
to be useful in other contexts (and I needed its value): it just joins
such tags as are non-Any. This, however, uses QByteArrayList, so added
that (it's small) to the bootstrap library and qmake.

This follows up on commit 8796e3016fae1672e727e2fa4e48f671a0c667ba.

[ChangeLog][QtCore][QLocale] The system locale's UI languages list now
includes, as for that of an ordinary locale, the results of adding
likely sub-tags from each locale name, and of removing some, where
this doesn't change which locale is specified. This gives searches for
translation files a better chance of finding a suitable file.

Fixes: QTBUG-75413
Change-Id: Iaafd79aac6a0fdd5f44aed16e445e84a2267c9da
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 0118e2e9151ae3e1e1cd72f24e8c129eaa69dc4f)
2019-10-10 19:11:00 +00:00
Thiago Macieira
f2e9505aa1 Filesystem: avoid crashes on exit in case the locale codec is null
On exit, QLocale::codecForLocale() can return null as the codec may have
already been destroyed. In that case, pretend that Latin1 was the
locale, so any file name is acceptable. This matches QString:

    QTextCodec *codec = QTextCodec::codecForLocale();
    if (codec)
        return codec->toUnicode(str, size);
 #endif // textcodec
    return fromLatin1(str, size);

Note that if we're wrong and the locale was *not* Latin1, files that you
had a name to may not be encoded or decoded the same way.

Fixes: QTBUG-78446
Change-Id: Iece6e011237e4ab284ecfffd15c54077728a17ca
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 70e6e9fe590590f602dee230a64870365d9301aa)
2019-10-09 20:08:48 +02:00
Shawn Rutledge
41e59afc41 evdevtouch: Report stationary touchpoints that include pressure changes
Task-number: QTBUG-77142
Change-Id: I35446092679573df51891302155c896a3bb6fc1c
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit ee9bc61cd906505271bad887664c15b9397906ab)
2019-10-09 08:52:40 +00:00
Dmitry Kazakov
d1646b37b1 Fix QRandomGenerator initialization on AMD CPUs
Some AMD CPUs (e.g. AMD A4-6250J and AMD Ryzen 3000-series) have a
failing random generation instruction, which always returns
0xffffffff, even when generation was "successful".

This code checks if hardware random generator generates four consecutive
equal numbers. If it does, then we probably have a failing one and
should disable it completely.

Change-Id: I38c87920ca2e8cce4143afbff5e453ce3845d11a
Fixes: QTBUG-69423
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 5839714d986f28412c9f9ed4801d1bf9378f7b51)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-08 21:21:47 +02:00
Andy Shaw
4a9292f169 Ensure all children of a widget get updated when a stylesheet changes
Before, only the direct children would get an update when the
stylesheet changed, any children below that would be unchanged.

Fixes: QTBUG-77006
Change-Id: Id668eaae74a8289d78d66644f077e6a3302960cd
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
(cherry picked from commit 9b6179cf957c32e0c02547d510dfee2088f02340)
2019-10-08 08:24:58 +00:00
Tor Arne Vestbø
2465184351 iOS: Prevent UIKit from adding UITextInteraction to our view
It's added automatically when some languages such as Japanese are
the active input language/keyboard, which results in UIKit triggering
the edit menu for any tap in the UI, regardless of whether it hits
the focus object or not.

Adopting the protocol is a much larger effort and needs to be
coordinated so that we still support text interaction on iOS
versions pre 13.0.

Even with this patch the UITextSelectionView will still blink
its own cursor, which doesn't seem to sync up with the UITextInput
protocol's view of where the cursor is.

Fixes: QTBUG-78496
Change-Id: I61500ad7ab9c8577f71188c0c99ead39465e3839
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit e00d888daefbfbd5f17e0772421773f8e295087b)
2019-10-07 16:59:15 +02:00
Andy Shaw
f7d44cc6da Fix CVE-2019-16168 in SQLite
v3.29.0 is the latest and there is no indication as to when the next
release is so we will apply this separately for now and it can be
reverted once it is in a release that we ship with.

This patch is taken from https://www.sqlite.org/src/info/98357d8c1263920b

Change-Id: I82d398b093b67842a4369e3220c01e7eea30763a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
(cherry picked from commit c3faeb852866a2fc8ae9cd6f8cf91947bd42b538)
2019-10-07 05:51:38 +00:00
Andy Shaw
ee932d3ed5 sqlite: Update to v3.29.0
[ChangeLog][QtSQL][sqlite] Updated to v3.29.0

Change-Id: Ibf61c829dcd24dc8cdf00f5b57078255b0ad5ef1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
(cherry picked from commit f88476569a8608d0f8257fcf3c426cbc68de6d7c)
2019-10-07 05:51:10 +00:00
Tor Arne Vestbø
1304b6705e Xcode: Ensure there's always a CFBundle[Short]Version[String] set
Leaving it empty resulted in errors from Xcode when compiling the app.

Task-number: QTBUG-25309
Task-number: QTBUG-74872
Change-Id: I61b0f47d754c5f5b181a6f918283d990458cc78d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 1d1ed017119df2cd28a9e21aee0a8cece5282250)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-09-27 15:41:16 +02:00
Shawn Rutledge
52889ded67 Add QQuickMultiPointTouchArea as a friend of QTouchEvent
QQuickMultiPointTouchArea needs to understand whether a stationary
touchpoint has relevant property changes, to decide whether to emit its
updated() signal. Amends 217dd1b3b03cd40b4bb926631464c684f7f84a69

Task-number: QTBUG-77142
Change-Id: I85e031820bef9d687369b7d67a57c67fe2875b4b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit bc35941dbbf6cbd09805a2217ecb062c565855ad)
2019-09-25 16:13:53 +02:00
Shawn Rutledge
d570f19652 Mark stationary touch points as updated if pressure or velocity changes
This is to inform Qt Quick when a stationary touchpoint is delivered
that it is because of a changed property. Qt Quick still needs to avoid
delivering item-customized events (with only the touch points that occur
inside the item) that contain only stationary touch points without
changed properties. To be able to check this private flag,
QQuickPointerTouchEvent needs to be a friend.

Task-number: QTBUG-77142
Change-Id: I6ee0dffbbeca9e513c77227b757252e2eec6a4ef
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 217dd1b3b03cd40b4bb926631464c684f7f84a69)
2019-09-25 16:13:46 +02:00
Andy Shaw
e8b3593ecb Move DialogButtonBoxLayout case to be before MouseDoubleClickDistance
This amends 9be66cb282dee1ce4380602a2f3caf5abfd144cf so that the
DialogButtonBoxLayout case is moved to be before the
MouseDoubleClickDistance one in case the fallthrough is triggered.

Change-Id: I843dad6b55ccffe6b6c275cd75587f04659e512f
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
(cherry picked from commit 54d3059ccfe6df0a375d2addac4ad41333122b8d)
2019-09-24 07:16:25 +00:00
Daniel Smith
cc1dc42c1f Update lancelot tests to use non-system-specific host info collection
Change the lancelot baseline test runner to use generic text files for
host info data collection. This also avoids relying on QProcess and
scraping the bash scripts output from stdout.

Fixes: QTBUG-71836
Change-Id: I88a46c99dbb11f71afc18cae5a6d2fbebcbe76c5
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 651dd26403052f98397783927ad02e008acf0552)
2019-09-23 11:51:26 +00:00
Shawn Rutledge
19ab8bf7e7 evdevtouch: Add fallback definition of ABS_MT_PRESSURE; fix alignment
Fixes: QTBUG-78298
Change-Id: Ib6acb1fdca551a84aba5dec2f28cf784a212692c
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 15e1c159868774b0b3c532a09281d45798b0f5d8)
2019-09-20 15:11:35 +02:00
Tor Arne Vestbø
1e310b5a45 widgets: Mark widgets as needing flush during painting
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.

(manually cherry-picked from commit 79bf1b7e348d186934b14c417859a48bf9b3a06c)

Task-number: QTBUG-77447
Change-Id: I1a8fa703c0b7172655271e2a8f5eca694cb14129
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-09-20 11:45:41 +00:00
Shawn Rutledge
9a322dfdea macOS dark mode: set the link color
Fixes: QTBUG-71740
Change-Id: I49f49338c7f3a28845de63c2a6bf2dc8495dd108
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 117175a2f2ecab990f65eefd32b42be22f9aa3ce)
2019-09-19 17:03:06 +02:00
Edward Welbourne
b207332b93 Doc-fix: correct some misinformation about QDateTime's handling of DST
Tidy up QDateTime::offsetFromUtc's doc, in the process. We don't take
DST into account for dates before the epoch; that should be mentioned
when saying we take DST into account. Also, referring to *this as the
"current" time begs to be misunderstood.

The \class comment also misleadingly claimed that we don't take into
account any changes to time-zone before DST; where, in fact, we only
ignore DST changes before 1970, not changes to standard offset.
(Conflict resolution also pulled in a typo-fix from 5.14.)

Change-Id: I090e668edf0338c825f5afcc67f894579a129c46
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit c6bde29e143b1fadac97f656ba6c3059135d4a11)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-09-19 11:30:02 +02:00
Edward Welbourne
3a71e387d9 MS TZ data: avoid calculating a date in year 0
There is no year 0 in the proleptic Gregorian calendar, so QDate()
won't be happy if asked for a date in it. Tweak scanning of the data
we get from MS-Win so as to avoid a date calculation that could
otherwise happen in year 0 when constructing
QDateTime(QDate(1, 1, 1), QTime(0, 0, 0), QTimeZone("Australia/Sydney")).

Added a test for this case, which Oliver Wolff has kindly verified
does reproduce the assertion failure. However, Coin is unable to
reproduce, as all its MS builds are configured with -release, so
Q_ASSERT() does nothing. (The relevant code then skips over year 0,
albeit for the wrong reasons, and gets the right results, albeit
inefficiently, leaving no other symptom by which to detect the
problem.)

Fixes: QTBUG-78051
Change-Id: Ife8a7470e5bd450bc421e89b3f1e1211756fc889
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 8286daba038d3c90d2bc06785ffcf9c0c603cb83)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-09-19 11:29:46 +02:00
Kai Koehne
4ddc50c0cd configure: Do use pkg-config --libs for static libs
This ensures that also linker commands like -pthread are returned.

Fixes: QTBUG-77159
Change-Id: If9ab3797ccfb52c6b96a4ab120c59fd8896d5466
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-09-19 06:59:13 +00:00
Kai Koehne
6bffb8e3e1 Update hints on how to link to OpenSSL
The traditional way to fix building against a custom OpenSSL is to set the
OPENSSL_LIBS environment variable.

Anyhow, since Qt 5.6 there's a more generic way to configure
linking against external libraries by configuring the <LIB>_INCDIR, <LIB>_LIBDIR,
<LIB>_PREFIX, <LIB>_LIBS, <LIB>_LIBS_DEBUG and <LIB>_LIBS_RELEASE
qmake variables at configure time. Using these have following advantages:

- Can handle different libs for a -debug-and-release build
- Can be used also for other libs than just openssl

So let's try to promote this.

Also update any examples for OpenSSL 1.1.

Change-Id: I24dbccdd87d0fc50bf31c6afe7aa692d4b810fb7
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-09-19 08:58:44 +02:00
Tor Arne Vestbø
52ad1de1f6 macOS: Keep default NSWindow background unless window is frameless
The logic was changed in ee82f8661 to only draw a window background
when the window was textured, and otherwise ask for a clear window
background. This has an unfortunate side-effect on macOS 10.15 that
the window's title bar will be partially transparent and reflect the
content under the window, with a blur effect.

It also inadvertently broke the use-case of setting the NSWindow
background color explicitly.

With this patch we're back to the behavior before ee82f8661, and
users who still want to have a non-borderless window with a clear
background can still do this by setting the background color to
the clear color manually.

Task-number: QTBUG-77637
Change-Id: I8a11bc46e6393b29a37f002ea123a987048106b9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 4534522ff0f189418d828fd29b9d417b5a1b5d27)
2019-09-16 13:50:20 +02:00
Allan Sandfeld Jensen
c7b3c5a082 Handle robustness with OpenGL < 4.0
We need to have the right idea of robustness, so check for extension.

Fixes: QTBUG-78107
Change-Id: I26987269e5c50bee20e2e3cc6d75f91a6c9af25e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit bc34784d053ebf9b0d167e9398052fcc80d8af87)
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-09-13 11:45:18 +02:00
Alexandru Croitor
afec5935ea CMake: Fix usage of debug frameworks on macOS
If an app wants use a debug framework of Qt, it is still expected that
the app should link against the release version, and just set
DYLD_IMAGE_SUFFIX=_debug when running the app.

This was not the case before, where the CMake Config files told CMake
to link explicitly against the debug libraries. This caused crashes
due to the Qt plugin loader mechanism still trying to find a release
platform plugin, which in turn would load release libraries, and thus
the application would end up loading both debug and release plugins.

Make sure the Config files in a framework case always reference the
release libraries (even though this might be counter intuitive).
Otherwise users of the Debug Config files would always get
crashes.

Fixes: QTBUG-78131
Fixes: QTBUG-78239
Change-Id: I88b1dc421477ad186012ca67b328a891128eb568
(cherry picked from commit be21ff11b7c25e3f6682c7987052557eca48e907)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-09-12 23:24:01 +02:00
Shawn Rutledge
3a50e51b01 QMenu::popup(): don't change the menu's screen if called from exec()
Since b3fc5e1ea3eb4fe838ac716aaca4efaa5de5a814,
topData()->initialScreenIndex has always been short-lived: it only
remembers the screen in case the widget parent is a QDesktopScreenWidget
(gotten from QDesktopWidget::screen()), only until the window is
created.  Then it is reset.  In the case of exec() we need to avoid
calling setScreen() twice, because that would set the screen once, then
forget which screen it was supposed to be on, then set the screen again
when exec() calls popup().  This is achieved by using the stored
eventLoop pointer to detect that popup() is being called from exec(),
and avoid calling setScreen() a second time in popup(), because exec()
already needed to call createWinId() before it created the event loop.

Amends 82da8306bc1313b85632eee0faf858239261a092

Task-number: QTBUG-76162
Change-Id: I70da517b9d530630e59d103cb2a1ce11c897b2c8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Joni Poikelin <joni.poikelin@qt.io>
(cherry picked from commit 648dac1ceb40a346adf2081997f5c6166c3ad503)
2019-09-10 12:00:31 +00:00
138 changed files with 11677 additions and 6577 deletions

View File

@ -4,4 +4,4 @@ CONFIG += warning_clean
QT_SOURCE_TREE = $$PWD
QT_BUILD_TREE = $$shadowed($$PWD)
MODULE_VERSION = 5.12.5
MODULE_VERSION = 5.12.7

1331
LICENSE.QT-LICENSE-AGREEMENT Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,913 +0,0 @@
QT LICENSE AGREEMENT
Agreement version 4.0
This License Agreement ("Agreement") is a legal agreement between The Qt
Company (as defined below) and the Licensee (as defined below) for the license
of Licensed Software (as defined below). Capitalized terms used herein are
defined in Section 1.
WHEREAS:
(A). Licensee wishes to use the Licensed Software for the purpose of developing
and distributing Applications and/or Devices; and
(B). The Qt Company is willing to grant the Licensee a right to use Licensed
Software for such purpose pursuant to term and conditions of this Agreement.
NOW, THEREFORE, THE PARTIES HEREBY AGREE AS FOLLOWS:
1. DEFINITIONS
"Affiliate" of a Party shall mean an entity (i) which is directly or indirectly
controlling such Party; (ii) which is under the same direct or indirect
ownership or control as such Party; or (iii) which is directly or indirectly
owned or controlled by such Party. For these purposes, an entity shall be
treated as being controlled by another if that other entity has fifty percent
(50 %) or more of the votes in such entity, is able to direct its affairs
and/or to control the composition of its board of directors or equivalent body.
"Applications" shall mean Licensee's software products created using the
Licensed Software, which may include the Redistributables, or part
thereof.
"Contractor(s)" shall mean third party consultants, distributors and
contractors performing services to a Party under applicable contractual
arrangement.
"Customer(s)" shall mean Licensee's end users to whom Licensee, directly or
indirectly, distributes copies of the Redistributables.
"Deployment Platforms" shall mean operating systems specified in the License
Certificate, in which the Redistributables can be distributed pursuant to the
terms and conditions of this Agreement.
"Designated User(s)" shall mean the employee(s) of Licensee or Licensee's
Affiliates acting within the scope of their employment or Licensee's
Contractors acting within the scope of their services for Licensee and on
behalf of Licensee. Designated Users shall be named in the License Certificate.
"Development License" shall mean the license needed by the Licensee for each
Designated User to use the Licensed Software under the license grant described
in Section 3.1 of this Agreement.
"Development Platforms" shall mean those operating systems specified in the
License Certificate, in which the Licensed Software can be used under the
Development License, but not distributed in any form or used for any other
purpose.
"Devices" shall mean hardware devices or products that 1) are manufactured
and/or distributed by the Licensee or its Affiliates or Contractors, and
(2)(i) incorporate or integrate the Redistributables or parts thereof; or (ii)
do not incorporate or integrate the Redistributables at the time of
distribution, but where, when used by a Customer, the main user interface or
substantial functionality of such device is provided by Application(s) or
otherwise depends on the Licensed Software.
"Distribution License(s)" shall mean the license required for distribution of
Redistributables in connection with Devices pursuant to license grant described
in Section 3.3 of this Agreement.
"Distribution License Packs" shall mean set of prepaid Distribution Licenses
for distribution of Redistributables, as defined in The Qt Company's standard
price list, quote, Purchase Order confirmation or in an appendix hereto,
as the case may be.
"Intellectual Property Rights" shall mean patents (including utility models),
design patents, and designs (whether or not capable of registration), chip
topography rights and other like protection, copyrights, trademarks, service
marks, trade names, logos or other words or symbols and any other form of
statutory protection of any kind and applications for any of the foregoing as
well as any trade secrets.
"License Certificate" shall mean a certificate generated by The Qt Company for
each Designated User respectively upon them downloading the licensed Software.
License Certificate will be available under respective Designated User's Qt
Account at account.qt.io and it will specify the Designated User, the
Development Platforms, Deployment Platforms and the License Term. The terms of
the License Certificate are considered part of this Agreement and shall be
updated from time to time to reflect any agreed changes to the foregoing terms
relating to Designated User's rights to the Licensed Software.
"License Fee" shall mean the fee charged to the Licensee for rights granted
under the terms of this Agreement.
"License Term" shall mean the agreed validity period of the Development
License of the respective Designated User, during which time the
Designated User is entitled to use the Licensed Software, as set forth in the
respective License Certificate.
"Licensed Software" shall mean all versions of the
(i) Qt Toolkit (including Qt Essentials, Qt Add-Ons and Value-Add modules) as
described in http://doc.qt.io/qt-5/qtmodules.html,
(ii) Qt Creator (including Creator IDE tool) as described in
http://doc.qt.io/qtcreator/index.html,
(iii) Qt 3D Studio as described in http://doc.qt.io/qt3dstudio/index.html, and
as well as corresponding online or electronic documentation, associated media
and printed materials, including the source code, example programs and the
documentation, licensed to the Licensee under this Agreement. Licensed Software
does not include Third Party Software (as defined in Section 4), Open Source
Qt, or other software products of The Qt Company (for example Qt Safe Renderer
and Qt for Automation), unless such other software products of The Qt Company
are separately agreed in writing to be included in scope of the Licensed
Software.
"Licensee" shall mean the individual or legal entity that is party to this
Agreement, as identified on the signature page hereof.
"Licensee's Records" shall mean books and records that are likely to contain
information bearing on Licensee's compliance with this Agreement or the
payments due to The Qt Company under this Agreement, including, but not limited
to: assembly logs, sales records and distribution records.
"Modified Software" shall have the meaning as set forth in Section 2.3.
"Online Services" shall mean any services or access to systems made available
by The Qt Company to the Licensee over the Internet relating to the Licensed
Software or for the purpose of use by the Licensee of the Licensed Software or
Support. Use of any such Online Services is discretionary for the Licensee and
some of them may be subject to additional fees.
"Open Source Qt" shall mean the non-commercial Qt computer software products,
licensed under the terms of the GNU Lesser General Public License, version
2.1 or later ("LGPL") or the GNU General Public License, version 2.0 or later
("GPL"). For clarity, Open Source Qt shall not be provided nor governed under
this Agreement.
"Party" or "Parties" shall mean Licensee and/or The Qt Company.
"Redistributables" shall mean the portions of the Licensed Software set forth
in Appendix 1, Section 1 that may be distributed pursuant to the terms of this
Agreement in object code form only, including any relevant documentation.
Where relevant, any reference to Licensed Software in this Agreement shall
include and refer also to Redistributables.
"Renewal Term" shall mean an extension of previous License Term as agreed
between the Parties.
"Submitted Modified Software" shall have the meaning as set forth in
Section 2.3.
"Support" shall mean standard developer support that is provided by The Qt
Company to assist Designated Users in using the Licensed Software in
accordance with The Qt Company's standard support terms and as further
defined in Section 8 hereunder.
"Taxes" shall have the meaning set forth in Section 10.5.
"Term" shall have the meaning set forth in Section 12.
"The Qt Company" shall mean:
(i) in the event Licensee is an individual residing in the United States or a
legal entity incorporated in the United States or having its headquarters in
the United States, The Qt Company Inc., a Delaware corporation with its office
at 2350 Mission College Blvd., Suite 1020, Santa Clara, CA 95054, USA.; or
(ii) in the event the Licensee is an individual residing outside of the United
States or a legal entity incorporated outside of the United States or having
its registered office outside of the United States, The Qt Company Ltd., a
Finnish company with its registered office at Bertel Jungin aukio D3A, 02600
Espoo, Finland.
"Third Party Software " shall have the meaning set forth in Section 4.
"Updates" shall mean a release or version of the Licensed Software containing
bug fixes, error corrections and other changes that are generally made
available to users of the Licensed Software that have contracted for Support.
Updates are generally depicted as a change to the digits following the decimal
in the Licensed Software version number. The Qt Company shall make Updates
available to the Licensee under the Support. Updates shall be considered as
part of the Licensed Software hereunder.
"Upgrades" shall mean a release or version of the Licensed Software containing
enhancements and new features and are generally depicted as a change to the
first digit of the Licensed Software version number. In the event Upgrades are
provided to the Licensee under this Agreement, they shall be considered as
part of the Licensed Software hereunder.
2. OWNERSHIP
2.1 Ownership of The Qt Company
The Licensed Software is protected by copyright laws and international
copyright treaties, as well as other intellectual property laws and treaties.
The Licensed Software is licensed, not sold.
All The Qt Company's Intellectual Property Rights are and shall remain the
exclusive property of The Qt Company or its licensors respectively.
2.2 Ownership of Licensee
All the Licensee's Intellectual Property Rights are and shall remain the
exclusive property of the Licensee or its licensors respectively.
All Intellectual Property Rights to the Modified Software, Applications and
Devices shall remain with the Licensee and no rights thereto shall be granted
by the Licensee to The Qt Company under this Agreement (except as set forth in
Section 2.3 below).
2.3 Modified Software
Licensee may create bug-fixes, error corrections, patches or modifications to
the Licensed Software ("Modified Software"). Such Modified Software may break
the source or binary compatibility with the Licensed Software (including
without limitation through changing the application programming interfaces
("API") or by adding, changing or deleting any variable, method, or class
signature in the Licensed Software and/or any inter-process protocols, services
or standards in the Licensed Software libraries). To the extent that Licensee's
Modified Software so breaks source or binary compatibility with the Licensed
Software, Licensee acknowledges that The Qt Company's ability to provide
Support may be prevented or limited and Licensee's ability to make use of
Updates may be restricted.
Licensee may, at its sole and absolute discretion, choose to submit Modified
Software to The Qt Company ("Submitted Modified Software") in connection with
Licensee's Support request, service request or otherwise. In the event Licensee
does so, then, Licensee hereby grants The Qt Company a sublicensable,
assignable, irrevocable, perpetual, worldwide, non-exclusive, royalty-free and
fully paid-up license, under all of Licensee's Intellectual Property Rights, to
reproduce, adapt, translate, modify, and prepare derivative works of, publicly
display, publicly perform, sublicense, make available and distribute such
Submitted Modified Software as The Qt Company sees fit at its free and absolute
discretion.
3. LICENSES GRANTED
3.1 Development with Licensed Software
Subject to the terms of this Agreement, The Qt Company grants to Licensee a
personal, worldwide, non-exclusive, non-transferable license, valid for the
License Term, to use, modify and copy the Licensed Software by Designated Users
on the Development Platforms for the sole purposes of designing, developing,
demonstrating and testing Application(s) and/or Devices, and to provide thereto
related support and other related services to end-user Customers.
Licensee may install copies of the Licensed Software on an unlimited number of
computers provided that (i) only the Designated Users may use the Licensed
Software, and (ii) all Designated Users must have a valid Development License
to use Licensed Software.
Licensee may at any time designate another Designated User to replace a then-
current Designated User by notifying The Qt Company in writing, provided that
any Designated User may be replaced only once during any six-month period.
Upon expiry of the initially agreed License Term, the respective License Terms
shall be automatically extended to one or more Renewal Term(s), unless and
until either Party notifies the other Party in writing that it does not wish to
continue the License Term, such notification to be provided to the other Party
no less than ninety (90) days before expiry of the respective License Term.
Unless otherwise agreed between the Parties, Renewal Term shall be of equal
length with the initial Term.
Any such Renewal Term shall be subject to License Fees agreed between the
Parties or, if no advance agreement exists, subject to The Qt Company's
standard pricing applicable at the commencement date of any such Renewal Term.
3.2 Distribution of Applications
Subject to the terms of this Agreement, The Qt Company grants to Licensee a
personal, worldwide, non-exclusive, non-transferable, revocable (for cause
pursuant to this Agreement) right and license, valid for the Term, to
(i) distribute, by itself or through its Contractors, Redistributables as
installed, incorporated or integrated into Applications for execution on the
Deployment Platforms, and
(ii) grant sublicenses to Redistributables, as distributed hereunder, for
Customers solely for Customer's internal use and to the extent necessary in
order for the Customers to use the Applications for their respective intended
purposes.
Right to distribute the Redistributables as part of an Application as provided
herein is not royalty-bearing but is conditional upon the Licensee having paid
the agreed Development Licenses from The Qt Company before distributing any
Redistributables to Customers.
3.3 Distribution of Devices
Subject to the terms of this Agreement, The Qt Company grants to Licensee a
personal, worldwide, non-exclusive, non-transferable, revocable (for cause
pursuant to this Agreement) right and license, valid for the Term, to
(i) distribute, by itself or through one or more tiers of Contractors,
Redistributables as installed, incorporated or integrated, or intended to be
installed, incorporated or integrated into Devices for execution on the
Deployment Platforms, and
(ii) grant sublicenses to Redistributables, as distributed hereunder, for
Customers solely for Customer's internal use and to the extent necessary in
order for the Customers to use the Devices for their respective intended
purposes.
Right to distribute the Redistributables with Devices as provided herein is
conditional upon the Licensee having purchased and paid the appropriate amount
of Development and Distribution Licenses from The Qt Company before
distributing any Redistributables to Customers.
3.4 Further Requirements
The licenses granted above in this Section 3 by The Qt Company to Licensee are
conditional and subject to Licensee's compliance with the following terms:
(i) Licensee shall not remove or alter any copyright, trademark or other
proprietary rights notice contained in any portion of the Licensed Software;
(ii) Applications must add primary and substantial functionality to the
Licensed Software;
(iii) Applications may not pass on functionality which in any way makes it
possible for others to create software with the Licensed Software; provided
however that Licensee may use the Licensed Software's scripting and QML ("Qt
Quick") functionality solely in order to enable scripting, themes and styles
that augment the functionality and appearance of the Application(s) without
adding primary and substantial functionality to the Application(s);
(iv) Applications must not compete with the Licensed Software;
(v) Licensee shall not use The Qt Company's or any of its suppliers' names,
logos, or trademarks to market Applications, except that Licensee may use
"Built with Qt" logo to indicate that Application(s) was developed using the
Licensed Software;
(vi) Licensee shall not distribute, sublicense or disclose source code of
Licensed Software to any third party (provided however that Licensee may
appoint employee(s) of Contractors as Designated Users to use Licensed
Software pursuant to this Agreement). Such right may be available for the
Licensee subject to a separate software development kit ("SDK") license
agreement to be concluded with The Qt Company;
(vii) Licensee shall not grant the Customers a right to (i) make copies of the
Redistributables except when and to the extent required to use the Applications
and/or Devices for their intended purpose, (ii) modify the Redistributables or
create derivative works thereof, (iii) decompile, disassemble or otherwise
reverse engineer Redistributables, or (iv) redistribute any copy or portion of
the Redistributables to any third party, except as part of the onward sale of
the Device on which the Redistributables are installed;
(viii) Licensee shall not and shall cause that its Affiliates or Contractors
shall not a) in any way combine, incorporate or integrate Licensed Software
with, or use Licensed Software for creation of, any software created with or
incorporating Open Source Qt, or b) incorporate or integrate Applications
into a hardware device or product other than a Device, unless Licensee has
received an advance written permission from The Qt Company to do so. Absent
such written permission, any and all distribution by the Licensee during the
Term of a hardware device or product a) which incorporate or integrate any
part of Licensed Software or Open Source Qt; or b) where the main user
interface or substantial functionality is provided by software build with
Licensed Software or Open Source Qt or otherwise depends on the Licensed
Software or Open Source Qt, shall be considered as a Device distribution under
this Agreement and dependent on compliance thereof (including but not limited
to obligation to pay applicable License Fees for such distribution);
(ix) Licensee shall cause all of its Affiliates and Contractors entitled to
make use of the licenses granted under this Agreement, to be contractually
bound to comply with the relevant terms of this Agreement and not to use the
Licensed Software beyond the terms hereof and for any purposes other than
operating within the scope of their services for Licensee. Licensee shall be
responsible for any and all actions and omissions of its Affiliates and
Contractors relating to the Licensed Software and use thereof (including but
not limited to payment of all applicable License Fees);
(x) Except when and to the extent explicitly provided in this Section 3,
Licensee shall not transfer, publish, disclose, display or otherwise make
available the Licensed Software;
; and
(xi) Licensee shall not attempt or enlist a third party to conduct or attempt
to conduct any of the above.
Above terms shall not be applicable if and to the extent they conflict with any
mandatory provisions of any applicable laws.
Any use of Licensed Software beyond the provisions of this Agreement is
strictly prohibited and requires an additional license from The Qt Company.
4. THIRD PARTY SOFTWARE
The Licensed Software may provide links to third party libraries or code
(collectively "Third Party Software") to implement various functions. Third
Party Software does not comprise part of the Licensed Software. In some cases,
access to Third Party Software may be included in the Licensed Software. Such
Third Party Software will be listed in the ".../src/3rdparty" source tree
delivered with the Licensed Software or documented in the Licensed Software, as
such may be amended from time to time. Licensee acknowledges that use or
distribution of Third Party Software is in all respects subject to applicable
license terms of applicable third party right holders.
5. PRE-RELEASE CODE
The Licensed Software may contain pre-release code and functionality marked or
otherwise stated as "Technology Preview", "Alpha", "Beta" or similar
designation. Such pre-release code may be present in order to provide
experimental support for new platforms or preliminary versions of one or more
new functionalities. The pre-release code may not be at the level of
performance and compatibility of a final, generally available, product
offering of the Licensed Software. The pre-release parts of the Licensed
Software may not operate correctly, may contain errors and may be substantially
modified by The Qt Company prior to the first commercial product release, if
any. The Qt Company is under no obligation to make pre-release code
commercially available, or provide any Support or Updates relating thereto. The
Qt Company assumes no liability whatsoever regarding any pre-release code, but
any use thereof is exclusively at Licensee's own risk and expense.
6. LIMITED WARRANTY AND WARRANTY DISCLAIMER
The Qt Company hereby represents and warrants that it has the power and
authority to grant the rights and licenses granted to Licensee under this
Agreement.
Except as set forth above, the Licensed Software is licensed to Licensee
"as is" and Licensee's exclusive remedy and The Qt Company's entire liability
for errors in the Licensed Software shall be limited, at The Qt Company's
option, to correction of the error, replacement of the Licensed Software or
return of the applicable fees paid for the defective Licensed Software for the
time period during which the License is not able to utilize the Licensed
Software under the terms of this Agreement.
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE QT COMPANY ON BEHALF OF
ITSELF AND ITS LICENSORS, SUPPLIERS AND AFFILIATES, DISCLAIMS ALL OTHER
WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-
INFRINGEMENT WITH REGARD TO THE LICENSED SOFTWARE. THE QT COMPANY DOES NOT
WARRANT THAT THE LICENSED SOFTWARE WILL SATISFY LICENSEE'S REQUIREMENTS OR THAT
IT WILL OPERATE WITHOUT DEFECT OR ERROR OR THAT THE OPERATION THEREOF WILL BE
UNINTERRUPTED. ALL USE OF AND RELIANCE ON THE LICENSED SOFTWARE IS AT THE SOLE
RISK OF AND RESPONSIBILITY OF LICENSEE.
7. INDEMNIFICATION AND LIMITATION OF LIABILITY
7.1 Limitation of Liability
EXCEPT FOR (I) CASES OF GROSS NEGLIGENCE OR INTENTIONAL MISCONDUCT, AND (II)
BREACH OF CONFIDENTIALITY, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, IN NO
EVENT SHALL EITHER PARTY BE LIABLE TO THE OTHER PARTY FOR ANY LOSS OF PROFIT,
LOSS OF DATA, LOSS OF BUSINESS OR GOODWILL OR ANY OTHER INDIRECT, SPECIAL,
CONSEQUENTIAL, INCIDENTAL OR PUNITIVE COST, DAMAGES OR EXPENSE OF ANY KIND,
HOWSOEVER ARISING UNDER OR IN CONNECTION WITH THIS AGREEMENT. PARTIES
SPECIFICALLY AGREE THAT LICENSEE'S OBLIGATION TO PAY LICENSE AND OTHER FEES
CORRESPONDING TO ACTUAL USAGE OF LICENSED SOFTWARE HEREUNDER SHALL BE
CONSIDERED AS A DIRECT DAMAGE.
EXCEPT FOR (I) CASES OF GROSS NEGLIGENCE OR INTENTIONAL MISCONDUCT, AND (II)
BREACH OF CONFIDENTIALITY, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, IN
NO EVENT SHALL EITHER PARTY'S TOTAL AGGREGATE LIABILITY UNDER THIS AGREEMENT
EXCEED THE AGGREGATE LICENSE FEES PAID OR PAYABLE TO THE QT COMPANY FROM
LICENSEE DURING THE PERIOD OF TWELVE (12) MONTHS IMMEDIATELY PRECEDING THE
EVENT RESULTING IN SUCH LIABILITY.
THE PROVISIONS OF THIS SECTION 7 ALLOCATE THE RISKS UNDER THIS AGREEMENT
BETWEEN THE QT COMPANY AND LICENSEE AND THE PARTIES HAVE RELIED UPON THE
LIMITATIONS SET FORTH HEREIN IN DETERMINING WHETHER TO ENTER INTO THIS AGREEMENT.
7.2 Licensee's Indemnification
Licensee shall indemnify and hold harmless The Qt Company from and against any
claim, injury, judgment, settlement, loss or expense, including attorneys' fees
related to: (a) Licensee's misrepresentation in connection with The Qt Company
or the Licensed Software or breach of this Agreement, (b) the Application or
Device (except where such cause of liability is solely attributable to the
Licensed Software).
8. SUPPORT, UPDATES AND ONLINE SERVICES
Upon due payment of the agreed License Fees the Licensee will be eligible to
receive Support and Updates and to use the Online Services during the License
Term, provided, however, that in the event the License Term is longer than 36
months, Support is provided only for the first 12 months, unless the Parties
specifically otherwise agree.
Unless otherwise decided by The Company at its free and absolute discretion,
Upgrades will not be included in the Support but may be available subject to
additional fees.
From time to time The Qt Company may change the Support terms, provided that
during the respective ongoing License Term the level of Support provided by The
Qt Company may not be reduced without the consent of the Licensee.
Unless otherwise agreed, The Qt Company shall not be responsible for providing
any service or support to Customers.
9. CONFIDENTIALITY
Each Party acknowledges that during the Term of this Agreement each Party may
receive information about the other Party's business, business methods,
business plans, customers, business relations, technology, and other
information, including the terms of this Agreement, that is confidential and
of great value to the other Party, and the value of which would be
significantly reduced if disclosed to third parties ("Confidential
Information"). Accordingly, when a Party (the "Receiving Party") receives
Confidential Information from the other Party (the "Disclosing Party"), the
Receiving Party shall only disclose such information to employees and
Contractors on a need to know basis, and shall cause its employees and
employees of its Affiliates to: (i) maintain any and all Confidential
Information in confidence; (ii) not disclose the Confidential Information to a
third party without the Disclosing Party's prior written approval; and (iii)
not, directly or indirectly, use the Confidential Information for any purpose
other than for exercising its rights and fulfilling its responsibilities
pursuant to this Agreement. Each Party shall take reasonable measures to
protect the Confidential Information of the other Party, which measures shall
not be less than the measures taken by such Party to protect its own
confidential and proprietary information.
Obligation of confidentiality shall not apply to information that (i) is or
becomes generally known to the public through no act or omission of the
Receiving Party; (ii) was in the Receiving Party's lawful possession prior to
the disclosure hereunder and was not subject to limitations on disclosure or
use; (iii) is developed independently by employees or Contractors of the
Receiving Party or other persons working for the Receiving Party who have not
had access to the Confidential Information of the Disclosing Party, as proven
by the written records of the Receiving Party; (iv) is lawfully disclosed to
the Receiving Party without restrictions, by a third party not under an
obligation of confidentiality; or (v) the Receiving Party is legally compelled
to disclose, in which case the Receiving Party shall notify the Disclosing
Party of such compelled disclosure and assert the privileged and confidential
nature of the information and cooperate fully with the Disclosing Party to
limit the scope of disclosure and the dissemination of disclosed Confidential
Information to the minimum extent necessary.
The obligations under this Section 9 shall continue to remain in force for a
period of five (5) years after the last disclosure, and, with respect to trade
secrets, for so long as such trade secrets are protected under applicable trade
secret laws.
10. FEES, DELIVERY AND PAYMENT
10.1 License Fees
License Fees are described in The Qt Company's standard price list, quote or
Purchase Order confirmation or in an appendix hereto, as the case may be.
The License Fees shall not be refunded or claimed as a credit in any event or
for any reason whatsoever.
10.2 Ordering Licenses
Licensee may purchase Development Licenses and Distribution Licenses pursuant
to agreed pricing terms or, if no specific pricing terms have been agreed upon,
at The Qt Company's standard pricing terms applicable at the time of purchase.
Licensee shall submit all purchase orders for Development Licenses and
Distribution Licenses to The Qt Company by email or any other method acceptable
to The Qt Company (each such order is referred to herein as a "Purchase Order")
for confirmation, whereupon the Purchase Order shall become binding between the
Parties.
10.3 Distribution License Packs
Unless otherwise agreed, Distribution Licenses shall be purchased by way of
Distribution License Packs.
Upon due payment of the ordered Distribution License Pack(s), the Licensee will
have an account of Distribution Licenses available for installing, bundling or
integrating (all jointly "installing") the Redistributables with the Devices or
for otherwise distributing the Redistributables in accordance with this
Agreement.
Each time Licensee "installs" or distributes a copy of Redistributables, then
one Distribution License is used, and Licensee's account of available
Distribution Licenses is decreased accordingly.
Licensee may "install" copies of the Redistributables so long as Licensee has
Distribution Licenses remaining on its account.
Redistributables will be deemed to have been "installed" into a Device when one
of the following circumstances shall have occurred: a) the Redistributables
have been loaded onto the Device and used outside of the Licensee's premises or
b) the Device has been fully tested and placed into Licensee's inventory
(or sold) for the first time (i.e., Licensee will not be required to use
(or pay for) more than one Distribution License for each individual Device,
e.g. in a situation where a Device is returned to Licensee's inventory after
delivery to a distributor or sale to a Customer). In addition, if Licensee
includes a back-up copy of the Redistributables on a CD-ROM or other storage
medium along with the product, that backup copy of the Redistributables will
not be deemed to have been "installed" and will not require an additional
Distribution License.
10.4 Payment Terms
License Fees and any other charges under this Agreement shall be paid by
Licensee no later than thirty (30) days from the date of the applicable invoice
from The Qt Company.
The Qt Company will submit an invoice to Licensee after the date of this
Agreement and/or after The Qt Company receives a Purchase Order from
Licensee.
A late payment charge of the lower of (a) one percent per month; or (b) the
interest rate stipulated by applicable law, shall be charged on any unpaid
balances that remain past due.
The Qt Company shall have the right to suspend, terminate or withhold grants
of all rights to the Licensed Software hereunder, including but not limited to
the Developer License, Distribution License, and Support, should Licensee fail
to make payment in timely fashion.
10.5 Taxes
All License Fees and other charges payable hereunder are gross amounts but
exclusive of any value added tax, use tax, sales tax and other taxes, duties or
tariffs ("Taxes"). Such applicable Taxes shall be paid by Licensee, or, where
applicable, in lieu of payment of such Taxes, Licensee shall provide an
exemption certificate to The Qt Company and any applicable authority.
11 RECORD-KEEPING AND REPORTING OBLIGATIONS; AUDIT RIGHTS
11.1 Licensee's Record-keeping
Licensee shall at all times maintain accurate and up-to-date written records of
Licensee's activities related to the use of Licensed Software and distribution
of Redistributables. The records shall be adequate to determine Licensee's
compliance with the provisions of this Agreement and to demonstrate the number
of Designated Users and Redistributables distributed by Licensee. The records
shall conform to good accounting practices reasonably acceptable to The Qt
Company.
Licensee shall, within thirty (30) days from receiving The Qt Company's request
to that effect, deliver to The Qt Company a report on Licensee's usage of
Licensed Software, such report to copies of Redistributables distributed by
Licensee during that calendar quarter, and also detailing the number of
undistributed copies of Redistributables made by Licensee and remaining in its
account contain information, in sufficient detail, on (i) amount of users
working with Licensed Software, (ii) copies of Redistributables distributed by
Licensee during that calendar quarter, (iii) number of undistributed copies of
Redistributables and corresponding number of unused Distribution Licenses
remaining on Licensee's account, and (iv) any other information as The Qt
Company may reasonably require from time to time.
11.2. The Qt Company's Audit Rights
The Qt Company or an independent auditor acting on behalf of The Qt Company's,
may, upon at least five (5) business days' prior written notice and at its
expense, audit Licensee with respect to the use of the Redistributables, but
not more frequently than once during each 6-month period. Such audit may be
conducted by mail, electronic means or through an in-person visit to Licensee's
place of business. Any such in-person audit shall be conducted during regular
business hours at Licensee's facilities and shall not unreasonably interfere
with Licensee's business activities. The Qt Company or the independent auditor
acting on behalf of The Qt Company shall be entitled to inspect Licensee's
Records. All such Licensee's Records and use thereof shall be subject to an
obligation of confidentiality under this Agreement.
If an audit reveals that Licensee is using the Licensed Software beyond scope
of the licenses Licensee has paid for, Licensee agrees to immediately pay The
Qt Company any amounts owed for such unauthorized use.
In addition, in the event the audit reveals a material violation of the terms
of this Agreement (underpayment of more than 5% of License Fees shall always be
deemed a material violation for purposes of this section), then the Licensee
shall pay The Qt Company's reasonable cost of conducting such audit.
12 TERM AND TERMINATION
12.1 Term
This Agreement shall enter into force upon due acceptance by both Parties and
remain in force for as long as there is any Development License(s) in force
("Term"), unless and until terminated pursuant to the terms of this Section 12.
12.2 Termination by The Qt Company
The Qt Company shall have the right to terminate this Agreement upon thirty
(30) days prior written notice if the Licensee is in material breach of any
obligation of this Agreement and fails to remedy such breach within such notice
period.
12.3 Mutual Right to Terminate
Either Party shall have the right to terminate this Agreement immediately upon
written notice in the event that the other Party becomes insolvent, files for
any form of bankruptcy, makes any assignment for the benefit of creditors, has
a receiver, administrative receiver or officer appointed over the whole or a
substantial part of its assets, ceases to conduct business, or an act
equivalent to any of the above occurs under the laws of the jurisdiction of the
other Party.
12.4 Parties' Rights and Duties upon Termination
Upon expiry or termination of the Agreement Licensee shall cease and shall
cause all Designated Users (including those of its Affiliates' and
Contractors') to cease using the Licensed Software and distribution of the
Redistributables under this Agreement.
Notwithstanding the above, in the event the Agreement expires or is terminated:
(i) as a result of The Qt Company choosing not to renew the Development
License(s) as set forth in Section 3.1, then all valid licenses possessed by
the Licensee at such date shall be extended to be valid in perpetuity under the
terms of this Agreement and Licensee is entitled to purchase additional
licenses as set forth in Section 10.2; or
(ii) for reason other than by The Qt Company pursuant to item (i) above or
pursuant to Section 12.2, then the Licensee is entitled, for a period of six
(6) months after the effective date of termination, to continue distribution of
Devices under the Distribution Licenses paid but unused at such effective date
of termination.
Upon any such termination the Licensee shall destroy or return to The Qt
Company all copies of the Licensed Software and all related materials and will
certify the same to The Qt Company upon its request, provided however that
Licensee may retain and exploit such copies of the Licensed Software as it may
reasonably require in providing continued support to Customers.
Expiry or termination of this Agreement for any reason whatsoever shall not
relieve Licensee of its obligation to pay any License Fees accrued or payable
to The Qt Company prior to the effective date of termination, and Licensee
shall immediately pay to The Qt Company all such fees upon the effective date
of termination. Termination of this Agreement shall not affect any rights of
Customers to continue use of Applications and Devices (and therein incorporated
Redistributables).
12.5 Extension in case of bankruptcy
In the event The Qt Company is declared bankrupt under a final, non-cancellable
decision by relevant court of law, and this Agreement is not, at the date of
expiry of the Development License(s) pursuant to Section 3.1, assigned to
party, who has assumed The Qt Company's position as a legitimate licensor of
Licensed Software under this Agreement, then all valid licenses possessed by
the Licensee at such date of expiry, and which the Licensee has not notified
for expiry, shall be extended to be valid in perpetuity under the terms of
this Agreement.
13. GOVERNING LAW AND LEGAL VENUE
In the event this Agreement is in the name of The Qt Company Inc., a Delaware
Corporation, then:
(i) this Agreement shall be construed and interpreted in accordance with the
laws of the State of California, USA, excluding its choice of law provisions;
(ii) the United Nations Convention on Contracts for the International Sale of
Goods will not apply to this Agreement; and
(iii) any dispute, claim or controversy arising out of or relating to this
Agreement or the breach, termination, enforcement, interpretation or validity
thereof, including the determination of the scope or applicability of this
Agreement to arbitrate, shall be determined by arbitration in San Francisco,
USA, before one arbitrator. The arbitration shall be administered by JAMS
pursuant to JAMS' Streamlined Arbitration Rules and Procedures. Judgment on the
Award may be entered in any court having jurisdiction. This Section shall not
preclude parties from seeking provisional remedies in aid of arbitration from a
court of appropriate jurisdiction.
In the event this Agreement is in the name of The Qt Company Ltd., a Finnish
Company, then:
(i) this Agreement shall be construed and interpreted in accordance with the
laws of Finland, excluding its choice of law provisions;
(ii) the United Nations Convention on Contracts for the International Sale of
Goods will not apply to this Agreement; and
(iii) any disputes, controversy or claim arising out of or relating to this
Agreement, or the breach, termination or validity thereof shall be shall be
finally settled by arbitration in accordance with the Arbitration Rules of
Finland Chamber of Commerce. The arbitration tribunal shall consist of one (1),
or if either Party so requires, of three (3), arbitrators. The award shall be
final and binding and enforceable in any court of competent jurisdiction. The
arbitration shall be held in Helsinki, Finland and the process shall be
conducted in the English language. This Section shall not preclude parties from
seeking provisional remedies in aid of arbitration from a court of appropriate
jurisdiction.
14. GENERAL PROVISIONS
14.1 No Assignment
Except in the case of a merger or sale of substantially all of its corporate
assets, Licensee shall not be entitled to assign or transfer all or any of its
rights, benefits and obligations under this Agreement without the prior written
consent of The Qt Company, which shall not be unreasonably withheld or delayed.
The Qt Company shall be entitled to freely assign or transfer any of its
rights, benefits or obligations under this Agreement.
14.2 No Third Party Representations
Licensee shall make no representations or warranties concerning the Licensed
Software on behalf of The Qt Company. Any representation or warranty Licensee
makes or purports to make on The Qt Company's behalf shall be void as to The
Qt Company.
14.3 Surviving Sections
Any terms and conditions that by their nature or otherwise reasonably should
survive termination of this Agreement shall so be deemed to survive.
14.4 Entire Agreement
This Agreement, the exhibits hereto, the License Certificate and any applicable
Purchase Order constitute the complete agreement between the Parties and
supersedes all prior or contemporaneous discussions, representations, and
proposals, written or oral, with respect to the subject matters discussed
herein.
In the event of any conflict or inconsistency between this Agreement and any
Purchase Order, the terms of this Agreement will prevail over the terms of the
Purchase Order with respect to such conflict or inconsistency.
Parties specifically acknowledge and agree that this Agreement prevails over
any click-to-accept or similar agreements the Designated Users may need to
accept online upon download of the Licensed Software, as may be required by
The Qt Company's applicable processes relating to Licensed Software.
14.5 Modifications
No modification of this Agreement shall be effective unless contained in a
writing executed by an authorized representative of each Party. No term or
condition contained in Licensee's Purchase Order shall apply unless expressly
accepted by The Qt Company in writing.
14.6 Force Majeure
Except for the payment obligations hereunder, neither Party shall be liable to
the other for any delay or non-performance of its obligations hereunder in the
event and to the extent that such delay or non-performance is due to an event
of act of God, terrorist attack or other similar unforeseeable catastrophic
event that prevents either Party for fulfilling its obligations under this
Agreement and which such Party cannot avoid or circumvent ("Force Majeure
Event"). If the Force Majeure Event results in a delay or non-performance of a
Party for a period of three (3) months or longer, then either Party shall have
the right to terminate this Agreement with immediate effect without any
liability (except for the obligations of payment arising prior to the event of
Force Majeure) towards the other Party.
14.7 Notices
Any notice given by one Party to the other shall be deemed properly given and
deemed received if specifically acknowledged by the receiving Party in writing
or when successfully delivered to the recipient by hand, fax, or special
courier during normal business hours on a business day to the addresses
specified for each Party on the signature page. Each communication and document
made or delivered by one Party to the other Party pursuant to this Agreement
shall be in the English language.
14.8 Export Control
Licensee acknowledges that the Redistributables may be subject to export
control restrictions under the applicable laws of respective countries.
Licensee shall fully comply with all applicable export license restrictions
and requirements as well as with all laws and regulations relating to the
Redistributables and exercise of licenses hereunder and shall procure all
necessary governmental authorizations, including without limitation, all
necessary licenses, approvals, permissions or consents, where necessary for the
re-exportation of the Redistributables, Applications and/or Devices.
14.9 No Implied License
There are no implied licenses or other implied rights granted under this
Agreement, and all rights, save for those expressly granted hereunder, shall
remain with The Qt Company and its licensors. In addition, no licenses or
immunities are granted to the combination of the Licensed Software with any
other software or hardware not delivered by The Qt Company under this Agreement.
14.10 Attorney Fees
The prevailing Party in any action to enforce this Agreement shall be entitled
to recover its attorney's fees and costs in connection with such action.
14.11 Severability
If any provision of this Agreement shall be adjudged by any court of competent
jurisdiction to be unenforceable or invalid, that provision shall be limited or
eliminated to the minimum extent necessary so that this Agreement shall
otherwise remain in full force and effect and enforceable.
IN WITNESS WHEREOF, the Parties hereto, intending to be legally bound hereby,
have caused this Agreement to be executed by Licensee's authorized
representative installing the Licensed Software and accepting the terms
hereof in connection therewith.
Appendix 1
1. Parts of the Licensed Software that are permitted for distribution in
object code form only ("Redistributables") under this Agreement:
- The Licensed Software's Qt Essentials and Qt Add-on libraries
- The Licensed Software's configuration tool ("qtconfig")
- The Licensed Software's help tool ("Qt Assistant")
- The Licensed Software's internationalization tools ("Qt Linguist", "lupdate",
"lrelease")
- The Licensed Software's QML ("Qt Quick") launcher tool ("qmlscene" or
"qmlviewer")
- The Licensed Software's installer framework
2. Parts of the Licensed Software that are not permitted for distribution
include, but are not limited to:
- The Licensed Software's source code and header files
- The Licensed Software's documentation
- The Licensed Software's documentation generation tool ("qdoc")
- The Licensed Software's tool for writing makefiles ("qmake")
- The Licensed Software's Meta Object Compiler ("moc")
- The Licensed Software's User Interface Compiler ("uic")
- The Licensed Software's Resource Compiler ("rcc")
- The Licensed Software's parts of the IDE tool ("Qt Creator")
- The Licensed Software's parts of the Design tools ("Qt 3D Studio" or
"Qt Quick Designer")
- The Licensed Software's Emulator

File diff suppressed because it is too large Load Diff

View File

@ -72,7 +72,7 @@ defineReplace(qtConfFunc_licenseCheck) {
hasOpenSource = true
else: \
hasOpenSource = false
exists($$QT_SOURCE_TREE/LICENSE.QT-LICENSE-AGREEMENT-4.0): \
exists($$QT_SOURCE_TREE/LICENSE.QT-LICENSE-AGREEMENT): \
hasCommercial = true
else: \
hasCommercial = false
@ -202,7 +202,7 @@ defineReplace(qtConfFunc_licenseCheck) {
affix = either
}
} else {
theLicense = $$cat($$QT_SOURCE_TREE/LICENSE.QT-LICENSE-AGREEMENT-4.0, lines)
theLicense = $$cat($$QT_SOURCE_TREE/LICENSE.QT-LICENSE-AGREEMENT, lines)
theLicense = $$first(theLicense)
showWhat = "Type '?' to view the $${theLicense}."
}
@ -229,7 +229,7 @@ defineReplace(qtConfFunc_licenseCheck) {
} else: equals(val, n)|equals(val, no) {
return(false)
} else: equals(commercial, yes):equals(val, ?) {
licenseFile = $$QT_SOURCE_TREE/LICENSE.QT-LICENSE-AGREEMENT-4.0
licenseFile = $$QT_SOURCE_TREE/LICENSE.QT-LICENSE-AGREEMENT
} else: equals(commercial, no):equals(val, l) {
licenseFile = $$QT_SOURCE_TREE/LICENSE.LGPL3
} else: equals(commercial, no):equals(val, g):$$gpl2Ok {

53
dist/changes-5.12.6 vendored Normal file
View File

@ -0,0 +1,53 @@
Qt 5.12.6 is a bug-fix release. It maintains both forward and backward
compatibility (source and binary) with Qt 5.12.0 through 5.12.5.
For more details, refer to the online documentation included in this
distribution. The documentation is also available online:
https://doc.qt.io/qt-5/index.html
The Qt version 5.12 series is binary compatible with the 5.11.x series.
Applications compiled for 5.11 will continue to run with 5.12.
Some of the changes listed in this file include issue tracking numbers
corresponding to tasks in the Qt Bug Tracker:
https://bugreports.qt.io/
Each of these identifiers can be entered in the bug tracker to obtain more
information about a particular change.
****************************************************************************
* QtCore *
****************************************************************************
- QLocale:
* The system locale's UI languages list now includes, as for that of an
ordinary locale, the results of adding likely sub-tags from each
locale name, and of removing some, where this doesn't change which
locale is specified. This gives searches for translation files a
better chance of finding a suitable file.
****************************************************************************
* Windows *
****************************************************************************
- Text:
* [QTBUG-57180] Removed confusing DirectWrite warning when loading
bitmap fonts.
****************************************************************************
* Android *
****************************************************************************
- Fixed regression that made it impossible for an application to use the
tap-and-hold gesture.
****************************************************************************
* Third-Party Code *
****************************************************************************
- libjpeg-turbo was updated to version 2.0.3
- QtSQL
* Updated sqlite to v3.29.0

25
dist/changes-5.12.7 vendored Normal file
View File

@ -0,0 +1,25 @@
Qt 5.12.7 is a bug-fix release. It maintains both forward and backward
compatibility (source and binary) with Qt 5.12.0 through 5.12.6.
For more details, refer to the online documentation included in this
distribution. The documentation is also available online:
https://doc.qt.io/qt-5/index.html
The Qt version 5.12 series is binary compatible with the 5.11.x series.
Applications compiled for 5.11 will continue to run with 5.12.
Some of the changes listed in this file include issue tracking numbers
corresponding to tasks in the Qt Bug Tracker:
https://bugreports.qt.io/
Each of these identifiers can be entered in the bug tracker to obtain more
information about a particular change.
****************************************************************************
* QtSQL *
****************************************************************************
- sqlite:
* Updated to v3.30.1

View File

@ -3,7 +3,7 @@
dita.metadata.default.author = Qt Project
dita.metadata.default.permissions = all
dita.metadata.default.publisher = Qt Project
dita.metadata.default.copyryear = 2019
dita.metadata.default.copyryear = 2020
dita.metadata.default.copyrholder = The Qt Company Ltd
dita.metadata.default.audience = programmer

View File

@ -78,7 +78,7 @@ HTML.footer += \
" <ul id=\"menu-footer-submenu\" class=\"right clearfix\"><li id=\"menu-item-1795\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-1795\"><a title=\"Sign into your account.\" href=\"https://account.qt.io/login\">Sign In</a></li>\n" \
" <li id=\"menu-item-10375\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-10375\"><a href=\"mailto:feedback@theqtcompany.com?Subject=Feedback%20about%20doc.qt.io%20site\">Feedback</a></li>\n" \
" <li id=\"menu-item-1494\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-1494\"><a href=\"http://qt.io/contact-us/\">Contact us</a></li>\n" \
" <li id=\"menu-item-4472\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-4472\"><a href=\"http://qt.io/about-us/\">© 2019 The Qt Company</a></li>\n" \
" <li id=\"menu-item-4472\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-4472\"><a href=\"http://qt.io/about-us/\">© 2020 The Qt Company</a></li>\n" \
" </ul>\n" \
"</div>\n" \
"</div>\n" \

View File

@ -8,7 +8,7 @@ HTML.footer = \
"</div>\n" \
"<div class=\"footer\">\n" \
" <p>\n" \
" <acronym title=\"Copyright\">&copy;</acronym> 2019 The Qt Company Ltd.\n" \
" <acronym title=\"Copyright\">&copy;</acronym> 2020 The Qt Company Ltd.\n" \
" Documentation contributions included herein are the copyrights of\n" \
" their respective owners.<br/>" \
" The documentation provided herein is licensed under the terms of the" \

View File

@ -5,7 +5,7 @@
HTML.footer = \
" </div>\n" \
" <p class=\"copy-notice\">\n" \
" <acronym title=\"Copyright\">&copy;</acronym> 2019 The Qt Company Ltd.\n" \
" <acronym title=\"Copyright\">&copy;</acronym> 2020 The Qt Company Ltd.\n" \
" Documentation contributions included herein are the copyrights of\n" \
" their respective owners. " \
" The documentation provided herein is licensed under the terms of the" \

View File

@ -228,7 +228,8 @@ mac {
CMAKE_PRL_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.prl
} else {
qt_framework {
CMAKE_LIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}.framework/$${CMAKE_QT_STEM}_debug
# Intentionally there is no '_debug' infix for framework builds.
CMAKE_LIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}.framework/$${CMAKE_QT_STEM}
CMAKE_LIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.framework/$${CMAKE_QT_STEM}
CMAKE_BUILD_IS_FRAMEWORK = "true"
} else {

View File

@ -97,21 +97,22 @@ macx-xcode {
qmake_pkginfo_typeinfo.value = "????"
QMAKE_MAC_XCODE_SETTINGS += qmake_pkginfo_typeinfo
!isEmpty(VERSION) {
l = $$split(VERSION, '.') 0 0 # make sure there are at least three
VER_MAJ = $$member(l, 0, 0)
VER_MIN = $$member(l, 1, 1)
VER_PAT = $$member(l, 2, 2)
unset(l)
bundle_version = $$VERSION
isEmpty(bundle_version): bundle_version = 1.0.0
qmake_full_version.name = QMAKE_FULL_VERSION
qmake_full_version.value = $${VER_MAJ}.$${VER_MIN}.$${VER_PAT}
QMAKE_MAC_XCODE_SETTINGS += qmake_full_version
l = $$split(bundle_version, '.') 0 0 # make sure there are at least three
VER_MAJ = $$member(l, 0, 0)
VER_MIN = $$member(l, 1, 1)
VER_PAT = $$member(l, 2, 2)
unset(l)
qmake_short_version.name = QMAKE_SHORT_VERSION
qmake_short_version.value = $${VER_MAJ}.$${VER_MIN}
QMAKE_MAC_XCODE_SETTINGS += qmake_short_version
}
qmake_full_version.name = QMAKE_FULL_VERSION
qmake_full_version.value = $${VER_MAJ}.$${VER_MIN}.$${VER_PAT}
QMAKE_MAC_XCODE_SETTINGS += qmake_full_version
qmake_short_version.name = QMAKE_SHORT_VERSION
qmake_short_version.value = $${VER_MAJ}.$${VER_MIN}
QMAKE_MAC_XCODE_SETTINGS += qmake_short_version
!isEmpty(QMAKE_XCODE_DEBUG_INFORMATION_FORMAT) {
debug_information_format.name = DEBUG_INFORMATION_FORMAT

View File

@ -821,9 +821,9 @@ defineTest(qtConfLibrary_pkgConfig) {
!qtConfResolveLibs($${1}.libs, $$libs): \
return(false)
contains($${1}.libs, ".*\\.$${QMAKE_EXTENSION_STATICLIB}$") {
qtRunLoggedCommand("$$pkg_config --static --libs-only-L $$args", libpaths)|return(false)
qtRunLoggedCommand("$$pkg_config --static --libs-only-l $$args", libs)|return(false)
eval(libs = $$libpaths $$libs)
qtRunLoggedCommand("$$pkg_config --static --libs $$args", libs)|return(false)
# Split by space
eval(libs = $$libs)
!qtConfResolveLibs($${1}.libs, $$libs): \
return(false)
}

View File

@ -1,4 +1,4 @@
QMAKE_TARGET_COMPANY = The Qt Company Ltd.
isEmpty(QMAKE_TARGET_PRODUCT): QMAKE_TARGET_PRODUCT = Qt5
isEmpty(QMAKE_TARGET_DESCRIPTION): QMAKE_TARGET_DESCRIPTION = C++ Application Development Framework
QMAKE_TARGET_COPYRIGHT = Copyright (C) 2019 The Qt Company Ltd.
QMAKE_TARGET_COPYRIGHT = Copyright (C) 2020 The Qt Company Ltd.

View File

@ -9,7 +9,7 @@ uic.depend_command = $$QMAKE_UIC_DEP -d ${QMAKE_FILE_IN}
uic.output = $$UI_DIR/$${QMAKE_MOD_UIC}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)}
uic.input = FORMS
uic.variable_out = GENERATED_FILES
uic.CONFIG += no_link target_predeps dep_lines
uic.CONFIG += no_link target_predeps dep_lines dep_existing_only
uic.name = UIC ${QMAKE_FILE_IN}
silent:uic.commands = @echo uic ${QMAKE_FILE_IN} && $$uic.commands
QMAKE_EXTRA_COMPILERS += uic

View File

@ -27,7 +27,7 @@ QOBJS = \
qjsonarray.o qjson.o qjsondocument.o qjsonobject.o qjsonparser.o qjsonvalue.o \
qmetatype.o qsystemerror.o qvariant.o \
quuid.o \
qarraydata.o qbitarray.o qbytearray.o qbytearraymatcher.o \
qarraydata.o qbitarray.o qbytearray.o qbytearraylist.o qbytearraymatcher.o \
qcryptographichash.o qdatetime.o qhash.o qlinkedlist.o qlist.o \
qlocale.o qlocale_tools.o qmap.o qregexp.o qringbuffer.o \
qstringbuilder.o qstring_compat.o qstring.o qstringlist.o qversionnumber.o \
@ -108,6 +108,7 @@ DEPEND_SRC = \
$(SOURCE_PATH)/src/corelib/tools/qarraydata.cpp \
$(SOURCE_PATH)/src/corelib/tools/qbitarray.cpp \
$(SOURCE_PATH)/src/corelib/tools/qbytearray.cpp\
$(SOURCE_PATH)/src/corelib/tools/qbytearraylist.cpp \
$(SOURCE_PATH)/src/corelib/tools/qbytearraymatcher.cpp \
$(SOURCE_PATH)/src/corelib/tools/qcryptographichash.cpp \
$(SOURCE_PATH)/src/corelib/tools/qdatetime.cpp \
@ -307,6 +308,9 @@ qarraydata.o: $(SOURCE_PATH)/src/corelib/tools/qarraydata.cpp
qbytearray.o: $(SOURCE_PATH)/src/corelib/tools/qbytearray.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
qbytearraylist.o: $(SOURCE_PATH)/src/corelib/tools/qbytearraylist.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
qvsnprintf.o: $(SOURCE_PATH)/src/corelib/tools/qvsnprintf.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<

View File

@ -71,6 +71,7 @@ QTOBJS= \
qfsfileengine_iterator.obj \
qarraydata.obj \
qbytearray.obj \
qbytearraylist.obj \
qvsnprintf.obj \
qbytearraymatcher.obj \
qdatetime.obj \

View File

@ -4728,6 +4728,11 @@
\li explicit_dependencies
\li The dependencies for the output only get generated from the depends
member and from nowhere else.
\row
\li dep_existing_only
\li Every dependency that is a result of .depend_command is checked for
existence. Non-existing dependencies are ignored.
This value was introduced in Qt 5.12.6.
\row
\li dep_lines
\li The output from the .depend_command is interpreted to be one file

View File

@ -1870,6 +1870,61 @@ QString MakefileGenerator::resolveDependency(const QDir &outDir, const QString &
return {};
}
void MakefileGenerator::callExtraCompilerDependCommand(const ProString &extraCompiler,
const QString &dep_cd_cmd,
const QString &tmp_dep_cmd,
const QString &inpf,
const QString &tmp_out,
bool dep_lines,
QStringList *deps,
bool existingDepsOnly,
bool checkCommandAvailability)
{
char buff[256];
QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, inpf, tmp_out, LocalShell);
if (checkCommandAvailability && !canExecute(dep_cmd))
return;
dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd);
if (FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), QT_POPEN_READ)) {
QByteArray depData;
while (int read_in = feof(proc) ? 0 : (int)fread(buff, 1, 255, proc))
depData.append(buff, read_in);
QT_PCLOSE(proc);
const QString indeps = QString::fromLocal8Bit(depData);
if (indeps.isEmpty())
return;
QDir outDir(Option::output_dir);
QStringList dep_cmd_deps = splitDeps(indeps, dep_lines);
for (int i = 0; i < dep_cmd_deps.count(); ++i) {
QString &file = dep_cmd_deps[i];
const QString absFile = outDir.absoluteFilePath(file);
if (absFile == file) {
// already absolute; don't do any checks.
} else if (exists(absFile)) {
file = absFile;
} else {
const QString localFile = resolveDependency(outDir, file);
if (localFile.isEmpty()) {
if (exists(file)) {
warn_msg(WarnDeprecated, ".depend_command for extra compiler %s"
" prints paths relative to source directory",
extraCompiler.toLatin1().constData());
} else if (existingDepsOnly) {
file.clear();
} else {
file = absFile; // fallback for generated resources
}
} else {
file = localFile;
}
}
if (!file.isEmpty())
file = fileFixify(file);
}
deps->append(dep_cmd_deps);
}
}
void
MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
{
@ -1984,6 +2039,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
}
t << endl;
}
const bool existingDepsOnly = config.contains("dep_existing_only");
QStringList tmp_dep = project->values(ProKey(*it + ".depends")).toQStringList();
if (config.indexOf("combine") != -1) {
if (tmp_out.contains(QRegExp("(^|[^$])\\$\\{QMAKE_(?!VAR_)"))) {
@ -1999,44 +2055,8 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
deps += findDependencies(inpf);
inputs += Option::fixPathToTargetOS(inpf, false);
if(!tmp_dep_cmd.isEmpty() && doDepends()) {
char buff[256];
QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, inpf, tmp_out, LocalShell);
dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd);
if (FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), QT_POPEN_READ)) {
QByteArray depData;
while (int read_in = feof(proc) ? 0 : (int)fread(buff, 1, 255, proc))
depData.append(buff, read_in);
QT_PCLOSE(proc);
const QString indeps = QString::fromLocal8Bit(depData);
if(!indeps.isEmpty()) {
QDir outDir(Option::output_dir);
QStringList dep_cmd_deps = splitDeps(indeps, dep_lines);
for(int i = 0; i < dep_cmd_deps.count(); ++i) {
QString &file = dep_cmd_deps[i];
QString absFile = outDir.absoluteFilePath(file);
if (absFile == file) {
// already absolute; don't do any checks.
} else if (exists(absFile)) {
file = absFile;
} else {
QString localFile = resolveDependency(outDir, file);
if (localFile.isEmpty()) {
if (exists(file))
warn_msg(WarnDeprecated, ".depend_command for extra compiler %s"
" prints paths relative to source directory",
(*it).toLatin1().constData());
else
file = absFile; // fallback for generated resources
} else {
file = localFile;
}
}
if(!file.isEmpty())
file = fileFixify(file);
}
deps += dep_cmd_deps;
}
}
callExtraCompilerDependCommand(*it, dep_cd_cmd, tmp_dep_cmd, inpf,
tmp_out, dep_lines, &deps, existingDepsOnly);
}
}
for(int i = 0; i < inputs.size(); ) {
@ -2084,44 +2104,8 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
for (ProStringList::ConstIterator it3 = vars.constBegin(); it3 != vars.constEnd(); ++it3)
cmd.replace("$(" + (*it3) + ")", "$(QMAKE_COMP_" + (*it3)+")");
if(!tmp_dep_cmd.isEmpty() && doDepends()) {
char buff[256];
QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, inpf, out, LocalShell);
dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd);
if (FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), QT_POPEN_READ)) {
QByteArray depData;
while (int read_in = feof(proc) ? 0 : (int)fread(buff, 1, 255, proc))
depData.append(buff, read_in);
QT_PCLOSE(proc);
const QString indeps = QString::fromLocal8Bit(depData);
if(!indeps.isEmpty()) {
QDir outDir(Option::output_dir);
QStringList dep_cmd_deps = splitDeps(indeps, dep_lines);
for(int i = 0; i < dep_cmd_deps.count(); ++i) {
QString &file = dep_cmd_deps[i];
QString absFile = outDir.absoluteFilePath(file);
if (absFile == file) {
// already absolute; don't do any checks.
} else if (exists(absFile)) {
file = absFile;
} else {
QString localFile = resolveDependency(outDir, file);
if (localFile.isEmpty()) {
if (exists(file))
warn_msg(WarnDeprecated, ".depend_command for extra compiler %s"
" prints paths relative to source directory",
(*it).toLatin1().constData());
else
file = absFile; // fallback for generated resources
} else {
file = localFile;
}
}
if(!file.isEmpty())
file = fileFixify(file);
}
deps += dep_cmd_deps;
}
}
callExtraCompilerDependCommand(*it, dep_cd_cmd, tmp_dep_cmd, inpf,
tmp_out, dep_lines, &deps, existingDepsOnly);
//use the depend system to find includes of these included files
QStringList inc_deps;
for(int i = 0; i < deps.size(); ++i) {

View File

@ -84,6 +84,11 @@ protected:
void writeExtraVariables(QTextStream &t);
void writeExtraTargets(QTextStream &t);
QString resolveDependency(const QDir &outDir, const QString &file);
void callExtraCompilerDependCommand(const ProString &extraCompiler, const QString &dep_cd_cmd,
const QString &tmp_dep_cmd, const QString &inpf,
const QString &tmp_out, bool dep_lines, QStringList *deps,
bool existingDepsOnly,
bool checkCommandAvailability = false);
void writeExtraCompilerTargets(QTextStream &t);
void writeExtraCompilerVariables(QTextStream &t);
bool writeDummyMakefile(QTextStream &t);

View File

@ -2350,33 +2350,15 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
if (!tmp_dep.isEmpty())
deps = tmp_dep;
if (!tmp_dep_cmd.isEmpty()) {
// Execute dependency command, and add every line as a dep
char buff[256];
QString dep_cmd = Project->replaceExtraCompilerVariables(
tmp_dep_cmd, inFile, out, MakefileGenerator::LocalShell);
if(Project->canExecute(dep_cmd)) {
dep_cmd.prepend(QLatin1String("cd ")
+ IoUtils::shellQuote(Option::fixPathToLocalOS(Option::output_dir, false))
+ QLatin1String(" && "));
if (FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), QT_POPEN_READ)) {
QString indeps;
while(!feof(proc)) {
int read_in = (int)fread(buff, 1, 255, proc);
if(!read_in)
break;
indeps += QByteArray(buff, read_in);
}
QT_PCLOSE(proc);
if(!indeps.isEmpty()) {
QStringList extradeps = indeps.split(QLatin1Char('\n'));
for (int i = 0; i < extradeps.count(); ++i) {
QString dd = extradeps.at(i).simplified();
if (!dd.isEmpty())
deps += Project->fileFixify(dd, MakefileGenerator::FileFixifyFromOutdir);
}
}
}
}
const QString dep_cd_cmd = QLatin1String("cd ")
+ IoUtils::shellQuote(Option::fixPathToLocalOS(Option::output_dir, false))
+ QLatin1String(" && ");
Project->callExtraCompilerDependCommand(extraCompilerName, dep_cd_cmd, tmp_dep_cmd,
inFile, out,
true, // dep_lines
&deps,
configs.contains("dep_existing_only"),
true /* checkCommandAvailability */);
}
for (int i = 0; i < deps.count(); ++i)
deps[i] = Option::fixPathToTargetOS(

View File

@ -1575,12 +1575,14 @@ void VcprojGenerator::initExtraCompilerOutputs()
if (!outputVar.isEmpty() && otherFilters.contains(outputVar))
continue;
QString tmp_out = project->first(outputs.first().toKey()).toQString();
QString tmp_out;
if (!outputs.isEmpty())
tmp_out = project->first(outputs.first().toKey()).toQString();
if (project->values(ProKey(*it + ".CONFIG")).indexOf("combine") != -1) {
// Combined output, only one file result
extraCompile.addFile(Option::fixPathToTargetOS(
replaceExtraCompilerVariables(tmp_out, QString(), QString(), NoShell), false));
} else {
} else if (!inputVars.isEmpty()) {
// One output file per input
const ProStringList &tmp_in = project->values(inputVars.first().toKey());
for (int i = 0; i < tmp_in.count(); ++i) {

View File

@ -68,6 +68,8 @@ public:
bool usePCH;
VCProjectWriter *projectWriter;
using Win32MakefileGenerator::callExtraCompilerDependCommand;
protected:
virtual VCProjectWriter *createProjectWriter();
bool doDepends() const override { return false; } // Never necessary

View File

@ -14,7 +14,7 @@ libjpeg-turbo is covered by three compatible BSD-style open source licenses:
This license covers the TurboJPEG API library and associated programs, as
well as the build system.
- The zlib License, which is listed below
- The [zlib License](https://opensource.org/licenses/Zlib)
This license is a subset of the other two, and it covers the libjpeg-turbo
SIMD extensions.
@ -66,7 +66,7 @@ best of our understanding.
2. If your binary distribution includes or uses the TurboJPEG API, then
your product documentation must include the text of the Modified BSD
License.
License (see below.)
**Origin**
- Clause 2 of the Modified BSD License
@ -91,7 +91,8 @@ best of our understanding.
The Modified (3-clause) BSD License
===================================
Copyright (C)\<YEAR\> \<AUTHOR\>. All Rights Reserved.
Copyright (C)2009-2019 D. R. Commander. All Rights Reserved.
Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -118,28 +119,6 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
The zlib License
================
Copyright (C) \<YEAR\>, \<AUTHOR\>.
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Why Three Licenses?
===================

View File

@ -2,22 +2,22 @@
#define JPEG_LIB_VERSION 80
#define LIBJPEG_TURBO_VERSION 2.0.0
#define LIBJPEG_TURBO_VERSION 2.0.3
#define LIBJPEG_TURBO_VERSION_NUMBER 2000000
#define LIBJPEG_TURBO_VERSION_NUMBER 2000002
#define C_ARITH_CODING_SUPPORTED
#define C_ARITH_CODING_SUPPORTED 1
#define D_ARITH_CODING_SUPPORTED
#define D_ARITH_CODING_SUPPORTED 1
#define MEM_SRCDST_SUPPORTED
#define MEM_SRCDST_SUPPORTED 1
#define BITS_IN_JSAMPLE 8
#define HAVE_STDDEF_H
#define HAVE_STDDEF_H 1
#define HAVE_STDLIB_H
#define HAVE_STDLIB_H 1
#define HAVE_UNSIGNED_CHAR
#define HAVE_UNSIGNED_CHAR 1
#define HAVE_UNSIGNED_SHORT
#define HAVE_UNSIGNED_SHORT 1

View File

@ -8,7 +8,7 @@
#define PACKAGE_NAME "libjpeg-turbo"
#define VERSION "2.0.0"
#define VERSION "2.0.3"
#if SIZE_MAX == 0xffffffff
#define SIZEOF_SIZE_T 4

View File

@ -6,11 +6,11 @@
"Description": "The Independent JPEG Group's JPEG software",
"Homepage": "http://libjpeg-turbo.virtualgl.org/",
"Version": "2.0.0",
"Version": "2.0.3",
"License": "Independent JPEG Group License",
"LicenseId": "IJG",
"LicenseFile": "LICENSE",
"Copyright": "Copyright (C) 2009-2018 D. R. Commander
"Copyright": "Copyright (C) 2009-2019 D. R. Commander
Copyright (C) 2011-2016 Siarhei Siamashka
Copyright (C) 2015-2016, 2018 Matthieu Darbois
Copyright (C) 2015 Intel Corporation

View File

@ -1,3 +1,111 @@
2.0.3
=====
### Significant changes relative to 2.0.2:
1. Fixed "using JNI after critical get" errors that occurred on Android
platforms when passing invalid arguments to certain methods in the TurboJPEG
Java API.
2. Fixed a regression in the SIMD feature detection code, introduced by
the AVX2 SIMD extensions (2.0 beta1[1]), that was known to cause an illegal
instruction exception, in rare cases, on CPUs that lack support for CPUID leaf
07H (or on which the maximum CPUID leaf has been limited by way of a BIOS
setting.)
3. The 4:4:0 (h1v2) fancy (smooth) chroma upsampling algorithm in the
decompressor now uses a similar bias pattern to that of the 4:2:2 (h2v1) fancy
chroma upsampling algorithm, rounding up or down the upsampled result for
alternate pixels rather than always rounding down. This ensures that,
regardless of whether a 4:2:2 JPEG image is rotated or transposed prior to
decompression (in the frequency domain) or after decompression (in the spatial
domain), the final image will be similar.
4. Fixed an integer overflow and subsequent segfault that occurred when
attempting to compress or decompress images with more than 1 billion pixels
using the TurboJPEG API.
5. Fixed a regression introduced by 2.0 beta1[15] whereby attempting to
generate a progressive JPEG image on an SSE2-capable CPU using a scan script
containing one or more scans with lengths divisible by 16 would result in an
error ("Missing Huffman code table entry") and an invalid JPEG image.
6. Fixed an issue whereby `tjDecodeYUV()` and `tjDecodeYUVPlanes()` would throw
an error ("Invalid progressive parameters") or a warning ("Inconsistent
progression sequence") if passed a TurboJPEG instance that was previously used
to decompress a progressive JPEG image.
2.0.2
=====
### Significant changes relative to 2.0.1:
1. Fixed a regression introduced by 2.0.1[5] that prevented a runtime search
path (rpath) from being embedded in the libjpeg-turbo shared libraries and
executables for macOS and iOS. This caused a fatal error of the form
"dyld: Library not loaded" when attempting to use one of the executables,
unless `DYLD_LIBRARY_PATH` was explicitly set to the location of the
libjpeg-turbo shared libraries.
2. Fixed an integer overflow and subsequent segfault (CVE-2018-20330) that
occurred when attempting to load a BMP file with more than 1 billion pixels
using the `tjLoadImage()` function.
3. Fixed a buffer overrun (CVE-2018-19664) that occurred when attempting to
decompress a specially-crafted malformed JPEG image to a 256-color BMP using
djpeg.
4. Fixed a floating point exception that occurred when attempting to
decompress a specially-crafted malformed JPEG image with a specified image
width or height of 0 using the C version of TJBench.
5. The TurboJPEG API will now decompress 4:4:4 JPEG images with 2x1, 1x2, 3x1,
or 1x3 luminance and chrominance sampling factors. This is a non-standard way
of specifying 1x subsampling (normally 4:4:4 JPEGs have 1x1 luminance and
chrominance sampling factors), but the JPEG format and the libjpeg API both
allow it.
6. Fixed a regression introduced by 2.0 beta1[7] that caused djpeg to generate
incorrect PPM images when used with the `-colors` option.
7. Fixed an issue whereby a static build of libjpeg-turbo (a build in which
`ENABLE_SHARED` is `0`) could not be installed using the Visual Studio IDE.
8. Fixed a severe performance issue in the Loongson MMI SIMD extensions that
occurred when compressing RGB images whose image rows were not 64-bit-aligned.
2.0.1
=====
### Significant changes relative to 2.0.0:
1. Fixed a regression introduced with the new CMake-based Un*x build system,
whereby jconfig.h could cause compiler warnings of the form
`"HAVE_*_H" redefined` if it was included by downstream Autotools-based
projects that used `AC_CHECK_HEADERS()` to check for the existence of locale.h,
stddef.h, or stdlib.h.
2. The `jsimd_quantize_float_dspr2()` and `jsimd_convsamp_float_dspr2()`
functions in the MIPS DSPr2 SIMD extensions are now disabled at compile time
if the soft float ABI is enabled. Those functions use instructions that are
incompatible with the soft float ABI.
3. Fixed a regression in the SIMD feature detection code, introduced by
the AVX2 SIMD extensions (2.0 beta1[1]), that caused libjpeg-turbo to crash on
Windows 7 if Service Pack 1 was not installed.
4. Fixed out-of-bounds read in cjpeg that occurred when attempting to compress
a specially-crafted malformed color-index (8-bit-per-sample) Targa file in
which some of the samples (color indices) exceeded the bounds of the Targa
file's color table.
5. Fixed an issue whereby installing a fully static build of libjpeg-turbo
(a build in which `CFLAGS` contains `-static` and `ENABLE_SHARED` is `0`) would
fail with "No valid ELF RPATH or RUNPATH entry exists in the file."
2.0.0
=====

View File

@ -135,12 +135,11 @@ without recompiling. libjpeg-turbo does not claim to support all of the
libjpeg v7+ features, nor to produce identical output to libjpeg v7+ in all
cases (see below.)
By passing an argument of `--with-jpeg7` or `--with-jpeg8` to `configure`, or
an argument of `-DWITH_JPEG7=1` or `-DWITH_JPEG8=1` to `cmake`, you can build a
version of libjpeg-turbo that emulates the libjpeg v7 or v8 ABI, so that
programs that are built against libjpeg v7 or v8 can be run with libjpeg-turbo.
The following section describes which libjpeg v7+ features are supported and
which aren't.
By passing an argument of `-DWITH_JPEG7=1` or `-DWITH_JPEG8=1` to `cmake`, you
can build a version of libjpeg-turbo that emulates the libjpeg v7 or v8 ABI, so
that programs that are built against libjpeg v7 or v8 can be run with
libjpeg-turbo. The following section describes which libjpeg v7+ features are
supported and which aren't.
### Support for libjpeg v7 and v8 Features
@ -247,9 +246,8 @@ don't, and it allows those functions to be provided in the "official"
libjpeg-turbo binaries.
Those who are concerned about maintaining strict conformance with the libjpeg
v6b or v7 API can pass an argument of `--without-mem-srcdst` to `configure` or
an argument of `-DWITH_MEM_SRCDST=0` to `cmake` prior to building
libjpeg-turbo. This will restore the pre-1.3 behavior, in which
v6b or v7 API can pass an argument of `-DWITH_MEM_SRCDST=0` to `cmake` prior to
building libjpeg-turbo. This will restore the pre-1.3 behavior, in which
`jpeg_mem_src()` and `jpeg_mem_dest()` are only included when emulating the
libjpeg v8 API/ABI.
@ -344,3 +342,15 @@ quality of 98-100. Thus, libjpeg-turbo must use the non-SIMD quantization
function in those cases. This causes performance to drop by as much as 40%.
It is therefore strongly advised that you use the slow integer forward DCT
whenever encoding images with a JPEG quality of 98 or higher.
Memory Debugger Pitfalls
========================
Valgrind and Memory Sanitizer (MSan) can generate false positives
(specifically, incorrect reports of uninitialized memory accesses) when used
with libjpeg-turbo's SIMD extensions. It is generally recommended that the
SIMD extensions be disabled, either by passing an argument of `-DWITH_SIMD=0`
to `cmake` when configuring the build or by setting the environment variable
`JSIMD_FORCENONE` to `1` at run time, when testing libjpeg-turbo with Valgrind,
MSan, or other memory debuggers.

View File

@ -4,7 +4,7 @@
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright (C) 2009-2011, 2014-2016, 2018, D. R. Commander.
* Copyright (C) 2009-2011, 2014-2016, 2018-2019, D. R. Commander.
* Copyright (C) 2015, Matthieu Darbois.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
@ -356,6 +356,8 @@ dump_buffer(working_state *state)
put_buffer = (put_buffer << size) | code; \
}
#if SIZEOF_SIZE_T != 8 && !defined(_WIN64)
#define CHECKBUF15() { \
if (put_bits > 15) { \
EMIT_BYTE() \
@ -363,6 +365,8 @@ dump_buffer(working_state *state)
} \
}
#endif
#define CHECKBUF31() { \
if (put_bits > 31) { \
EMIT_BYTE() \

View File

@ -492,8 +492,8 @@ prepare_for_pass(j_compress_ptr cinfo)
*/
master->pass_type = output_pass;
master->pass_number++;
/*FALLTHROUGH*/
#endif
/*FALLTHROUGH*/
case output_pass:
/* Do a data-output pass. */
/* We need not repeat per-scan setup if prior optimization pass did it. */

View File

@ -10,16 +10,16 @@
#define LIBJPEG_TURBO_VERSION_NUMBER @LIBJPEG_TURBO_VERSION_NUMBER@
/* Support arithmetic encoding */
#cmakedefine C_ARITH_CODING_SUPPORTED
#cmakedefine C_ARITH_CODING_SUPPORTED 1
/* Support arithmetic decoding */
#cmakedefine D_ARITH_CODING_SUPPORTED
#cmakedefine D_ARITH_CODING_SUPPORTED 1
/* Support in-memory source/destination managers */
#cmakedefine MEM_SRCDST_SUPPORTED
#cmakedefine MEM_SRCDST_SUPPORTED 1
/* Use accelerated SIMD routines. */
#cmakedefine WITH_SIMD
#cmakedefine WITH_SIMD 1
/*
* Define BITS_IN_JSAMPLE as either
@ -33,37 +33,37 @@
#define BITS_IN_JSAMPLE @BITS_IN_JSAMPLE@ /* use 8 or 12 */
/* Define to 1 if you have the <locale.h> header file. */
#cmakedefine HAVE_LOCALE_H
#cmakedefine HAVE_LOCALE_H 1
/* Define to 1 if you have the <stddef.h> header file. */
#cmakedefine HAVE_STDDEF_H
#cmakedefine HAVE_STDDEF_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#cmakedefine HAVE_STDLIB_H
#cmakedefine HAVE_STDLIB_H 1
/* Define if you need to include <sys/types.h> to get size_t. */
#cmakedefine NEED_SYS_TYPES_H
#cmakedefine NEED_SYS_TYPES_H 1
/* Define if you have BSD-like bzero and bcopy in <strings.h> rather than
memset/memcpy in <string.h>. */
#cmakedefine NEED_BSD_STRINGS
#cmakedefine NEED_BSD_STRINGS 1
/* Define to 1 if the system has the type `unsigned char'. */
#cmakedefine HAVE_UNSIGNED_CHAR
#cmakedefine HAVE_UNSIGNED_CHAR 1
/* Define to 1 if the system has the type `unsigned short'. */
#cmakedefine HAVE_UNSIGNED_SHORT
#cmakedefine HAVE_UNSIGNED_SHORT 1
/* Compiler does not support pointers to undefined structures. */
#cmakedefine INCOMPLETE_TYPES_BROKEN
#cmakedefine INCOMPLETE_TYPES_BROKEN 1
/* Define if your (broken) compiler shifts signed values as if they were
unsigned. */
#cmakedefine RIGHT_SHIFT_IS_UNSIGNED
#cmakedefine RIGHT_SHIFT_IS_UNSIGNED 1
/* Define to 1 if type `char' is unsigned and you are not using gcc. */
#ifndef __CHAR_UNSIGNED__
#cmakedefine __CHAR_UNSIGNED__
#cmakedefine __CHAR_UNSIGNED__ 1
#endif
/* Define to empty if `const' does not conform to ANSI C. */

View File

@ -592,7 +592,7 @@ ycck_cmyk_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
/* Declarations for ordered dithering
*
* We use a 4x4 ordered dither array packed into 32 bits. This array is
* sufficent for dithering RGB888 to RGB565.
* sufficient for dithering RGB888 to RGB565.
*/
#define DITHER_MASK 0x3

View File

@ -4,7 +4,7 @@
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright (C) 2009-2011, 2016, 2018, D. R. Commander.
* Copyright (C) 2009-2011, 2016, 2018-2019, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
@ -589,7 +589,11 @@ decode_mcu_slow(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
if (entropy->dc_needed[blkn]) {
/* Convert DC difference to actual value, update last_dc_val */
int ci = cinfo->MCU_membership[blkn];
s += state.last_dc_val[ci];
/* This is really just
* s += state.last_dc_val[ci];
* It is written this way in order to shut up UBSan.
*/
s = (int)((unsigned int)s + (unsigned int)state.last_dc_val[ci]);
state.last_dc_val[ci] = s;
if (block) {
/* Output the DC coefficient (assumes jpeg_natural_order[0] = 0) */
@ -684,7 +688,7 @@ decode_mcu_fast(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
if (entropy->dc_needed[blkn]) {
int ci = cinfo->MCU_membership[blkn];
s += state.last_dc_val[ci];
s = (int)((unsigned int)s + (unsigned int)state.last_dc_val[ci]);
state.last_dc_val[ci] = s;
if (block)
(*block)[0] = (JCOEF)s;

View File

@ -429,8 +429,6 @@ h2v2_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
#define PACK_TWO_PIXELS_LE(l, r) ((r << 16) | l)
#define PACK_TWO_PIXELS_BE(l, r) ((l << 16) | r)
#define PACK_NEED_ALIGNMENT(ptr) (((size_t)(ptr)) & 3)
#define WRITE_TWO_PIXELS_LE(addr, pixels) { \
((INT16 *)(addr))[0] = (INT16)(pixels); \
((INT16 *)(addr))[1] = (INT16)((pixels) >> 16); \
@ -448,7 +446,7 @@ h2v2_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
/* Declarations for ordered dithering
*
* We use a 4x4 ordered dither array packed into 32 bits. This array is
* sufficent for dithering RGB888 to RGB565.
* sufficient for dithering RGB888 to RGB565.
*/
#define DITHER_MASK 0x3

View File

@ -8,6 +8,7 @@
* Copyright (C) 2010, 2015-2016, D. R. Commander.
* Copyright (C) 2014, MIPS Technologies, Inc., California.
* Copyright (C) 2015, Google, Inc.
* Copyright (C) 2019, Arm Limited.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
@ -315,9 +316,9 @@ h1v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
JSAMPARRAY output_data = *output_data_ptr;
JSAMPROW inptr0, inptr1, outptr;
#if BITS_IN_JSAMPLE == 8
int thiscolsum;
int thiscolsum, bias;
#else
JLONG thiscolsum;
JLONG thiscolsum, bias;
#endif
JDIMENSION colctr;
int inrow, outrow, v;
@ -327,15 +328,18 @@ h1v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
for (v = 0; v < 2; v++) {
/* inptr0 points to nearest input row, inptr1 points to next nearest */
inptr0 = input_data[inrow];
if (v == 0) /* next nearest is row above */
if (v == 0) { /* next nearest is row above */
inptr1 = input_data[inrow - 1];
else /* next nearest is row below */
bias = 1;
} else { /* next nearest is row below */
inptr1 = input_data[inrow + 1];
bias = 2;
}
outptr = output_data[outrow++];
for (colctr = 0; colctr < compptr->downsampled_width; colctr++) {
thiscolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);
*outptr++ = (JSAMPLE)((thiscolsum + 1) >> 2);
*outptr++ = (JSAMPLE)((thiscolsum + bias) >> 2);
}
}
inrow++;

View File

@ -154,7 +154,7 @@ typedef struct {
*/
boolean is_padded; /* is the colorindex padded for odither? */
int Ncolors[MAX_Q_COMPS]; /* # of values alloced to each component */
int Ncolors[MAX_Q_COMPS]; /* # of values allocated to each component */
/* Variables for ordered dithering */
int row_index; /* cur row's vertical index in dither matrix */

View File

@ -4,7 +4,7 @@
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2010, 2012-2018, D. R. Commander.
* Copyright (C) 2010, 2012-2019, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
@ -36,7 +36,7 @@
*/
#define JCOPYRIGHT \
"Copyright (C) 2009-2018 D. R. Commander\n" \
"Copyright (C) 2009-2019 D. R. Commander\n" \
"Copyright (C) 2011-2016 Siarhei Siamashka\n" \
"Copyright (C) 2015-2016, 2018 Matthieu Darbois\n" \
"Copyright (C) 2015 Intel Corporation\n" \
@ -49,4 +49,4 @@
"Copyright (C) 1991-2016 Thomas G. Lane, Guido Vollbeding"
#define JCOPYRIGHT_SHORT \
"Copyright (C) 1991-2018 The libjpeg-turbo Project and many others"
"Copyright (C) 1991-2019 The libjpeg-turbo Project and many others"

View File

@ -0,0 +1,26 @@
From 676425e522e08eb0e7dfaacdac79a5de27542322 Mon Sep 17 00:00:00 2001
From: Andy Shaw <andy.shaw@qt.io>
Date: Wed, 11 Dec 2019 10:51:22 +0100
Subject: [PATCH 53/53] Fix CVE-2019-19244 in SQLite
Fixes: QTBUG-80635
Change-Id: I718349e28ec76ea164dd50f2a985f2074dd6bdbd
---
src/3rdparty/sqlite/sqlite3.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c
index 8fd740b300..bd647ca1c2 100644
--- a/src/3rdparty/sqlite/sqlite3.c
+++ b/src/3rdparty/sqlite/sqlite3.c
@@ -131679,6 +131679,7 @@ SQLITE_PRIVATE int sqlite3Select(
*/
if( (p->selFlags & (SF_Distinct|SF_Aggregate))==SF_Distinct
&& sqlite3ExprListCompare(sSort.pOrderBy, pEList, -1)==0
+ && p->pWin==0
){
p->selFlags &= ~SF_Distinct;
pGroupBy = p->pGroupBy = sqlite3ExprListDup(db, pEList, 0);
--
2.21.0 (Apple Git-122.2)

View File

@ -0,0 +1,31 @@
From 7905740b8e79479298e83d8e559fc49b46cf980e Mon Sep 17 00:00:00 2001
From: Andy Shaw <andy.shaw@qt.io>
Date: Thu, 19 Dec 2019 21:59:09 +0100
Subject: [PATCH] Fix CVE-2019-19242 in SQLite
Change-Id: I78a72a574da5cf3503950afe47146ae6424f00c6
---
src/3rdparty/sqlite/sqlite3.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c
index bd647ca1c2..d3e0c065b6 100644
--- a/src/3rdparty/sqlite/sqlite3.c
+++ b/src/3rdparty/sqlite/sqlite3.c
@@ -101055,7 +101055,12 @@ expr_code_doover:
** constant.
*/
int iReg = sqlite3ExprCodeTarget(pParse, pExpr->pLeft,target);
- int aff = sqlite3TableColumnAffinity(pExpr->y.pTab, pExpr->iColumn);
+ int aff;
+ if( pExpr->y.pTab ){
+ aff = sqlite3TableColumnAffinity(pExpr->y.pTab, pExpr->iColumn);
+ }else{
+ aff = pExpr->affExpr;
+ }
if( aff>SQLITE_AFF_BLOB ){
static const char zAff[] = "B\000C\000D\000E";
assert( SQLITE_AFF_BLOB=='A' );
--
2.21.0 (Apple Git-122.2)

View File

@ -0,0 +1,95 @@
From 11a2f4647b67494fb731a6fd793f1b28074631d3 Mon Sep 17 00:00:00 2001
From: Andy Shaw <andy.shaw@qt.io>
Date: Thu, 19 Dec 2019 22:31:15 +0100
Subject: [PATCH] Fix CVE-2019-19603 in SQLite
This includes the patch needed to fix this CVE and a supporting one to
include a new function added that it depends on.
Task-number: QTBUG-80903
Change-Id: Ic7639d50c89a3ee7d45426588c3ab0efd0eebb72
---
src/3rdparty/sqlite/sqlite3.c | 32 ++++++++++++++++++++++++++------
1 file changed, 26 insertions(+), 6 deletions(-)
diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c
index d3e0c065b6..a430554db7 100644
--- a/src/3rdparty/sqlite/sqlite3.c
+++ b/src/3rdparty/sqlite/sqlite3.c
@@ -19519,6 +19519,12 @@ SQLITE_PRIVATE Module *sqlite3VtabCreateModule(
);
# define sqlite3VtabInSync(db) ((db)->nVTrans>0 && (db)->aVTrans==0)
#endif
+SQLITE_PRIVATE int sqlite3ReadOnlyShadowTables(sqlite3 *db);
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+SQLITE_PRIVATE int sqlite3ShadowTableName(sqlite3 *db, const char *zName);
+#else
+# define sqlite3ShadowTableName(A,B) 0
+#endif
SQLITE_PRIVATE int sqlite3VtabEponymousTableInit(Parse*,Module*);
SQLITE_PRIVATE void sqlite3VtabEponymousTableClear(sqlite3*,Module*);
SQLITE_PRIVATE void sqlite3VtabMakeWritable(Parse*,Table*);
@@ -108483,6 +108489,22 @@ SQLITE_PRIVATE int sqlite3WritableSchema(sqlite3 *db){
return (db->flags&(SQLITE_WriteSchema|SQLITE_Defensive))==SQLITE_WriteSchema;
}
+/*
+ ** Return TRUE if shadow tables should be read-only in the current
+ ** context.
+ */
+int sqlite3ReadOnlyShadowTables(sqlite3 *db){
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ if( (db->flags & SQLITE_Defensive)!=0
+ && db->pVtabCtx==0
+ && db->nVdbeExec==0
+ ){
+ return 1;
+ }
+#endif
+ return 0;
+}
+
/*
** This routine is used to check if the UTF-8 string zName is a legal
** unqualified name for a new schema object (table, index, view or
@@ -108516,8 +108538,8 @@ SQLITE_PRIVATE int sqlite3CheckObjectName(
}
}
}else{
- if( pParse->nested==0
- && 0==sqlite3StrNICmp(zName, "sqlite_", 7)
+ if( (pParse->nested==0 && 0==sqlite3StrNICmp(zName, "sqlite_", 7))
+ || (sqlite3ReadOnlyShadowTables(db) && sqlite3ShadowTableName(db, zName))
){
sqlite3ErrorMsg(pParse, "object name reserved for internal use: %s",
zName);
@@ -109662,7 +109684,7 @@ static void convertToWithoutRowidTable(Parse *pParse, Table *pTab){
** zName is temporarily modified while this routine is running, but is
** restored to its original value prior to this routine returning.
*/
-static int isShadowTableName(sqlite3 *db, char *zName){
+int sqlite3ShadowTableName(sqlite3 *db, const char *zName){
char *zTail; /* Pointer to the last "_" in zName */
Table *pTab; /* Table that zName is a shadow of */
Module *pMod; /* Module for the virtual table */
@@ -109680,8 +109702,6 @@ static int isShadowTableName(sqlite3 *db, char *zName){
if( pMod->pModule->xShadowName==0 ) return 0;
return pMod->pModule->xShadowName(zTail+1);
}
-#else
-# define isShadowTableName(x,y) 0
#endif /* ifndef SQLITE_OMIT_VIRTUALTABLE */
/*
@@ -109723,7 +109743,7 @@ SQLITE_PRIVATE void sqlite3EndTable(
p = pParse->pNewTable;
if( p==0 ) return;
- if( pSelect==0 && isShadowTableName(db, p->zName) ){
+ if( pSelect==0 && sqlite3ShadowTableName(db, p->zName) ){
p->tabFlags |= TF_Shadow;
}
--
2.21.0 (Apple Git-122.2)

View File

@ -0,0 +1,29 @@
From a83bbce4d6f31d93ea4d2a681aa52c148f148e26 Mon Sep 17 00:00:00 2001
From: Andy Shaw <andy.shaw@qt.io>
Date: Thu, 2 Jan 2020 09:07:08 +0100
Subject: [PATCH] Fix CVE-2019-19646 in SQLite
Task-number: QTBUG-81020
Change-Id: I7176db20d4a44b1fb443a6108675f719e9643343
---
src/3rdparty/sqlite/sqlite3.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c
index 57e61b8313..980a149b1a 100644
--- a/src/3rdparty/sqlite/sqlite3.c
+++ b/src/3rdparty/sqlite/sqlite3.c
@@ -123765,7 +123765,9 @@ SQLITE_PRIVATE void sqlite3Pragma(
if( j==pTab->iPKey ) continue;
if( pTab->aCol[j].notNull==0 ) continue;
sqlite3ExprCodeGetColumnOfTable(v, pTab, iDataCur, j, 3);
- sqlite3VdbeChangeP5(v, OPFLAG_TYPEOFARG);
+ if( sqlite3VdbeGetOp(v,-1)->opcode==OP_Column ){
+ sqlite3VdbeChangeP5(v, OPFLAG_TYPEOFARG);
+ }
jmp2 = sqlite3VdbeAddOp1(v, OP_NotNull, 3); VdbeCoverage(v);
zErr = sqlite3MPrintf(db, "NULL value in %s.%s", pTab->zName,
pTab->aCol[j].zName);
--
2.21.0 (Apple Git-122.2)

View File

@ -0,0 +1,83 @@
From 78c972eec5bab03a408b8ba1373572bcfe2db630 Mon Sep 17 00:00:00 2001
From: Andy Shaw <andy.shaw@qt.io>
Date: Thu, 2 Jan 2020 08:47:23 +0100
Subject: [PATCH] Fix CVE-2019-19645 in SQLite
Task-number: QTBUG-81020
Change-Id: I58b1dd9e7a90ba998c3af7f25a4627d8bdd70970
---
src/3rdparty/sqlite/sqlite3.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c
index d3e0c065b6..57e61b8313 100644
--- a/src/3rdparty/sqlite/sqlite3.c
+++ b/src/3rdparty/sqlite/sqlite3.c
@@ -17946,6 +17946,7 @@ struct Select {
#define SF_IncludeHidden 0x20000 /* Include hidden columns in output */
#define SF_ComplexResult 0x40000 /* Result contains subquery or function */
#define SF_WhereBegin 0x80000 /* Really a WhereBegin() call. Debug Only */
+#define SF_View 0x0200000 /* SELECT statement is a view */
/*
** The results of a SELECT can be distributed in several ways, as defined
@@ -103920,6 +103921,7 @@ static int renameUnmapExprCb(Walker *pWalker, Expr *pExpr){
static int renameUnmapSelectCb(Walker *pWalker, Select *p){
Parse *pParse = pWalker->pParse;
int i;
+ if( p->selFlags & SF_View ) return WRC_Prune;
if( ALWAYS(p->pEList) ){
ExprList *pList = p->pEList;
for(i=0; i<pList->nExpr; i++){
@@ -104024,6 +104026,7 @@ static void renameWalkWith(Walker *pWalker, Select *pSelect){
** descend into sub-select statements.
*/
static int renameColumnSelectCb(Walker *pWalker, Select *p){
+ if( p->selFlags & SF_View ) return WRC_Prune;
renameWalkWith(pWalker, p);
return WRC_Continue;
}
@@ -104489,8 +104492,9 @@ static void renameColumnFunc(
if( sParse.pNewTable ){
Select *pSelect = sParse.pNewTable->pSelect;
if( pSelect ){
+ pSelect->selFlags &= ~SF_View;
sParse.rc = SQLITE_OK;
- sqlite3SelectPrep(&sParse, sParse.pNewTable->pSelect, 0);
+ sqlite3SelectPrep(&sParse, pSelect, 0);
rc = (db->mallocFailed ? SQLITE_NOMEM : sParse.rc);
if( rc==SQLITE_OK ){
sqlite3WalkSelect(&sWalker, pSelect);
@@ -104602,6 +104606,7 @@ static int renameTableSelectCb(Walker *pWalker, Select *pSelect){
int i;
RenameCtx *p = pWalker->u.pRename;
SrcList *pSrc = pSelect->pSrc;
+ if( pSelect->selFlags & SF_View ) return WRC_Prune;
if( pSrc==0 ){
assert( pWalker->pParse->db->mallocFailed );
return WRC_Abort;
@@ -104681,10 +104686,13 @@ static void renameTableFunc(
if( pTab->pSelect ){
if( isLegacy==0 ){
+ Select *pSelect = pTab->pSelect;
NameContext sNC;
memset(&sNC, 0, sizeof(sNC));
sNC.pParse = &sParse;
+ assert( pSelect->selFlags & SF_View );
+ pSelect->selFlags &= ~SF_View;
sqlite3SelectPrep(&sParse, pTab->pSelect, &sNC);
if( sParse.nErr ) rc = sParse.rc;
sqlite3WalkSelect(&sWalker, pTab->pSelect);
@@ -109994,6 +110002,7 @@ SQLITE_PRIVATE void sqlite3CreateView(
** allocated rather than point to the input string - which means that
** they will persist after the current sqlite3_exec() call returns.
*/
+ pSelect->selFlags |= SF_View;
if( IN_RENAME_OBJECT ){
p->pSelect = pSelect;
pSelect = 0;
--
2.21.0 (Apple Git-122.2)

View File

@ -0,0 +1,30 @@
From 423d82ac8c7c545e8eac6f70a3e5e92208b7d991 Mon Sep 17 00:00:00 2001
From: Andy Shaw <andy.shaw@qt.io>
Date: Tue, 21 Jan 2020 15:15:00 +0100
Subject: [PATCH] Fix CVE-2019-19880 in SQLite
Fixes: QTBUG-81565
Change-Id: I6bf2364e696315e5262d1abfa2f0b6947f14a33b
---
src/3rdparty/sqlite/sqlite3.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c
index d5b43857ad..cd1a4d5221 100644
--- a/src/3rdparty/sqlite/sqlite3.c
+++ b/src/3rdparty/sqlite/sqlite3.c
@@ -147620,9 +147620,11 @@ static ExprList *exprListAppendList(
int nInit = pList ? pList->nExpr : 0;
for(i=0; i<pAppend->nExpr; i++){
Expr *pDup = sqlite3ExprDup(pParse->db, pAppend->a[i].pExpr, 0);
+ assert( pDup==0 || !ExprHasProperty(pDup, EP_MemToken) );
if( bIntToNull && pDup && pDup->op==TK_INTEGER ){
pDup->op = TK_NULL;
pDup->flags &= ~(EP_IntValue|EP_IsTrue|EP_IsFalse);
+ pDup->u.zToken = 0;
}
pList = sqlite3ExprListAppend(pParse, pList, pDup);
if( pList ) pList->a[nInit+i].sortFlags = pAppend->a[i].sortFlags;
--
2.21.0 (Apple Git-122.2)

View File

@ -6,8 +6,8 @@
"Description": "SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine.",
"Homepage": "https://www.sqlite.org/",
"Version": "3.28.0",
"DownloadLocation": "https://www.sqlite.org/2019/sqlite-amalgamation-3280000.zip",
"Version": "3.30.1",
"DownloadLocation": "https://www.sqlite.org/2019/sqlite-amalgamation-3300100.zip",
"License": "Public Domain",
"Copyright": "The authors disclaim copyright to the source code. However, a license can be obtained if needed."
}

File diff suppressed because it is too large Load Diff

View File

@ -123,9 +123,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
#define SQLITE_VERSION "3.28.0"
#define SQLITE_VERSION_NUMBER 3028000
#define SQLITE_SOURCE_ID "2019-04-16 19:49:53 884b4b7e502b4e991677b53971277adfaf0a04a284f8e483e2553d0f83156b50"
#define SQLITE_VERSION "3.30.1"
#define SQLITE_VERSION_NUMBER 3030001
#define SQLITE_SOURCE_ID "2019-10-10 20:19:45 18db032d058f1436ce3dea84081f4ee5a0f2259ad97301d43c426bc7f3df1b0b"
/*
** CAPI3REF: Run-Time Library Version Numbers
@ -1296,8 +1296,14 @@ typedef struct sqlite3_api_routines sqlite3_api_routines;
** ^The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS]
** to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to
** test whether a file is readable and writable, or [SQLITE_ACCESS_READ]
** to test whether a file is at least readable. The file can be a
** directory.
** to test whether a file is at least readable. The SQLITE_ACCESS_READ
** flag is never actually used and is not implemented in the built-in
** VFSes of SQLite. The file is named by the second argument and can be a
** directory. The xAccess method returns [SQLITE_OK] on success or some
** non-zero error code if there is an I/O error or if the name of
** the file given in the second argument is illegal. If SQLITE_OK
** is returned, then non-zero or zero is written into *pResOut to indicate
** whether or not the file is accessible.
**
** ^SQLite will always allocate at least mxPathname+1 bytes for the
** output buffer xFullPathname. The exact size of the output buffer
@ -2087,6 +2093,17 @@ struct sqlite3_mem_methods {
** following this call. The second parameter may be a NULL pointer, in
** which case the trigger setting is not reported back. </dd>
**
** [[SQLITE_DBCONFIG_ENABLE_VIEW]]
** <dt>SQLITE_DBCONFIG_ENABLE_VIEW</dt>
** <dd> ^This option is used to enable or disable [CREATE VIEW | views].
** There should be two additional arguments.
** The first argument is an integer which is 0 to disable views,
** positive to enable views or negative to leave the setting unchanged.
** The second parameter is a pointer to an integer into which
** is written 0 or 1 to indicate whether views are disabled or enabled
** following this call. The second parameter may be a NULL pointer, in
** which case the view setting is not reported back. </dd>
**
** [[SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER]]
** <dt>SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER</dt>
** <dd> ^This option is used to enable or disable the
@ -2198,6 +2215,7 @@ struct sqlite3_mem_methods {
** features include but are not limited to the following:
** <ul>
** <li> The [PRAGMA writable_schema=ON] statement.
** <li> The [PRAGMA journal_mode=OFF] statement.
** <li> Writes to the [sqlite_dbpage] virtual table.
** <li> Direct writes to [shadow tables].
** </ul>
@ -2213,6 +2231,34 @@ struct sqlite3_mem_methods {
** integer into which is written 0 or 1 to indicate whether the writable_schema
** is enabled or disabled following this call.
** </dd>
**
** [[SQLITE_DBCONFIG_LEGACY_ALTER_TABLE]]
** <dt>SQLITE_DBCONFIG_LEGACY_ALTER_TABLE</dt>
** <dd>The SQLITE_DBCONFIG_LEGACY_ALTER_TABLE option activates or deactivates
** the legacy behavior of the [ALTER TABLE RENAME] command such it
** behaves as it did prior to [version 3.24.0] (2018-06-04). See the
** "Compatibility Notice" on the [ALTER TABLE RENAME documentation] for
** additional information. This feature can also be turned on and off
** using the [PRAGMA legacy_alter_table] statement.
** </dd>
**
** [[SQLITE_DBCONFIG_DQS_DML]]
** <dt>SQLITE_DBCONFIG_DQS_DML</td>
** <dd>The SQLITE_DBCONFIG_DQS_DML option activates or deactivates
** the legacy [double-quoted string literal] misfeature for DML statement
** only, that is DELETE, INSERT, SELECT, and UPDATE statements. The
** default value of this setting is determined by the [-DSQLITE_DQS]
** compile-time option.
** </dd>
**
** [[SQLITE_DBCONFIG_DQS_DDL]]
** <dt>SQLITE_DBCONFIG_DQS_DDL</td>
** <dd>The SQLITE_DBCONFIG_DQS option activates or deactivates
** the legacy [double-quoted string literal] misfeature for DDL statements,
** such as CREATE TABLE and CREATE INDEX. The
** default value of this setting is determined by the [-DSQLITE_DQS]
** compile-time option.
** </dd>
** </dl>
*/
#define SQLITE_DBCONFIG_MAINDBNAME 1000 /* const char* */
@ -2227,7 +2273,11 @@ struct sqlite3_mem_methods {
#define SQLITE_DBCONFIG_RESET_DATABASE 1009 /* int int* */
#define SQLITE_DBCONFIG_DEFENSIVE 1010 /* int int* */
#define SQLITE_DBCONFIG_WRITABLE_SCHEMA 1011 /* int int* */
#define SQLITE_DBCONFIG_MAX 1011 /* Largest DBCONFIG */
#define SQLITE_DBCONFIG_LEGACY_ALTER_TABLE 1012 /* int int* */
#define SQLITE_DBCONFIG_DQS_DML 1013 /* int int* */
#define SQLITE_DBCONFIG_DQS_DDL 1014 /* int int* */
#define SQLITE_DBCONFIG_ENABLE_VIEW 1015 /* int int* */
#define SQLITE_DBCONFIG_MAX 1015 /* Largest DBCONFIG */
/*
** CAPI3REF: Enable Or Disable Extended Result Codes
@ -3776,7 +3826,7 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal);
** ^The specific value of WHERE-clause [parameter] might influence the
** choice of query plan if the parameter is the left-hand side of a [LIKE]
** or [GLOB] operator or if the parameter is compared to an indexed column
** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
** and the [SQLITE_ENABLE_STAT4] compile-time option is enabled.
** </li>
** </ol>
**
@ -4811,6 +4861,12 @@ SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt);
** perform additional optimizations on deterministic functions, so use
** of the [SQLITE_DETERMINISTIC] flag is recommended where possible.
**
** ^The fourth parameter may also optionally include the [SQLITE_DIRECTONLY]
** flag, which if present prevents the function from being invoked from
** within VIEWs or TRIGGERs. For security reasons, the [SQLITE_DIRECTONLY]
** flag is recommended for any application-defined SQL function that has
** side-effects.
**
** ^(The fifth parameter is an arbitrary pointer. The implementation of the
** function can gain access to this pointer using [sqlite3_user_data()].)^
**
@ -4927,8 +4983,30 @@ SQLITE_API int sqlite3_create_window_function(
** [SQLITE_UTF8 | preferred text encoding] as the fourth argument
** to [sqlite3_create_function()], [sqlite3_create_function16()], or
** [sqlite3_create_function_v2()].
**
** The SQLITE_DETERMINISTIC flag means that the new function will always
** maps the same inputs into the same output. The abs() function is
** deterministic, for example, but randomblob() is not.
**
** The SQLITE_DIRECTONLY flag means that the function may only be invoked
** from top-level SQL, and cannot be used in VIEWs or TRIGGERs. This is
** a security feature which is recommended for all
** [application-defined SQL functions] that have side-effects. This flag
** prevents an attacker from adding triggers and views to a schema then
** tricking a high-privilege application into causing unintended side-effects
** while performing ordinary queries.
**
** The SQLITE_SUBTYPE flag indicates to SQLite that a function may call
** [sqlite3_value_subtype()] to inspect the sub-types of its arguments.
** Specifying this flag makes no difference for scalar or aggregate user
** functions. However, if it is not specified for a user-defined window
** function, then any sub-types belonging to arguments passed to the window
** function may be discarded before the window function is called (i.e.
** sqlite3_value_subtype() will always return 0).
*/
#define SQLITE_DETERMINISTIC 0x800
#define SQLITE_DETERMINISTIC 0x000000800
#define SQLITE_DIRECTONLY 0x000080000
#define SQLITE_SUBTYPE 0x000100000
/*
** CAPI3REF: Deprecated Functions
@ -6574,6 +6652,12 @@ struct sqlite3_index_info {
** ^The sqlite3_create_module()
** interface is equivalent to sqlite3_create_module_v2() with a NULL
** destructor.
**
** ^If the third parameter (the pointer to the sqlite3_module object) is
** NULL then no new module is create and any existing modules with the
** same name are dropped.
**
** See also: [sqlite3_drop_modules()]
*/
SQLITE_API int sqlite3_create_module(
sqlite3 *db, /* SQLite connection to register module with */
@ -6589,6 +6673,23 @@ SQLITE_API int sqlite3_create_module_v2(
void(*xDestroy)(void*) /* Module destructor function */
);
/*
** CAPI3REF: Remove Unnecessary Virtual Table Implementations
** METHOD: sqlite3
**
** ^The sqlite3_drop_modules(D,L) interface removes all virtual
** table modules from database connection D except those named on list L.
** The L parameter must be either NULL or a pointer to an array of pointers
** to strings where the array is terminated by a single NULL pointer.
** ^If the L parameter is NULL, then all virtual table modules are removed.
**
** See also: [sqlite3_create_module()]
*/
SQLITE_API int sqlite3_drop_modules(
sqlite3 *db, /* Remove modules from this connection */
const char **azKeep /* Except, do not remove the ones named here */
);
/*
** CAPI3REF: Virtual Table Instance Object
** KEYWORDS: sqlite3_vtab
@ -7297,7 +7398,7 @@ SQLITE_API int sqlite3_test_control(int op, ...);
#define SQLITE_TESTCTRL_FIRST 5
#define SQLITE_TESTCTRL_PRNG_SAVE 5
#define SQLITE_TESTCTRL_PRNG_RESTORE 6
#define SQLITE_TESTCTRL_PRNG_RESET 7
#define SQLITE_TESTCTRL_PRNG_RESET 7 /* NOT USED */
#define SQLITE_TESTCTRL_BITVEC_TEST 8
#define SQLITE_TESTCTRL_FAULT_INSTALL 9
#define SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS 10
@ -7319,7 +7420,10 @@ SQLITE_API int sqlite3_test_control(int op, ...);
#define SQLITE_TESTCTRL_SORTER_MMAP 24
#define SQLITE_TESTCTRL_IMPOSTER 25
#define SQLITE_TESTCTRL_PARSER_COVERAGE 26
#define SQLITE_TESTCTRL_LAST 26 /* Largest TESTCTRL */
#define SQLITE_TESTCTRL_RESULT_INTREAL 27
#define SQLITE_TESTCTRL_PRNG_SEED 28
#define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS 29
#define SQLITE_TESTCTRL_LAST 29 /* Largest TESTCTRL */
/*
** CAPI3REF: SQL Keyword Checking

View File

@ -132,23 +132,6 @@ public class QtActivityLoader extends QtLoader {
return;
}
if (Build.VERSION.SDK_INT < 16) {
// fatal error, show the error and quit
AlertDialog errorDialog = new AlertDialog.Builder(m_activity).create();
if (m_contextInfo.metaData.containsKey("android.app.unsupported_android_version"))
errorDialog.setMessage(m_contextInfo.metaData.getString("android.app.unsupported_android_version"));
else
errorDialog.setMessage("Unsupported Android version.");
errorDialog.setButton(m_activity.getResources().getString(android.R.string.ok), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
}
});
errorDialog.show();
return;
}
try {
m_activity.setTheme(Class.forName("android.R$style").getDeclaredField(QT_ANDROID_DEFAULT_THEME).getInt(null));
} catch (Exception e) {

View File

@ -59,7 +59,7 @@ macro(QT5_MAKE_OUTPUT_FILE infile prefix ext outfile )
set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}")
string(REPLACE ".." "__" _outfile ${_outfile})
get_filename_component(outpath ${_outfile} PATH)
get_filename_component(_outfile ${_outfile} NAME_WE)
string(REGEX REPLACE "\\.[^.]*$" "" _outfile ${_outfile})
file(MAKE_DIRECTORY ${outpath})
set(${outfile} ${outpath}/${prefix}${_outfile}.${ext})
endmacro()

View File

@ -90,42 +90,6 @@ DECLSPEC_IMPORT BOOLEAN WINAPI SystemFunction036(PVOID RandomBuffer, ULONG Rando
QT_BEGIN_NAMESPACE
#if defined(Q_PROCESSOR_X86) && QT_COMPILER_SUPPORTS_HERE(RDRND)
static qsizetype qt_random_cpu(void *buffer, qsizetype count) Q_DECL_NOTHROW;
# ifdef Q_PROCESSOR_X86_64
# define _rdrandXX_step _rdrand64_step
# else
# define _rdrandXX_step _rdrand32_step
# endif
static QT_FUNCTION_TARGET(RDRND) qsizetype qt_random_cpu(void *buffer, qsizetype count) Q_DECL_NOTHROW
{
unsigned *ptr = reinterpret_cast<unsigned *>(buffer);
unsigned *end = ptr + count;
while (ptr + sizeof(qregisteruint)/sizeof(*ptr) <= end) {
if (_rdrandXX_step(reinterpret_cast<qregisteruint *>(ptr)) == 0)
goto out;
ptr += sizeof(qregisteruint)/sizeof(*ptr);
}
if (sizeof(*ptr) != sizeof(qregisteruint) && ptr != end) {
if (_rdrand32_step(ptr))
goto out;
++ptr;
}
out:
return ptr - reinterpret_cast<unsigned *>(buffer);
}
#else
static qsizetype qt_random_cpu(void *, qsizetype)
{
return 0;
}
#endif
enum {
// may be "overridden" by a member enum
FillBufferNoexcept = true
@ -366,8 +330,8 @@ Q_NEVER_INLINE void QRandomGenerator::SystemGenerator::generate(quint32 *begin,
}
qsizetype filled = 0;
if (qt_has_hwrng() && (uint(qt_randomdevice_control) & SkipHWRNG) == 0)
filled += qt_random_cpu(buffer, count);
if (qHasHwrng() && (uint(qt_randomdevice_control) & SkipHWRNG) == 0)
filled += qRandomCpu(buffer, count);
if (filled != count && (uint(qt_randomdevice_control) & SkipSystemRNG) == 0) {
qsizetype bytesFilled =

View File

@ -79,14 +79,6 @@ extern Q_CORE_EXPORT QBasicAtomicInteger<uint> qt_randomdevice_control;
enum { qt_randomdevice_control = 0 };
#endif
inline bool qt_has_hwrng()
{
#if defined(Q_PROCESSOR_X86) && QT_COMPILER_SUPPORTS_HERE(RDRND)
return qCpuHasFeature(RDRND);
#else
return false;
#endif
}
QT_END_NAMESPACE

View File

@ -69,7 +69,9 @@ static bool checkNameDecodable(const char *d_name, qsizetype len)
# ifdef QT_LOCALE_IS_UTF8
int mibEnum = 106;
# else
int mibEnum = codec->mibEnum();
int mibEnum = 4; // Latin 1
if (codec)
mibEnum = codec->mibEnum();
# endif
if (Q_LIKELY(mibEnum == 106)) // UTF-8
return QUtf8::isValidUtf8(d_name, len).isValidUtf8;

View File

@ -83,7 +83,10 @@ enum {
WM_QT_SOCKETNOTIFIER = WM_USER,
WM_QT_SENDPOSTEDEVENTS = WM_USER + 1,
WM_QT_ACTIVATENOTIFIERS = WM_USER + 2,
SendPostedEventsWindowsTimerId = ~1u
};
enum : UINT_PTR {
SendPostedEventsWindowsTimerId = ~UINT_PTR(1)
};
class QEventDispatcherWin32Private;
@ -278,7 +281,7 @@ LRESULT QT_WIN_CALLBACK qt_GetMessageHook(int code, WPARAM wp, LPARAM lp)
// no more input or timer events in the message queue, we can allow posted events to be sent normally now
if (d->sendPostedEventsWindowsTimerId != 0) {
// stop the timer to send posted events, since we now allow the WM_QT_SENDPOSTEDEVENTS message
KillTimer(d->internalHwnd, d->sendPostedEventsWindowsTimerId);
KillTimer(d->internalHwnd, SendPostedEventsWindowsTimerId);
d->sendPostedEventsWindowsTimerId = 0;
}
(void) d->wakeUps.fetchAndStoreRelease(0);

View File

@ -173,7 +173,8 @@ public:
// for controlling when to send posted events
QAtomicInt serialNumber;
int lastSerialNumber, sendPostedEventsWindowsTimerId;
int lastSerialNumber;
UINT_PTR sendPostedEventsWindowsTimerId;
QAtomicInt wakeUps;
// timers

View File

@ -232,7 +232,7 @@ QObjectPrivate::QObjectPrivate(int version)
receiveChildEvents = true;
postedEvents = 0;
extraData = 0;
connectedSignals[0] = connectedSignals[1] = 0;
// connectedSignals[0] = connectedSignals[1] = 0; // already 0.
metaObject = 0;
isWindow = false;
deleteLaterCalled = false;
@ -411,9 +411,10 @@ void QObjectPrivate::addConnection(int signal, Connection *c)
c->next->prev = &c->next;
if (signal < 0) {
connectedSignals[0] = connectedSignals[1] = ~0;
connectedSignals[0].store(~0);
connectedSignals[1].store(~0);
} else if (signal < (int)sizeof(connectedSignals) * 8) {
connectedSignals[signal >> 5] |= (1 << (signal & 0x1f));
connectedSignals[signal >> 5].store(connectedSignals[signal >> 5].load() | (1 << (signal & 0x1f)));
}
}
@ -455,7 +456,7 @@ void QObjectPrivate::cleanConnectionLists()
if (!allConnected && !connected && signal >= 0
&& size_t(signal) < sizeof(connectedSignals) * 8) {
// This signal is no longer connected
connectedSignals[signal >> 5] &= ~(1 << (signal & 0x1f));
connectedSignals[signal >> 5].store(connectedSignals[signal >> 5].load() & ~(1 << (signal & 0x1f)));
} else if (signal == -1) {
allConnected = connected;
}

View File

@ -232,7 +232,7 @@ public:
Connection *senders; // linked list of connections connected to this object
Sender *currentSender; // object currently activating the object
mutable quint32 connectedSignals[2];
mutable QAtomicInteger<quint32> connectedSignals[2];
union {
QObject *currentChildBeingDeleted; // should only be used when QObjectData::isDeletingChildren is set
@ -257,7 +257,7 @@ Q_DECLARE_TYPEINFO(QObjectPrivate::ConnectionList, Q_MOVABLE_TYPE);
inline bool QObjectPrivate::isSignalConnected(uint signal_index, bool checkDeclarative) const
{
return signal_index >= sizeof(connectedSignals) * 8
|| (connectedSignals[signal_index >> 5] & (1 << (signal_index & 0x1f))
|| (connectedSignals[signal_index >> 5].load() & (1 << (signal_index & 0x1f))
|| (checkDeclarative && isDeclarativeSignalConnected(signal_index)));
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Copyright (C) 2018 Intel Corporation
** Copyright (C) 2020 Intel Corporation
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@ -208,6 +208,8 @@ bool QLibraryPrivate::load_sys()
for(int suffix = 0; retry && !pHnd && suffix < suffixes.size(); suffix++) {
if (!prefixes.at(prefix).isEmpty() && name.startsWith(prefixes.at(prefix)))
continue;
if (path.isEmpty() && prefixes.at(prefix).contains(QLatin1Char('/')))
continue;
if (!suffixes.at(suffix).isEmpty() && name.endsWith(suffixes.at(suffix)))
continue;
if (loadHints & QLibrary::LoadArchiveMemberHint) {

View File

@ -305,7 +305,6 @@ static QString locatePlugin(const QString& fileName)
paths.append(fileName.left(slash)); // don't include the '/'
} else {
paths = QCoreApplication::libraryPaths();
paths.prepend(QStringLiteral(".")); // search in current dir first
}
for (const QString &path : qAsConst(paths)) {

View File

@ -222,7 +222,9 @@ public:
for (int i = 0; i < str.length(); ++i)
d->utf16[i] = uc[i];
#else
memcpy(d->utf16, str.unicode(), str.length()*sizeof(ushort));
memcpy(static_cast<void *>(d->utf16),
static_cast<const void *>(str.unicode()),
str.length()*sizeof(ushort));
#endif
if (str.length() & 1)
d->utf16[str.length()] = 0;

View File

@ -3028,15 +3028,15 @@ inline qint64 QDateTimePrivate::zoneMSecsToEpochMSecs(qint64 zoneMSecs, const QT
datetime by adding a number of seconds, days, months, or years.
QDateTime can describe datetimes with respect to \l{Qt::LocalTime}{local
time}, to \l{Qt::UTC}{UTC}, to a specified \l{Qt::OffsetFromUTC}{offset
from UTC} or to a specified \l{{Qt::TimeZone}{time zone}, in conjunction
with the QTimeZone class. For example, a time zone of "Europe/Berlin" will
apply the daylight-saving rules as used in Germany since 1970. In contrast,
an offset from UTC of +3600 seconds is one hour ahead of UTC (usually
written in ISO standard notation as "UTC+01:00"), with no daylight-saving
offset or changes. When using either local time or a specified time zone,
time-zone transitions such as the starts and ends of daylight-saving time
(DST) are taken into account. The choice of system used to represent a
time}, to \l{Qt::UTC}{UTC}, to a specified \l{Qt::OffsetFromUTC}{offset from
UTC} or to a specified \l{Qt::TimeZone}{time zone}, in conjunction with the
QTimeZone class. For example, a time zone of "Europe/Berlin" will apply the
daylight-saving rules as used in Germany since 1970. In contrast, an offset
from UTC of +3600 seconds is one hour ahead of UTC (usually written in ISO
standard notation as "UTC+01:00"), with no daylight-saving offset or
changes. When using either local time or a specified time zone, time-zone
transitions such as the starts and ends of daylight-saving time (DST; but
see below) are taken into account. The choice of system used to represent a
datetime is described as its "timespec".
A QDateTime object is typically created either by giving a date and time
@ -3124,11 +3124,13 @@ inline qint64 QDateTimePrivate::zoneMSecsToEpochMSecs(qint64 zoneMSecs, const QT
The range of valid dates taking DST into account is 1970-01-01 to the
present, and rules are in place for handling DST correctly until 2037-12-31,
but these could change. For dates falling outside that range, QDateTime
makes a \e{best guess} using the rules for year 1970 or 2037, but we can't
guarantee accuracy. This means QDateTime doesn't take into account changes
in a time zone before 1970, even if the system's time zone database provides
that information.
but these could change. For dates after 2037, QDateTime makes a \e{best
guess} using the rules for year 2037, but we can't guarantee accuracy;
indeed, for \e{any} future date, the time-zone may change its rules before
that date comes around. For dates before 1970, QDateTime doesn't take DST
changes into account, even if the system's time zone database provides that
information, although it does take into account changes to the time-zone's
standard offset, where this information is available.
\section2 Offsets From UTC
@ -3374,17 +3376,22 @@ QTimeZone QDateTime::timeZone() const
/*!
\since 5.2
Returns the current Offset From UTC in seconds.
Returns this date-time's Offset From UTC in seconds.
If the timeSpec() is Qt::OffsetFromUTC this will be the value originally set.
The result depends on timeSpec():
\list
\li \c Qt::UTC The offset is 0.
\li \c Qt::OffsetFromUTC The offset is the value originally set.
\li \c Qt::LocalTime The local time's offset from UTC is returned.
\li \c Qt::TimeZone The offset used by the time-zone is returned.
\endlist
If the timeSpec() is Qt::TimeZone this will be the offset effective in the
Time Zone including any Daylight-Saving Offset.
If the timeSpec() is Qt::LocalTime this will be the difference between the
Local Time and UTC including any Daylight-Saving Offset.
If the timeSpec() is Qt::UTC this will be 0.
For the last two, the offset at this date and time will be returned, taking
account of Daylight-Saving Offset unless the date precedes the start of
1970. The offset is the difference between the local time or time in the
given time-zone and UTC time; it is positive in time-zones ahead of UTC
(East of The Prime Meridian), negative for those behind UTC (West of The
Prime Meridian).
\sa setOffsetFromUtc()
*/

View File

@ -106,7 +106,8 @@ Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qt_hash(QStringView key, uint chained =
Q_DECL_CONST_FUNCTION inline uint qHash(std::nullptr_t, uint seed = 0) Q_DECL_NOTHROW
{
return qHash(reinterpret_cast<quintptr>(nullptr), seed);
const void *ptr = nullptr; // work-around for MSVC's reinterpret_cast bug
return qHash(reinterpret_cast<quintptr>(ptr), seed);
}
template <class T> inline uint qHash(const T *key, uint seed = 0) Q_DECL_NOTHROW

View File

@ -339,6 +339,22 @@ QByteArray QLocalePrivate::bcp47Name(char separator) const
return localeId.withLikelySubtagsRemoved().name(separator);
}
/*!
\internal
*/
QByteArray QLocalePrivate::rawName(char separator) const
{
QByteArrayList parts;
if (m_data->m_language_id != QLocale::AnyLanguage)
parts.append(languageCode().latin1());
if (m_data->m_script_id != QLocale::AnyScript)
parts.append(scriptCode().latin1());
if (m_data->m_country_id != QLocale::AnyCountry)
parts.append(countryCode().latin1());
return parts.join(separator);
}
static const QLocaleData *findLocaleDataById(const QLocaleId &localeId)
{
const uint idx = locale_index[localeId.language_id];
@ -3973,29 +3989,63 @@ QString QLocale::formattedDataSize(qint64 bytes, int precision, DataSizeFormats
*/
QStringList QLocale::uiLanguages() const
{
QStringList uiLanguages;
QVector<QLocale> locales;
#ifndef QT_NO_SYSTEMLOCALE
if (d->m_data == systemData()) {
QVariant res = systemLocale()->query(QSystemLocale::UILanguages, QVariant());
if (!res.isNull()) {
QStringList result = res.toStringList();
if (!result.isEmpty())
return result;
uiLanguages = res.toStringList();
// ... but we need to include likely-adjusted forms of each of those, too:
for (const auto entry : qAsConst(uiLanguages))
locales.append(QLocale(entry));
}
}
} else
#endif
QLocaleId id = QLocaleId::fromIds(d->m_data->m_language_id, d->m_data->m_script_id, d->m_data->m_country_id);
const QLocaleId max = id.withLikelySubtagsAdded();
const QLocaleId min = max.withLikelySubtagsRemoved();
QStringList uiLanguages;
uiLanguages.append(QString::fromLatin1(min.name()));
if (id.script_id) {
id.script_id = 0;
if (id != min && id.withLikelySubtagsAdded() == max)
uiLanguages.append(QString::fromLatin1(id.name()));
{
locales.append(*this);
}
for (int i = locales.size(); i-- > 0; ) {
const QLocale &locale = locales.at(i);
int j;
QByteArray prior;
if (i < uiLanguages.size()) {
// Adding likely-adjusted forms to system locale's list.
// Name the locale is derived from:
const QString &name = uiLanguages.at(i);
prior = name.toLatin1();
// Don't try to likely-adjust if construction's likely-adjustments
// were so drastic the result doesn't match the prior name:
if (locale.name() != name && locale.d->rawName() != prior)
continue;
// Insert just after prior:
j = i + 1;
} else {
// Plain locale, not system locale; just append.
j = uiLanguages.size();
}
const auto data = locale.d->m_data;
QLocaleId id
= QLocaleId::fromIds(data->m_language_id, data->m_script_id, data->m_country_id);
const QLocaleId max = id.withLikelySubtagsAdded();
const QLocaleId min = max.withLikelySubtagsRemoved();
id.script_id = 0; // For re-use as script-less variant.
// Include version with all likely sub-tags (last) if distinct from the rest:
if (max != min && max != id && max.name() != prior)
uiLanguages.insert(j, QString::fromLatin1(max.name()));
// Include scriptless version if likely-equivalent and distinct:
if (data->m_script_id && id != min && id.name() != prior
&& id.withLikelySubtagsAdded() == max) {
uiLanguages.insert(j, QString::fromLatin1(id.name()));
}
// Include minimal version (first) unless it's what our locale is derived from:
if (min.name() != prior)
uiLanguages.insert(j, QString::fromLatin1(min.name()));
}
if (max != min && max != id)
uiLanguages.append(QString::fromLatin1(max.name()));
return uiLanguages;
}

View File

@ -355,6 +355,7 @@ public:
quint16 countryId() const { return m_data->m_country_id; }
QByteArray bcp47Name(char separator = '-') const;
QByteArray rawName(char separator = '-') const;
inline QLatin1String languageCode() const { return QLocalePrivate::languageToCode(QLocale::Language(m_data->m_language_id)); }
inline QLatin1String scriptCode() const { return QLocalePrivate::scriptToCode(QLocale::Script(m_data->m_script_id)); }

View File

@ -376,6 +376,38 @@ static quint64 detectProcessorFeatures()
features &= ~AllAVX512;
}
#if defined(Q_PROCESSOR_X86) && QT_COMPILER_SUPPORTS_HERE(RDRND)
/**
* Some AMD CPUs (e.g. AMD A4-6250J and AMD Ryzen 3000-series) have a
* failing random generation instruction, which always returns
* 0xffffffff, even when generation was "successful".
*
* This code checks if hardware random generator generates four consecutive
* equal numbers. If it does, then we probably have a failing one and
* should disable it completely.
*
* https://bugreports.qt.io/browse/QTBUG-69423
*/
if (features & CpuFeatureRDRND) {
const qsizetype testBufferSize = 4;
unsigned testBuffer[4] = {};
const qsizetype generated = qRandomCpu(testBuffer, testBufferSize);
if (Q_UNLIKELY(generated == testBufferSize &&
testBuffer[0] == testBuffer[1] &&
testBuffer[1] == testBuffer[2] &&
testBuffer[2] == testBuffer[3])) {
fprintf(stderr, "WARNING: CPU random generator seem to be failing, disable hardware random number generation\n");
fprintf(stderr, "WARNING: RDRND generated: 0x%x 0x%x 0x%x 0x%x\n",
testBuffer[0], testBuffer[1], testBuffer[2], testBuffer[3]);
features &= ~CpuFeatureRDRND;
}
}
#endif
return features;
}
@ -589,4 +621,40 @@ void qDumpCPUFeatures()
puts("");
}
#if defined(Q_PROCESSOR_X86) && QT_COMPILER_SUPPORTS_HERE(RDRND)
# ifdef Q_PROCESSOR_X86_64
# define _rdrandXX_step _rdrand64_step
# else
# define _rdrandXX_step _rdrand32_step
# endif
QT_FUNCTION_TARGET(RDRND) qsizetype qRandomCpu(void *buffer, qsizetype count) Q_DECL_NOTHROW
{
unsigned *ptr = reinterpret_cast<unsigned *>(buffer);
unsigned *end = ptr + count;
int retries = 10;
while (ptr + sizeof(qregisteruint)/sizeof(*ptr) <= end) {
if (_rdrandXX_step(reinterpret_cast<qregisteruint *>(ptr)))
ptr += sizeof(qregisteruint)/sizeof(*ptr);
else if (--retries == 0)
goto out;
}
while (sizeof(*ptr) != sizeof(qregisteruint) && ptr != end) {
bool ok = _rdrand32_step(ptr);
if (!ok && --retries)
continue;
if (ok)
++ptr;
break;
}
out:
return ptr - reinterpret_cast<unsigned *>(buffer);
}
#endif
QT_END_NAMESPACE

View File

@ -346,6 +346,15 @@ extern Q_CORE_EXPORT QBasicAtomicInteger<unsigned> qt_cpu_features[2];
#endif
Q_CORE_EXPORT void qDetectCpuFeatures();
#if defined(Q_PROCESSOR_X86) && QT_COMPILER_SUPPORTS_HERE(RDRND)
Q_CORE_EXPORT qsizetype qRandomCpu(void *, qsizetype) Q_DECL_NOTHROW;
#else
static inline qsizetype qRandomCpu(void *, qsizetype) Q_DECL_NOTHROW
{
return 0;
}
#endif
static inline quint64 qCpuFeatures()
{
quint64 features = qt_cpu_features[0].load();
@ -366,6 +375,15 @@ static inline quint64 qCpuFeatures()
#define qCpuHasFeature(feature) (((qCompilerCpuFeatures & CpuFeature ## feature) == CpuFeature ## feature) \
|| ((qCpuFeatures() & CpuFeature ## feature) == CpuFeature ## feature))
inline bool qHasHwrng()
{
#if defined(Q_PROCESSOR_X86) && QT_COMPILER_SUPPORTS_HERE(RDRND)
return qCpuHasFeature(RDRND);
#else
return false;
#endif
}
#define ALIGNMENT_PROLOGUE_16BYTES(ptr, i, length) \
for (; i < static_cast<int>(qMin(static_cast<quintptr>(length), ((4 - ((reinterpret_cast<quintptr>(ptr) >> 2) & 0x3)) & 0x3))); ++i)

View File

@ -918,7 +918,7 @@ static int ucstrncmp(const QChar *a, const QChar *b, size_t l)
};
// we're going to read a[0..15] and b[0..15] (32 bytes)
for ( ; a + offset + 16 <= end; offset += 16) {
for ( ; end - a >= offset + 16; offset += 16) {
#ifdef __AVX2__
__m256i a_data = _mm256_loadu_si256(reinterpret_cast<const __m256i *>(a + offset));
__m256i b_data = _mm256_loadu_si256(reinterpret_cast<const __m256i *>(b + offset));
@ -942,7 +942,7 @@ static int ucstrncmp(const QChar *a, const QChar *b, size_t l)
}
// we're going to read a[0..7] and b[0..7] (16 bytes)
if (a + offset + 8 <= end) {
if (end - a >= offset + 8) {
__m128i a_data = _mm_loadu_si128(reinterpret_cast<const __m128i *>(a + offset));
__m128i b_data = _mm_loadu_si128(reinterpret_cast<const __m128i *>(b + offset));
if (isDifferent(a_data, b_data))
@ -952,7 +952,7 @@ static int ucstrncmp(const QChar *a, const QChar *b, size_t l)
}
// we're going to read a[0..3] and b[0..3] (8 bytes)
if (a + offset + 4 <= end) {
if (end - a >= offset + 4) {
__m128i a_data = _mm_loadl_epi64(reinterpret_cast<const __m128i *>(a + offset));
__m128i b_data = _mm_loadl_epi64(reinterpret_cast<const __m128i *>(b + offset));
if (isDifferent(a_data, b_data))
@ -973,7 +973,7 @@ static int ucstrncmp(const QChar *a, const QChar *b, size_t l)
if (l >= 8) {
const QChar *end = a + l;
const uint16x8_t mask = { 1, 1 << 1, 1 << 2, 1 << 3, 1 << 4, 1 << 5, 1 << 6, 1 << 7 };
while (a + 7 < end) {
while (end - a > 7) {
uint16x8_t da = vld1q_u16(reinterpret_cast<const uint16_t *>(a));
uint16x8_t db = vld1q_u16(reinterpret_cast<const uint16_t *>(b));

View File

@ -371,6 +371,7 @@ QDate calculateTransitionLocalDate(const SYSTEMTIME &rule, int year)
// Otherwise, the rule date is annual and relative:
const int dayOfWeek = rule.wDayOfWeek == 0 ? 7 : rule.wDayOfWeek;
QDate date(year, rule.wMonth, 1);
Q_ASSERT(date.isValid());
// How many days before was last dayOfWeek before target month ?
int adjust = dayOfWeek - date.dayOfWeek(); // -6 <= adjust < 7
if (adjust >= 0) // Ensure -7 <= adjust < 0:
@ -401,6 +402,7 @@ qint64 calculateTransitionForYear(const SYSTEMTIME &rule, int year, int bias)
{
// TODO Consider caching the calculated values - i.e. replace SYSTEMTIME in
// WinTransitionRule; do this in init() once and store the results.
Q_ASSERT(year);
const QDate date = calculateTransitionLocalDate(rule, year);
const QTime time = QTime(rule.wHour, rule.wMinute, rule.wSecond);
if (date.isValid() && time.isValid())
@ -479,6 +481,7 @@ struct TransitionTimePair
int yearEndOffset(const QWinTimeZonePrivate::QWinTransitionRule &rule, int year)
{
Q_ASSERT(year);
int offset = rule.standardTimeBias;
// Only needed to help another TransitionTimePair work out year + 1's start
// offset; and the oldYearOffset we use only affects an alleged transition
@ -743,11 +746,12 @@ QTimeZonePrivate::Data QWinTimeZonePrivate::data(qint64 forMSecsSinceEpoch) cons
const QWinTransitionRule &rule = m_tranRules.at(ruleIndex);
// Does this rule's period include any transition at all ?
if (rule.standardTimeRule.wMonth > 0 || rule.daylightTimeRule.wMonth > 0) {
const int endYear = qMax(rule.startYear, year - 1);
int prior = year == 1 ? -1 : year - 1; // No year 0.
const int endYear = qMax(rule.startYear, prior);
while (year >= endYear) {
const int newYearOffset = (year <= rule.startYear && ruleIndex > 0)
? yearEndOffset(m_tranRules.at(ruleIndex - 1), year - 1)
: yearEndOffset(rule, year - 1);
? yearEndOffset(m_tranRules.at(ruleIndex - 1), prior)
: yearEndOffset(rule, prior);
const TransitionTimePair pair(rule, year, newYearOffset);
bool isDst = false;
if (pair.std != invalidMSecs() && pair.std <= forMSecsSinceEpoch) {
@ -755,7 +759,8 @@ QTimeZonePrivate::Data QWinTimeZonePrivate::data(qint64 forMSecsSinceEpoch) cons
} else if (pair.dst != invalidMSecs() && pair.dst <= forMSecsSinceEpoch) {
isDst = true;
} else {
--year; // Try an earlier year for this rule (once).
year = prior; // Try an earlier year for this rule (once).
prior = year == 1 ? -1 : year - 1; // No year 0.
continue;
}
return ruleToData(rule, forMSecsSinceEpoch,
@ -767,8 +772,11 @@ QTimeZonePrivate::Data QWinTimeZonePrivate::data(qint64 forMSecsSinceEpoch) cons
// No transition, no DST, use the year's standard time.
return ruleToData(rule, forMSecsSinceEpoch, QTimeZone::StandardTime);
}
if (year >= rule.startYear)
if (year >= rule.startYear) {
year = rule.startYear - 1; // Seek last transition in new rule.
if (!year)
--year;
}
}
// We don't have relevant data :-(
return invalidData();
@ -795,9 +803,10 @@ QTimeZonePrivate::Data QWinTimeZonePrivate::nextTransition(qint64 afterMSecsSinc
year = rule.startYear; // Seek first transition in this rule.
const int endYear = ruleIndex + 1 < m_tranRules.count()
? qMin(m_tranRules.at(ruleIndex + 1).startYear, year + 2) : (year + 2);
int prior = year == 1 ? -1 : year - 1; // No year 0.
int newYearOffset = (year <= rule.startYear && ruleIndex > 0)
? yearEndOffset(m_tranRules.at(ruleIndex - 1), year - 1)
: yearEndOffset(rule, year - 1);
? yearEndOffset(m_tranRules.at(ruleIndex - 1), prior)
: yearEndOffset(rule, prior);
while (year < endYear) {
const TransitionTimePair pair(rule, year, newYearOffset);
bool isDst = false;
@ -810,7 +819,9 @@ QTimeZonePrivate::Data QWinTimeZonePrivate::nextTransition(qint64 afterMSecsSinc
newYearOffset = rule.standardTimeBias;
if (pair.dst > pair.std)
newYearOffset += rule.daylightTimeBias;
++year; // Try a later year for this rule (once).
// Try a later year for this rule (once).
prior = year;
year = year == -1 ? 1 : year + 1; // No year 0
continue;
}
@ -837,11 +848,12 @@ QTimeZonePrivate::Data QWinTimeZonePrivate::previousTransition(qint64 beforeMSec
const QWinTransitionRule &rule = m_tranRules.at(ruleIndex);
// Does this rule's period include any transition at all ?
if (rule.standardTimeRule.wMonth > 0 || rule.daylightTimeRule.wMonth > 0) {
const int endYear = qMax(rule.startYear, year - 1);
int prior = year == 1 ? -1 : year - 1; // No year 0.
const int endYear = qMax(rule.startYear, prior);
while (year >= endYear) {
const int newYearOffset = (year <= rule.startYear && ruleIndex > 0)
? yearEndOffset(m_tranRules.at(ruleIndex - 1), year - 1)
: yearEndOffset(rule, year - 1);
? yearEndOffset(m_tranRules.at(ruleIndex - 1), prior)
: yearEndOffset(rule, prior);
const TransitionTimePair pair(rule, year, newYearOffset);
bool isDst = false;
if (pair.std != invalidMSecs() && pair.std < beforeMSecsSinceEpoch) {
@ -849,7 +861,8 @@ QTimeZonePrivate::Data QWinTimeZonePrivate::previousTransition(qint64 beforeMSec
} else if (pair.dst != invalidMSecs() && pair.dst < beforeMSecsSinceEpoch) {
isDst = true;
} else {
--year; // Try an earlier year for this rule (once).
year = prior; // Try an earlier year for this rule (once).
prior = year == 1 ? -1 : year - 1; // No year 0.
continue;
}
if (isDst)
@ -863,8 +876,11 @@ QTimeZonePrivate::Data QWinTimeZonePrivate::previousTransition(qint64 beforeMSec
// rule:
return ruleToData(rule, startOfTime, QTimeZone::StandardTime, false);
} // else: no transition during rule's period
if (year >= rule.startYear)
if (year >= rule.startYear) {
year = rule.startYear - 1; // Seek last transition in new rule
if (!year)
--year;
}
}
// Apparently no transition before the given time:
return invalidData();

View File

@ -935,6 +935,8 @@ public:
friend class QGuiApplicationPrivate;
friend class QApplication;
friend class QApplicationPrivate;
friend class QQuickPointerTouchEvent;
friend class QQuickMultiPointTouchArea;
};
#if QT_DEPRECATED_SINCE(5, 0)

View File

@ -67,7 +67,8 @@ public:
state(Qt::TouchPointReleased),
pressure(-1),
rotation(0),
ellipseDiameters(0, 0)
ellipseDiameters(0, 0),
stationaryWithModifiedProperty(false)
{ }
inline QTouchEventTouchPointPrivate *detach()
@ -91,6 +92,7 @@ public:
QSizeF ellipseDiameters;
QVector2D velocity;
QTouchEvent::TouchPoint::InfoFlags flags;
bool stationaryWithModifiedProperty : 1;
QVector<QPointF> rawScreenPositions;
};

View File

@ -140,7 +140,7 @@ Qt::KeyboardModifiers QGuiApplicationPrivate::modifier_buttons = Qt::NoModifier;
QPointF QGuiApplicationPrivate::lastCursorPosition(qInf(), qInf());
QWindow *QGuiApplicationPrivate::currentMouseWindow = 0;
QPointer<QWindow> QGuiApplicationPrivate::currentMouseWindow;
QString QGuiApplicationPrivate::styleOverride;
@ -185,7 +185,7 @@ int QGuiApplicationPrivate::mousePressY = 0;
static int mouseDoubleClickDistance = -1;
static int touchDoubleTapDistance = -1;
QWindow *QGuiApplicationPrivate::currentMousePressWindow = 0;
QPointer<QWindow> QGuiApplicationPrivate::currentMousePressWindow;
static Qt::LayoutDirection layout_direction = Qt::LayoutDirectionAuto;
static bool force_reverse = false;
@ -201,7 +201,7 @@ QClipboard *QGuiApplicationPrivate::qt_clipboard = 0;
QList<QScreen *> QGuiApplicationPrivate::screen_list;
QWindowList QGuiApplicationPrivate::window_list;
QWindow *QGuiApplicationPrivate::focus_window = 0;
QPointer<QWindow> QGuiApplicationPrivate::focus_window;
static QBasicMutex applicationFontMutex;
QFont *QGuiApplicationPrivate::app_font = 0;
@ -2775,10 +2775,12 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To
if (touchPoint.state() == Qt::TouchPointStationary) {
if (touchInfo.touchPoint.velocity() != touchPoint.velocity()) {
touchInfo.touchPoint.setVelocity(touchPoint.velocity());
touchPoint.d->stationaryWithModifiedProperty = true;
stationaryTouchPointChangedProperty = true;
}
if (!qFuzzyCompare(touchInfo.touchPoint.pressure(), touchPoint.pressure())) {
touchInfo.touchPoint.setPressure(touchPoint.pressure());
touchPoint.d->stationaryWithModifiedProperty = true;
stationaryTouchPointChangedProperty = true;
}
} else {

View File

@ -212,8 +212,8 @@ public:
static int mousePressX;
static int mousePressY;
static QPointF lastCursorPosition;
static QWindow *currentMouseWindow;
static QWindow *currentMousePressWindow;
static QPointer<QWindow> currentMouseWindow;
static QPointer<QWindow> currentMousePressWindow;
static Qt::ApplicationState applicationState;
static bool highDpiScalingUpdated;
static QPointer<QWindow> currentDragWindow;
@ -234,7 +234,7 @@ public:
static QPalette *app_pal;
static QWindowList window_list;
static QWindow *focus_window;
static QPointer<QWindow> focus_window;
#ifndef QT_NO_CURSOR
QList<QCursor> cursor_list;

View File

@ -495,6 +495,8 @@ static const struct {
{ Qt::Key_LaunchD, QT_TRANSLATE_NOOP("QShortcut", "Launch (D)") },
{ Qt::Key_LaunchE, QT_TRANSLATE_NOOP("QShortcut", "Launch (E)") },
{ Qt::Key_LaunchF, QT_TRANSLATE_NOOP("QShortcut", "Launch (F)") },
{ Qt::Key_LaunchG, QT_TRANSLATE_NOOP("QShortcut", "Launch (G)") },
{ Qt::Key_LaunchH, QT_TRANSLATE_NOOP("QShortcut", "Launch (H)") },
{ Qt::Key_MonBrightnessUp, QT_TRANSLATE_NOOP("QShortcut", "Monitor Brightness Up") },
{ Qt::Key_MonBrightnessDown, QT_TRANSLATE_NOOP("QShortcut", "Monitor Brightness Down") },
{ Qt::Key_KeyboardLightOnOff, QT_TRANSLATE_NOOP("QShortcut", "Keyboard Light On/Off") },
@ -521,9 +523,11 @@ static const struct {
{ Qt::Key_Book, QT_TRANSLATE_NOOP("QShortcut", "Book") },
{ Qt::Key_CD, QT_TRANSLATE_NOOP("QShortcut", "CD") },
{ Qt::Key_Calculator, QT_TRANSLATE_NOOP("QShortcut", "Calculator") },
{ Qt::Key_Calendar, QT_TRANSLATE_NOOP("QShortcut", "Calendar") },
{ Qt::Key_Clear, QT_TRANSLATE_NOOP("QShortcut", "Clear") },
{ Qt::Key_ClearGrab, QT_TRANSLATE_NOOP("QShortcut", "Clear Grab") },
{ Qt::Key_Close, QT_TRANSLATE_NOOP("QShortcut", "Close") },
{ Qt::Key_ContrastAdjust, QT_TRANSLATE_NOOP("QShortcut", "Adjust contrast") },
{ Qt::Key_Copy, QT_TRANSLATE_NOOP("QShortcut", "Copy") },
{ Qt::Key_Cut, QT_TRANSLATE_NOOP("QShortcut", "Cut") },
{ Qt::Key_Display, QT_TRANSLATE_NOOP("QShortcut", "Display") },
@ -537,6 +541,7 @@ static const struct {
{ Qt::Key_LogOff, QT_TRANSLATE_NOOP("QShortcut", "Logoff") },
{ Qt::Key_Market, QT_TRANSLATE_NOOP("QShortcut", "Market") },
{ Qt::Key_Meeting, QT_TRANSLATE_NOOP("QShortcut", "Meeting") },
{ Qt::Key_Memo, QT_TRANSLATE_NOOP("QShortcut", "Memo") },
{ Qt::Key_MenuKB, QT_TRANSLATE_NOOP("QShortcut", "Keyboard Menu") },
{ Qt::Key_MenuPB, QT_TRANSLATE_NOOP("QShortcut", "Menu PB") },
{ Qt::Key_MySites, QT_TRANSLATE_NOOP("QShortcut", "My Sites") },
@ -557,6 +562,7 @@ static const struct {
{ Qt::Key_Support, QT_TRANSLATE_NOOP("QShortcut", "Support") },
{ Qt::Key_TaskPane, QT_TRANSLATE_NOOP("QShortcut", "Task Panel") },
{ Qt::Key_Terminal, QT_TRANSLATE_NOOP("QShortcut", "Terminal") },
{ Qt::Key_ToDoList, QT_TRANSLATE_NOOP("QShortcut", "To-do list") },
{ Qt::Key_Tools, QT_TRANSLATE_NOOP("QShortcut", "Tools") },
{ Qt::Key_Travel, QT_TRANSLATE_NOOP("QShortcut", "Travel") },
{ Qt::Key_Video, QT_TRANSLATE_NOOP("QShortcut", "Video") },

View File

@ -352,9 +352,10 @@
"condition": "features.openssl-linked && libs.openssl.source != 0
&& input.openssl.prefix == '' && input.openssl.libs == '' && input.openssl.libs.debug == ''",
"message": "When linking against OpenSSL, you can override the default
library names through OPENSSL_LIBS.
library names and directories with setting OPENSSL_PREFIX (or OPENSSL_INCDIR, OPENSSL_LIBDIR),
and OPENSSL_LIBS, OPENSSL_LIBS_DEBUG, OPENSSL_LIBS_RELEASE.
For example:
OPENSSL_LIBS='-L/opt/ssl/lib -lssl -lcrypto' ./configure -openssl-linked"
./configure -openssl-linked OPENSSL_PREFIX='/opt/ssl' OPENSSL_LIBS='-lssl -lcrypto'"
},
{
"type": "warning",

View File

@ -55,12 +55,11 @@
When building a version of Qt linked against OpenSSL, the build system will
attempt to link with libssl and libcrypt libraries located in the default
location on the developer's system. This location is configurable:
set the \c OPENSSL_LIBS environment variable to contain the linker options
required to link Qt against the installed library. For example, on a Unix/Linux
set the \c OPENSSL_LIBDIR command line argument. For example, on Unix/Linux
system:
\code
OPENSSL_LIBS='-L/opt/ssl/lib -lssl -lcrypto' ./configure -openssl-linked
./configure -openssl-linked OPENSSL_LIBDIR=/usr/local/ssl
\endcode
To disable SSL support in a Qt build, configure Qt with the \c{-no-openssl}

View File

@ -102,9 +102,9 @@ qtConfig(ssl) {
# Add optional SSL libs
# Static linking of OpenSSL with msvc:
# - Binaries http://slproweb.com/products/Win32OpenSSL.html
# - also needs -lUser32 -lAdvapi32 -lGdi32 -lCrypt32
# - also needs -lWs2_32 -lGdi32 -lAdvapi32 -lCrypt32 -lUser32
# - libs in <OPENSSL_DIR>\lib\VC\static
# - configure: -openssl -openssl-linked -I <OPENSSL_DIR>\include -L <OPENSSL_DIR>\lib\VC\static OPENSSL_LIBS="-lUser32 -lAdvapi32 -lGdi32" OPENSSL_LIBS_DEBUG="-lssleay32MDd -llibeay32MDd" OPENSSL_LIBS_RELEASE="-lssleay32MD -llibeay32MD"
# - configure: -openssl-linked -openssl-linked OPENSSL_INCDIR="%OPENSSL_DIR%\include" OPENSSL_LIBDIR="%OPENSSL_DIR%\lib\VC\static" OPENSSL_LIBS="-lWs2_32 -lGdi32 -lAdvapi32 -lCrypt32 -lUser32" OPENSSL_LIBS_DEBUG="-llibssl64MDd -llibcrypto64MDd" OPENSSL_LIBS_RELEASE="-llibssl64MD -llibcrypto64MD"
qtConfig(openssl-linked): \
QMAKE_USE_FOR_PRIVATE += openssl

View File

@ -4979,7 +4979,7 @@ void QGLWidget::renderText(double x, double y, double z, const QString &str, con
// The only option in Qt 5 is the shader-based OpenGL 2 paint engine.
// Setting fixed pipeline transformations is futile. Instead, pass the
// extra values directly and let the engine figure the matrices out.
static_cast<QGL2PaintEngineEx *>(p->paintEngine())->setTranslateZ(-win_z);
static_cast<QGL2PaintEngineEx *>(p->paintEngine())->setTranslateZ(-2 * win_z);
qt_gl_draw_text(p, qRound(win_x), qRound(win_y), str, font);

View File

@ -100,20 +100,6 @@ static const char *languageForWritingSystem[] = {
};
enum { LanguageCount = sizeof(languageForWritingSystem) / sizeof(const char *) };
#ifdef Q_OS_OSX
static NSInteger languageMapSort(id obj1, id obj2, void *context)
{
NSArray<NSString *> *map1 = reinterpret_cast<NSArray<NSString *> *>(obj1);
NSArray<NSString *> *map2 = reinterpret_cast<NSArray<NSString *> *>(obj2);
NSArray<NSString *> *languages = reinterpret_cast<NSArray<NSString *> *>(context);
NSString *lang1 = [map1 objectAtIndex:0];
NSString *lang2 = [map2 objectAtIndex:0];
return [languages indexOfObject:lang1] - [languages indexOfObject:lang2];
}
#endif
QCoreTextFontDatabase::QCoreTextFontDatabase()
: m_hasPopulatedAliases(false)
{
@ -406,142 +392,99 @@ template class QCoreTextFontDatabaseEngineFactory<QCoreTextFontEngine>;
template class QCoreTextFontDatabaseEngineFactory<QFontEngineFT>;
#endif
QFont::StyleHint styleHintFromNSString(NSString *style)
QStringList QCoreTextFontDatabase::fallbacksForFamily(const QString &family)
{
if ([style isEqual: @"sans-serif"])
return QFont::SansSerif;
else if ([style isEqual: @"monospace"])
return QFont::Monospace;
else if ([style isEqual: @"cursive"])
return QFont::Cursive;
else if ([style isEqual: @"serif"])
return QFont::Serif;
else if ([style isEqual: @"fantasy"])
return QFont::Fantasy;
else // if ([style isEqual: @"default"])
return QFont::AnyStyle;
}
if (family.isEmpty())
return QStringList();
#ifdef Q_OS_OSX
static QString familyNameFromPostScriptName(NSString *psName)
{
QCFType<CTFontDescriptorRef> fontDescriptor = (CTFontDescriptorRef) CTFontDescriptorCreateWithNameAndSize((CFStringRef)psName, 12.0);
QCFString familyName = (CFStringRef) CTFontDescriptorCopyAttribute(fontDescriptor, kCTFontFamilyNameAttribute);
QString name = QString::fromCFString(familyName);
if (name.isEmpty())
qWarning() << "QCoreTextFontDatabase: Failed to resolve family name for PostScript name " << QString::fromCFString((CFStringRef)psName);
auto attributes = @{ id(kCTFontFamilyNameAttribute): family.toNSString() };
QCFType<CTFontDescriptorRef> fontDescriptor = CTFontDescriptorCreateWithAttributes(CFDictionaryRef(attributes));
if (!fontDescriptor) {
qWarning() << "Failed to create fallback font descriptor for" << family;
return QStringList();
}
return name;
}
#endif
QCFType<CTFontRef> font = CTFontCreateWithFontDescriptor(fontDescriptor, 12.0, 0);
if (!font) {
qWarning() << "Failed to create fallback font for" << family;
return QStringList();
}
static void addExtraFallbacks(QStringList *fallbackList)
{
#if defined(Q_OS_MACOS)
// Since we are only returning a list of default fonts for the current language, we do not
// cover all unicode completely. This was especially an issue for some of the common script
// symbols such as mathematical symbols, currency or geometric shapes. To minimize the risk
// of missing glyphs, we add Arial Unicode MS as a final fail safe, since this covers most
// of Unicode 2.1.
if (!fallbackList->contains(QStringLiteral("Arial Unicode MS")))
fallbackList->append(QStringLiteral("Arial Unicode MS"));
// Since some symbols (specifically Braille) are not in Arial Unicode MS, we
// add Apple Symbols to cover those too.
if (!fallbackList->contains(QStringLiteral("Apple Symbols")))
fallbackList->append(QStringLiteral("Apple Symbols"));
#else
Q_UNUSED(fallbackList)
#endif
QCFType<CFArrayRef> cascadeList = CFArrayRef(CTFontCopyDefaultCascadeListForLanguages(font,
(CFArrayRef)[NSUserDefaults.standardUserDefaults stringArrayForKey:@"AppleLanguages"]));
if (!cascadeList) {
qWarning() << "Failed to create fallback cascade list for" << family;
return QStringList();
}
QStringList fallbackList;
const int numCascades = CFArrayGetCount(cascadeList);
for (int i = 0; i < numCascades; ++i) {
CTFontDescriptorRef fontFallback = CTFontDescriptorRef(CFArrayGetValueAtIndex(cascadeList, i));
QCFString fallbackFamilyName = CFStringRef(CTFontDescriptorCopyAttribute(fontFallback, kCTFontFamilyNameAttribute));
fallbackList.append(QString::fromCFString(fallbackFamilyName));
}
return fallbackList;
}
QStringList QCoreTextFontDatabase::fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const
{
Q_UNUSED(style);
Q_UNUSED(script);
QMacAutoReleasePool pool;
static QHash<QString, QStringList> fallbackLists;
QStringList fallbackList = fallbacksForFamily(family);
if (!family.isEmpty()) {
QCFType<CFMutableDictionaryRef> attributes = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
CFDictionaryAddValue(attributes, kCTFontFamilyNameAttribute, QCFString(family));
if (QCFType<CTFontDescriptorRef> fontDescriptor = CTFontDescriptorCreateWithAttributes(attributes)) {
if (QCFType<CTFontRef> font = CTFontCreateWithFontDescriptor(fontDescriptor, 12.0, 0)) {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSArray *languages = [defaults stringArrayForKey: @"AppleLanguages"];
QCFType<CFArrayRef> cascadeList = (CFArrayRef) CTFontCopyDefaultCascadeListForLanguages(font, (CFArrayRef) languages);
if (cascadeList) {
QStringList fallbackList;
const int numCascades = CFArrayGetCount(cascadeList);
for (int i = 0; i < numCascades; ++i) {
CTFontDescriptorRef fontFallback = (CTFontDescriptorRef) CFArrayGetValueAtIndex(cascadeList, i);
QCFString fallbackFamilyName = (CFStringRef) CTFontDescriptorCopyAttribute(fontFallback, kCTFontFamilyNameAttribute);
fallbackList.append(QString::fromCFString(fallbackFamilyName));
}
addExtraFallbacks(&fallbackList);
extern QStringList qt_sort_families_by_writing_system(QChar::Script, const QStringList &);
fallbackList = qt_sort_families_by_writing_system(script, fallbackList);
return fallbackList;
if (fallbackList.isEmpty()) {
// We were not able to find a fallback for the specific family,
// or the family was empty, so we fall back to the style hint.
QString styleFamily = [styleHint]{
switch (styleHint) {
case QFont::SansSerif: return QStringLiteral("Helvetica");
case QFont::Serif: return QStringLiteral("Times New Roman");
case QFont::Monospace: return QStringLiteral("Menlo");
#ifdef Q_OS_MACOS
case QFont::Cursive: return QStringLiteral("Apple Chancery");
#endif
case QFont::Fantasy: return QStringLiteral("Zapfino");
case QFont::TypeWriter: return QStringLiteral("American Typewriter");
case QFont::AnyStyle: Q_FALLTHROUGH();
case QFont::System: {
QCFType<CTFontRef> font = CTFontCreateUIFontForLanguage(kCTFontUIFontSystem, 12.0, NULL);
return static_cast<QString>(QCFString(CTFontCopyFullName(font)));
}
default: return QString(); // No matching font on this platform
}
}();
if (!styleFamily.isEmpty()) {
fallbackList = fallbacksForFamily(styleFamily);
if (!fallbackList.contains(styleFamily))
fallbackList.prepend(styleFamily);
}
}
// We were not able to find a fallback for the specific family,
// so we fall back to the stylehint.
if (fallbackList.isEmpty())
return fallbackList;
static const QString styleLookupKey = QString::fromLatin1(".QFontStyleHint_%1");
static bool didPopulateStyleFallbacks = false;
if (!didPopulateStyleFallbacks) {
#if defined(Q_OS_MACX)
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSArray<NSString *> *languages = [defaults stringArrayForKey:@"AppleLanguages"];
NSDictionary<NSString *, id> *fallbackDict = [NSDictionary<NSString *, id> dictionaryWithContentsOfFile:@"/System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreText.framework/Resources/DefaultFontFallbacks.plist"];
for (NSString *style in [fallbackDict allKeys]) {
NSArray *list = [fallbackDict valueForKey:style];
QFont::StyleHint fallbackStyleHint = styleHintFromNSString(style);
QStringList fallbackList;
for (id item in list) {
// sort the array based on system language preferences
if ([item isKindOfClass:[NSArray class]]) {
NSArray *langs = [reinterpret_cast<NSArray *>(item)
sortedArrayUsingFunction:languageMapSort context:languages];
for (NSArray<NSString *> *map in langs)
fallbackList.append(familyNameFromPostScriptName([map objectAtIndex:1]));
}
else if ([item isKindOfClass: [NSString class]])
fallbackList.append(familyNameFromPostScriptName(item));
}
fallbackList.append(QLatin1String("Apple Color Emoji"));
addExtraFallbacks(&fallbackList);
fallbackLists[styleLookupKey.arg(fallbackStyleHint)] = fallbackList;
}
#else
QStringList staticFallbackList;
staticFallbackList << QString::fromLatin1("Helvetica,Apple Color Emoji,Geeza Pro,Arial Hebrew,Thonburi,Kailasa"
"Hiragino Kaku Gothic ProN,.Heiti J,Apple SD Gothic Neo,.Heiti K,Heiti SC,Heiti TC"
"Bangla Sangam MN,Devanagari Sangam MN,Gujarati Sangam MN,Gurmukhi MN,Kannada Sangam MN"
"Malayalam Sangam MN,Oriya Sangam MN,Sinhala Sangam MN,Tamil Sangam MN,Telugu Sangam MN"
"Euphemia UCAS,.PhoneFallback").split(QLatin1String(","));
for (int i = QFont::Helvetica; i <= QFont::Fantasy; ++i)
fallbackLists[styleLookupKey.arg(i)] = staticFallbackList;
#if defined(Q_OS_MACOS)
// Since we are only returning a list of default fonts for the current language, we do not
// cover all Unicode completely. This was especially an issue for some of the common script
// symbols such as mathematical symbols, currency or geometric shapes. To minimize the risk
// of missing glyphs, we add Arial Unicode MS as a final fail safe, since this covers most
// of Unicode 2.1.
if (!fallbackList.contains(QStringLiteral("Arial Unicode MS")))
fallbackList.append(QStringLiteral("Arial Unicode MS"));
// Since some symbols (specifically Braille) are not in Arial Unicode MS, we
// add Apple Symbols to cover those too.
if (!fallbackList.contains(QStringLiteral("Apple Symbols")))
fallbackList.append(QStringLiteral("Apple Symbols"));
#endif
didPopulateStyleFallbacks = true;
}
extern QStringList qt_sort_families_by_writing_system(QChar::Script, const QStringList &);
fallbackList = qt_sort_families_by_writing_system(script, fallbackList);
Q_ASSERT(!fallbackLists.isEmpty());
return fallbackLists[styleLookupKey.arg(styleHint)];
return fallbackList;
}
QStringList QCoreTextFontDatabase::addApplicationFont(const QByteArray &fontData, const QString &fileName)

View File

@ -92,6 +92,7 @@ protected:
private:
void populateFromDescriptor(CTFontDescriptorRef font, const QString &familyName = QString());
static QStringList fallbacksForFamily(const QString &family);
mutable QString defaultFontName;

View File

@ -1961,13 +1961,13 @@ QFontEngine *QWindowsFontDatabase::createEngine(const QFontDef &request, const Q
} else {
HGDIOBJ oldFont = SelectObject(data->hdc, hfont);
const QFont::HintingPreference hintingPreference =
static_cast<QFont::HintingPreference>(request.hintingPreference);
bool useDw = useDirectWrite(hintingPreference, fam);
IDWriteFontFace *directWriteFontFace = NULL;
HRESULT hr = data->directWriteGdiInterop->CreateFontFaceFromHdc(data->hdc, &directWriteFontFace);
if (FAILED(hr)) {
const QString errorString = qt_error_string(int(hr));
qWarning().noquote().nospace() << "DirectWrite: CreateFontFaceFromHDC() failed ("
<< errorString << ") for " << request << ' ' << lf << " dpi=" << dpi;
} else {
if (SUCCEEDED(hr)) {
bool isColorFont = false;
#if defined(QT_USE_DIRECTWRITE2)
IDWriteFontFace2 *directWriteFontFace2 = nullptr;
@ -1977,9 +1977,7 @@ QFontEngine *QWindowsFontDatabase::createEngine(const QFontDef &request, const Q
isColorFont = directWriteFontFace2->GetPaletteEntryCount() > 0;
}
#endif
const QFont::HintingPreference hintingPreference =
static_cast<QFont::HintingPreference>(request.hintingPreference);
const bool useDw = useDirectWrite(hintingPreference, fam, isColorFont);
useDw = useDw || useDirectWrite(hintingPreference, fam, isColorFont);
qCDebug(lcQpaFonts) << __FUNCTION__ << request.family << request.pointSize
<< "pt" << "hintingPreference=" << hintingPreference << "color=" << isColorFont
<< dpi << "dpi" << "useDirectWrite=" << useDw;
@ -2001,6 +1999,10 @@ QFontEngine *QWindowsFontDatabase::createEngine(const QFontDef &request, const Q
} else {
directWriteFontFace->Release();
}
} else if (useDw) {
const QString errorString = qt_error_string(int(hr));
qWarning().noquote().nospace() << "DirectWrite: CreateFontFaceFromHDC() failed ("
<< errorString << ") for " << request << ' ' << lf << " dpi=" << dpi;
}
SelectObject(data->hdc, oldFont);

View File

@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Copyright (C) 2019 The Qt Company Ltd.
** Copyright (C) 2016 Jolla Ltd, author: <gunnar.sletta@jollamobile.com>
** Contact: https://www.qt.io/licensing/
**
@ -74,7 +74,7 @@ Q_LOGGING_CATEGORY(qLcEvdevTouch, "qt.qpa.input")
#define ABS_MT_TOUCH_MAJOR 0x30 /* Major axis of touching ellipse */
#endif
#ifndef ABS_MT_POSITION_X
#define ABS_MT_POSITION_X 0x35 /* Center X ellipse position */
#define ABS_MT_POSITION_X 0x35 /* Center X ellipse position */
#endif
#ifndef ABS_MT_POSITION_Y
#define ABS_MT_POSITION_Y 0x36 /* Center Y ellipse position */
@ -88,6 +88,9 @@ Q_LOGGING_CATEGORY(qLcEvdevTouch, "qt.qpa.input")
#ifndef ABS_MT_TRACKING_ID
#define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */
#endif
#ifndef ABS_MT_PRESSURE
#define ABS_MT_PRESSURE 0x3a
#endif
#ifndef SYN_MT_REPORT
#define SYN_MT_REPORT 2
#endif
@ -570,6 +573,7 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data)
m_lastTouchPoints = m_touchPoints;
m_touchPoints.clear();
Qt::TouchPointStates combinedStates;
bool hasPressure = false;
QMutableHashIterator<int, Contact> it(m_contacts);
while (it.hasNext()) {
@ -600,6 +604,9 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data)
continue;
}
if (contact.pressure)
hasPressure = true;
addTouchPoint(contact, &combinedStates);
}
@ -646,7 +653,7 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data)
m_contacts.clear();
if (!m_touchPoints.isEmpty() && combinedStates != Qt::TouchPointStationary)
if (!m_touchPoints.isEmpty() && (hasPressure || combinedStates != Qt::TouchPointStationary))
reportPoints();
if (m_filtered)

View File

@ -38,6 +38,7 @@
****************************************************************************/
#include "qlibinputtouch_p.h"
#include "qtouchoutputmapping_p.h"
#include <libinput.h>
#include <QtGui/QGuiApplication>
#include <QtGui/QScreen>
@ -45,6 +46,8 @@
QT_BEGIN_NAMESPACE
Q_DECLARE_LOGGING_CATEGORY(qLcLibInput)
QWindowSystemInterface::TouchPoint *QLibInputTouch::DeviceState::point(int32_t slot)
{
const int id = qMax(0, slot);
@ -62,12 +65,23 @@ QLibInputTouch::DeviceState *QLibInputTouch::deviceState(libinput_event_touch *e
return &m_devState[dev];
}
static inline QPointF getPos(libinput_event_touch *e)
QPointF QLibInputTouch::getPos(libinput_event_touch *e)
{
// TODO Map to correct screen using QTouchOutputMapping.
// Perhaps investigate libinput_device_get_output_name as well.
// For now just use the primary screen.
DeviceState *state = deviceState(e);
QScreen *screen = QGuiApplication::primaryScreen();
if (!state->m_screenName.isEmpty()) {
if (!m_screen) {
const QList<QScreen *> screens = QGuiApplication::screens();
for (QScreen *s : screens) {
if (s->name() == state->m_screenName) {
m_screen = s;
break;
}
}
}
if (m_screen)
screen = m_screen;
}
const QRect geom = QHighDpi::toNativePixels(screen->geometry(), screen);
const double x = libinput_event_touch_get_x_transformed(e, geom.width());
const double y = libinput_event_touch_get_y_transformed(e, geom.height());
@ -76,9 +90,25 @@ static inline QPointF getPos(libinput_event_touch *e)
void QLibInputTouch::registerDevice(libinput_device *dev)
{
struct udev_device *udev_device;
udev_device = libinput_device_get_udev_device(dev);
QString devNode = QString::fromUtf8(udev_device_get_devnode(udev_device));
QString devName = QString::fromUtf8(libinput_device_get_name(dev));
qCDebug(qLcLibInput, "libinput: registerDevice %s - %s",
qPrintable(devNode), qPrintable(devName));
QTouchOutputMapping mapping;
if (mapping.load()) {
m_devState[dev].m_screenName = mapping.screenNameForDeviceNode(devNode);
if (!m_devState[dev].m_screenName.isEmpty())
qCDebug(qLcLibInput, "libinput: Mapping device %s to screen %s",
qPrintable(devNode), qPrintable(m_devState[dev].m_screenName));
}
QTouchDevice *&td = m_devState[dev].m_touchDevice;
td = new QTouchDevice;
td->setName(QString::fromUtf8(libinput_device_get_name(dev)));
td->setName(devName);
td->setType(QTouchDevice::TouchScreen);
td->setCapabilities(QTouchDevice::Position | QTouchDevice::Area);
QWindowSystemInterface::registerTouchDevice(td);

View File

@ -42,6 +42,7 @@
#include <QtCore/QHash>
#include <QtCore/QList>
#include <QtCore/QPointer>
#include <qpa/qwindowsysteminterface.h>
//
@ -60,6 +61,7 @@ struct libinput_device;
QT_BEGIN_NAMESPACE
class QScreen;
class QLibInputTouch
{
public:
@ -73,15 +75,18 @@ public:
private:
struct DeviceState {
DeviceState() : m_touchDevice(0) { }
DeviceState() : m_touchDevice(nullptr), m_screenName() { }
QWindowSystemInterface::TouchPoint *point(int32_t slot);
QList<QWindowSystemInterface::TouchPoint> m_points;
QTouchDevice *m_touchDevice;
QString m_screenName;
};
DeviceState *deviceState(libinput_event_touch *e);
QPointF getPos(libinput_event_touch *e);
QHash<libinput_device *, DeviceState> m_devState;
mutable QPointer<QScreen> m_screen;
};
QT_END_NAMESPACE

View File

@ -522,10 +522,6 @@ QKmsDevice::QKmsDevice(QKmsScreenConfig *screenConfig, const QString &path)
, m_path(path)
, m_dri_fd(-1)
, m_has_atomic_support(false)
#if QT_CONFIG(drm_atomic)
, m_atomic_request(nullptr)
, m_previous_request(nullptr)
#endif
, m_crtc_allocator(0)
{
if (m_path.isEmpty()) {
@ -541,7 +537,7 @@ QKmsDevice::QKmsDevice(QKmsScreenConfig *screenConfig, const QString &path)
QKmsDevice::~QKmsDevice()
{
#if QT_CONFIG(drm_atomic)
atomicReset();
threadLocalAtomicReset();
#endif
}
@ -881,39 +877,51 @@ bool QKmsDevice::hasAtomicSupport()
}
#if QT_CONFIG(drm_atomic)
drmModeAtomicReq * QKmsDevice::atomic_request()
drmModeAtomicReq *QKmsDevice::threadLocalAtomicRequest()
{
if (!m_atomic_request && m_has_atomic_support)
m_atomic_request = drmModeAtomicAlloc();
if (!m_has_atomic_support)
return nullptr;
return m_atomic_request;
AtomicReqs &a(m_atomicReqs.localData());
if (!a.request)
a.request = drmModeAtomicAlloc();
return a.request;
}
bool QKmsDevice::atomicCommit(void *user_data)
bool QKmsDevice::threadLocalAtomicCommit(void *user_data)
{
if (m_atomic_request) {
int ret = drmModeAtomicCommit(m_dri_fd, m_atomic_request,
DRM_MODE_ATOMIC_NONBLOCK | DRM_MODE_PAGE_FLIP_EVENT | DRM_MODE_ATOMIC_ALLOW_MODESET, user_data);
if (!m_has_atomic_support)
return false;
if (ret) {
qWarning("Failed to commit atomic request (code=%d)", ret);
return false;
}
AtomicReqs &a(m_atomicReqs.localData());
if (!a.request)
return false;
m_previous_request = m_atomic_request;
m_atomic_request = nullptr;
int ret = drmModeAtomicCommit(m_dri_fd, a.request,
DRM_MODE_ATOMIC_NONBLOCK | DRM_MODE_PAGE_FLIP_EVENT | DRM_MODE_ATOMIC_ALLOW_MODESET,
user_data);
return true;
if (ret) {
qWarning("Failed to commit atomic request (code=%d)", ret);
return false;
}
return false;
a.previous_request = a.request;
a.request = nullptr;
return true;
}
void QKmsDevice::atomicReset()
void QKmsDevice::threadLocalAtomicReset()
{
if (m_previous_request) {
drmModeAtomicFree(m_previous_request);
m_previous_request = nullptr;
if (!m_has_atomic_support)
return;
AtomicReqs &a(m_atomicReqs.localData());
if (a.previous_request) {
drmModeAtomicFree(a.previous_request);
a.previous_request = nullptr;
}
}
#endif

View File

@ -57,6 +57,7 @@
#include <qpa/qplatformscreen.h>
#include <QtCore/QMap>
#include <QtCore/QVariant>
#include <QtCore/QThreadStorage>
#include <xf86drm.h>
#include <xf86drmMode.h>
@ -238,10 +239,9 @@ public:
bool hasAtomicSupport();
#if QT_CONFIG(drm_atomic)
bool atomicCommit(void *user_data);
void atomicReset();
drmModeAtomicReq *atomic_request();
drmModeAtomicReq *threadLocalAtomicRequest();
bool threadLocalAtomicCommit(void *user_data);
void threadLocalAtomicReset();
#endif
void createScreens();
@ -281,8 +281,11 @@ protected:
bool m_has_atomic_support;
#if QT_CONFIG(drm_atomic)
drmModeAtomicReq *m_atomic_request;
drmModeAtomicReq *m_previous_request;
struct AtomicReqs {
drmModeAtomicReq *request = nullptr;
drmModeAtomicReq *previous_request = nullptr;
};
QThreadStorage<AtomicReqs> m_atomicReqs;
#endif
quint32 m_crtc_allocator;

View File

@ -195,20 +195,6 @@ namespace QtAndroidInput
angleDelta);
}
void releaseMouse(int x, int y)
{
m_ignoreMouseEvents = true;
QPoint globalPos(x,y);
QWindow *tlw = topLevelWindowAt(globalPos);
QPoint localPos = tlw ? (globalPos-tlw->position()) : globalPos;
// Release left button
QWindowSystemInterface::handleMouseEvent(tlw,
localPos,
globalPos,
Qt::MouseButtons(Qt::NoButton));
}
static void longPress(JNIEnv */*env*/, jobject /*thiz*/, jint /*winId*/, jint x, jint y)
{
QAndroidInputContext *inputContext = QAndroidInputContext::androidInputContext();

View File

@ -61,8 +61,6 @@ namespace QtAndroidInput
void updateHandles(int handleCount, QPoint editMenuPos = QPoint(), uint32_t editButtons = 0, QPoint cursor = QPoint(), QPoint anchor = QPoint(), bool rtl = false);
bool registerNatives(JNIEnv *env);
void releaseMouse(int x, int y);
}
QT_END_NAMESPACE

View File

@ -827,9 +827,6 @@ void QAndroidInputContext::longPress(int x, int y)
focusObjectStopComposing();
// Release left button, otherwise the following events will cancel the menu popup
QtAndroidInput::releaseMouse(x, y);
const double pixelDensity =
QGuiApplication::focusWindow()
? QHighDpiScaling::factor(QGuiApplication::focusWindow())

View File

@ -464,7 +464,8 @@ QVariant QAndroidPlatformTheme::themeHint(ThemeHint hint) const
return QStringList(QLatin1String("android"));
}
return QStringList(QLatin1String("fusion"));
case DialogButtonBoxLayout:
return QVariant(QPlatformDialogHelper::AndroidLayout);
case MouseDoubleClickDistance:
{
int minimumDistance = qEnvironmentVariableIntValue("QT_ANDROID_MINIMUM_MOUSE_DOUBLE_CLICK_DISTANCE");
@ -488,8 +489,6 @@ QVariant QAndroidPlatformTheme::themeHint(ThemeHint hint) const
Q_FALLTHROUGH();
}
case DialogButtonBoxLayout:
return QVariant(QPlatformDialogHelper::AndroidLayout);
default:
return QPlatformTheme::themeHint(hint);
}

View File

@ -54,8 +54,6 @@ class QCocoaBackingStore : public QRasterBackingStore
protected:
QCocoaBackingStore(QWindow *window);
QCFType<CGColorSpaceRef> colorSpace() const;
QMacNotificationObserver m_backingPropertiesObserver;
virtual void backingPropertiesChanged() = 0;
};
class QNSWindowBackingStore : public QCocoaBackingStore
@ -71,7 +69,6 @@ private:
bool windowHasUnifiedToolbar() const;
QImage::Format format() const override;
void redrawRoundedBottomCorners(CGRect) const;
void backingPropertiesChanged() override;
};
class QCALayerBackingStore : public QCocoaBackingStore
@ -118,7 +115,8 @@ private:
bool recreateBackBufferIfNeeded();
bool prepareForFlush();
void backingPropertiesChanged() override;
void backingPropertiesChanged();
QMacNotificationObserver m_backingPropertiesObserver;
std::list<std::unique_ptr<GraphicsBuffer>> m_buffers;
};

View File

@ -51,17 +51,6 @@ QT_BEGIN_NAMESPACE
QCocoaBackingStore::QCocoaBackingStore(QWindow *window)
: QRasterBackingStore(window)
{
// Ideally this would be plumbed from the platform layer to QtGui, and
// the QBackingStore would be recreated, but we don't have that code yet,
// so at least make sure we invalidate our backingstore when the backing
// properties (color space e.g.) are changed.
NSView *view = static_cast<QCocoaWindow *>(window->handle())->view();
m_backingPropertiesObserver = QMacNotificationObserver(view.window,
NSWindowDidChangeBackingPropertiesNotification, [this]() {
qCDebug(lcQpaBackingStore) << "Backing properties for"
<< this->window() << "did change";
backingPropertiesChanged();
});
}
QCFType<CGColorSpaceRef> QCocoaBackingStore::colorSpace() const
@ -341,11 +330,6 @@ void QNSWindowBackingStore::redrawRoundedBottomCorners(CGRect windowRect) const
#endif
}
void QNSWindowBackingStore::backingPropertiesChanged()
{
m_image = QImage();
}
// ----------------------------------------------------------------------------
// https://stackoverflow.com/a/52722575/2761869
@ -365,6 +349,18 @@ QCALayerBackingStore::QCALayerBackingStore(QWindow *window)
{
qCDebug(lcQpaBackingStore) << "Creating QCALayerBackingStore for" << window;
m_buffers.resize(1);
// Ideally this would be plumbed from the platform layer to QtGui, and
// the QBackingStore would be recreated, but we don't have that code yet,
// so at least make sure we update our backingstore when the backing
// properties (color space e.g.) are changed.
NSView *view = static_cast<QCocoaWindow *>(window->handle())->view();
m_backingPropertiesObserver = QMacNotificationObserver(view.window,
NSWindowDidChangeBackingPropertiesNotification, [this]() {
qCDebug(lcQpaBackingStore) << "Backing properties for"
<< this->window() << "did change";
backingPropertiesChanged();
});
}
QCALayerBackingStore::~QCALayerBackingStore()
@ -572,17 +568,26 @@ void QCALayerBackingStore::flush(QWindow *flushedWindow, const QRegion &region,
flushedView.layer.contents = nil;
}
qCInfo(lcQpaBackingStore) << "Flushing" << backBufferSurface
<< "to" << flushedView.layer << "of" << flushedView;
if (flushedView == backingStoreView) {
qCInfo(lcQpaBackingStore) << "Flushing" << backBufferSurface
<< "to" << flushedView.layer << "of" << flushedView;
flushedView.layer.contents = backBufferSurface;
} else {
auto subviewRect = [flushedView convertRect:flushedView.bounds toView:backingStoreView];
auto scale = flushedView.layer.contentsScale;
subviewRect = CGRectApplyAffineTransform(subviewRect, CGAffineTransformMakeScale(scale, scale));
flushedView.layer.contents = backBufferSurface;
// We make a copy of the image data up front, which means we don't
// need to mark the IOSurface as being in use. FIXME: Investigate
// if there's a cheaper way to get sub-image data to a layer.
m_buffers.back()->lock(QPlatformGraphicsBuffer::SWReadAccess);
QImage subImage = m_buffers.back()->asImage()->copy(QRectF::fromCGRect(subviewRect).toRect());
m_buffers.back()->unlock();
if (flushedView != backingStoreView) {
const CGSize backingStoreSize = backingStoreView.bounds.size;
flushedView.layer.contentsRect = CGRectApplyAffineTransform(
[flushedView convertRect:flushedView.bounds toView:backingStoreView],
// The contentsRect is in unit coordinate system
CGAffineTransformMakeScale(1.0 / backingStoreSize.width, 1.0 / backingStoreSize.height));
qCInfo(lcQpaBackingStore) << "Flushing" << subImage
<< "to" << flushedView.layer << "of subview" << flushedView;
QCFType<CGImageRef> cgImage = subImage.toCGImage();
flushedView.layer.contents = (__bridge id)static_cast<CGImageRef>(cgImage);
}
// Since we may receive multiple flushes before a new frame is started, we do not
@ -623,8 +628,11 @@ QImage QCALayerBackingStore::toImage() const
void QCALayerBackingStore::backingPropertiesChanged()
{
m_buffers.clear();
m_buffers.resize(1);
qCDebug(lcQpaBackingStore) << "Updating color space of existing buffers";
for (auto &buffer : m_buffers) {
if (buffer)
buffer->setColorSpace(colorSpace());
}
}
QPlatformGraphicsBuffer *QCALayerBackingStore::graphicsBuffer() const
@ -701,10 +709,11 @@ bool QCALayerBackingStore::prepareForFlush()
QCALayerBackingStore::GraphicsBuffer::GraphicsBuffer(const QSize &size, qreal devicePixelRatio,
const QPixelFormat &format, QCFType<CGColorSpaceRef> colorSpace)
: QIOSurfaceGraphicsBuffer(size, format, colorSpace)
: QIOSurfaceGraphicsBuffer(size, format)
, dirtyRegion(0, 0, size.width() / devicePixelRatio, size.height() / devicePixelRatio)
, m_devicePixelRatio(devicePixelRatio)
{
setColorSpace(colorSpace);
}
QImage *QCALayerBackingStore::GraphicsBuffer::asImage()

View File

@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2017 The Qt Company Ltd.
** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
@ -52,6 +52,8 @@
@property (class, strong, readonly) NSColor *unemphasizedSelectedTextColor NS_AVAILABLE_MAC(10_14);
@property (class, strong, readonly) NSColor *unemphasizedSelectedContentBackgroundColor NS_AVAILABLE_MAC(10_14);
@property (class, strong, readonly) NSArray<NSColor *> *alternatingContentBackgroundColors NS_AVAILABLE_MAC(10_14);
// Missing from non-Mojave SDKs, even if introduced in 10.10
@property (class, strong, readonly) NSColor *linkColor NS_AVAILABLE_MAC(10_10);
@end
#endif
@ -111,6 +113,8 @@ QPalette * qt_mac_createSystemPalette()
palette->setBrush(QPalette::ToolTipBase, qt_mac_toQBrush([NSColor controlColor]));
palette->setColor(QPalette::Normal, QPalette::Link, qt_mac_toQColor([NSColor linkColor]));
return palette;
}

View File

@ -48,9 +48,11 @@ QT_BEGIN_NAMESPACE
class QIOSurfaceGraphicsBuffer : public QPlatformGraphicsBuffer
{
public:
QIOSurfaceGraphicsBuffer(const QSize &size, const QPixelFormat &format, QCFType<CGColorSpaceRef> colorSpace);
QIOSurfaceGraphicsBuffer(const QSize &size, const QPixelFormat &format);
~QIOSurfaceGraphicsBuffer();
void setColorSpace(QCFType<CGColorSpaceRef> colorSpace);
const uchar *data() const override;
uchar *data() override;
int bytesPerLine() const override;

View File

@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(lcQpaIOSurface, "qt.qpa.backingstore.iosurface");
QIOSurfaceGraphicsBuffer::QIOSurfaceGraphicsBuffer(const QSize &size, const QPixelFormat &format, QCFType<CGColorSpaceRef> colorSpace)
QIOSurfaceGraphicsBuffer::QIOSurfaceGraphicsBuffer(const QSize &size, const QPixelFormat &format)
: QPlatformGraphicsBuffer(size, format)
{
const size_t width = size.width();
@ -81,17 +81,26 @@ QIOSurfaceGraphicsBuffer::QIOSurfaceGraphicsBuffer(const QSize &size, const QPix
Q_ASSERT(size_t(bytesPerLine()) == bytesPerRow);
Q_ASSERT(size_t(byteCount()) == totalBytes);
if (colorSpace) {
IOSurfaceSetValue(m_surface, CFSTR("IOSurfaceColorSpace"),
QCFType<CFPropertyListRef>(CGColorSpaceCopyPropertyList(colorSpace)));
}
}
QIOSurfaceGraphicsBuffer::~QIOSurfaceGraphicsBuffer()
{
}
void QIOSurfaceGraphicsBuffer::setColorSpace(QCFType<CGColorSpaceRef> colorSpace)
{
static const auto kIOSurfaceColorSpace = CFSTR("IOSurfaceColorSpace");
qCDebug(lcQpaIOSurface) << "Tagging" << this << "with color space" << colorSpace;
if (colorSpace) {
IOSurfaceSetValue(m_surface, kIOSurfaceColorSpace,
QCFType<CFPropertyListRef>(CGColorSpaceCopyPropertyList(colorSpace)));
} else {
IOSurfaceRemoveValue(m_surface, kIOSurfaceColorSpace);
}
}
const uchar *QIOSurfaceGraphicsBuffer::data() const
{
return (const uchar *)IOSurfaceGetBaseAddress(m_surface);

View File

@ -255,8 +255,8 @@ static bool isMouseEvent(NSEvent *ev)
- (NSColor *)backgroundColor
{
return self.styleMask & NSWindowStyleMaskTexturedBackground ?
[super backgroundColor] : [NSColor clearColor];
return self.styleMask == NSWindowStyleMaskBorderless ?
[NSColor clearColor] : [super backgroundColor];
}
- (void)sendEvent:(NSEvent*)theEvent

View File

@ -52,6 +52,7 @@
#include <QScreen>
#include <QDir>
#if QT_CONFIG(regularexpression)
# include <QFileInfo>
# include <QRegularExpression>
#endif
#include <QLoggingCategory>
@ -144,7 +145,12 @@ int QEglFSDeviceIntegration::framebufferIndex() const
int fbIndex = 0;
#if QT_CONFIG(regularexpression)
QRegularExpression fbIndexRx(QLatin1String("fb(\\d+)"));
QRegularExpressionMatch match = fbIndexRx.match(QString::fromLocal8Bit(fbDeviceName()));
QFileInfo fbinfo(QString::fromLocal8Bit(fbDeviceName()));
QRegularExpressionMatch match;
if (fbinfo.isSymLink())
match = fbIndexRx.match(fbinfo.symLinkTarget());
else
match = fbIndexRx.match(fbinfo.fileName());
if (match.hasMatch())
fbIndex = match.captured(1).toInt();
#endif

View File

@ -83,6 +83,8 @@ bool QEglFSKmsGbmDevice::open()
setFd(fd);
m_eventReader.create(this);
return true;
}
@ -90,6 +92,8 @@ void QEglFSKmsGbmDevice::close()
{
// Note: screens are gone at this stage.
m_eventReader.destroy();
if (m_gbm_device) {
gbm_device_destroy(m_gbm_device);
m_gbm_device = nullptr;

View File

@ -54,8 +54,6 @@
QT_BEGIN_NAMESPACE
QMutex QEglFSKmsGbmScreen::m_waitForFlipMutex;
QEglFSKmsGbmIntegration::QEglFSKmsGbmIntegration()
{
qCDebug(qLcEglfsKmsDebug, "New DRM/KMS via GBM integration created");

View File

@ -110,7 +110,7 @@ QEglFSKmsGbmScreen::FrameBuffer *QEglFSKmsGbmScreen::framebufferForBufferObject(
return fb.take();
}
QEglFSKmsGbmScreen::QEglFSKmsGbmScreen(QKmsDevice *device, const QKmsOutput &output, bool headless)
QEglFSKmsGbmScreen::QEglFSKmsGbmScreen(QEglFSKmsDevice *device, const QKmsOutput &output, bool headless)
: QEglFSKmsScreen(device, output, headless)
, m_gbm_surface(nullptr)
, m_gbm_bo_current(nullptr)
@ -243,7 +243,7 @@ void QEglFSKmsGbmScreen::ensureModeSet(uint32_t fb)
if (device()->hasAtomicSupport()) {
#if QT_CONFIG(drm_atomic)
drmModeAtomicReq *request = device()->atomic_request();
drmModeAtomicReq *request = device()->threadLocalAtomicRequest();
if (request) {
drmModeAtomicAddProperty(request, op.connector_id, op.crtcIdPropertyId, op.crtc_id);
drmModeAtomicAddProperty(request, op.crtc_id, op.modeIdPropertyId, op.mode_blob_id);
@ -276,19 +276,15 @@ void QEglFSKmsGbmScreen::waitForFlip()
if (!m_gbm_bo_next)
return;
QMutexLocker lock(&m_waitForFlipMutex);
while (m_gbm_bo_next) {
drmEventContext drmEvent;
memset(&drmEvent, 0, sizeof(drmEvent));
drmEvent.version = 2;
drmEvent.vblank_handler = nullptr;
drmEvent.page_flip_handler = pageFlipHandler;
drmHandleEvent(device()->fd(), &drmEvent);
}
m_flipMutex.lock();
device()->eventReader()->startWaitFlip(this, &m_flipMutex, &m_flipCond);
m_flipCond.wait(&m_flipMutex);
m_flipMutex.unlock();
flipFinished();
#if QT_CONFIG(drm_atomic)
if (device()->hasAtomicSupport())
device()->atomicReset();
device()->threadLocalAtomicReset();
#endif
}
@ -324,16 +320,16 @@ void QEglFSKmsGbmScreen::flip()
if (device()->hasAtomicSupport()) {
#if QT_CONFIG(drm_atomic)
drmModeAtomicReq *request = device()->atomic_request();
drmModeAtomicReq *request = device()->threadLocalAtomicRequest();
if (request) {
drmModeAtomicAddProperty(request, op.eglfs_plane->id, op.eglfs_plane->framebufferPropertyId, fb->fb);
drmModeAtomicAddProperty(request, op.eglfs_plane->id, op.eglfs_plane->crtcPropertyId, op.crtc_id);
drmModeAtomicAddProperty(request, op.eglfs_plane->id, op.eglfs_plane->srcwidthPropertyId,
output().size.width() << 16);
op.size.width() << 16);
drmModeAtomicAddProperty(request, op.eglfs_plane->id, op.eglfs_plane->srcXPropertyId, 0);
drmModeAtomicAddProperty(request, op.eglfs_plane->id, op.eglfs_plane->srcYPropertyId, 0);
drmModeAtomicAddProperty(request, op.eglfs_plane->id, op.eglfs_plane->srcheightPropertyId,
output().size.height() << 16);
op.size.height() << 16);
drmModeAtomicAddProperty(request, op.eglfs_plane->id, op.eglfs_plane->crtcXPropertyId, 0);
drmModeAtomicAddProperty(request, op.eglfs_plane->id, op.eglfs_plane->crtcYPropertyId, 0);
drmModeAtomicAddProperty(request, op.eglfs_plane->id, op.eglfs_plane->crtcwidthPropertyId,
@ -368,7 +364,7 @@ void QEglFSKmsGbmScreen::flip()
if (device()->hasAtomicSupport()) {
#if QT_CONFIG(drm_atomic)
drmModeAtomicReq *request = device()->atomic_request();
drmModeAtomicReq *request = device()->threadLocalAtomicRequest();
if (request) {
drmModeAtomicAddProperty(request, d.screen->output().eglfs_plane->id,
d.screen->output().eglfs_plane->framebufferPropertyId, fb->fb);
@ -391,22 +387,10 @@ void QEglFSKmsGbmScreen::flip()
}
#if QT_CONFIG(drm_atomic)
if (device()->hasAtomicSupport())
device()->atomicCommit(this);
device()->threadLocalAtomicCommit(this);
#endif
}
void QEglFSKmsGbmScreen::pageFlipHandler(int fd, unsigned int sequence, unsigned int tv_sec, unsigned int tv_usec, void *user_data)
{
Q_UNUSED(fd);
Q_UNUSED(sequence);
Q_UNUSED(tv_sec);
Q_UNUSED(tv_usec);
QEglFSKmsGbmScreen *screen = static_cast<QEglFSKmsGbmScreen *>(user_data);
screen->flipFinished();
}
void QEglFSKmsGbmScreen::flipFinished()
{
if (m_cloneSource) {

View File

@ -43,7 +43,8 @@
#define QEGLFSKMSGBMSCREEN_H
#include "qeglfskmsscreen.h"
#include <QtCore/QMutex>
#include <QMutex>
#include <QWaitCondition>
#include <gbm.h>
@ -54,7 +55,7 @@ class QEglFSKmsGbmCursor;
class QEglFSKmsGbmScreen : public QEglFSKmsScreen
{
public:
QEglFSKmsGbmScreen(QKmsDevice *device, const QKmsOutput &output, bool headless);
QEglFSKmsGbmScreen(QEglFSKmsDevice *device, const QKmsOutput &output, bool headless);
~QEglFSKmsGbmScreen();
QPlatformCursor *cursor() const override;
@ -75,18 +76,15 @@ private:
void cloneDestFlipFinished(QEglFSKmsGbmScreen *cloneDestScreen);
void updateFlipStatus();
static void pageFlipHandler(int fd,
unsigned int sequence,
unsigned int tv_sec,
unsigned int tv_usec,
void *user_data);
gbm_surface *m_gbm_surface;
gbm_bo *m_gbm_bo_current;
gbm_bo *m_gbm_bo_next;
bool m_flipPending;
QMutex m_flipMutex;
QWaitCondition m_flipCond;
QScopedPointer<QEglFSKmsGbmCursor> m_cursor;
struct FrameBuffer {
@ -101,8 +99,6 @@ private:
bool cloneFlipPending = false;
};
QVector<CloneDestination> m_cloneDests;
static QMutex m_waitForFlipMutex;
};
QT_END_NAMESPACE

Some files were not shown because too many files have changed in this diff Show More