Commit Graph

40833 Commits

Author SHA1 Message Date
Pavel Artsishevsky
a22bb694ce Fix QPainter's ColorDodge and ColorBurn composition modes
Added checking corner cases (more specific formulas) in
color_dodge_op()/color_dodge_op_rgb64() and color_burn_op()/color_burn_op_rgb64()
to produce correct results for any input.

Task-number: QTBUG-77231
Change-Id: I274f80b356bd4236a9176a84a95604c2eb01787a
Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-08-02 12:46:53 +03:00
Allan Sandfeld Jensen
76c097c4d7 Improve our color space terminology
Replace our use of 'gamut' with 'primaries'. One is the axes of the
color space, the other the volume of representable values. For the
currently supported color spaces those are mostly equivalent, but when
we later add support for scRgb, this would be misleading as it has the
same primaries as sRGB but a much wider gamut, and we would like to use
the same primaries/"gamut" id for it.

Also few people would know what "the sRGB gamut" is, but
"the sRGB primaries" is easily googable.

Change-Id: I3348ccaae27a071ec77a4356331b9bbbf92e0d19
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-08-02 09:44:55 +02:00
Joerg Bornemann
97d6517114 Fix Makefile re-generation for debug_and_release builds
Re-generation of the Makefile depends on a correctly set up
QMAKE_INTERNAL_INCLUDED_FILES variable. In debug_and_release builds
this variable is set up for Makefile.Debug and Makefile.Release, but
not for the meta Makefile. However, that's where the Makefile
re-generation target is located.

We now collect the contents of QMAKE_INTERNAL_INCLUDED_FILES for
Makefile.Debug/Release and use that for the meta Makefile.

Fixes: QTBUG-13334
Change-Id: I6124a91447d5c54d51680e23570c4e97f44e6a73
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-08-02 08:06:44 +02:00
Sona Kurazyan
1932754e90 Clean up documentation of deprecated APIs from QApplication
Build docs for deprecated APIs conditionally, based on deprecation
version. Remove the docs of methods deprecated since 5.0.0, these
methods are not compiled anymore.

Change-Id: If9302eecc8b3fff4a27c2e4a66ac102add7d66c5
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-01 19:04:19 +02:00
Sona Kurazyan
376715f1a5 Remove usages of deprecated APIs of qtbase/widgets
- Replace the usages of deprecated APIs by corresponding
  alternatives in the library code and documentation.

- Build docs for deprecated APIs conditionally, based on deprecation
  version. Remove the docs of methods deprecated since 5.0.0, these
  methods are not compiled anymore.

- Modify the tests to make them build when deprecated APIs disabled:
    * Make the the parts of the tests testing the deprecated APIs to
      be compiled conditionally, only when the corresponding methods
      are enabled.
    * If the test-case tests only the deprecated API, but not the
      corresponding replacement, add tests for the replacement

Task-number: QTBUG-76491
Task-number: QTBUG-76540
Task-number: QTBUG-76541
Change-Id: I6aaf0a1369c479fb880369a38f2b8e1e86b46934
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-01 17:04:13 +00:00
Sona Kurazyan
bd2c8353b4 Improve the keypadnavigation manual test
- No need to use QSignalMapper here, replace its uses with lambdas.
- Replace index 'for' loop with iterator loop, to simplify the code.

Change-Id: Ide3d2db99a074c0233eb5c2fd7a9b217d804973f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-08-01 19:03:42 +02:00
Timur Pocheptsov
ec62033bc2 tst_http2::connectToHost - add a fix for SecureTransport backend
One of the tests above was unsetting a variable that enforces
the use of a temporary keychain. We have to set it back, otherwise
the test is failing. What surprises me though - why I had this
problem only locally and not on CI? Apparently, SecureTransport
is not covered by our configurations ...

Change-Id: I0ff1e3e304632869391ed61213c245b949d8c778
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-01 17:37:53 +02:00
Sona Kurazyan
b6688a4d49 Un-deprecate QSignalMapper
From the comments on QTBUG-73407 and the last comments on
29bcbeab90, it seems like there are still
use-cases when QSignalMapper is useful.

Change-Id: I8402286cb8a395a4601cda8a4cdda51f19aef073
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-01 17:00:35 +02:00
Tor Arne Vestbø
662798d785 macOS: Add system detection and version defines for macOS Catalina (10.15)
Change-Id: I127efe752ebb70825f1b31f0d64c4293d1c71820
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-01 15:25:01 +02:00
Tor Arne Vestbø
360000342a macOS: Improve screen positioning during window creation
Allow AppKit to resolve screen for NSWindow lazily in the case where the
position is outside any known screen. And explicitly set the style mask
if detecting the corner case of positioning a window in the unavailable
space on a rotated screen.

In testing the effect of creating the window with a borderless style mask
and then updating the mask did not seem to have any visual consequences,
but we try to limit this mode just in case by only enabling it in the
corner cases we detect.

Change-Id: I4b7fcc6755a1ad5ff2683bec79d80a78226edae0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-08-01 15:24:55 +02:00
Tor Arne Vestbø
89e97e9937 Pass qmake arguments when creating Xcode project from Makefile
Change-Id: I0020273b200465f44a135848b4fd505793e85c30
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-08-01 15:24:25 +02:00
Tor Arne Vestbø
a34b0855f1 macOS: Don't assume NSWindows will be created on the screen we request
The user may have assigned the application to start up on a specific
display, in which case the window's screen is nil after creation, and
the resulting screen will be delivered as a normal screen change once
the window is ordered on screen.

Fixes: QTBUG-77154
Change-Id: Idade6d833e31654db239243f2430166b5d86eca2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-01 15:23:56 +02:00
Timur Pocheptsov
bd8ef7fe24 Blacklist tst_http2::connectToHost
Test if flakey.

Change-Id: I1f956f47ab4cf0602f3631e4f7908df35f5ce83f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-08-01 13:18:02 +00:00
Marc Mutz
4726f47b41 Port users of get{Contents,Text}Margins() missed first time around
Done-with: Sona Kurazyan <sona.kurazyan@qt.io>
Change-Id: I5b584cbe468429c53c2d661a0d7957d74e7ad691
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-08-01 12:55:07 +00:00
Friedemann Kleint
f23f9ba041 QTestLib: Speed up QCOMPARE for QString
Add overloads for qCompare() for QStringView making use of the fast
formatting helper introduced by 94aa350621
for int.

Speeds up the bug report example by a factor of 3..4.

Task-number: QTBUG-38890
Change-Id: Icc706618b2f1d23b37d354a04d4e1d1cc4b5aee3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-08-01 13:51:23 +02:00
Sona Kurazyan
10845315b7 Conditionally disable parts of the tests testing the deprecated APIs
Somehow missed these during my first iteration.

Change-Id: Iaef0ab84d9320a98f49ec071c93cd6f2907d92c3
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2019-08-01 13:51:18 +02:00
Allan Sandfeld Jensen
b80b228240 Fix QColorTransform memory leak
Introduced recently when the smart-pointer was made manual.

Change-Id: I29a041631e94a8e131dd29dae32975d68b386e00
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-08-01 13:51:15 +02:00
Marc Mutz
9ad8debe38 qlalr: fix compilation with C++20
std::not1 is deprecated in C++17, removed in C++20.

Use its replacement, std::not_fn.

Change-Id: I37d4929c81c2a5befeb44f954ae77b23960d2ff0
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2019-08-01 11:20:27 +00:00
Friedemann Kleint
174061f9f3 QHighDPI: Fix broken scaling of QPoint(F)
For some reason, the overload resolution of the
High DPI scale() functions introduced by
b6ded193ee chose the
wrong overloads for QPointF and/or QPoint; it fell
back to the generic template intended for qreal,
QSize, etc, ignoring the origin. Remove the
template and spell out all overloads.

Fixes: QTBUG-77255
Change-Id: I5661f16f7326f65156f646f430f5a0c71d5302d2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-08-01 13:20:23 +02:00
Sona Kurazyan
d914a5ba4e Remove the remaining usages of deprecated APIs of qtbase
This change removes the leftovers form other cleanup commits.

Task-number: QTBUG-76491
Change-Id: I61440f87c5a280f9666b78e19aac4d8ac603767e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2019-08-01 06:48:27 +02:00
Marc Mutz
a2c18fd10c tst_QMenu: Eradicate Q_FOREACH loops
In two cases, we now detach. ¯\_(ツ)_/¯  This is test code.

Change-Id: I244f5e20dd923281049f38b76366163c16b6498c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-08-01 07:46:36 +03:00
Marc Mutz
6e8dd46a6f QResource: consistently cache resourceList()
Each call to reourceList() uses atomic operations to check whether
resourceGLobalData has not expired, yet.

Some functions already cached the value, but then went on to use the
function directly afterwards. In some cases, this was due to the
cached value being a pointer-to-const and the function later deciding
to mutate the list. But all the code is safe from detaches, so this
distinction need not be made.

Standardize on caching, and using the cached value, except in
functions which call it only once.

Change-Id: I79780b990da539bf7beaa8104e13cb8187f84812
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-08-01 07:46:29 +03:00
Qt Forward Merge Bot
231b70c294 Merge "Merge remote-tracking branch 'origin/5.13' into dev" 2019-08-01 01:00:23 +02:00
Qt Forward Merge Bot
5ee1c86d10 Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: I4505ec6fe17a1aa2c8d1e6576234d06a34eb9f99
2019-08-01 01:00:10 +02:00
Tasuku Suzuki
0642444e72 Fix spdy build without features.properties
Move location of stream ID from a dynamic property to an internal QHash.

Change-Id: I9bab4cbfaebe6a04d54afa7889aac748070e1f2e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-08-01 04:47:32 +09:00
Allan Sandfeld Jensen
dcc4d54fc9 Parse color space name from ICC profile
Adds parsing of ICCv2 and ICCv4 description tags.

Change-Id: I8647e1529d4127950624f16c475d8dba610149b6
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-07-31 21:47:17 +02:00
Allan Sandfeld Jensen
a2c1109152 Harden ICC parser
Add missing implicit size checks of tags by passing the already checked
explicitly given size forward.

Also adds my fuzzing test for the ICC parser as it is security critical,
by being used by multiple image formats.

Change-Id: Ieb632ccb78f9b445a276959ffbd66fa04a7a5b45
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-07-31 21:47:04 +02:00
Christian Ehrlicher
4583555b8c QSortFilterProxyModel: avoid some unnecessary copies
Clean up QSortFilterProxyModel by using const refs instead copies and
range-based for loops instead plain loops

Change-Id: Ic1250f33e7c311a9e1d3c19cc5dc7a9578423e74
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-07-31 21:46:54 +02:00
Volker Hilsheimer
3d7bd7ad19 Fix hit testing in non-client area of fixed-size windows, don't show resize cursors
The m_windowState member is never updated regarding active state;
isActive is instead reimplemented to query the window manager, so use
that.

To extend the area where the user can move the window over the entire
titlebar of fixed-height windows, just test whether the mouse position
is within the titlebar.

Change-Id: I6b87aacd0bdab511cfd4959df1114af5c6013852
Fixes: QTBUG-77220
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-07-31 20:13:49 +02:00
Christian Ehrlicher
4d7271087e QAbstractItemView: refine documentation for SingleSelection
Since Qt5.1 it is possible to deselect the current selected item in
SingleSelection mode when pressing the Ctrl key during the click but
this was not mentioned in the docs.

Change-Id: I86652308215bf218ea959f869334b6077e4634f9
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-07-31 18:03:22 +02:00
Simon Hausmann
2dddc1c9f4 Fix erroneous missing-cmake-tests errors
After commit 9c7ebd191b, qmake would
complain about missing cmake tests even for internal modules that have
no application side C++ linkage that needs testing.

Change-Id: I23b23c81dbe6be2b6da5672cbd7b8f8454ec2f66
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-07-31 16:37:28 +02:00
Eirik Aavitsland
697910e5fb Fix assert in QPainterPath after clear()
The newly introduced clear() method left the path in an undefined
state: d_ptr allocated, but no elements. The elements vector is
otherwise never empty, since ensureData() inserts a dummy initial
moveTo element.

Fix by making sure that clear() leaves the path in the same state as
ensureData() (i.e. "empty" but not "null"), except possibly more
capacity allocated in the elements vector.

Fixes: QTBUG-76534
Change-Id: I7ad8b312913f5eb6e22023f5d2fd873e54b1e23c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-07-31 12:05:54 +02:00
Qt Forward Merge Bot
a4567c9058 Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" 2019-07-31 10:30:56 +02:00
Qt Forward Merge Bot
241ccb7c83 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Ifbaa4877051d93bcb0d58eed35bfe8dffa5634a3
2019-07-31 10:30:44 +02:00
Volker Hilsheimer
23e605cc5b Plug a memory leak introduced in e24a4976be
While it is correct not to call the functor when the context object has
been destroyed, we still need ot clean up the slotObj. It's a low-
probability memory leak: the context object has to disappear while
waiting for a host resolution, and for repeated requests for the same
host the cache takes over anyway.

Task-number: QTBUG-76276
Change-Id: Id9daf391353b8252443f3186a7d504d70c553b24
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-07-31 09:25:30 +02:00
Marc Mutz
25c38601de QWheelEvent: use QT_DEPRECATED_VERSION_X_5_15
... in an attempt to get qt5 integration going.

Change-Id: I22dd6ff2cb9a6d11620878c432905bd07292220b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-31 10:04:53 +03:00
Laszlo Agocs
3f201f988f rhi: Fix clear value in offscreen test
Leftover from the migration to QColor as color clear value.

Change-Id: Ibf49d65234a1e14d53035b46249753a5929ca22b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-07-31 09:04:49 +02:00
Laszlo Agocs
493ce2f3d4 rhi: gl: Add support for compute
...and storage buffers and images.

Change-Id: If38a51322e3187088a13cf4e9b88cb40c8af8621
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-07-31 09:04:45 +02:00
Laszlo Agocs
c955426945 rhi: metal: Do not hold on to the drawable when not presenting
The Quick render loops do SkipPresent occasionally, and it all seemed
to work with the threaded one because we lack an autorelease pool on
the SG render thread. (to be corrected separately) The basic one ended
up crashing sometimes, however. Holding on to the drawable is incorrect.

Fixes: QTBUG-76953
Change-Id: I0d0ec6d09aa209d2c848d7a9dbd9b15916fe23ab
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-07-31 09:04:41 +02:00
Laszlo Agocs
a093e4e3c2 rhi: vulkan: Fix glitches on resize on X11
...by notifying QVulkanInstance about the present. With the xcb platform
this then gets turned into updating the sync request counter.

Change-Id: Iecfb6d10ead3befcb24c19433d4712ed73a84bb4
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-07-31 09:04:37 +02:00
Joerg Bornemann
f84ea9a6bd Rename MakefileGenerator::build_args() to ...::fullBuildArgs()
...because
  - it calls the properly camel-cased member function buildArgs(bool),
    which is slightly confusing
  - it returns buildArgs(true) plus input and output

We also let it return only the arguments, excluding the qmake
executable. This is consistent with the function's name and saves us a
string replacement stunt at one call site.

Change-Id: I8bea65900bd51962962e4cfd425ffbc26e3a52fe
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-07-31 09:04:34 +02:00
Joerg Bornemann
7adc1d329f Remove dead code from metamakefile.cpp
Remove usage of the 'if (0 && ...)' pattern that was presumably used
to temporarily disable code paths. The disabling of the two code paths
was introduced in 356a677b386648710efc4db9a8a1b4a975f95c48 (old
internal history, 2004) and
0326e3511928d90329152b9b0493da76e9caa442 (old internal history, 2006).
It can be deduced that it's pretty safe to remove both.

Change-Id: I88aee65b1286701241b5b80fbac0c65cd99ecd5e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-07-31 09:04:30 +02:00
Liang Qi
4aec85b6bb Merge "Merge remote-tracking branch 'origin/5.13' into dev" 2019-07-30 21:41:23 +02:00
Marc Mutz
130fd22d39 QWidget/QLineEdit: deprecate get{Contents,Text}Margins()
We have contentsMargins() and textMargins() methods since 4.6 which
are much more efficient and easier to use.

[ChangeLog][QtWidgets][QLineEdit] The getTextMargins() member function
has been deprecated in favor of textMargins().

[ChangeLog][QtWidgets][QWidget] The getContentsMargins() member
function has been deprecated in favor of contentsMargins().

Change-Id: Ifdb890af6198fc682b94701786c67a5b945a4b4c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-30 22:41:19 +03:00
Liang Qi
71ec1d6d79 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	qmake/generators/win32/mingw_make.cpp

Change-Id: I2f790bc8572bd22fea01edf7ca74595b29f063eb
2019-07-30 13:47:36 +02:00
Heikki Halmet
305f2c3aa6 BLACKLIST insert_remove_loop for msvc-2019
Task-number: QTBUG-77239
Change-Id: Ie1a08db0b4c4e1bbcb7981f24bcf12d5e6d33e48
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2019-07-30 14:11:02 +03:00
Oliver Wolff
652085c5c2 qfsfileengine_p.h: Un-inline processOpenModeFlags
An inlined exported function does not make sense and will cause a
warning.

Fixes: QTBUG-77242
Change-Id: I016b93d6b39c4db82148fdc5a8a92bc9d5751885
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-07-30 13:10:08 +02:00
Marc Mutz
76be819345 QEasingCurve: reduce code duplication in setCurveShape()
Instead of creating an explicit QEasingCurve object in each
switched-over case, extract the conversion between the enums
involved into a helper and just call setEasingCurve() with
the result (implicitly converted to QEasingCurve).

Saves 0.5KiB in text size on optimized AMD64 Linux GCC 9.1
builds.

Change-Id: I81b5d7199d9dd99ba3735c910a50e371e0b99838
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-07-30 13:10:33 +03:00
Marc Mutz
bcf6f99237 QEasingCurve: remove a default case label
A default: case label turns off compiler warnings for missing
enumeration values, which we'd like to have, so remove it.

Change-Id: I96247a7fc46e91a29591a907e52841a90df62f10
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-07-30 13:10:18 +03:00
Marc Mutz
7940bc32a1 QLineEdit: use QMargins internally instead of 4 x int
Replace the four ints xTextMargin with one QMargins member, and the
effectiveXTextMargin() function with effectiveTextMargins(). The
left and right effective margins were always used together, so this
in no case leads to extra work, compared to separate functions.

Change-Id: I46d061919ffac297142213ccb4033caa0288b554
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-07-30 13:05:11 +03:00