Commit Graph

9074 Commits

Author SHA1 Message Date
Liang Qi
c0359bd3c3 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/corelib/global/qfloat16.cpp
	src/corelib/global/qfloat16.h
	src/plugins/platforms/windows/qwindowswindow.cpp

Change-Id: I0938aaa6a9771f55e48c95ed29f6f5291431b947
2019-05-15 07:11:41 +02:00
Michal Klocek
1e5deb0641 Add 'well-formated' JSON string values
Add support for surrogate code points U+D800 through U+DFFF,
represent them with JSON escape sequences.

https://github.com/tc39/proposal-well-formed-stringify

Change-Id: I84fea53a8ef400beebefdba10ea82dc510fe7dda
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-14 10:06:35 +00:00
Marc Mutz
ac83032c60 tst_qrandomgenerator: replace QLinkedList with a std::list
In preparation of deprecating QLinkedList.

This actually simplifies the code, since std::list has a ctor from size,
which QLinkedList lacks, and which the code worked around by using
initializer_list.

Change-Id: I07f9d590f863d9e4e00de73339cdfa27079f6e03
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-14 05:28:14 +00:00
Frederik Gladhorn
ac4cf6e2b2 Handle missing enum value in test
Change-Id: I39ad53686b45a79105ccfd9938d79518e26dd5d5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-05-13 16:39:44 +00:00
Liang Qi
388fe97f2a Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/corelib/tools/qstring.cpp

Change-Id: I81dbf90fc936c9bf08197baefa071117bddb1c63
2019-05-13 08:04:58 +02:00
Qt Forward Merge Bot
f8212b87d9 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I0c00ffe0eabebc919f22d6faa4bf958b288e8fd9
2019-05-12 01:00:08 +02:00
Ville Voutilainen
2a1651cc16 Make moc grok binary literals with digit separators
Task-number: QTBUG-75656
Change-Id: I6011ef2fb07497cc2a055d6828a1b6356927c281
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-10 18:34:02 +00:00
Edward Welbourne
ab2655c559 Support POSIX rules as $TZ values
The TZ environment variable can validly contain a POSIX rule, rather
than an IANA ID, as described here:
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03

However, if TZ were set to such a value, leading to it being used as
systemTimeZoneId(), it would be passed to QTzTimeZonePrivate::init(),
which is a no-op unless it manages to open a zoneinfo/ file with the
given ianaId as name.  When the environment variable doesn't name a
zoneinfo/ file, we would thus get an invalid time-zone.  We can,
instead, check whether the ianaId looks like a valid POSIX rule and,
if it does, use it as m_posixRule, enabling us to correctly handle
this case.

Tweak parsing of POSIX rules so that a zone using name "UTC" or "GMT"
with an offset other than 0 will be rejected as invalid.  This avoids
parsing a zone name such as "GMT+17" or "UTC+00:01" as a POSIX rule,
where it should be understood as an offset from UTC (and only certain
well-established offsets are supported).

Added two test-cases to tst_QTimeZone::tzTest() for validity of a
POSIX zone value - a simple one constructed during discussion of the
bug, the other taken from an example in:
http://leaf.sourceforge.net/doc/buci-tz3.html

Task-number: QTBUG-75565
Change-Id: Ia5cb1cc56b13b0f6b56258e48be98d04d909e32a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-10 14:17:01 +00:00
Mårten Nordheim
b29cc512f8 Granularize blacklist of qsslsocket for Windows
Using the information from grafana we can unblacklist all the things
which are consistently passing.

Change-Id: I79917ca9c40e1df2dab46bb54cc0a2bd4a1a4621
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-05-10 13:09:19 +00:00
Mårten Nordheim
fa6859c119 Granularize blacklist of qhttpsocketengine for Windows
Using the information from grafana we can unblacklist all the things
which are consistently passing.

Change-Id: I3676d9cb5f9167039c3d1963521fa85785210f7c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-05-10 13:09:18 +00:00
Mårten Nordheim
1503265eb1 Granularize blacklist of platformsocketengine for Windows
Using the information from grafana we can unblacklist all the things
which are consistently passing.

Change-Id: If04963cd5f9a53ee2293d596f9111ebcb1add532
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-05-10 13:09:17 +00:00
Anton Kudryavtsev
681bd76e67 QStringView, QLatin1String: add indexOf methods
[ChangeLog][QtCore][QLatin1String] Added indexOf().

[ChangeLog][QtCore][QStringView] Added indexOf().

Change-Id: I9f56e5b40030e39b29e50914a46beb58013b537b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-10 07:16:42 +00:00
Qt Forward Merge Bot
e56d3b03ed Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/corelib/tools/qlocale_data_p.h
        (Regenerated by running the scripts in util/local_database/)
	src/gui/opengl/qopengltextureuploader.cpp

Done-With: Edward Welbourne <edward.welbourne@qt.io>
Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io>
Change-Id: I12df7f066ed0a25eb109f61c4b8d8dea63b683e2
2019-05-09 13:06:11 +00:00
Jan Arve Saether
2b7edd0534 Fix bug with QLayout::replaceWidget(a, a)
It should effectively leave the layout untouched

Fixes: QTBUG-69706
Change-Id: I4d8232895bf1d1ae0d1b73156ef6ec6001d8968a
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2019-05-09 12:01:38 +00:00
Shawn Rutledge
7dd71e8125 Markdown: blockquotes, code blocks, and generalized nesting
Can now detect nested quotes and code blocks inside quotes, and can
rewrite the markdown too.

QTextHtmlParser sets hard-coded left and right margins, so we need to do
the same to be able to read HTML and write markdown, or vice-versa,
and to ensure that all views (QTextEdit, QTextBrowser, QML Text etc.)
will render it with margins.  But now we add a semantic memory too:
BlockQuoteLevel is similar to HeadingLevel, which was added in
310daae539 to preserve H1..H6 heading
levels, because detecting it via font size didn't make sense in
QTextMarkdownWriter.  Likewise detecting quote level by its margins
didn't make sense; markdown supports nesting quotes; and indenting
nested quotes via 40 pixels may be a bit too much, so we should consider
it subject to change (and perhaps be able to change it via CSS later on).
Since we're adding BlockQuoteLevel and depending on it in QTextMarkdownWriter,
it's necessary to set it in QTextHtmlParser to enable HTML->markdown
conversion.  (But so far, nested blockquotes in HTML are not supported.)

Quotes (and nested quotes) can contain indented code blocks, but it seems
the reverse is not true (according to https://spec.commonmark.org/0.29/#example-201 )

Quotes can contain fenced code blocks.

Quotes can contain lists.  Nested lists can be interrupted with
nested code blocks and nested quotes.

So far the writer assumes all code blocks are the indented type.
It will be necessary to add another attribute to remember whether the
code block is indented or fenced (assuming that's necessary).
Fenced code blocks would work better for writing inside block quotes
and list items because the fence is less ambiguous than the indent.

Postponing cursor->insertBlock() as long as possible helps with nesting.
cursor->insertBlock() needs to be done "just in time" before inserting
text that will go in the block.  The block and char formats aren't
necessarily known until that time.  When a nested block (such as a
nested quote) ends, the context reverts to the previous block format,
which then needs to be re-determined and set before we insert text
into the outer block; but if no text will be inserted, no new block
is necessary.  But we can't use QTextBlockFormat itself as storage,
because for some reason bullets become very "sticky" and it becomes
impossible to have plain continuation paragraphs inside list items:
they all get bullets.  Somehow QTextBlockFormat remembers, if we copy it.
But we can create a new one each time and it's OK.

Change-Id: Icd0529eb90d2b6a3cb57f0104bf78a7be81ede52
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-05-08 20:28:53 +00:00
Shawn Rutledge
82b26444a4 Change QTextMarkdownWriter to pass by const pointer and QAIM
- QObjects are always passed by pointer not by reference, by convention
- writeTable() takes QAIM rather than QATM to make testing via
  QStandardItemModel possible in the future

Change-Id: I5bc6b8cd9709da4fb5d57d98fa22e0cb34360944
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-05-08 20:28:44 +00:00
Shawn Rutledge
76716c4a9a Markdown: deal with horizontal rules (thematic breaks)
Change-Id: I14d4bcfe1a6c3bd87d1328f0abb81b2138545e4e
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-05-08 20:28:37 +00:00
Shawn Rutledge
040dd7fe26 Markdown: fix several issues with lists and continuations
Importer fixes:
- the first list item after a heading doesn't keep the heading font
- the first text fragment after a bullet is the bullet text, not a
  separate paragraph
- detect continuation lines and append to the list item text
- detect continuation paragraphs and indent them properly
- indent nested list items properly
- add a test for QTextMarkdownImporter
Writer fixes:
- after bullet items, continuation lines and paragraphs are indented
- indentation of continuations isn't affected by checkboxes
- add extra newlines between list items in "loose" lists
- avoid writing triple newlines
- enhance the test for QTextMarkdownWriter

Change-Id: Ib1dda514832f6dc0cdad177aa9a423a7038ac8c6
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-05-08 20:28:28 +00:00
Konstantin Shegunov
c6bee8e4b2 Fix integer overflows in QDeadlineTimer
If the deadline is far in the future, the conversions to nanoseconds
or internal arithmetic may overflow and give an invalid object, thus
the deadline may end up in the past. Added a test to the testlib
selftest for sleep.

[ChangeLog][QtCore][QDeadlineTimer] Fixed integer overflows
leading to immediate timeouts.

Task-number: QTBUG-69750
Change-Id: I9814eccdf9f9b3add9ca66ec3e27e10cd5ad54a8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-08 17:19:44 +00:00
Joerg Bornemann
ce1830fd21 Migrate Windows system libs to external dependencies
Started-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Change-Id: I211ce3252b836894aeeac1c85eb316d9596bca57
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-05-08 08:30:02 +00:00
Dmitry Kazakov
06b8644953 Fix notification of QDockWidget when it gets undocked
Before the patch the notification was emitted only when the docker
was attached to the panel or changed a position on it.

It looks like the old behavior was documented in a unittest,
so this patch might actually be a "behavior change".

Change-Id: Id3ffbd2018a8e68844d174328dd1c4ceb7fa01d3
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-05-07 17:28:23 +00:00
Lars Knoll
92f9842732 Deprecate conversion functions between QList and QSet
Users should use range constructors instead to do the conversion.
Keep conversion methods between QList and QVector as these will turn
into a no-op in Qt 6, whereas forcing people to use range constructors
would lead to deep copies of the data.

Change-Id: Id9fc9e4d007044e019826da523e8418857c91283
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-05-07 14:15:44 +00:00
Lars Knoll
d510e1e7f9 Add swapItemsAt() to QVector
This closes one compatibility gap with QList, to make
it easier to replace QList with QVector in Qt6.

Change-Id: I5655bc4cd2150a6f09a1ed68c0742f3b42ca47e4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-05-07 14:15:37 +00:00
Frederik Gladhorn
490ee4c5e6 Fix compilation of tst_qaccessibilitylinux
Note that the test is still disabled, but this is needed in any case.

Change-Id: Ib7523ba800b94c32690c1bd09b23fc2078c71d4e
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2019-05-07 10:07:59 +00:00
Frederik Gladhorn
eba3b567d6 Accessibility: Improve handling of read-only state
We have been rather sloppy in how read-only versus editable is handled.
According to the definition, editable signifies that in principle a
widget allows the user to change its text. Read-only means that this
ability is (currently) disabled.

Task-number: QTBUG-75002
Change-Id: I5d71843abcdaac52f4a60a1abcac2604341f6c96
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2019-05-07 10:05:30 +00:00
Liang Qi
c2b553784d Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/corelib/kernel/qobject.cpp
	src/corelib/kernel/qvariant.h
	src/corelib/tools/qlist.h

Done-With: Milian Wolff <milian.wolff@kdab.com>
Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io>
Change-Id: I6803f7239aa137a51a7467fab7cc7a01302a848d
2019-05-07 11:58:30 +02:00
Edward Welbourne
43abe86e2f Update locale data to CLDR v35.1
The formatting of times in Norwegian has reverted to using dots in
place of colons, as it did before v31 (commit 82deb0ad1), so reverted
the tests to their state before that.

Change-Id: I8a09ce253731bb0f0f3caca117f06ad568940a81
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-07 09:29:51 +00:00
Shawn Rutledge
6afdbfdaaf Use "monospace" as fallback system FixedFont in KDE theme; logging
Also de-duplicate the "monospace" string in qgenericunixthemes.cpp,
and add tst_QFontDatabase::systemFixedFont() to verify that
QFontDatabase::systemFont(QFontDatabase::FixedFont) really returns
a monospace font across platforms.  Replace commented-out qDebug()s
with qt.text.font.match and qt.text.font.db logging categories to
troubleshoot when the test fails (among other uses).  Add qt.qpa.fonts
logging category to unix themes to show default system and fixed fonts
(font engines on other platforms are already using this category).

Fixes: QTBUG-54623
Change-Id: I2aa62b8c783d9ddb591a5e06e8df85c4af5bcb0c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-05-07 07:48:43 +00:00
Lars Knoll
0b373c2e36 Don't rely on functions that are deprecated
Change-Id: I4150368e44b43e45f3604bf0fc7dab38a15e5ec9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-05-06 20:04:51 +00:00
Lars Knoll
5ced1ff9fc Fix compilation with Qt 6
Change-Id: Ie165ab2f17740a996112b7e918b595d5873674a1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-05-06 20:04:45 +00:00
Lars Knoll
08101b2b27 Fix qplugin.h for Qt 6
Change-Id: I3ae6594a2982f990a5b3851a063b0b2f02d16bd9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-05 17:34:57 +00:00
Lars Knoll
82ddecfb17 Deprecate {to,from}Std{List,Vector}
ask our users to use the range constructors instead. This will allow
us to remove the include dependency towards <list> and <vector> in
Qt 6.

Change-Id: Id90f2058432e19941de1fa847100a7920432ad71
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-05 17:34:43 +00:00
Lars Knoll
e3b55616e2 Prefix QTextStream operators with Qt:: in tests
Change-Id: I852f016fcb619a9e634deee6efb1fe7930d974c8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-05-03 09:36:36 +00:00
Lars Knoll
f27f89f335 Don't use deprecated API
Change-Id: Ic56c22a1be5e69b371991c3e9ad98a1106848e78
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-03 09:36:22 +00:00
Liang Qi
b5c2535eb0 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/3rdparty/pcre2/qt_attribution.json

Change-Id: Ibae941cb12662f27bd6962ee02bc235971c59a15
2019-05-03 10:44:24 +02:00
Allan Sandfeld Jensen
d775b1fcb3 Remove handling of missing Q_COMPILER_INITIALIZER_LISTS
Change-Id: Id65b39c787235a051262544932e6717d076f1ea0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-02 23:10:55 +00:00
Allan Sandfeld Jensen
78a7e54f8f Custom color-space based on chromaticities
Change-Id: I7fa6efa8993aa2b79ea60b6a21bf57c4f67a120f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-05-02 20:50:46 +00:00
Robert Loehning
884dc0be7f Remove redundant file from tests
Change-Id: Icb398f1ba32dd1cc3a1e042818750c253539fae3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-02 14:40:14 +00:00
Paul Lemire
389dec3e7c Only generate temporaries when it makes sense
- Never for global inputs
- Otherwise only if the temporary is referenced more than once
  -> meaning it's actually caching the result of some operation

Tests updated accordingly.

Change-Id: Ic76615370d23dee3965ca6350d5257a8be5a3e22
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2019-05-02 12:47:05 +00:00
Liang Qi
166889ddcb Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/corelib/kernel/qobject.cpp

Change-Id: I8ca1163a1fa8072dcd16ea4426c58219149599fd
2019-05-02 09:39:31 +02:00
Shawn Rutledge
355ecfb11c Add QTextMarkdownWriter::writeTable(QAbstractTableModel)
This provides the ability to write live data from a table to Markdown,
which can be useful to load it into a text document or a wiki.
But so far QTextMarkdownWriter is still a private class, intended to be
used experimentally from QtQuick and perhaps later exposed in other ways.

Change-Id: I0de4673987e4172178604e49b5a024a05d4486ba
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-05-02 04:10:35 +00:00
Alexander Volkov
ef3daddae1 Use QPlatformTheme::TouchDoubleTapDistance for touch events
... and update the cached values on theme change.

Modify tst_QWidget::touchEventSynthesizedMouseEvent()
to avoid unexpected double click detection.

Change-Id: I151c47e851ebba7550b1b09caca2781c28d7d3d9
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-05-01 20:29:16 +00:00
Allan Sandfeld Jensen
b32b61f17e Remove handling of missing Q_COMPILER_RVALUE_REFS
Remove remaining handling of missing support for rvalue refs.

Change-Id: I78bab8bccfeeb9c76f464f345874364a37e4840a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-01 20:24:45 +00:00
Giuseppe D'Angelo
d4435a37ca Add qobject_cast operators for std::shared_ptr
Mimicking what we currently have for QSharedPointer, but also adding
* snake_case version (matching the ones in std)
* rvalue-overloaded versions (matching the C++2a overloads).

[ChangeLog][QtCore][QSharedPointer] Overloads of
qSharedPointerObjectCast have been added to work on std::shared_ptr.

Change-Id: I26ddffd82b000bf876e7c141fdce86a7b8c1d75a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-01 18:37:32 +00:00
Shawn Rutledge
23c2da3cc2 Add QTextMarkdownWriter, QTextEdit::markdown property etc.
A QTextDocument can now be written out in Markdown format.

- Add the QTextMarkdownWriter as a private class for now
- Add QTextDocument::toMarkdown()
- QTextDocumentWriter uses QTextMarkdownWriter if setFormat("markdown")
  is called or if the file suffix is .md or .mkd
- Add QTextEdit::toMarkdown() and the markdown property

[ChangeLog][QtGui][Text] Markdown (CommonMark or GitHub dialect) is now
a supported format for reading into and writing from QTextDocument.

Change-Id: I663a77017fac7ae1b3f9a400f5cd357bb40750af
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-05-01 14:31:27 +00:00
Volker Hilsheimer
78d0b6e975 Ignore failing test for free space on APFS
The file system appears to cache too aggressively, so if the reported
storage size doesn't change after flushing to disk, ignore the failure.

Change-Id: Iba7dce79591447fac296bfe92c2dc993d36d0c2a
Fixes: QTBUG-69868
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-30 10:58:13 +00:00
Joerg Bornemann
0e4326d717 Remove cruft from testProcessEOF.pro
TEMPLATE_PREFIX is gone since Qt 5.0.0.

Change-Id: I181962b942191187baf62f13d0abd17e7ebdcce1
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-04-30 10:51:02 +00:00
Tony Sarajärvi
3308a81942 Extend blacklisting of setWindowState to cover RHELs
Task-number: QTBUG-68864
Change-Id: I7503877fbbe6109806d9fd087514588d2ac640c7
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
2019-04-29 17:11:08 +00:00
Jesus Fernandez
d647cf85fa Tests: Simplify MyCookieJar
Don't reimplement the protected functions in the base class just
override the access with the using keyword.

Change-Id: I323487d9ddb1d458d5faca020c3eb4d931a9b226
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-04-29 14:11:00 +00:00
Qt Forward Merge Bot
4a54e8fd82 Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: Ic712e8a84b01b212bb1121d7a2c9b85e0d2da9da
2019-04-29 01:00:22 +02:00