Commit Graph

40380 Commits

Author SHA1 Message Date
Joerg Bornemann
d5f65d8814 Remove hook handling code from QEventDispatcherWin32
Since commit 6a7cea64 qt_GetMessageHook is effectively a no-op, and
we can remove the complete hook handling code.

Change-Id: I90383c0c09c2b0f1d715872de5f9519a879d9bae
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-07-02 11:22:17 +02:00
Friedemann Kleint
6df8a30333 tst_QShortcut: Brush up the code, preparing the extraction of a base class to QtGui
- Use nullptr
- Fix static method invocations
- Use QString() instead of QString("")
- Use override
- Use member initialization
- Remove unimplemented code related to status bars
- Use Qt 5 connection syntax
- Fix apparent oversights in ambiguousItems() and
  unicodeCompare(),where the 2nd shortcut was assigned to the wrong button
- Use Q_ENUM for the enumerations which will output the value in
  QCOMPARE and automatically declare them to be a metatype
- Use enums in helper function signature for clarity

Task-number: QTBUG-76493
Change-Id: I0ed6ee7ee8dc2dbb48160a8383e6ed29164c3449
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-07-02 11:05:02 +02:00
Sona Kurazyan
8c8eae279d Remove usages of deprecated APIs from QDateTime
- Replaced the usages of:
  * QDateTime::toTime_t() -> QDateTime::toSecsSinceEpoch().
  * QDateTime::fromTime_t() -> QDateTime::fromSecsSinceEpoch().
  * QDate::shortDayName() -> QLocale::system().dayName().
  * QTime by QElapsedTimer, where the deprecated methods of QTime
    were used.

- Modified the tests for the deprecated methods to be enabled only
  when the corresponding methods are enabled: when the deprecated
  APIs are disabled, the tests will be also disabled, and the
  compilation won't be broken.

Task-number: QTBUG-76491
Change-Id: I4d565db2329e580c567aae511696eb1efe120843
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-02 09:49:36 +02:00
Ulf Hermann
c34242c679 Make the default ctor of QVarLengthArray implicit
Otherwise "QVarLengthArray<Foo> x = {};" gives a warning. Also, some
compilers get confused about "QVarLengthArray()" this way.

Task-number: QTBUG-76199
Change-Id: I4296586c0181d3e6e82ca8b7b79aeb9a21645d1f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-07-02 09:39:33 +02:00
Friedemann Kleint
fdef9c8039 uic: Implement form window setting to disable QObject::connectSlotsByName()
Task-number: QTBUG-76375
Change-Id: I16ad147366aa7d52b7a0e17ae240127d8ac34b3c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2019-07-02 09:15:47 +02:00
Tasuku Suzuki
377ffbd21d Fix build without feature.tabbar
Change-Id: I0891f8f6054382407f5ce2fdb3ead0203d255945
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-07-02 16:15:43 +09:00
Joerg Bornemann
cee5a11bdb Fix directory separator of QMAKE_INCDIR_VULKAN
Like in Qt code itself we should use forward slashes consistently.

This enables the vulkan test to run on Linux for MinGW
cross-compilation.

Task-number: QTBUG-76660
Change-Id: Ifc6dec11bac3c3769d5d06e49da529f66f7b5843
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-07-02 08:02:53 +02:00
Tasuku Suzuki
b727d2f0e1 Fix build without feature.dockwidget and tabwidget
Change-Id: I621664f646475c1b5cfde47b7087c0c9f5ad8e4d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-07-02 11:16:32 +09:00
Liang Qi
57fccd6f21 Merge "Merge remote-tracking branch 'origin/5.13' into dev" 2019-07-01 19:20:20 +02:00
Mat Sutcliffe
8f4baa3a22 QStringList: utilize QStringMatcher's support for QStringView
This opportunity was missed when adding the QStringView overload of
QStringList::filter() in 2a99f60cfb.

Change-Id: I8d679b92de6cc76c4d59fd54f01a25579ab3488f
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-07-01 16:52:44 +01:00
Edward Welbourne
a4f5f25eb0 Move YearRange to QDateTime from its Private
As planned when adding YearRange: now that it's merged up to dev, move
it to QDateTime, since we can add to the API at 5.14.0.

This follows up on commit 82ad4be4a2.

Change-Id: I81b6c2331121a71e2592514781c02c5756e70c52
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-07-01 17:49:09 +02:00
Edward Welbourne
8bfae093ed Add data for Windows Time-Zone IDs added in the last two years
We've not run util/locale_database/cldr2qtimezone.py for a while, so
CLDR has had time to add several more zones.  Catch up, inserting the
new entries in order.

Change-Id: I8625548b0f7775958230eccbd89b897d7afed9e9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-07-01 17:48:53 +02:00
Edward Welbourne
13242673cf Tidy up in cldr2qtimezone.py and document the need to run it
It wasn't mentioned in cldr2qlocalexml.py's instructions, so I didn't
know to run it.  The data it used in an illustration was out of date.
Two tests could be combined with no loss.

Change-Id: I26e619e6210ea5b1258326fc4bc2b6aee9d6a999
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-01 17:48:32 +02:00
Edward Welbourne
bbd64f64b2 cldr2qtimezone.py: report all missing zones, rather than just the first
When scanning the CLDR data, the script raised an exception if it
didn't recognize a zone ID.  Instead, collect up such unrecognized IDs
in a list and report them all at the end, so that whoever runs this
can do them all in one go, rather than doing one, running the script,
doing the next, running the script, ad nauseam.

Change-Id: Ia659f1d1c7e1c1b4ccb87cc23828a0588a5bf958
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-01 17:48:16 +02:00
Edward Welbourne
2f19a3053e Use simpler data structures in cldr2qtimezone.py
Use tuples for the fixed data.  The numbering of rows in the data
tables isn't part of any public API, so we can change it freely; it is
thus unnecessary, as we can just enumerate a tuple of the data values
to generate sequential indices on the fly.  (Updates to the data shall
no longer need to renumber in order to insert entries.)

Restore ordering of the data tables, and remove wanton spacing from
inside parens, in the process.

Change-Id: I59956cfb6191fe729300b57070671b7e66bd0379
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-07-01 17:47:51 +02:00
Marc Mutz
7993cada39 QAccessibleWidget: fix UB (invalid cast)
Casting an object to a subclass that is not the dynamic type of the
object constitutes undefined behavior.

Fix by befriending QObject.

Change-Id: Ib70dbef9095df31a6d89449d82a02cef9fccd348
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-07-01 17:43:08 +02:00
Joerg Bornemann
2f672b2239 Do not ignore exit codes when installing meta files
Since commit 20e9422e we don't ignore exit codes when installing files
anymore. This patch does the same for meta file installation. We
really should be notified properly if something goes wrong here.

Task-number: QTBUG-18870
Change-Id: Ib6a20293380f400379b10ec767bf38dc74d5beeb
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-01 17:39:59 +02:00
Giuseppe D'Angelo
da0f40f9ac QCharRef/QByteRef: schedule for Qt 7 removal
With all of their special behavior deprecated, QCharRef and QByteRef
can simply be removed. Add a comment.

Change-Id: I8bad95424207ae281b5edf348b9ad81c6807dc12
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-07-01 17:37:49 +02:00
Laszlo Agocs
2c289c6c1e rhi: d3d: Fix resource binding mismatch with multiple passes
The resetShaderResources() done when starting a render or compute pass
purges all vertex, index, SRV, and UAV bindings. This will be optimized
at a later point, but until then the command buffer's state should be
updated accordingly, otherwise certain use cases end up with incorrect
rendering results due to not binding vertex/index/shader resources
as appropriate.

This fixes the shadowmap example on d3d.

Change-Id: I4d07929b8664b64bc608c6c8df474b0ee7c2ddbb
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-01 17:34:51 +02:00
Laszlo Agocs
058c52fc2a rhi: Improve base vertex/instance support
Have feature flags as appropriate. OpenGL is causing a mess here
but let's support what we can since some of this will become relevant
in more sophisticated mesh drawing cases with 3D in particular.

Change-Id: Idfa7b4642ec87147978e03d78d6233efbd151491
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-01 17:34:47 +02:00
Laszlo Agocs
201a22a4d2 rhi: gl: Add support for instanced drawing
...when having a 3.3+ or ES 3.0+ context.

Change-Id: Ie92815263e190912d8f0b7b92ae6da55e062af05
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-01 17:34:44 +02:00
Laszlo Agocs
9452c963c8 rhi: Add a test for instancing
Draws 1024 cubes at random x,y positions with varying color with
a single instanced draw call.

Change-Id: I8737503acf23866ad4734b1d88753415a3b93445
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-01 17:34:40 +02:00
Laszlo Agocs
03ebad7bfd rhi: gl: Adjust texture and renderbuffer sizes automatically
Enforce the maximum texture size limit both for textures and renderbuffers,
showing warnings and adjusting the size automatically.

On the low end ES 2.0 devices we can easily hit a maximum size of 2048x2048.
For example a Raspberry Pi running in full HD with the Controls 2 Material
style breaks right away as it tries to create slightly wider than 2048 texture
for its ShaderEffect.

Instead of breaking with an obscure framebuffer incomplete warning at best,
show something more informative and adjust the sizes so that something shows
up on the screen still.

(naturally applications not taking the maximum sizes returned from QRhi
into account are technically incorrect and may well end up with incorrect
rendering, but we should still try handling this as gracefully as possible)

Change-Id: Ib75eb893ab4774e1a3c49ed2d14c6bf9be8c807a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-01 17:34:37 +02:00
Laszlo Agocs
13a7777bbf rhi: gl: Make fb attachment logic ES 2.0 and WebGL compatible
So that we can now operate on plain ES 2.0 implementations like the
Broadcom stack on the Raspberry Pi (which does not even have packed
depth stencil).

Also add the WebGL-specific combined attach logic to enable WebAssembly.
This has not been tested in practice.

Change-Id: I21219319062f295c1e88e3057c0c2ede724ac664
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-01 17:34:33 +02:00
Laszlo Agocs
854ddb0301 rhi: Enhance line width and point size support
...but this will vary between backends, or in some cases
even between implementations of the same API.

Point size is settable only via the vertex shader (gl_PointSize).
It is silently ignored with D3D and HLSL.

Line widths other than 1 are supported only on OpenGL and Vulkan.
(but this is in fact deprecated with GL and optional with Vulkan)

Add QRhi::Feature values for both.

The line width is now settable on QRhiGraphicsPipeline. It is not a
dynamic state since the static, per-pipeline width is good enough for
most cases. (and the feature is not supported on half of the backends
anyways so it will get limited use in practice).

Change-Id: I6d3a32269527c452b794b2cb8b0f03101eab40b2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-01 17:34:29 +02:00
Frederik Gladhorn
1df2cdda6c Bump version
Change-Id: Ieb9a694d44503789664a6098c4fb14eb940337fe
2019-07-01 16:34:58 +02:00
Frederik Gladhorn
cafcab5263 Bump version
Change-Id: Ic4a8c031d1de3dd887fb6f135035ccb2ec9a37b3
2019-07-01 16:01:19 +02:00
Liang Qi
d25c322729 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/network/ssl/qsslsocket_openssl.cpp
	src/platformsupport/vkconvenience/qvkconvenience.cpp

Change-Id: I97ce6ed185f7fdad8102cc58d3cfec0119fd7bb4
2019-07-01 10:21:37 +02:00
Yulong Bai
56fb2266f2 QTypeModuleInfo: fix clang '-wconstant-logical-operand' warnings
Change-Id: Ia73e4ffbabd5db67063584a7e53966da53133689
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2019-07-01 09:26:52 +02:00
Mikhail Svetkin
222b81f5da rtems: Fix missing some ernno defines
By default RTEMS does not support linux extensions for errno.
Enable it for build.

Change-Id: I43b346794b99ac0ed339bfbe6e39684071615503
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ryan Chu <ryan.chu@qt.io>
2019-07-01 02:04:19 +02:00
Mikhail Svetkin
248e81a280 rtems: Add environment variable for configure default thread stack size
The default stack size is too small on RTEMS.
Qt uses threads internally and there is no way to change their stack
size.

Change-Id: I94a42c7a70c745f0b50d7051d9320edfabd1e09e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-01 00:03:34 +00:00
Mat Sutcliffe
2a99f60cfb QStringList: add QStringView overloads of join, filter, replaceInStrings
[ChangeLog][QtCore][QStringList] Added QStringView overloads of join(),
filter(), and replaceInStrings().

Change-Id: I9636e21e2e43ed46cce0aa7fa23ab0710aa641ba
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-06-30 23:16:11 +00:00
Ryan Chu
57055ffafd Share the common configurations among different modules
This change is used to generalize a template docker-compose file for all
modules. Ideally, the leaf module only need to keep a docker compose
file for all platforms (docker-compose.yml).

NOTE:
The version of docker-compose file downgrades from 3.4 to 2.1 because
the 'extends' keyword is not supported in Compose version 3.x.

Change-Id: I2e36fd9236eda86cb5fcf940d787ccefe9200696
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2019-07-01 01:09:42 +02:00
Mikhail Svetkin
889b44043e rtems: Fix build 3rdparty/sha3
RTEMS does not have byteswap.h

Change-Id: I37222ba4edb7338600f7c902819440feadc03a63
Reviewed-by: Ryan Chu <ryan.chu@qt.io>
2019-06-30 23:34:55 +02:00
Mikhail Svetkin
98f7df2114 rtems: Fix build qdatetime.cpp
RTEMS does not have "timezone" global variable.

Change-Id: Ifa4c6f8939270a83fb7b5ba623daafa1e9f81003
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-06-30 19:31:56 +02:00
Tasuku Suzuki
e85d1963b5 Fix build without feature.stringlistmodel
Change-Id: Ia7a24ef1b0beea7519403000ba20dc78a3c20a21
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@gmail.com>
2019-06-30 17:16:52 +09:00
Sona Kurazyan
ff2b2032a0 Remove usages of deprecated APIs from QtAlgorithms
Task-number: QTBUG-76491
Change-Id: I9dab736a0cbd2e86588919640c26e8ce6b3674d0
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2019-06-29 21:58:36 +02:00
Friedemann Kleint
fabf9239e0 QTestLib: Replace typedef by 'using'
Apply Fixits by Qt Creator with some amendments.

Task-number: QTBUG-69413
Change-Id: I366cca6e5755719e8241e76774af6be2b5312627
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-06-29 21:51:15 +02:00
Marc Mutz
e7b1c500d4 Mark qHash(QOcspResponse) as noexcept
Because it is.

Change-Id: I8d5204c30884b2c8656615a7d82428c539672d28
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2019-06-29 16:11:52 +02:00
Marc Mutz
65b8f59e04 QMutexPool: fix memory order of atomic operations
The array of QAtomicPointer<QMutex> can be initialized using relaxed
stores of nullptr, since nullptr is the whole data. But once we store
an actual QMutex pointer in the array, we need to publish the indirect
data thus created. We did this, with testAndSetRelease(); what was
missing was a corresponding acquire fence on load, without which there
is no happens-before relationship between the writes performed by the
QMutex ctor and the reads performed by a subsequent mutex.lock(), say,
on the same data.

Fix by adding acquire fences to all loads. That includes the dtor,
since mutexes may have been created in different threads, and never
been imported into this_thread before the dtor is running.

As a drive-by, return a new'ed QMutex that was successfully installed
directly to the caller, without again going through a load-acquire.

Change-Id: Ia25d205b1127c8c4de0979cef997d1a88123c5c3
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-29 16:11:08 +02:00
Marc Mutz
840f55f0ae Remove unused qmutexpool_p.h includes
Change-Id: Ic5f56b12953f2e42d94f6e6c14fac166c0c75539
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-06-29 16:10:25 +02:00
Marc Mutz
a27e7e8151 QObject: deprecate the undocumented userData() feature
... and schedule it for removal in Qt 6.

This appears to have come to some fame on the internet, so better add
a deprecation warning before we remove it in Qt 6.

Change-Id: I42d91d933f47dfd2d8d54c92358e9e46ced6bf21
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-06-29 16:10:01 +02:00
Marc Mutz
5696260425 QObject: fix allocation of IDs for the undocumented userData() feature
This appears to have come to some fame on the internet, so better fix
the implementation before we remove it in Qt 6.

Change-Id: Ia37ca89105b13bea1ffcdce8b2e8cd957b7bd108
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-29 14:09:38 +00:00
Marc Mutz
66223727c7 Port from implicit to explicit atomic pointer operations
The old code used the implicit conversions from QAtomicPointer<T> to T*
and vice versa. The semantics of these differ from the ones std::atomic
uses, so we're going to deprecate these, like we did for load() and
store(), too.

This patch fixex some users of these APIs before we deprecate them.

Change-Id: I0a88bb1c359392538bb64b511bfc62381a56a468
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-29 09:10:34 +02:00
Thiago Macieira
5d7e221bbf QRandomGenerator: assert that bounded() calls have correct arguments
Otherwise, the math will fail badly. Documentation improved to reflect
reality.

Change-Id: I9e3d261ad9bf41cfb2b6fffd159085cd38e3c388
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-28 23:05:57 -07:00
Thiago Macieira
a39b19b0c7 QTranslator: simplify QString byte-swapping code
No need to check QSysInfo, just use qFromBigEndian. On big-endian
systems, it does the memcpy for us.

Change-Id: I1004b4b819774c4c9296fffd158fe3aa5ff0a287
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-28 23:05:29 -07:00
Thiago Macieira
227c1a56ec Move the Item typedef to public in the associative Java iterators
The documentation talks about them. They're just iterators.

Fixes: QTBUG-75123
Change-Id: I194d3f37471a49788a7bfffd15956064b42383b7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-06-28 23:05:09 -07:00
Thiago Macieira
b321559a22 Document OOM conditions in the QArrayData-based containers
The other containers probably don't handle as well, so I just documented
the ones that I know how they work.

Fixes: QTBUG-75470
Change-Id: I95ecabe2f50e450c991afffd159a0483aac35a79
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Albert Astals Cid <aacid@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-28 23:05:00 -07:00
Thiago Macieira
d62ee14283 Work around Apple Clang's -Wshadow warning
Well, yeah, it technically does...

 qcborstream.h:245:15: warning: declaration shadows a typedef in the global namespace [-Wshadow]
 /usr/include/libkern/OSTypes.h:36:26: note: previous declaration is here

Fixes: QTBUG-75825
Change-Id: Idce141629dd34287808bfffd159ee2a75428bf12
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-06-28 23:04:42 -07:00
Thiago Macieira
89d28ebe86 QTransposeProxyModel: include the moc in the .cpp
All the other QtCore files do.

Change-Id: Ie7ae7616eadf4035bec6fffd15ac3b5479716ff3
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-06-28 23:04:27 -07:00