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>
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>
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>
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>
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>
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>
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
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>