Commit Graph

12152 Commits

Author SHA1 Message Date
Edward Welbourne
6ee13db700 Correct string comparison in Android's IANA ID matching code
It used QString.compare() and assumed it was returning a bool true on
equality, when it actually returns an int that compares to 0 as the
given strings compare. So it should use compare() == 0.

This fixes several of QTimeZone's blacklisted tests on Android and a
crasher, which we dodged with a QSKIP. Added an id-comparison to a
test. Gave two local variables more informative names, made an early
return into a QSKIP so it explains itself.

Fixes: QTBUG-89905
Fixes: QTBUG-69122
Fixes: QTBUG-69132
Fixes: QTBUG-87435
Pick-to: 6.0 5.15
Change-Id: Icf18ed5a810143d6e65d36e34a70e82faac10b8e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-01-18 15:55:15 +01:00
Edward Welbourne
50c63446f5 Fix problems with offset-derived ids for QTimeZone
When creating a time-zone from a UTC+offset name that isn't known to
the system, QTimeZone (since the fix to QTBUG-77738 in 5.15.0) falls
back to constructing a suitable UTC-offset backend; however, the id of
this is not guaranteed to match the id passed in to the constructor.
In all other cases, the id of a QTimeZone does match the id passed to
its constructor.

Some utcOffsetId testcases had different id() than the id passed to
the constructor, due to mismatches where a zone was constructed using
the fall-back but the generated id included its minutes (as :00) or
omitted its seconds. The omission of seconds is clearly a bug, but we
also don't want to include :00 for seconds when it's not needed. So
change QTimeZonePrivate::isoOffsetFormat() to accept a
QTimeZone::NameType to configure how much we include in an id. Its
callers other than the relevant constructor (from offset) still get
minutes, even when :00, but will also get seconds added if that isn't
zero; and the constructor from offset now gets the short form obtained
by omitting all trailing zeros.

Since all valid whole-hour offset names that do include :00 for the
minutes field are in fact known standard offset names, the elision of
minutes will only affect zones created by ID in the case of a
whole-hour offset given without :00 minutes specifier, so these shall
necessarily in fact get the ID passed to the constructor. Creating by
UTC-offset with a name that specifies zero seconds will result in a
QTimeZone instance whose id() differs from what was passed to its
constructor (eliding the :00 seconds and potentially also minutes, if
also zero) but this should be the only case where a QTimeZone's id
doesn't match the one passed to the constructor, when constructed by
id.

Fixed inconsistency between the offset-constructor's declaration
(taking offset as int) and definition (taking qint32) in the process.
Added an id check to the utcOffsetId() testcase. Amended two tests of
offset-derived time-zones' IDs, added comments to make clear how one
of those differs from a matching standard name test and converted two
uses of QCOMPARE(, true) to QVERIFY().

[ChangeLog][QtCore][QTimeZone] QTimeZone instances created by offset
from UTC (in seconds) shall now only include minutes in their ID when
the offset is not a whole number of hours. They shall also include the
seconds in their ID when the offset is not a whole number of minutes.

Pick-to: 6.0 5.15
Task-number: QTBUG-87435
Change-Id: I610e0a78e2aca51e12bfe003497434a998e93dc7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-01-18 15:55:05 +01:00
Andrei Golubev
6f520abdab Add new special QObjectPrivate::{connect, disconnect} for QML
Original QML-specific connection mechanism ignores the receiver argument
and uses sender as receiver. This causes uncontrollable memory growth
in certain cases as connections on receiver persist even after receiver
is destroyed

New connect() with receiver parameter uses underlying API correctly,
disconnect is provided for the symmetry (not sure it's really needed)

Task-number: QTBUG-86368
Pick-to: 5.15 6.0
Change-Id: I4580d75b617cb2c4dfb971a4dfb8e943e325572b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-01-18 15:54:03 +01:00
Kai Köhne
f1465c621c QLocale: Allow direct conversion to language, country, and script codes
Currently the codes are only exposed in aggregated form, i.e. through
name(), bcp47Name(). There are use cases though where you are only
interested in either language, country, or script codes. One example
is in Qt Linguist.

This patch therefore exposes the static languageToCode(),
countryToCode(), scriptToCode() methods that were so far only available
in the private API also in the public API.

[ChangeLog][QtCore][QLocale] Added static languageToCode(),
countryToCode() scriptToCode() methods that convert enum values
to the respective ISO code strings.

Fixes: QTBUG-39542
Fixes: QTBUG-64942
Change-Id: Ib1d5c3293e2f53245ba4c1fc8159275bcb290080
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-01-18 15:52:31 +01:00
Fabian Kosmale
2d8757f879 QVariant::fromValue<T>: require T to be copy constructible
In Qt 5, QVariant::fromValue<T> would not compile unless
Q_DECLARE_METATYPE(T) was used, and Q_DECLARE_METATYPE(T) would lead to
a compile error if T were not copy constructible.
In Qt 6, we do not require Q_DECLARE_METATYPE before using fromValue,
and QMetaType itself works with non-copy constructible types just fine.
However, QVariant still requires it, thus we need to now enforce this in
fromValue itself.

Change-Id: Ib6964a438d8c46033dd3a037b9d871de2b42e175
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-01-18 15:51:18 +01:00
Laszlo Agocs
9f7088fd7f rhi: Stop hardcoding the Vulkan backend's desired instance extensions
Instead, have a static function in QRhiVulkanInitParams then Qt Quick
and anyone else who creates a QVulkanInstance that is then used in
combination with QRhi can query.

Change-Id: I046e0d84541fc00f5487a7527c97be262221527f
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-01-18 13:21:15 +01:00
Laszlo Agocs
7d378bd780 vulkan: Add instance-level version getter
...as described in the Vulkan >= 1.1 spec. One can now call
supportedApiVersion() (before create(), similarly to the other
supported* functions) to determine the available Vulkan
(instance-level) version.

Fixes: QTBUG-90333
Change-Id: Ibe8482402b7f07e4abc48c88252ff0365e4e2faa
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-01-18 13:21:15 +01:00
Eirik Aavitsland
167bcafcb6 Fix lancelot GL painting test for GLES
RGB10 internal texture format is not supported on GLES, use RGB10_A2
instead.

Pick-to: 6.0
Change-Id: Ib43eb99b170f441e886be50d29a6a5f7696c05c7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-01-18 07:42:31 +01:00
Christian Ehrlicher
c23e8cb582 QSettings: Add support for QMetaType::Float
When writing out a float value, the output string is encoded as QVariant
for no reason. Looks like an oversight when QMetaType::Float was added a
long time ago.

Fixes: QTBUG-21156
Change-Id: I7f5d31e15892d700c1b1e5e731b7733ce3a15730
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-01-15 18:51:15 +01:00
Friedemann Kleint
539553a572 QTestlib/JUnit XML: Log most messages to standard output instead of error output
Add an enumeration for system-out and alog element
for it. Redirect the messages types that are not warnings/errors
to this element. For compatibility, write it out only
if it is not empty. Rename enumerations and members accordingly.

[ChangeLog][QtTestLib] In JUnit XML, output that is
not a warning/error is now logged under <system-out>
instead of <system-err>.

Fixes: QTBUG-86540
Change-Id: I55598eafa7dafa486ac5a8221029c332ff47413b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-01-15 18:05:40 +01:00
Friedemann Kleint
7f5d41e286 Windows: Fix dialog moving up after closing/reshowing
A resize event delivered after closing the platform window
was causing the stored frame margins to be cleared.
Bail out of QWidgetWindow::updateMargins() if the
platform window is null.

Pick-to: 5.15
Fixes: QTBUG-79147
Change-Id: Iebbc90c3cccafa209cd720baedf45affb3f3c2b8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-01-15 18:05:19 +01:00
Jarek Kobus
98a89fb711 Hardcode a special case of using qOverload for slots without arguments
Pick-to: 6.0
Fixes: QTBUG-90308
Change-Id: I35cd45679ded626654dd0e7e3eea8a7bb14c1d56
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-01-15 17:39:46 +01:00
Friedemann Kleint
2f8428d332 Brush up QTestlib/generate_expected_output.py
- Generate the expected files in the source tree,
  removing the need to copy them over
- Add proper option parsing, add options for formats
  and to skip the callgrind test, which locks up
- Determine the script location by __file__
- Determine the Qt version by reading the .cmake.conf file
- Introduce f-strings
- Print the usage when invoked in the wrong directory

Task-number: QTBUG-86540
Change-Id: Idabb50a14db60127374b7a1271951dbbbc85d131
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-01-15 15:37:18 +01:00
Sona Kurazyan
154573929a Fix setting active window as application's focus widget
When setting the application's focus widget we search for the next
child widget that can hold the focus and call its setFocus() method,
which also updates focus widgets of all its parent wigets.

In case if the focus widget is the active window itself, we only set it
as the application's focus widget, but we don't update the focus widget
of the active window itself. Because of this the focusWidget() method
always results nullptr for the active window. This prevents from setting
the focus back to active window after the focus has changed (for example
after a context menu is closed, as in the bugreport).

Transfer the focus to active window by calling the setFocus() method, as
it is done in case of transferring the focus to any other widget.

Pick-to: 6.0 5.15
Fixes: QTBUG-85846
Change-Id: I91ebf182fd5bb7d451a1186e2f3e38c8d48acc4e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-01-15 15:22:18 +01:00
Sona Kurazyan
20e364e00c tst_qdom: clean-up the code enabled only before Qt 6
Change-Id: Ifcf863ccb2094661b43bd5ccf8387960447ddd8e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-01-15 15:22:08 +01:00
Qiang Li
3f3d5e6716 Fix the tips still show when cursor move to another action
In this case, the previous action's tip is still displayed
when the cursor moves from one action with tip to another action
without tip.

Fixes: QTBUG-89082
Pick-to: 5.15
Pick-to: 6.0
Change-Id: I0a00595dc3d716725678487be9cbb363c4d3b392
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-01-15 12:26:41 +01:00
ChunLin Wang
dafd26acbe Fix QApplication::font returns the font unstable according to the object
If a default font was not registered for the widget's class, it returns the default font of its nearest registered superclass.

Fixes: QTBUG-89910
Pick-to: 5.15 6.0
Change-Id: I6e6b2c6a0044462f84db9f76a03be0c6cfaaae8e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-01-15 14:38:35 +08:00
Ivan Solovev
00505ed2b5 Widgets: fix setTabOrder for QAbstractSpinBox-like widgets
setTabOrder was not considering the case, when a child widget has
its focus proxy set to its parent widget. This happens, for example,
for the QLineEdit that is nested inside the QAbstractSpinBox.
For such cases the lastFocusChild was calculated incorrectly, and, as
a result, such child widgets were not correctly positioned in the
focus chain. This could lead to an error while backtabbing.

Here is a brief example. Suppose we have 3 widgets arranged like this:

auto spinBoxOne = new QDoubleSpinBox;
auto spinBoxTwo = new QDoubleSpinBox;
auto button = new QPushButton;

Then the default widget focus order is:
- spinBoxOne
- lineedit (from spinBoxOne)
- spinBoxTwo
- lineedit (from spinBoxTwo)
- button

Before this commit setting the explicit tab order changed the focus
order in the following way:

QWidget::setTabOrder(spinBoxOne, spinBoxTwo);
QWidget::setTabOrder(spinBoxTwo, button);

- spinBoxOne
- spinBoxTwo
- button
- lineedit (from spinBoxOne)
- lineedit (from spinBoxTwo)

In this case, backtabbing from spinBoxOne actually leads us to
lineedit (from spinBoxTwo), which refers to spinBoxTwo.
And so we're stuck in a loop.

This commit fixes the issue by handling such special case, and
preserving correct focus order.

Note: the actual unit-test in this patch uses QLineEdit instead of
QPushButton, because one can't tab to buttons on macOS by default.
However the general idea is the same.

Pick-to: 6.0 5.15
Fixes: QTBUG-81097
Change-Id: I5d16da7733a4d63f809cab28b8ca9e116b87cffa
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-01-14 20:09:43 +01:00
Shawn Rutledge
aeeac48cbd AA_SynthesizeTouchForUnhandledMouseEvents: keep correct coordinates
QGuiApplicationPrivate::processMouseEvent() sends a
QWindowSystemInterfacePrivate::TouchEvent if the mouse event is not
accepted and AA_SynthesizeTouchForUnhandledMouseEvents is enabled.
A QPA TouchEvent always contains native touch points, which is why
it calls QWindowSystemInterfacePrivate::fromNativeTouchPoints to
translate the QMouseEvent's device-independent position back to the
raw position that it would have had if it came from a real touchscreen.
Therefore we must give that function touchpoints that are actually in
native coordinates.

It may be that some of this transformation could be avoided entirely,
but here we prove that the existing way works correctly, by adding
coordinate checking to the tst_QWindow::mouseToTouchTranslation() test.

Pick-to: 6.0
Task-number: QTBUG-86165
Change-Id: I4c9ca2b11e9eb76d79712c187db3eb9865da581a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-01-14 19:09:28 +00:00
Morten Johan Sørvig
a2db96e253 Skip tst_qhighdpi when offscreen is not built
Android and Wasm do not build the offscreen platform
plugin (see src/plugins/platforms/CMakeLists.txt).

Skip building the tst_qhighdpi test as well in this
case. Remove the BLACKLIST entry.

Task-number: QTBUG-88505
Change-Id: I172198c8c24759b14f73ad07260c449fc6ab893f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-01-14 14:21:45 +01:00
Mårten Nordheim
d2e2d0d3a6 QCache: when overwriting, store the new cost instead of the delta
The delta was clearly intended to be used on the total (and still is)
but it also wound up getting stored in the cache, which wouldn't be a
big problem unless the object was removed, in which case we could
incidentally 'free up more space' than intended.

Pick-to: 6.0
Change-Id: Ib2b0f072d30da6d16a93dce60e4c5f6080c109fc
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-01-14 10:00:01 +00:00
Andy Shaw
c2657f9762 QODBC: Preserve the whole value when using HighPrecision
Some ODBC drivers do not properly handle SQL_NO_DATA and therefore
decimal values returned with HighPrecision are cut off because the
decimal point is not taken into account.

Fixes: QTBUG-73286
Pick-to: 6.0 5.15 5.12
Change-Id: I905c947b4d0266a3245d5735300300ca00f77480
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2021-01-14 07:02:43 +00:00
Christian Kandeler
b88f692d7d QTestLib: Show the values of unregistered enums
... on a failed QCOMPARE.

Change-Id: I653894927e49fad92c21409d03ed70880ca510f6
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2021-01-13 16:15:06 +01:00
Laszlo Agocs
c262a69851 rhi: gl: Add some enablers for supporting GL_TEXTURE_EXTERNAL_OES
From QRhi's perspective this consists of two things:

- A shader with samplerExternalOES in it cannot go through the standard
  pipeline. Rather, a QShader with suitable GLSL code in it has to be
  constructed manually. As this is something useful as an autotest
  anyway, add a test case to the qshader autotest that demonstrates
  this.

- When it comes to correctly calling glBindTexture, add a QRhiTexture
  flag. The expectation is that an OpenGL-only client sets this in
  combination with QRhiTexture::createFrom(), thus wrapping an existing
  texture that then gets bound to the GL_TEXTURE_EXTERNAL_OES target
  instead of our usual GL_TEXTURE_2D.

For completeness we also add a SamplerExternalOES variable type to
QShaderDescription, but the sampler type is not actually used by the
QRhi OpenGL backend, as it is the QRhiTexture that defines the
texture target.

Change-Id: I36b52325deb3703b59186ee3d726d0c3015bfc4b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-01-13 10:08:23 +01:00
Laszlo Agocs
042cd97884 rhi: Expose device name, type, and IDs
...to the extent it is sensible. We have to make compromises still,
meaning some fields will only be applicable with certain APIs.

Most of this is already shown upon QRhi::create() as info debug
prints, when enabled. Now expose it all through the QRhi API as
well.

This is useful for printing in qtdiag, and, while it should be
avoided as much as possible, to make decisions about disabling
3D rendering features depending on the driver and GPU in use.

Change-Id: Iebe1e192965c928b82a094d1c7c50ddf4b38b9a2
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-01-13 10:08:23 +01:00
Joerg Bornemann
04f11f9935 Remove .prev_CMakeLists.txt files
Those serve no purpose anymore, now that the .pro files are gone.

Task-number: QTBUG-88742
Change-Id: I39943327b8c9871785b58e9973e4e7602371793e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-01-12 20:59:13 +01:00
Andy Shaw
bb00b63dee Set the PlaceholderText color in the palette from the stylesheet as well
The color should be used across the board, so the PlaceholderText color
should also be respecting the one passed for Text and so on.

Fixes: QTBUG-89815
Pick-to: 6.0 5.15
Change-Id: I2accb3db35488f95a1c8ebacf2316a08ee416fac
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-01-12 20:24:28 +01:00
Alexander Volkov
376e3bd8ec Introduce QUrlResourceProvider to load resources for HTML
QTextDocument and the text editor classes suggest to override
their loadResource() methods to provide data associated with
a text document. This approach has the following drawbacks:
- it requires subclassing
- there is no way to set a global resource provider
- QLabel is missing virtual loadResource() method and
  it can't be added without breaking ABI

QUrlResourceProvider is designed to solve these issues.
One should create a derived class that implements
QUrlResourceProvider::resource(). The objects of the derived
class then can be set for any text document.
The default resource provider can be set with
QUrlResourceProvider::setDefaultProvider().
This change also adds QLabel::setResourceProvider(),
which doesn't break ABI.

[ChangeLog][QtGui][Text] Introduced QUrlResourceProvider that allows to
load resources for HTML. It is intended to replace the use of
QTextDocument::loadResource().

Change-Id: Iaf19b229f522a73508f20715257450fe58f68daf
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-01-12 15:33:10 +03:00
David Skoland
9e09677c1d Remove QtDBus includes
Per the discussion of QTBUG-88831, we determined that module-wide
imports are unfortunate, especially for compile times. Following this,
all QtDBus includes have been replaced with the headers for the classes
actually used in each file. Additionally, some cleanup of header file
order and format has been performed in the changed files.

Pick-to: 6.0
Change-Id: I62c1b75682a48422f0ba1168dd5d7bd0952808ac
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-01-12 09:19:27 +01:00
Volker Hilsheimer
d7d6f8765f Make sure QMimeData is fully declared
The test deletes instances of QMimeData in the dropMimeData function.
The compiler warns about deleting objects of incomplete type if QMimeDate
is only forward declared.

Change-Id: I3423a7ea334180ff0b68efbecb3d3feeb0632239
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-01-11 16:57:41 +01:00
Fabian Kosmale
240505457b QBindable: Improve read-only support
If we create a QBindable from a const property, we should obtain a
read-only interface. Besides implementing this feature, this patch adds
a isReadOnly method to Q(Untyped)Bindable which can be used to check
whether one can modify the property via the bindable interface.

Task-number: QTBUG-89505
Task-number: QTBUG-89469
Change-Id: Ic36949a5b84c5119e0060ed0a1cf4ac94a66f341
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-11 15:57:26 +01:00
Assam Boudjelthia
b036ca3347 Android: exclude tst_QFile::moveToTrash on Android
The Android tests were marked insignificant for some days, due to an
emulator issue, these tests slipped during that time. Exclude them now
to bring Android tests back.

Task-number: QTBUG-89398
Pick-to: 6.0
Change-Id: Ia65a0ae8d7474fd2554dda299a60371dbbc9dddb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-01-11 12:15:12 +00:00
Assam Boudjelthia
a0ee011865 Android: exclude failing tests for tst_QPlainTextEdit on Android
The Android tests were marked insignificant for some days, due to an
emulator issue, these tests slipped during that time. Exclude them now
to bring Android tests.

Task-number: QTBUG-89402
Pick-to: 6.0
Change-Id: I96d0f87b36975b7e2c83956b04b6569a03a781a9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2021-01-11 12:14:35 +00:00
Giuseppe D'Angelo
c34c6af374 Replace some more erase/remove patterns with removeIf
Change-Id: I6c6f33450fbfd798e5ef71a8ba18f590581dc3a2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-01-10 15:02:47 +01:00
Christian Ehrlicher
b211148e4b Sql ODBC driver: add direct support for float and short datatype
This patch adds native support for SQL_REAL (float) and SQL_SMALLINT
(short). Previously those datatypes were mapped to double and integer.

[ChangeLog][QtSql] The ODBC driver now properly maps QMetaType::Float to
real sql datatype and QMetaType::Short to smallint

Fixes: QTBUG-8963
Fixes: QTBUG-57279
Change-Id: Ifec4c609734dbe6165c1ebdadb461c2aae47ba78
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2021-01-10 13:02:14 +01:00
Timur Pocheptsov
3d5f86e77d tst_QSslSocket::setSslConfiguration - skip if SecureTransport is in use
SecureTransport does not allow deprecated digest algorithms, and
(depending on ST version) it may or may not accept our server's
certificate.
Funnily enough, they 'fluctuate' between versions again and again.

Fixes: QTBUG-89922
Change-Id: Ie5fbfca316806bd5000ce2d128b81b718bb36624
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-01-08 20:33:24 +00:00
Volker Hilsheimer
9963aaacdb Remove irrelevant test row, fix compiler warning
With the introduction of QKeyCombination, the result of |'ing together
a set of modifiers and a key goes always through the same QKeySequence
constructor, no matter the order.

The implicit conversion through int when the wrong order is used
causes a compiler warning as that conversion is deprecated. So remove
that test case.

Pick-to: 6.0
Change-Id: I04e27bcd51723ee0efc77e52e45ca3eb8bac5fc7
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-01-08 16:37:22 +01:00
Samuli Piippo
d3399092db tst_qdatastream: expect failure on 32bit system with large QBitArray
Test data causes the QBitArray to be read as 0 byte length. Same issue
on all 32bit systems, removing android blacklisting as this was the only
one failing there.

Task-number: QTBUG-87660
Change-Id: I63f0c1c6fa4e2242e6ebe70f50e422ab0fbf1c88
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-01-08 12:25:55 +02:00
Samuli Piippo
18ef1b83fb tst_qtextmarkdown: blacklist tests for QEMU ARMv7
Most tests fail when running on QEMU ARMv7, but not on target HW or
QEMU ARM64.

Task-number: QTBUG-89819
Change-Id: I686268c200cce1a44a717b80c2970f608be44636
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-01-08 09:04:55 +02:00
Andy Shaw
dce43106e2 PSQL: Fix the QSqlDatabase test
Pick-to: 6.0 5.15
Change-Id: Ic7956b556f1f0f10574fd79f5cbd283208240353
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2021-01-07 22:28:41 +01:00
Samuli Piippo
19a756047e tst_qstylesheetstyle: blacklist tests for QEMU ARMv7
QEMU ARMv7 uses different font, which doesn't pass the tests.

Task-number: QTQAINFRA-3836
Change-Id: I8454c35d99045adfd28d3bcbbaf791b0a668978f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-01-07 16:53:43 +02:00
Samuli Piippo
ea16299072 tst_qlineedit: expect failure only on armv7
Works correctly on ARM64

Change-Id: I7a7d54525a5411a5d7363053c28e131a64f0cc40
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-01-07 16:53:22 +02:00
Joerg Bornemann
ad2da2d27a Remove the qmake project files
Remove the qmake project files for most of Qt.

Leave the qmake project files for examples, because we still test those
in the CI to ensure qmake does not regress.

Also leave the qmake project files for utils and other minor parts that
lack CMake project files.

Task-number: QTBUG-88742
Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-01-07 15:32:28 +01:00
Samuli Piippo
ac970d48fd tst_qdatetime: blacklist zone-change test for QEMU ARMv7
systemTimeZoneChange() fails also on 32bit QEMU ARMv7.

Task-number: QTBUG-87663
Change-Id: I5c006a8637edff0a95b1f9b76d2c58006aeae6d6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-01-07 06:35:31 +00:00
Samuli Piippo
5a0f9004e2 tst_qarraydata: blacklist dataPointerAllocate on all 32bit systems
The test case fails also on QEMU ARMv7.

Task-number: QTBUG-88705
Change-Id: Ibe8c777f0205b298f6b9a27c067dd552253fcf33
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-01-07 08:35:21 +02:00
Samuli Piippo
513be303b7 tst_toolsupport: fix expected alignment on ARMv7
The alignment has been recently updated but never correctly tested,
as test has either been disabled or marked as insignificant.

Change-Id: If6e529c290b2057f58c3b27c89279d9e90728ad4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-01-07 08:35:10 +02:00
Ulf Hermann
c9a1102269 Make QString and QByteArray sequentially iterable
As lists of QStrings and QByteArrays are sequentially iterable the base
types should really also be.

The only problem is that they don't have methods to remove items from
the back or the front, but that is well within what we can support with
QSequentialIterable.

Change-Id: I2ab551e7b11a092aba363fb4012d131bbc4b11b4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-01-06 17:15:03 +01:00
Volker Hilsheimer
7114b6d23c Prefix binary produced by QAbstractItemModelTester testcase with tst_
This is standard for all test cases. It matters, because cmake targets
are generated, and e.g.

$ ninja tst_qabstractitemmodeltester

should do what the user expects.

Change-Id: Iac8160c53d5005382e61c03b7daceaba0a4c2596
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: David Skoland <david.skoland@qt.io>
2021-01-06 11:16:13 +00:00
Zhang Yu
22416ecaaf Fix QMultiHash::equal_range crashes
QMultiHash::equal_range crashes when called in a const member function.
The Data `d` is a NULL pointer when calling equal_range()
before inserting data into an empty QMultiHash.
Then calling`d->find` crashes.

Fixes: QTBUG-89687
Pick-to: 6.0
Change-Id: I10c3d196cbc72aed8c8c922ef16534bba51037b7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-01-06 09:07:10 +08:00
David Faure
0cbbba2aa5 Update shared-mime-info to the 2.1 release, adjust implementation
The spec hasn't changed, but I made the same mistake in xdgmime
(the reference implementation) and in Qt: when multiple globs match,
and the result from magic sniffing is unrelated to any of those globs,
then I used the magic result, but that's wrong, globs have priority
and one of them should be picked up.

This is now fixed in xdgmime
(https://gitlab.freedesktop.org/xdg/xdgmime/-/merge_requests/3)
and in the expected results in shared-mime-info
(https://gitlab.freedesktop.org/xdg/shared-mime-info/-/merge_requests/99)
which this commit is also tested against.

This change also optimizes QMimeBinaryProvider::addFileNameMatches
to have the same logic as xdgmime for glob matching:
literals > extensions > other globs
As soon as one category matches, we can stop there.
This makes no difference in the overall results, in practice.

The user bug report (against the Qt implementation, actually)
is https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/138
as well as https://bugs.kde.org/show_bug.cgi?id=411718

Pick-to: 6.0 5.15
Change-Id: Ia0a34080427daff43c732609443ee6df8f41447c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-01-05 18:31:54 +00:00