Commit Graph

43036 Commits

Author SHA1 Message Date
Edward Welbourne
963931550d Check all matches for each XPath when searching
Previously, if we found one element with required attributes, we would
search into it and ignore any later elements also with those required
attributes. This meant that, if the first didn't contain the child
elements we were looking for, we'd fail to find what we sought, if it
was in a later matching element (e.g. with some ignored attributes).
We would then go on to look for a match in a later file, where there
might have been a match we should have found in the earlier file.

Check all matches, rather than only the first match in each file.  Do
the search in each file "in parallel" to save reparsing the XPath.
This clears the search code of rather hard-to-follow break/else
handling in loops; and currently makes no change to the generated
data.

Change-Id: I86b010e65b9a1fc1b79e5fdd45a5aeff1ed5d5d5
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-04-02 19:43:43 +01:00
Edward Welbourne
89bd12b9ad Change QLocale to use CLDR's accounting formats for currencies
In particular, this changed the US currency formats for negative
amounts to be parenthesised versions of the positive amount forms,
rather than having a minus sign after the $ sign. Test updated.

[ChangeLog][QtCore][QLocale] Currency formats are now based on CLDR's
accounting formats, where they were previously mostly based (more or
less by accident) on standard formats. In particular, this now means
negative currency formats are specified, where available, where they
(mostly) were not previously.

Task-number: QTBUG-79902
Change-Id: Ie0c07515ece8bd518a74a6956bf97ca85e9894eb
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-04-02 20:43:34 +02:00
Edward Welbourne
81cf23c7a7 Take CLDR's distinguished attributes into account
When doing XPATH searches, child nodes that have distinguished
attributes that were not asked for should be skipped. This is part of
the LDML spec and matters when resolving locale inheritance. Scan the
LDML DTD (previously only scanned for the CLDR version) to find which
attributes of which tags are ignorable - all others are distinguished
- and take the result into account when performing XPATH searches.

The XPath we were using for currency formats wasn't excluding
currencyFormatLength elements with type="short" and patterns specific
to thousands (and larger multiples); this is fixed by taking
distinguished attributes into account. However, the XPATH also wasn't
specifying the always distinguished attribute type="standard" that
was, in practice, used for nearly all locales that weren't (wrongly)
using short-forms for thousands; so type="standard" is now made
explicit, so as to minimize the diff.

This leaves only twenty-one locales with a negative currency formats.
A later commit shall switch to using accounting by default (it falls
back via an alias to standard, in any case), thereby restoring the two
mentioned below that were using it by accident, but the present change
gives the minimal diff here.

Thousands-specific formats replaced with sensible ones:
* zh_Hant_{HK,MO} (Traditional Mandarin, Hong Kong and Macau)
* eo_001 (Esperanto)
* fr_CA (Canadian French)
* ha_* (Hausa, when not written in Arabic)
* es_{GT,MX,US} (Spanish - Guatemala, Mexico, USA)
* sw_KE (Swahili, Kenya)
* yi_001 (Yiddish)
* mfe_MU (Morisyen, Mauritius)
* lag_TZ (Langi, Tanzania)
* mgh_MZ (Makhuwa Meetto, Mozambique)
* wae_CH (Walser, Switzerland)
* kkj_CM (Kako, Cameroon)
* lkt_US (Lakota, USA)
* pa_Arab_PK (Punjabi, in Arabic script, as used in Pakistan; uses
  arabext number system, whose currency falls back to latn's, for
  which pa_Arab over-rides the thousands-format).

Format changed from an over-ridden type="accounting" to standard (so
these lost a negative-specific form) in:
* en_SI (English, Slovenia)
* es_DO (Spanish, Dominican Republic; same)

For some locales we were picking up over-rides of narrow or short list
formats, or formats for or-lists or unit-lists rather than and-lists,
in place of the standard list format, that these locales don't
over-ride, provided by a parent locale. This changed list formats for:
* en_CA, en_IN (dropped "Oxford" comma before "and")
* qu_* (Quechua; dropped "utaq", presumably meaning "and")
* ur_IN (Urdu, India; was using unit-list formats)

[ChangeLog][QtCore][QLocale] Data used for currency formats in several
locales and list patterns in some locales have changed due to now
parsing the CLDR data more faithfully.

Fixes: QTBUG-81344
Change-Id: I6b95c6c37db92df167153767c1b103becfb0ac98
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-04-02 19:43:28 +01:00
Edward Welbourne
e5eb0aa428 Take number system into account in currency format look-up
CLDR's currency formats do have number system variation, so take it
into account. (The old xpathlite code clearly intended to do this, but
failed at it due to looking for the wrong component of an XPATH to
fix.) This changes the currency formats in use for
* all Dutch locales (because nl.xml lists a currency format for arab
  before the one for latn, and they differ),
* Punjabi, Urdu - specifically pa_Guru_IN, ur_Arab_PK (both like
  Dutch, arabext before latn; which is correct for pa_Arab_PK and
  ur_Arab_IN),
* Sindi (whose over-ride of latn currency format we were using, where
  we should be using arab's format, supplied by root's default),
* Tatar (which specifies a generic currency format, which we were
  using, before one specific to latn, which we now use),
* Tongan (same as Dutch),
* Konkani (like Dutch, deva before latn) and
* several North African Arabic locales (whose default number system is
  latn, rather than arab, but previously used arab's formats).

Task-number: QTBUG-79902
Change-Id: I18d8ec16bfd3a516d1bcd2f63bc7f7f15179a3f4
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-04-02 19:43:23 +01:00
Edward Welbourne
be3dfd7a71 Rework cldr2qlocalexml.py's reading of CLDR data
Move the code out to a CldrReader class in cldr.py, expand CldrAccess
with facilities that needs, expand ldml.py to include support for more
features, finally making xpathlite.py redundant. This initial commit
aims, though, to be bug-for-bug compatible with xpathlite in its
reading of the CLDR data.

It turns out we've been using draftier data than we were aware of
(which might not be a bad thing). The xpathlite code appeared to check
for draft attributes, but these only appear on leaf nodes and most
data were fetched by finding a parent and then scanning its children
without the draft check; only am/pm data was actually being excluded
based on draft values.  (We allowed contributed, for am/pm, in
addition to approved, which is all the xpathlite code allows
otherwise.) There are also some less equivocal bugs; I'll deal with
these in later commits.

Simplified number-system data look-ups; the old get_number_in_system()
was taking care of old LDML versions' placement of the number system
attribute; this is no longer needed. (It was also being used for a
currency value to which it was not appropriate, which is now handled
separately; this is one of the bugs mentioned above.) Ditched a
fall-back to nativeZeroDigit, which no longer exists in CLDR.

Change the command-line to take the root of the CLDR data tree, rather
than its common/main/ sub-directory. Support naming the file to which
to write output, as a second command-line argument, instead of always
writing to stdout (which remains the default) and leaving whoever runs
the script to redirect stdout.

Support (internally for now, while adding TODOs to give main() more
command-line options) separating the stderr output into its more and
less interesting parts; for now, continue producing both, but suppress
the least interesting entirely.

Task-number: QTBUG-81344
Change-Id: Ie611b47403a9452b51feaeeaaa0fbc8f7e84dc71
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-04-02 19:43:18 +01:00
Edward Welbourne
c834dbc6fb Move cldr2qtimezone.py's CLDR-reading to a CldrAccess class
This begins the process of replacing xpathlite.py, adding low-level
DOM-access classes to ldml.py and the CldrAccess class to cldr.py

Moved a format comment from cldr2qtimezone.py's doc-string to the
method of CldrAccess that does the actual reading.

Task-number: QTBUG-81344
Change-Id: I46ae3f402f8207ced6d30a1de5cedaeef47b2bcf
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-04-02 19:43:13 +01:00
Edward Welbourne
9fab53a513 Rework qlocalexml2cpp.py to use writers based on Transcriber
This saves repetition of temporary-file manipulation code. In the
process, ensure that we tidy away temporary files on failure.

Moved a comment in qlocale.h to *outside* the re-written portion, to
save having to rewrite it every time. Added blank lines to separate
script data from country data in the generated output. Changed 0s in
one comment to zeros, to match another comment.

Isolated use of sys to the __main__ block.
Isolated use of enumdata to the new LocaleHeaderWriter class.
Modernised all the string-formatting I touched.

Task-number: QTBUG-81344
Change-Id: I5768e45d9a8ea23facc303b3dd8af8b3ccbf7ff2
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-04-02 19:42:56 +01:00
Edward Welbourne
5b1c33cc78 Rework cldr2qtimezone.py into more maintainable form
Broke out the updating of a source file to a ZoneIdWriter helper
class, which enables tidying away the temporary file if we fail.
Collected up the rest of the script into a main() that's now
called from a __name__ == '__main__' block.
Rationalized the imports.

Eliminated an inefficient lookup function by constructing a suitable
dict() before entering the loop that needed it.

Separated the "data you might need to update" tables from the code
that does the work, to make it easier for those adding support for new
zones to see what they're doing.

Removed the spurious $Revision$ from the output and reworded the
premable of the generated file. (It would seem CLDR no longer uses an
RCS-based version-control system.) Generated output is otherwise
unchanged.

Task-number: QTBUG-81344
Change-Id: I7d9de8357ebcb599d154de9f862e25f7ade00390
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-04-02 19:42:50 +01:00
Edward Welbourne
bb4242341b Add tools to localetools to facilitate source file recreation
For now unused; later commits shall put them to use.
Transcriber -- base, takes care of tempfile and renaming.
SourceFileEditor -- handles copying parts before and after a common delimiter.

Task-number: QTBUG-81344
Change-Id: I28cf977d0a08825fbb873fb330da6823b88ad3ed
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-04-02 19:42:45 +01:00
Edward Welbourne
c3dea1ffca Move some shared code to a localetools module
The time-zone script was importing two functions from the locale data
generation script. Move them to a separate module, to which I'll
shortly add some more shared utilities. Cleaned up some imports in the
process.

Combined qlocalexml2cpp's and xpathlit's error classes into a new
Error class in the new module and made it a bit more like a proper
python error class.

Task-number: QTBUG-81344
Change-Id: Idbe0139ba9aaa2f823b8f7216dee1d2539c18b75
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-04-02 19:42:40 +01:00
Edward Welbourne
4d9f1a87de Move qlocalexml2cpp.py's XML-reading to QLocaleXmlReader
This new class mirrors the existing QLocaleXmlWriter and places the
two side-by-side in qlocalexml.py, rather than having the writing and
reading in separate places.

Made judicious use of transformed versions of mappings to save
repeated iteration of a mapping's entries to do lookups on fist
entries of pair-values; several (id, name, code) data-sets are
sometimes indexed by id, sometimes by name.

Reworked the default_map, that the complicated compareLocaleKeys()
used in sorting locale keys, to map IDs instead of names; the function
also needed the locale_map so that it could convert IDs to names,
which we can skip by going directly with IDs.

Task-number: QTBUG-81344
Change-Id: Iff6a97f7f0755b56dda70d8a6796ec074c558910
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-04-02 19:42:34 +01:00
Edward Welbourne
a20697a394 Rework cldr2qlocalexml.py in terms of a QLocaleXmlWriter class
Delegate the output of XML to a helper class provided by qlocalexml.py
and restructure the driver script so that it can be imported without
running anything. It now has a minimal __name__ == '__main__' block
that calls a main() function. This, for the moment, requires a global
via which it shares the CLDR directory with various other functions;
that shall go away in a later commit.

Task-number: QTBUG-81344
Change-Id: Ica2d3ec09f2d38ba42fd930258cc765283f29a71
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-04-02 19:42:28 +01:00
Edward Welbourne
333d7e6de4 Clean up QTzTimeZonePrivate::systemTimeZoneId()
The special handling of ":/etc/localtime" should only apply if that's
the exact value of $TZ; the old code would have treated
"/etc/localtime" the same, due to stripping a leading ':' before
checking for it.  We can also test whether to do that stripping using
startsWith().

When reading the content of files, avoid QTextStream's trip via
QString and back to QByteArray by using the QFile's readLine()
directly, or by using readAll().

Task-number: QTBUG-75585
Change-Id: I1524529a2c34d83a9fbd00d41c11f2d994dfc49d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-04-02 20:41:09 +02:00
Samuel Thibault
54886d7f81 Enable accessibility on Linux when org.a11y.Status IsEnable is true
Otherwise accessibility would only work when Orca is set to be started
in the session preference, and it would not work when running Orca or
compiz' zoom by hand.

The existing comment said that it was always true since gnome 3.6, but at
least in Debian 8's gnome 3.14, Debian 9's gnome 3.22, and Debian 10's
3.30 it is not always true, it is Orca which sets it on startup. Compiz's
focuspoll module also does so for people with low vision using zoom with
focus tracking.

[ChangeLog][Accessibility][Linux] Enable accessibility on Linux when Orca is
started by hand

Change-Id: I36cfe1b45e442c0fcefe813e09a67a74205c3ecf
Reviewed-by: Frederik Gladhorn <gladhorn@kde.org>
2020-04-02 19:34:07 +01:00
Tor Arne Vestbø
6387138a79 Pass SDK root to the linker as -isysroot, not -Wl,-syslibroot
The former option to clang will result in more options to the linker,
such as the newly introduced -platform_version, which writes the
SDK version to the resulting binary. By using the syslibroot flag
directly we were missing the platform version, and binaries were
left without an SDK version set, resulting in failed validation
of the binary. Going with the clang driver gives us the right
behavior for free.

Fixes: QTBUG-83100
Change-Id: I98bc9ba644dae4bcc7a6a88481556bae185ce5fa
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 6a60192ac03d0b4ab542191065122243cebcd1ca)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-04-02 18:33:42 +02:00
Edward Welbourne
53ed635dbb Set CONFIG += benchmark in corelib's various benchmarks
This leads to "make benchmark" actually running the benchmark, which
would be nice, I think. Purged various CONFIG += release or -= debug
lines from the same configurations; those surely only configure how
the test code is compiled, which is more or less pointless; it's the
code under test whose debug/release state matters, and I don't suppose
that's affected by the build config of the test code.

In the process, reduce diversity of the ordering of lines within these
*.pro files and purge some dangling space.

Change-Id: Ia9f9f0ca4c096262de928806bdfa6ea3b9e7b9ba
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-04-02 18:33:42 +02:00
Lars Knoll
64b1af3fa0 Warn that the EDITABLE flag for property declarations is deprecated
Additionally mark QMetaProperty::isEditable as deprecated.

Change-Id: I1abe4c6f2d30c2f96380f9e5942be431dbfed38f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-04-02 15:21:46 +00:00
Volker Hilsheimer
1de427bd4e Use correct deprecation macro, and add \since to new member function
Change-Id: Ib9e88855c708f1fe2402d78c55ff08812d86e035
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-04-02 16:32:03 +02:00
Oliver Wolff
1430b2944b ANGLE: d3d11: Do not register windows message hooks for d3d11 windows
These message hooks are used to handle ALT+ENTER to enter/exit fullscreen
mode and PRINTSCREEN to take screenshots. Qt is implementing these
functionalities itself so we do not have to register these hooks.

If too many of these hooks are registered, callbacks are no longer called
and Qt's message queue is no longer handling messages. By saving these
hooks we can make sure that more Qt windows at the same time are possible
without getting unresponsive due to too many hooks being registered.

Change-Id: I5354f91f08cbfeda5e8dc3ad7f824fbd5b3b2932
Reviewed-by: Dominik Holland <dominik.holland@qt.io>
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-04-02 08:58:03 +02:00
Shawn Rutledge
f515ca5dcd Fix QTabletEvent manual tests
- QPainterPath needs an explicit include now
- QTabletEvent::device() is deprecated

Change-Id: I2d1086847ee2cf5ed63e345c7c2d6eb43897f0e4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-04-01 22:57:55 +02:00
Volker Hilsheimer
5c1bc5c8a4 QLineEdit: clarify the impact of using validators
Values that are validated as Intermediate are possible to enter, but
returnPressed and editingFinished signals are not emitted.

Fixes: QTBUG-82915
Change-Id: I3e194cd6ee93b3402090117b67044cf3663a232e
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-04-01 21:37:48 +02:00
Friedemann Kleint
00d9f68c41 Speed up tst_QApplication::testDeleteLaterProcessEvents2()
Quit the event loop once the object is destroyed.

Change-Id: I6df1cfe867daacb6af56eb84646be91d98a2f545
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-03-31 21:50:37 +02:00
Friedemann Kleint
ae653fc08b tst_QApplication::testDeleteLaterProcessEvents(): Split the test
The test can trigger timeouts in COIN, split into subtests.

Change-Id: I1fa5d52422275f89b2858d90c5979632aa7058e2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-03-31 21:50:32 +02:00
Liang Qi
7ed097b31f Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-03-31 16:24:30 +02:00
Friedemann Kleint
82a39f12fa QCommonStyle::pixelMetric(): Silence warnings about deprecated enum values
Add the Qt 6 code paths and enclose in warnings exclusions.

Change-Id: I321296ef220fb788f04979ffff42a8a5f226dfdb
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-03-31 16:08:53 +02:00
Liang Qi
947e1f45c7 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp

Change-Id: Ifaa56153f5f0d687a6b4d94f84fcfa1e1751afd2
2020-03-31 12:30:18 +02:00
Volker Hilsheimer
d934fd7f54 Send MouseMove events without buttons if the press closed the popup
With nested popup widgets, pressing a mouse button on the lower
popup will close the active popup. MouseMove events that are generated
before the button is released again should not have that button
included, as it is likely to result in incorrect state handling in
the widget. This change removes all buttons from the MouseMove event,
which is the second best option.

This is mostly consistent with the behavior when closing a popup and
no other popup remains. The widget underneath will get MouseMove
events without the respective button included.

This change doesn't include a fix for the final release event, which
should ideally also not be delivered to the remaining popup, as it
never got a corresponding press event. Qt has already reset the states
in which it stores which widget received the press event at the time
the release is generated, such as qt_button_down and qt_popup_down.
So we can't separate a release grabbed by a newly opened popup (which
we want) from a release to the popup that became active after closing
(which we don't want).
However, widgets can more easily work around this issue, and the risk
of breaking things by changing the code further becomes too high.

Change-Id: I603bbdbc7e7355952d96ab77c5e2d2f1e6f94987
Fixes: QTBUG-82538
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2020-03-30 20:06:20 +01:00
Allan Sandfeld Jensen
8f88a3962a Fix 1 pixel wide images
Images are rounded up to 4 bytes per line minimum, so one pixel wide
images might not shrink when resizing.

Fixes: QTBUG-83179
Change-Id: If72c94409e4c899c5ad05b2867f5f53a94d0580f
Reviewed-by: Christian Kamm <mail@ckamm.de>
2020-03-30 20:55:11 +02:00
Robert Loehning
f5a58cccc2 Fuzzing: ignore logging output from QColorSpace
Change-Id: Ica549be24c8873854934f4ba24f2b3f7cb077e25
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-03-30 19:05:33 +01:00
Robert Loehning
cd57dae62f Fuzzing: Add QGuiApplication to gui fuzz targets
Change-Id: I3713701f63d9d8938fbb42ad1ae2f0c4ae813e94
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-03-30 19:05:22 +01:00
Liang Qi
22fe293038 testlib: add QAbstractItemModelTester::verify()
This amends b3e4be2d8b.

When building testlib with QtGui linked:(use "QT = core-private gui"
in src/testlib/testlib.pro)

    Undefined symbols for architecture x86_64:
      "QAbstractItemModelTester::verify(bool, char const*, char const*, char const*, int)", referenced from:
          QTestPrivate::testDataGuiRoles(QAbstractItemModelTester*) in qabstractitemmodeltester.o

Change-Id: Ideb10ddd6717fed8d9f91f75bbfc9d5a22104730
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2020-03-30 19:32:06 +02:00
Shawn Rutledge
68916fede4 Finish deprecating TouchPoint::rect, sceneRect and screenRect accessors
All 6 getters and setters were deprecated by doc comment \obsolete in
3c159957f8 (Qt 5.9). Now we will generate
compiler warnings too.

Change-Id: I94c6da607fa5758072af1287c9286b6c52179cfb
Reviewed-by: Frederik Gladhorn <gladhorn@kde.org>
2020-03-30 18:12:51 +02:00
Andy Shaw
2e0c29a4bb itemviews: Use the start of the current selection when getting the range
When doing a shift-select while moving the mouse then the start point
should be based on the start of the current selection and not the
pressed position. If there is no current selection start index, then
we can safely depend on pressed position as this will be the previous
index pressed on.

This resolves an issue introduced by
e02293a76d when fixing QTBUG-78797

Fixes: QTBUG-81542
Change-Id: Ia66c42b220452fdcbc8cfccc05dbc8a3911c3f5e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-03-30 11:17:59 +00:00
Eirik Aavitsland
c3b6d09cae Update bundled libjpeg-turbo to version 2.0.4
[ChangeLog][Third-Party Code] libjpeg-turbo was updated to version 2.0.4

Change-Id: I7f74af0dc774a2172ff59713613a706e80d5b2cb
Reviewed-by: Liang Qi <liang.qi@qt.io>
2020-03-30 07:36:47 +01:00
Joni Poikelin
7eb7bb979e Fix Fusion style ignoring SH_UnderlineShortcut from proxy style
Fixes: QTBUG-83133
Change-Id: If3fbfae515567d9a0136beb35ca1f9f59460894b
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-03-30 09:11:26 +03:00
Thiago Macieira
bff56f953a tst_QCborValue: Prepare for 64-bit QVectors in Qt 6
Change-Id: Ief61acdfbe4d4b5ba1f0fffd15fe1e921aab0a72
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-03-27 16:45:59 -03:00
Thiago Macieira
783d574b93 CBOR support: prevent overflowing QByteArray's max allocation
QByteArray doesn't like it.

Apply the same protection to QString, which we know uses the same
backend but uses elements twice as big. That means it can contain
slightly more than half as many elements, but exact half will suffice
for our needs.

Change-Id: Iaa63461109844e978376fffd15f9d4c7a9137856
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-03-27 16:45:48 -03:00
Qt Forward Merge Bot
fd44fb7675 Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-03-27 18:58:56 +01:00
Kai Koehne
0b4ae8e682 MinGW: Fix build with -angle
Since Qt 5.14, debug libs for MinGW don't necessarily have a 'd' suffix anymore.

Fixes: QTBUG-83087
Change-Id: Ia9f499ebed05e96fb056134681a2124c2262fb08
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-03-27 15:34:12 +01:00
Eirik Aavitsland
533f7d7ca3 Raster painting: fix dashing for separate lines
When drawing multiple distinct (unconnected) lines (e.g. from
QPainter::drawLines() or a QPainterPath with alternating
movetos/linetos), the dash pattern should not continue from one to the
next, as it should when drawing a connected line (e.g. polyline).
Both the cosmetic stroker and the full stroker does it right, but the
fast rasterizing codepath got it wrong.

Fixes: QTBUG-83048
Change-Id: I3d090f7121726755a0e53cb66b99a5563ac0e1c0
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-03-27 12:31:01 +01:00
Volker Hilsheimer
0613bf5d16 QTextEdit: remove the cursor when a read-only textedit looses focus
A read-only text edit with Qt::TextSelectableByKeyboard shows a steady
cursor to indicate to users that they can select the text, but not edit
it. When the control receives focus, it doesn't turn on blinking, but
explicitly sets cursorOn to true.

When focus is lost, then cursorOn needs to be reset to false to make
the cursor disappear, even if the blinking (as indicated by the poorly
named cursorVisible variable) is not on.

Change-Id: I78408b5c50c6ede3f9a7128be7a31b9c6795cf9c
Fixes: QTBUG-83029
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-03-27 12:13:53 +01:00
Tor Arne Vestbø
d4a4202caa widgets: Sync client rect of paint-on-screen widgets during resize
Paint events are delivered with the client rect of the widget, and
this applies to paint-on-screen widgets as well. The same goes for
how the widget repaint manager tracks dirty rects. Internally we
were also calling paintOnScreen() with client rects, so the use
of geometry() in the resize handler was likely a bug/oversight.

Change-Id: I1312ccf77218d1162e0971e4cbabaa80f49c852c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-03-27 11:19:52 +01:00
Qt Forward Merge Bot
4752bd7718 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/corelib/serialization/qcborvalue.cpp

Change-Id: I539d8cae5fd413b8a6c9c5d8a6364c79c8133a0a
2020-03-27 09:23:33 +01:00
Lorn Potter
6434101360 wasm: refactor network to use fetch API
This has better support for threaded use, and gets rid of bind use.

This requires emscripten 1.38.37 and above

Task-number: QTBUG-76891
Change-Id: Ic30a6820c2ce945c314751c06cfc356914a71217
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-03-26 22:36:36 +00:00
Topi Reinio
96de59d7c1 Doc: Document new property change notifiers for QSortFilterProxyModel
Change-Id: I02789fa2281d33c7344a5d5e730a27fe6fa50e56
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-03-26 15:28:42 +01:00
Topi Reinio
0b5a1100ff Doc: Adjust offline style for the litehtml rendering engine
Qt Creator now has the option to use the litehtml backend as a
replacement for the QTextBrowser-based help viewer.

Fix a few issues that the offline style has with the litehtml renderer:

- Fall back to using an unordered list for the navigation bar.
- Remove the background image for #buildversion and adjust font size.
- Adjust the generated padding around code snippets.

Keep the script that switches the offline-simple.css style to the
full offline style (offline.css) for JavaScript-enabled browsers.
The litehtml backend in Qt Creator will handle this switch internally.

With these changes, the generated offline documentation looks
acceptable when rendered with QTextBrowser, litehtml, or desktop
web browsers.

Fixes: QTBUG-82567
Change-Id: I86b179b1985b7ef54feddab30cb227b28021efe5
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-03-26 15:28:31 +01:00
Topi Reinio
07558ae12d Doc: QItemSelectionModel: Note when function default arguments were added
Change-Id: I4b7a9269b68c86548035b57211c4c1b5ad451767
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-03-26 15:28:08 +01:00
Topi Reinio
7d0f24b166 Doc: Mark QTextStream manipulators as deprecated
and instruct to use the ones from the Qt namespace instead.

Task-number: QTBUG-82532
Change-Id: I6a85f5096da8aec925a287beff136b77d113926e
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-03-26 15:27:58 +01:00
Topi Reinio
beffcc590c Doc: Expand reasoning for QHash deprecations
and mark QHash::[const_|key_]iterator operators correctly as deprecated.

Change-Id: I01da16254759b9bdb7920709de45a72933d6b5c8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-03-26 15:27:49 +01:00
Topi Reinio
f588804725 Doc: Expand reasoning for QMap deprecations
Change-Id: Idaec1ebd2a392af2b8d778e72acda6bd117d1a48
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-03-26 15:27:39 +01:00