Commit Graph

41309 Commits

Author SHA1 Message Date
Edward Welbourne
14aa481614 Convert foreach to ranged for in QDateTime benchmark
Change-Id: I05cf7b1916afa94a9f0f9b83af9b4ebe20a04cf0
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-08-30 11:09:59 +02:00
Edward Welbourne
0556366ddb Deduplicate list-building code in QDateTime benchmark
Aside from the start-date and the end-date, and a variant with a
time-zone, the lists various tests were building were all built the
same way; so pack that up as a pair of functions (one without
time-zone, one with) to save duplication. Make the list in each
function const, ready for conversion of foreach loops to ranged for.

In the process, replace QList with QVector, reserve space before we
populate and use auto for the now-const list variables it's saved in.

Change-Id: I7d8cce459a4d6111cd645e8d3966ad769ab7e201
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-08-30 11:09:36 +02:00
Marc Mutz
c78a716b72 QDateTimeParser: replace QVector with QVarLengthArray<12>
The lists of month and day-of-week names usually currently do not
exceed 13 elements (incl. possible leap months), so don't use
QVector, use QVarLengthArray with Prealloc = 13.

This value may be increased when ISO week-as-month is merged, but
the container remains valid even with 52 "months" (though the code
that calculates its runtime size will naturally need to be adjusted).

Change-Id: I4ead897d933f89fc092850fcc22ca41da0a6ddc6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-08-30 09:06:34 +00:00
Edward Welbourne
54f6c9bfd9 Fix unused variable warnings in QDateTime benchmark
Change-Id: Id123ace74cfa7b5ff406eabbfda0aad9f58c3fd4
Reviewed-by: David Faure <david.faure@kdab.com>
2019-08-30 10:55:46 +02:00
Edward Welbourne
06f69700af Fix some bogus date calculations in QDateTime's benchmark
Multiplying a Julian Day number by the number of milliseconds per day
does not get you a time since the start of 1970; it gets you a time
since the start of the Julian Day number system, which was several
millennia earlier.

Change-Id: Ic90a6c3de445baf9cfd30f28dd847f146e6a7adf
Reviewed-by: David Faure <david.faure@kdab.com>
2019-08-30 10:55:12 +02:00
Edward Welbourne
2faa6cafa9 Pass QDate, QTime as value classes, rather than by const reference
This can, of course, only be done in private APIs - but comment on
public APIs to do the same at Qt 6.

Change-Id: I3c79951572be3c37b0b0c5b1b05bced051a40964
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-08-30 10:54:27 +02:00
Edward Welbourne
20f69beae4 Optimize QDate by shortcutting some gregorian calendar methods
Add some static methods to QGregorianCalendar, some of which serve to
implement its methods, that QDate can use to bypass vtables and
exploit fixed truths of the Gregorian calendar in its default
handling.

Change-Id: Iec191cdf4d52945dbd5679e609180cb4fe59b5fd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-30 10:52:42 +02:00
Fredrik Orderud
7b2dfb37ee Remove hardcoded qt_instdate field from binary
Move hardcoded date to the only client code in the repo.

This field is currently modified by MaintenanceTool and possibly windeployqt,
which contributes to breaking the DLL signature on Windows. Removing the field
should avoid this problem.

Task-number: QTBUG-76985
Change-Id: I01386136ac493ea50c99c05879a3e215f3f6344c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-08-30 07:03:02 +02:00
Antti Kokko
b2df41b5a8 Add changes file for Qt 5.12.5
Change-Id: Ic3c3c0d934b2f6b8980c165c4a464442fc4cebbc
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-08-30 07:00:11 +02:00
Qt Forward Merge Bot
0d6e555778 Merge "Merge remote-tracking branch 'origin/5.14' into dev" 2019-08-29 21:24:21 +02:00
Qt Forward Merge Bot
a6915d83ea Merge remote-tracking branch 'origin/5.14' into dev
Change-Id: I63a9a4a77ff260d7fc5434d13a5932055a4fb640
2019-08-29 21:24:08 +02:00
Mårten Nordheim
108382e236 Mark QNetworkAccessManager::autoDeleteReplies as const
From the API review.

Amends cd816d4b6a.

Change-Id: I3d3e2ef331501fa498545c5eec0e321544165b0d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-08-29 18:16:52 +02:00
Timur Pocheptsov
048e66a11d Close popups on windowWillMiniaturize notification
We do this on windowDidMove/windowWillClose, but we don't on a 'will
miniaturize' notification. This can leave an application with an
orphan popup window, such as context menu which looks really weird.
I err on a safe side though - I don't close all popups - the application's
logic can be such that it has several windows and one of them gets
minimized (we can do this via QWidget's interface, for example) - would
be strange if all popups close. So I only close popups that have
the miniaturized window as a transient parent.

Task-number: QTBUG-77833
Change-Id: Ib655a27c0ce8661f9e7156e6035f7fffaff901b1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-08-29 17:27:37 +02:00
Joerg Bornemann
ea1c8d4e65 Remove nonsensical initialization from QMakeLocalFileName
The c'tor that takes a QString detects whether the string's first and
*last but one* characters are double quotes. In that case it removes
the first and *last* characters, resulting in a conversion from
"\"C:\\foo\"\\" to "C:\\foo\"". It's highly unlikely that this code path
was ever triggered, because its erroneous result would have been
noticed. Remove it.

Change-Id: I653e6a4667ae3620c35e509420eb22a71bb986a9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-08-29 14:02:48 +00:00
Jędrzej Nowacki
949482f8e4 Add QObject allocation benchmarks
The benchmark measures the performance of QObject allocation,
including costs of memory allocations.

Change-Id: I5d8ecfb97fe0be3375340b5ce84eb423e8a4ddaf
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-29 14:04:27 +02:00
Alex Trotsenko
81408c0e76 QEventDispatcherWin32: avoid livelock in a foreign event loop
According to Windows docs, GetMessage() function retrieves the messages
from the input queue in defined order, where posted messages are
processed ahead of input messages, even if they were posted later.
Therefore, if the application produces a posted event permanently, as
a result of processing that event, user input messages may be blocked
due to hard CPU usage by the application.

It's not a problem, if an internal Qt event loop is running. By calling
sendPostedEvents() on the beginning of processEvents(), we are sending
posted events only once per iteration. However, during execution of
the foreign loop, we should artificially lower the priority of the
WM_QT_SENDPOSTEDEVENTS message in order to enable delivery of other
input messages.

To solve the problem, it is proposed to postpone the
WM_QT_SENDPOSTEDEVENTS message until the message queue becomes empty,
as it works for the internal loop.

Task-number: QTBUG-77464
Change-Id: I8dedb6837c6fc41aa6f497e67ab2352c2b4f3772
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-08-29 09:12:29 +00:00
Laszlo Agocs
2602209f54 rhi: vulkan: Introduce secondary command buffer usage
As an option. Must opt in via setting ExternalContentsInPass in
the flags for beginFrame(). It is somewhat unfortunate to require
declaring this up front, but forcing using secondary command buffers
always, even though beginExternal() may not be used in many applications,
would be an overkill.

Change-Id: I8d52bcab40c96f89f140c4c7877b6c459925e3c7
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-08-29 10:23:15 +02:00
Laszlo Agocs
0077e0f88c rhi: vulkan: Add missing VK_QUERY_RESULT_WAIT_BIT
Mainly to get the validation layer from newer Vulkan SDKs to shut up.

Change-Id: I3a00d2e7b5617eb1656625b1b2a919bb3c07feb9
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-08-29 10:23:05 +02:00
Laszlo Agocs
4e97c4061e rhi: Attempt to fix up the logic around beginExternal()
Mainly for Vulkan where it lacked the recording of the still queued
commands. Uncovered by Qt Quick examples that integrate custom Vulkan
rendering.

This still has an issue that needs to be tackled separately. (we probably
will switch to using a dedicated secondary command buffer with
RENDER_PASS_CONTINUE_BIT for the external commands, and then just have
a vkCmdExecuteCommands in our own queue instead of recording everything in
beginExternal).

The possibility of losing glMemoryBarrier() calls due to begin/endExternal()
with the OpenGL backend is fixed too. The logic here mirrors Vulkan
to some extent except that we do not have a concept of (and so the trouble
with) renderpass instances.

Clean up around the implementations of finish() as well. Attempting to share
code via a "flushCommandBuffer" function is admirable but is not worth it
since some semantics are different. (finish() cannot be called within a
begin/endPass, unlike begin/endExternal).

Change-Id: I5137db598d6a40d484e53678f5c919abf750d9ed
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-08-29 10:22:56 +02:00
Laszlo Agocs
2d7fc7a152 rhi: vulkan: Expose the VkRenderPass via the usual mechanisms
Qt Quick in turn will expose it via QSGRendererInterface. Essential when
adding custom Vulkan rendering into a Qt Quick application because the
custom pipeline state objects will need to reference a VkRenderPass.

Change-Id: Idf4092cfc3937830fb8123164081059b0d8d030e
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-08-29 10:22:41 +02:00
Volker Hilsheimer
d6551fe125 QTree/TableView: Don't emit clicked when releasing after double click
If an item is double clicked, then without this fix, the views emit the
clicked() signal when the mousebutton is released after the double click
event. This is unexpected and wrong.

QAbstractItemView keeps track of the item the mouse was pressed on, to
verify that the release occurred on the same item before emitting
clicked, and to make sure we have a valid pressed item before initiating
drag'n'drop. By resetting d->pressedItem when a double click has been
handled, we can prevent the emission of a clicked signal in the next
release event.

[ChangeLog][QtWidgets][QTreeView] Don't emit clicked signal after a
doubleClicked signal.

Fixes: QTBUG-77771
Change-Id: I05988e9e2222157f4216cebc40c22507e8d83b82
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
2019-08-29 09:52:10 +02:00
BogDan Vatra
c28b881c98 Android: Use LLVM tools where possible
Properly set CROSS_COMPILE qmake variable

Fixes: QTBUG-77890
Change-Id: I73e22d0f936d35c373c064d30ea8d92005d79b2c
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-08-29 09:45:37 +03:00
BogDan Vatra
8e54fc0880 Android: AUX template doesn't require a multi arch build
Change-Id: I7b7abe7f016b4b85546986354653fc4ddf320dcc
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-08-29 09:45:34 +03:00
Qt Forward Merge Bot
ce8ab39a08 Merge "Merge remote-tracking branch 'origin/5.14' into dev" 2019-08-29 01:00:59 +02:00
Qt Forward Merge Bot
a31d1af591 Merge remote-tracking branch 'origin/5.14' into dev
Change-Id: I536ba1f13c5234487dc6827ad30548f5629fae2c
2019-08-29 01:00:49 +02:00
Rainer Keller
02a6209487 Fix invalid end range appended to HTTP request
When the end range of a byte range in a HTTP request is skipped the download
manager adds 0 it its place when resuming that download.

When there is no end range given the value is skipped.

Task-number: QTBUG-77867
Change-Id: I52358c94cf56c88217fcc91abb102ed393ac7242
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-08-28 15:34:08 +02:00
Tor Arne Vestbø
0844be34ba iOS: Skip explicit dead code stripping when generating Xcode projects
Fixes: QTBUG-73680
Change-Id: I5d17ef6321bb1f800c39c3f80dca9527ad343d12
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-08-28 13:58:39 +02:00
Kai Koehne
351f6eb52b Add Third-Party code in qregion.cpp to qt_attribution.json file
This makes it visible also in the overview documentation of the module,
and can be used to automatically generate attribution documents.

The code actually mentions the names and file versions (CVS?) where things
got copied from; however, X11 seems to have stopped using CVS a long time
ago, and without a server it's hard to determine the exact X11 version that
was copied from. It arguably doesn't matter, anyhow, because we won't update
the code anymore.

Fixes: QTBUG-70556
Change-Id: Ib17117a1a3c4112b81982afbd51273048a43221a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-08-28 13:40:02 +02:00
Tor Arne Vestbø
79bf1b7e34 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.

Change-Id: I73c143761d4a0da6991433b41dea0a0bc83a448a
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-08-28 13:22:59 +02:00
Tor Arne Vestbø
984df39c79 widgets: Add logging for widget painting
Change-Id: I551ec290812369e3848c1096fed7e813cd9e1cd6
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-08-28 13:22:50 +02:00
Karsten Heimrich
375f565060 Fix reporting the network interface type on macOS 10.14.5 and later
* initialize the structure used as argument to ioctl SIOCGIFMEDIA

The ioctl in ifType(...) returned -1 and set errno to EFAULT, thus
the code to determine the interface type was not executed.

Task-number: QTBUG-76408
Change-Id: Ib69c2c0cd4dda3604d568adf9746e0c9a280e9a0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-08-28 13:05:18 +02:00
Christian Ehrlicher
271d3bae38 QGraphicsItem: mark GraphicsItemChange::ItemMatrixChange as deprecated
The enum GraphicsItemChange::ItemMatrixChange is deprecated since Qt4
times. The corresponding matrix functions were also marked as deprecated
in 5.13 but the enum was forgotten. Therefore also mark it as deprecated
so it can be removed with Qt6.

Change-Id: I39bec89af14aaefe2e504f5a890ef314574766a1
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2019-08-28 13:04:21 +02:00
BogDan Vatra
0315e1945e Android: install qmlfiles only for first ABI
qmlfiles are the same for all ABIs, and installing them for all leads to race condition

Change-Id: I69fe062f59f1d7c028dff5212e2f2fac7e71398d
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-08-28 13:50:31 +03:00
Qt Forward Merge Bot
9c132004b0 Merge "Merge remote-tracking branch 'origin/5.14' into dev" 2019-08-28 12:01:42 +02:00
Alexandru Croitor
7e8705f663 Revert "Re-add dependencies.yaml now that qt5.git wip/qt6 builds fine"
This reverts commit 8811e96aac.

As discussed we shouldn't use the files until we have an easier
mechanism for updating in place.

Change-Id: I34bbed8ac2f11005db3a9c20621d797a110d8b31
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-28 11:47:23 +02:00
BogDan Vatra
3db14b5bd3 Say hello to -android-abis configure param
This configure parameter is useful to compile Qt only for a selected ABIs.

The old parameter, -android-arch, does the same thing, it's kept for compatibility.

[ChangeLog][Android] -android-abis configure script parameter useful to compile Qt
only for a selected Android ABIs.

Change-Id: I1f418c7e0914dd83b98d763e8cd8c09841e20fdf
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-08-28 12:36:34 +03:00
Tor Arne Vestbø
3542fc4958 widgets: Simplify QWidgetRepaintManager::flush
Change-Id: Icba88fa068aac2ac5d8bb04e46a3e3f34e279a48
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-08-28 10:41:29 +02:00
Ulf Hermann
26afc5c9b1 Provide conversion between QVariant and QUuid in bootstrap
The classes are there. There is no need for the extra #if-ery.

Change-Id: Ic92ff894d6c9d26dbe32ca83b9501fa8d07e3d44
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-08-28 06:33:48 +00:00
Joerg Bornemann
fc6d569862 Do not prepend QMAKE_PREFIX_STATICLIB to TARGET for TEMPLATE aux
This was introduced by accident in 4da47d0f.

Fixes: QTBUG-77429
Change-Id: Ic3d9052e1fc83dab5ed3b8725629588208b0d7bb
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 2a4cf923f4)
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-08-28 06:25:01 +00:00
Qt Forward Merge Bot
b205443351 Merge remote-tracking branch 'origin/5.14' into dev
Change-Id: Icb486cf8f31ec85d940b2179e8d023fbbc7fd3fa
2019-08-28 07:33:51 +02:00
BogDan Vatra
4cc3615b4e Use QLatin1String where possible
Change-Id: I8f94ba4880bcac735e4445d71f0e22774d9f78eb
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-08-28 07:38:48 +03:00
Marc Mutz
00d972fa4f QReadWriteLock QT_NO_THREAD shell: make API compatible with the regular one
- add missing explicit
- drop static from member functions that aren't static in the regular version
  (ie. all functions)

As a drive-by, remove redundant inline keyword where it doesn't cause
wanton inconsistency with surrounding code.

Change-Id: I5aed73c3afa85d98d97b57c2c1874b1a5e664960
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-28 06:25:40 +02:00
Tor Arne Vestbø
ebec918722 widgets: Simplify markNeedsFlush in QWidgetPrivate::drawWidget
QWidgetRepaintManager::markNeedsFlush already ignores paintOnScreen
widgets.

Change-Id: I8b5d6f79c8fd60115f77d65aef05cc4baf840bdd
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-08-28 00:47:09 +02:00
Tor Arne Vestbø
25026defdc widgets: Clarify QWidgetRepaintManager::sync of specific widget
Change-Id: Ifa2a8245decfcb2b36c1952a39ec60b7eeca6e43
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-08-28 00:46:36 +02:00
Sona Kurazyan
c1e4c7d763 Improve docs of QSysInfo
- Compile the docs for deprecated APIs conditionally, based on
  deprecation version.

- Document the alternatives to be used instead of the deprecated APIs.

Change-Id: I671b3b8dd14a0dc079a31cbc8e048c41cc603bb9
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-27 21:27:06 +00:00
Laszlo Agocs
af686f5aef Mark all rhi docs as internal
This is private API for the time being. Without this the QRhi*
classes show up in the class list in the docs.

Change-Id: I662abb9cc8eaae13ffe9266bd6313faa8e138353
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-08-27 23:08:09 +02:00
Joerg Bornemann
97465b1540 Don't add default lib dirs to LIBRARY_SEARCH_PATHS in xcode projects
Having hard-coded absolute paths in the xcode project breaks switching
between iOS and simulator builds.

Fixes: QTBUG-77804
Change-Id: Ib655bfc774b92c413a7b94ba4d005b6e1c4d2905
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-08-27 21:59:00 +02:00
Allan Sandfeld Jensen
eb8d461171 Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" 2019-08-27 16:35:31 +02:00
Allan Sandfeld Jensen
afac8dac58 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/gui/painting/qdrawhelper.cpp
	src/gui/painting/qdrawhelper_p.h
	src/gui/painting/qdrawhelper_sse2.cpp
	src/gui/painting/qdrawhelper_x86_p.h

Change-Id: I83256bb38ab3a705776e353bc0629315b6c59a0f
2019-08-27 13:08:38 +02:00
Liang Qi
4c3b221ba8 Merge "Merge remote-tracking branch 'origin/dev' into 5.14" 2019-08-27 10:29:29 +02:00