Synced QMetaObjectBuilder::MetaObjectFlag with the MetaObjectFlags enum
from qmetaobject_p.h. Also added a few comments for Qt 6.
Change-Id: Ieccd5cf8d512a6bf7256b2f4db88d45662774536
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This feature is needed to register complex types (e.g. Q_GADGETS) at
runtime, using a single constructor method and added type parameter.
Without having the type id available to the Constructor it is impossible
to specialize behavior, thus requiring separate constructors for each
type. Generating these separate constructors at compile time is easy,
but not at runtime.
[ChangeLog][QMetaType] QMetaType can now register constructor for a set
of dynamic types.
Change-Id: I6071271d0e157864594dd07b4bc3a0abbeb15a44
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
the test uses CoreFoundation api directly, so it must link it
explicitly.
amends 6c8f32388b.
Change-Id: I76b7d8ab41d6a66138eb45bd0f067cfee8e96cb8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The table and macros weren't extensible enough for non-Latin-based
languages.
Change-Id: I950f06de57aaf6bd0b24e0056e4acee2fb655f3d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We have #if-ery on Q_OS_DARWIN controlling an expectation of gettign
"GMT+1" and "GMT+2" instead of "CET" and "CEST" in two tests; this
turns out to not be a deficiency of macOS so much as of how we
configure Coin's VMs. While we fix that, we need to ignore failures
in these tests, so that we can pull the #if-ery out and clear the
blacklist once the VMs are set up properly.
Task-number: QTBUG-70149
Change-Id: If3577200cf980b3329161ab3eea7bd2e9d0124e0
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
This reverts commit fd38c97a6c.
Apparently our actual VMs for 10.13 don't get this right, although the
ones used in testing did (prompting the fix this reverts). We
probably have mis-configured VMs, but this is the quick-fix to get
development moving again.
Task-number: QTBUG-70149
Change-Id: Ib96755d8e21d9b226e22fc985f13f34fa04117b1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
CLDR up to somewhere between v29 (used by 5.9) and v31.0.1 (used by
5.10 and later) claimed Costa Ricans don't include fractions in their
currency; now it claims they expec two digits. Apparently one of them
does expect those digits, so this is the regression test I'll be
cherry-picking back to LTS, to accompany the CLDR updates they need.
Task-number: QTBUG-70093
Change-Id: I138772cc6013fa74de4f7c54b836cac83421eab2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
_q_interpolate<T> subtracts 2 arguments of type T,
for unsigned types this can cause wrapping around
Task-number: QTBUG-57925
Change-Id: Iffa59f413579a3d5de8cb728fe71443d8e8a04aa
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
After updating MinGW toolchain from 5.3.0 to 7.30 test starts to fail.
Task-number: QTBUG-69947
Change-Id: I850d854b27e1cb4e1dd2cb600e8e79bd18bff4a0
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Simo Fält <simo.falt@qt.io>
They have been blacklisted on windows and macOS previously. Now failing
on WinRT as well.
Task-number: QTBUG-69962
Change-Id: I30ca23005b082e820ee896fa36a8984a1536ad6b
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Assume two MIME types A and B are registered, both with the same glob
pattern, A being parent of B, A with some magic rule, and B with another
magic rule. Given a file that matches the glob pattern and the magic rule
of A, the resulting MIME type depended on the order of registration of A
and B, because it would just check if some glob matching MIME type was
also a subclass of the magic matching MIME type.
The patch prefers the the MIME type that matches by magic if that
matches by glob pattern as well (i.e. A in our example).
The "recommended checking order" of the spec does handle that case.
Task-number: QTBUG-44846
Change-Id: I2af43f6199faf9a42cd9c35d3a045441afbd6217
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
This patch implements the support for QRegularExpression in
QSortFilterProxyModel.
[ChangeLog][QtCore][QSFPM] QSortFilterProxyModel now supports
QRegularExpression.
Task-number: QTBUG-46810
Change-Id: If932d55f98f9b8bcf3a72c03ffd51da52cb50ad1
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: David Faure <david.faure@kdab.com>
The match method still uses QRegExp. This patch updates the code to use
QRegularExpression and translates the wildcard patterns to a suitable
form for QRegularExpression.
[ChangeLog][Core][QDir] QDir now uses QRegularExpression internally for
wildcard matching. Note that QRegularExpression might not give the
exact same result as QRegExp as its implementation follows strictly the
glob patterns definition for wildcard expressions. Nevertheless, the
tests for QDir return the same results as before.
Change-Id: I095959443ac7362f7534e35454eff038061fca82
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This patch refactors the wildcardToRegularExpression method to generate
a simpler regular expression. It also fixes some shortcomings of the
previous implementation.
Tests have been updated to ensure all cases are properly supported.
Change-Id: I454e3fe8fe0bb663b2f319d6fa2fa8aec626c50d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Deep down in CoreFoundation, ICU is used, and this test triggers a
heap-buffer-overflow with AddressSanitizer. Disable this test for macOS
until Apple fixes it.
Task-number: QTBUG-69875
Change-Id: I43e4a69708be8cde3bde87c57db21f5b717f96b8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Before this change, if you try to insert a row at the bottom of QSortFilterProxyModel
the row will be inserted in the source model at position proxy->rowCount rather
than at the bottom. This causes insert at apparently random positions in the source.
[ChangeLog][QtCore][QSortFilterProxyModel]
QSortFilterProxyModel::insertRows(row,count,parent) with
row == QSortFilterProxyModel::rowCount will insert at the bottom of the source model
rather than at the row QSortFilterProxyModel::rowCount of the source model
Task-number: QTBUG-58499
Task-number: QTBUG-69158
Change-Id: Ie78416c8fbc429303b8c9c98375630e3e4d85f6d
Reviewed-by: David Faure <david.faure@kdab.com>
Add it to configure.json and replace all occurrences of QT_NO_THREAD
with QT_CONFIG(thread). Add conditions for other features that depend
on thread support. Remove conditions where we can use the QMutex and
QThreadStorage stubs.
Change-Id: I284e5d794fda9a4c6f4a1ab29e55aa686272a0eb
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
qt_nameprep() already reset the string to its original length to
indicate failure, but we didn't handle that in qt_ACE_do(). So make it
have a return value whcih makes it easier to handle that case and do
handle it.
[ChangeLog][QtCore][QUrl] Fixed a bug that caused URLs whose hostnames
contained unassigned or prohibited Unicode codepoints to report
isValid() = true, despite clearing the hostname.
Change-Id: I41e7b3bced5944239f41fffd1545b7274c4b419d
Reviewed-by: David Faure <david.faure@kdab.com>
The API originally proposed was flawed in the sense that the setter
function would use a modified version of the parameter given which would
have make it a black box for the user. This patch fixes that by removing
that setter and providing a static method that will return the pattern
suitably modified to be used by QRegularExpression the same way the
escape method does.
[ChangeLog][Core][QRegularExpression] Implemented support for wildcard
patterns through a static method.
Change-Id: I0054bcaffd7525dac569f54fa81f73b7e4544b2e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
tst_QtEndian's transformRegion_template() was getting a
signed/unsigned comparison warning when T was unsigned in a
QCOMPARE(T-value, 0); so use T(0) instead.
Change-Id: I78cb2ab96f79393def65ed2c020aa3039017ab92
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
That way, we'll get told all the cases that fail, rather than only the
first. Provoked by investigation of failures that turned out to be
caused by QTBUG-69875.
Change-Id: I8fa2902cbbcb307cbe1fdec2e7d8d6b0c3eb998a
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
The CLDR data contains eight locales with numeric territory codes, 001
for World, 150 for Europe and 419 for Latin America. The last was
already known in our enumdata.py, but as "Latin America and The
Caribbean", which is not supported by the CLDR, so I've amended it
while adding the other two. This gives us support for Esperanto and
Yiddish (among others).
[ChangeLog][QtCore][QLocale] Added support for World and Europe as
(numeric) "country" codes ("territory" in CLDR terms), thereby
enabling support for Yiddish and Esperanto, among other locales using
such codes.
Task-number: QTBUG-57802
Change-Id: Ibb1180fb720743a3a0589527649d10f3c9cd123d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
These tests kludge round Apple's use of GMT+1 and GMT+2 as names for
CET and CEST on Darwin; but 10.13 actually gets the names right, so
side-step out of the kludge when on this version or later.
Change-Id: Icb8a2f3ac30f0f621a19042dc03e0d281782dd41
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
They have a separate type that we can't recognize directly, but we
can check if we can recognize the QFlags<T> form, though we have to
add a lot of template-conditions to avoid triggering QFlags static
asserts.
Change-Id: I00853682c5376dd3cc411ff151f47bce2389e277
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Adds an enumName to QMetaEnum to carry the name of the enum since for
flags that doesn't match the name of the Qt type, but is needed if the
flag is scoped.
Change-Id: I1c0f77eb9e40e6fd1eb6a59bea77caf0f33fcf43
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
We had 30s and 60s only, which isn'tenough for the Qt CI.
Task-number: QTBUG-69741
Change-Id: I00e04a465fcf4fc1a462fffd154782999e84ef8b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
[ChangeLog][QtCore][QObject] Fixed a bug in setProperty() that caused a
property change not to take effect if the old value compared equal using
QVariant's equality operator, but the values were not strictly equal.
Task-number: QTBUG-69744
Change-Id: I00e04a465fcf4fc1a462fffd1547885861a07a64
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The majority of tests use QPluginLoader::setFileName implicitly, which
refuses to do any work in static builds. Therefore the majority of tests
are skipped. But in the future we'll get tests here that for example use
QPluginLoader::staticPlugins() and for that we want to include the
sub-directory in the build and test run.
Change-Id: Ib8ec274e22ac8050feaca8967eb8626b53876b92
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
I'm intentionally not testing improperly-paired surrogates, since those
can't be encoded in CBOR.
Change-Id: I0d3cc366baaa49f3ad28fffd154240287ce34c22
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Do not overwrite stdout/stderr by default, but only if requested.
This restores the behavior of QProcess::startDetached of Qt 5.9.
Task-number: QTBUG-67905
Change-Id: Idccf7b0da7bd80f88a0624286ddf2851bc974fb1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
A default-constructed QJsonObject has no data payload, it is only a pair of null
pointers. So, when it becomes necessary to 'materialize' such an object, a
special global emptyObject constant is used as the substitute payload. There is
a small problem with this global constant though, namely that it's is_object
flag is unset. In other words, the emptyObject is not an object, but an array.
Fix by setting the is_object flag on emptyObject.
The example code in the bug report
QJsonObject parent;
QJsonObject child;
parent["child"] = child; // 1
child = parent["child"].toObject(); // 2
child["test"] = "test"; // 3
runs into this problem on line 1. Inserting the default-constructed child means
inserting a copy of emptyObject. On line 2 a pointer to this copy of emptyObject
is retrieved and cast to an object. But it's not an object, it's an array, so
things go wrong hereafter.
Specifically, on line 3, two inserts are performed, one from operator[] and one
from operator=. Each insert increments a compaction counter. The second insert
triggers compaction (QJsonObject::insert calls Value::requiredStorage calls
Data::compact) and compaction branches based on the is_object flag. Replacing
line 3 with
child.insert("test", "test");
causes the example to appear to work since compaction is not triggered and the
JSON serializer does not look at the is_object flag. Still, any further insert()
calls would trigger compaction and memory corruption.
Task-number: QTBUG-69626
Change-Id: I8bd5174dce95998bac479c4b4ffea70bca1a4d04
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
If we ever need to add QCborValue to the bootstrap library, it's
unlikely that we'll need this part. And by splitting it, I can make the
code handle more cases, that hadn't been properly handled before.
Change-Id: I2f630efbbce54f14bfa9fffd154160c0ad893695
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
There is no such file, if one of the "directory" components of its
path is not, in fact, a directory. Added a test for non-existent file
(specified to give empty canonical file path) as well as a test for a
file in a sub-directory of a known file. The former incidentally
tests for QTBUG-29402, fixed long ago.
Change-Id: I60b80acc0f99f0a88cdb1c4d191af7384f3a31c5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use one QStringLiteral instead of repeating a QLatin1String(), that
was passed to a function that has to convert it to unicode; do the
conversion at compile-time.
Reducing i % 256 is fatuous when i ranges from 1 to 100.
A QFile will close() itself on destruction, no need to do it explicitly.
Especially when *not* close()ing the *other* QFile that was left open.
Change-Id: Idb39312d9c9beaf082b7cead574bc6bb9bb3a775
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
On Unix, we wouldn't even *try* to truncate if the file was open for
appending. The combination may be an eccentric choice but - at least
when it's combined with reading - I can imagine use-cases for it; and
we should (at least try to) deliver what we're asked for, even if we
can't think why anyone would want it. So actually enable truncation
when asked to.
Amended some tests to check this works and corrected the QIODevice
documentation of mode flags (which misdescribed the special case that
implies Truncate). Removed special-case code, to apply truncate when
writing but not reading, since it's been made redundant by the
pre-processing of mode done in QFSFileEngine::processOpenModeFlags().
[ChangeLog][QtCore][QFile] When opening a file, if Truncate is asked
for, or implied by other flags, it shall be attempted, regardless of
what other options are selected. We previously did this on Windows;
now we do so also on Unix (even when appending).
Task-number: QTBUG-13470
Change-Id: I1e08d02cfbae102725fccbbc3aab5c7bf8830687
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
For keys, QSettings escapes all characters outside of [-a-zA-Z0-9_.]
by using percent encoding, and changes '/' to '\'. That is,
settings.setValue("qt.*", true)
will be written to an .ini file as
qt.%2A=true
This means that QSettings can not be used to write general-purpose
qtlogging.ini files. Fix this by applying the reverse transformation
method from QSettings when reading in the .ini file.
[ChangeLog][Logging] Qt will now accept qtlogging.ini files
written by QSettings.
Task-number: QTBUG-69548
Change-Id: I55b7a8b433291268dc6855901f72b1c04f8ee6d3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>