Commit Graph

1499 Commits

Author SHA1 Message Date
Mitch Curtis
d86192e5ba QFontDatabase: improve logging output
Log the style name, add more descriptions of what's being logged.

Before:

Adding font "Lucida Grande" 50 QFont::StyleNormal 0 aa true fixed false

After:

Adding font family "Lucida Grande" stylename "Regular" weight 50 style QFont::StyleNormal pixelSize 0 antialiased true fixed false

Change-Id: I138f1b9f41dc41c528c830d81f8018fc16561631
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-28 15:42:29 +01:00
Kari Hormi
79d7487c89 Fix cursor not showing in empty block preceding a table
When an empty text block precedes a table in QTextEdit, the cursor in
the said text block is drawn twice (in order to make sure that the
cursor is drawn on top of the table) with inverted colors, resulting in
nothing showing up. This commit checks for an empty block before the table
and skips the first drawing of the cursor if that's what it finds.

Fixes: QTBUG-62919
Change-Id: I828d06e0645007ac42e3f308a35868b4f0db1380
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2019-10-14 15:10:46 +03:00
Lars Knoll
8c092570fc Fix warning about out of bounds access in QString::operator[]
Fixes runtime warnings that got triggered by change
c2d2757bcc.

Change-Id: I50620b179de8608f45d6f2ef053eeb8b1e10ae43
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-09 15:58:08 +02:00
Eskil Abrahamsen Blomfeldt
d5abda313d iOS: Fix fallback fonts on iOS 13+
Since iOS 13, the cascade list for the default UI font contains
meta-families for several writing systems, such as CJK. Since
these font families were never populated to the database, we ignored
them in Qt, and thus got missing glyphs for the characters in question.

The fix is to make sure these fonts are populated in the database.
It contains a partial backport of 922d195020,
which adds the qt_isFamilyPopulated() accessor to allow us to check
if the family has been populated in the font database. In Qt 5.14,
there is public API for this in QPlatformFontDatabase, so this is
a temporary resolution until then.

Fixes: QTBUG-77467
Change-Id: Ia9ebb8a19ad2367eb764ae1496a52966b465336b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-09-26 10:32:25 +00:00
Shawn Rutledge
06cc5d3071 Ensure that QFont::fromString() doesn't parse empty font specifications
Fixes: QTBUG-78236
Change-Id: Iba060e7a24080cdc8f317ecb6dc616b2cd918acb
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-09-24 14:38:40 +02:00
Qt Forward Merge Bot
fa2589bbb5 Merge remote-tracking branch 'origin/5.13.1' into 5.13
Change-Id: Ic633850940bbe17dcedc1609217a052b6f81ce4b
2019-09-05 13:33:00 +02:00
Rainer Keller
af6ac444c9 Fix crash when text contains too many directional chars
In case a text to be layouted contains more than 128 directional characters
it causes the application to crash

The function initScriptAnalysisAndIsolatePairs() collects information of
RTL/LTR chaaracters into vector "isolatePairs". The size of the vector is
capped to 128. Later the function generateDirectionalRuns() iterates
the text again and tries to access items from the previously capped vector
above the upper bound.

Task-number: QTBUG-77819
Change-Id: Ibb7bf12c12b1db22f43ff46236518da3fdeed26a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
(cherry picked from commit 1232205e32)
Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-31 08:29:31 +00:00
Liang Qi
44c393f9b6 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	config.tests/arch/write_info.pri
		Repair architecture config test for the WASM_OBJECT_FILES=1 build mode
	configure.pri
	tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp

Done-With: Jörg Bornemann <joerg.bornemann@qt.io>
Change-Id: I9e12088356eb5bc65b53211cd7a8e330cccd1bb4
2019-08-12 13:23:11 +02:00
Lars Knoll
afb326f071 Refactor lockedAlphaMapForGlyph
Simply return a Glyph pointer and not a QImage to avoid allocating and
deleting lots of d pointers for QImage when drawing text. Saves one
new/delete pair per glyph drawn and speeds up text drawing by 10% for
relatively large glyphs (probably more for smaller ones).

The qtext::paintLayoutToPixmap() benchmark shows a 16% improvement
in performance with this change.

Renamed the method to glyphData().

Change-Id: I7a353de521e4f4321c770fb1ac6043d33f6f332c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-08-08 11:18:02 +02:00
Eskil Abrahamsen Blomfeldt
a3dec41cf1 Add attribution for AGLFN
We were missing attribution for the AGLFN tables.

Task-number: QTBUG-70968
Change-Id: Ib84cbd25c9f7c49611761c9eba16624de5b77dd2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-08-08 07:07:37 +02:00
Eskil Abrahamsen Blomfeldt
79e0effead Fix crash in QTextDocument::clearUndoRedoStacks()
When calling QTextDocument::clearUndoRedoStacks() with UndoStack,
there were two bugs: The first was that we were retrieving
the item at "undoState" and deleting this. This is actually the
upper limit of the for loop. If the stack does not contain any
redos, then it would be == undoStack.size() and we would assert.

If there were redos, then we would delete the item at undoState
multiple times (actually undoState times).

In addition, when the loop exited, we first removed the dangling
pointers using remove() and then there was a weird resize() to
the new size minus the old undoState.

This would either assert because we tried to resize to a negative
number, or it would arbitrarily remove items from the stack.

[ChangeLog][QtGui][Text] Fixed a crash bug in
QTextDocument::clearUndoRedoStacks(QTextDocument::UndoStack).

Task-number: QTBUG-69546
Change-Id: I8a93e828ec27970763a2756071fa0b01678d2dcd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2019-08-08 07:07:20 +02:00
Ville Voutilainen
4f116f00fc Fix GCC 4.8 build
Change-Id: I4994146b359e8e37f6c0fa1b27f03fb9e800fdd5
Fixes: QTBUG-77218
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-05 15:50:42 +03:00
Qt Forward Merge Bot
77d126ccb5 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	configure.pri

Also required s/solid\.color/solidColor/ in a couple of places in:
	src/gui/painting/qpaintengine_raster.cpp

Change-Id: I29937f63e9779deb6dac7ae77e2948d06ebc0319
2019-07-12 12:23:29 +02:00
Andre Hartmann
a776d6ec5b QTextObject: One more 0 to nullptr conversion
Change-Id: I61446afa882304400d3ae8045e4f17bb7a020600
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-07-08 21:20:06 +02:00
Eskil Abrahamsen Blomfeldt
78caba7ae6 Support pen color with color fonts
Color fonts may also contain regular alphabet characters that
should be rendered with the current pen. In Qt, however, these
characters were drawn into the cache with a default pen color
of black.

Since all characters in a font is currently backed by the same cache,
and it would require a lot of plumbing to get around this, a step
in the right direction is to include the current pen color in the
cache as long as it is an RGB cache. This means that drawing
text with the color font with different pen colors will create
different caches.

There is no API to select font color on Freetype currently, but
this problem has also not been observed there, as the fonts
in question, with both regular and color glyphs, are not being
detected as color fonts (so the text color will be correct).
So Freetype will be left out for now.

[ChangeLog][QtGui][Text] Fixed bug where regular text rendered
with a color font would always display in black.

Task-number: QTBUG-55096
Task-number: QTBUG-74761
Change-Id: Icc7dbf73241db1e7cc6a0de18c2de927aeecf713
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-07-05 06:02:55 +00:00
Allan Sandfeld Jensen
6ff0614b61 Handle multiple font-families in <font> face attribute
This seems to be a common use case, and to be expected from pastes
of MSWord documents.

Change-Id: I5849d7f51408e76f15a0b03c2118649f118af1d6
Fixes: QTBUG-66794
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-03 13:21:14 +02:00
Allan Sandfeld Jensen
64033c3592 Output all font families in HTML output
Fix our generation of font-family CSS so it contains the full list of
families.

Change-Id: I37d5efa64faeb4b6aeb7e2c5d6a54ff07febe9cc
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-06-21 13:31:38 +02:00
Liang Qi
aedc59b1c3 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/corelib/io/qstorageinfo_unix.cpp
	src/network/ssl/qsslsocket_openssl.cpp

Change-Id: Ibc9ce799bef62d60d616beaa9fbde8ebeadfbc20
2019-06-25 15:47:42 +02:00
Thiago Macieira
0e1623158b Fix GCC 9's warning about deprecated violation of Rule of 5
error: implicitly-declared 'QDistanceField& QDistanceField::operator=(const QDistanceField&)' is deprecated [-Werror=deprecated-copy]
note: because 'QDistanceField' has user-provided 'QDistanceField::QDistanceField(const QDistanceField&)'

Change-Id: Ie7ae7616eadf4035bec6fffd15aabc58e99632d9
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2019-06-23 07:03:38 +00:00
Qt Forward Merge Bot
2a9cf3aeab Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I53a50669face6f68ddc046fd2102de8c1f888b4b
2019-06-14 01:00:09 +02:00
Eirik Aavitsland
83dccf00cc Fix printing of table headers in multi-frame QTextDocuments
The calculation of page position of table headers would only work
correctly for tables in the root frame of a QTextDocument. Fix by
including the relative positions of subframes.

Fixes: QTBUG-59000
Change-Id: I2cc7e21bddf806f7f5f9b0675ac014c339ba2453
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-04-11 15:29:44 +02:00
Liang Qi
3c662bf13c Merge remote-tracking branch 'origin/5.13.0' into 5.13
Conflicts:
	src/plugins/platforms/wasm/qwasmintegration.cpp
	src/plugins/platforms/wasm/qwasmintegration.h

Change-Id: Idf4c7936513fb1f21daa8f6105b8545f13447bb8
2019-06-11 10:30:48 +02:00
Qt Forward Merge Bot
93f7a24df0 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Ic7c790602e4ac3f4a0d3d4630441b28cf76f75fc
2019-06-11 01:00:06 +02:00
Eirik Aavitsland
a4f79313f0 Fix: QTextDocument::find backward search crossing paragraphs
If the start position of a backward string search was the at the start
of a paragraph, the code would start searching at an illegal position
(at the eol character) in the preceding paragraph. That caused
that whole paragraph to be skipped, so any matches there
would not be found. Fix by making sure the search starts at legal
position.

Fixes: QTBUG-48035
Change-Id: Id6c0159b6613ec75ec617a0a57096ceef2b4cbd0
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2019-06-04 07:14:03 +00:00
Andrew den Exter
d661a22ae2 Write an anchor-type attribute when embedding images in an ODF document
Without this some readers will fail to display the image or position
the image at the start of a paragraph rather than inline.

Change-Id: I2b9257e3193e5e68eb20112017a0c23be1d06cb0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-13 13:03:07 +10:00
Andrew den Exter
345f86a2d8 Avoid re-encoding embedded images when writing an ODF file
If an embedded image is already encodeded as an png or jpg write the
data as is instead of decoding to a QImage and re-encoding as a new
image.

Change-Id: I479ae1fddbf59900a500497dd1bdf7449c21f273
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-13 13:03:01 +10:00
Friedemann Kleint
761b71bd20 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Iaf6bd52972b562b9c91d9e93a988d26b0eb9d3b4
2019-05-27 09:17:14 +02: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
Christian Ehrlicher
69f6cab0af Doc: replace even more null/0/nullptr with \nullptr macro
Try to replace all wordings like '.. to 0' with '.. to \nullptr'. Also
checked for 'null pointer' and similar.

Change-Id: I73341f59ba51e0798e816a8b1a532c7c7374b74a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-05-08 12:48:32 +00:00
Frederik Gladhorn
4f5b2733b6 Merge 5.13 into 5.13.0
Change-Id: I98e2b93d78dba1cbf746c39a0b5877d5e72c91fc
2019-05-07 14:51:25 +02:00
Jüri Valdmann
b5154b5254 Fix QTextEngine::shapeText casing of surrogate pairs
The high part was not copied to output.

Fixes: QTBUG-75559
Change-Id: I9350e52d256510f52b3fcc0015bf879d2c609532
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2019-05-07 07:50:33 +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
Andy Shaw
ac68ef1efc Don't duplicate font family names in the fallback list
Fixes: QTBUG-75333
Change-Id: Iaaf4b13d50c6b9b52e629b81d5e9cbc552a0202c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-05-07 07:24:00 +00:00
Qt Forward Merge Bot
e4e5a1f0b7 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Iaad9509712c848ed42ada2c25065162a6fc5a930
2019-05-06 01:00:13 +02:00
Nick Shaforostov
4d5fb551d6 fix compilation with various -no-feature-* options
Change-Id: Ic1975db497613e3efe50be4246c167efe10d8e31
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-05-05 09:14:48 +00:00
Allan Sandfeld Jensen
ef05c48898 Fix -Wdeprecated-copy warnings
Implicit copy constructors or methods are considered deprecated for
classes that has one of the two or a destructor.

The warning is enabled with -Wextra in gcc 9

Change-Id: Ic9be654f2a142fb186a4d5a7d6b4f7d6f4e611d8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-01 07:39:55 +00:00
Qt Forward Merge Bot
9f1a1e320c Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Ibce9bfef928ce39070183c488ce86ae32e5ea705
2019-04-28 01:00:26 +02:00
Lars Knoll
b4cc294347 Fix page breaking with large images
Don't go into an infinite loop breaking pages, when an image is about
as large as the page. Correctly take top and bottom margins into account
when calculating whether the image could fit on one page.

Amends change 416b4cf685.

Fixes: QTBUG-73730
Change-Id: Id311ddf05510be3b1d131702f4e17025a9861e58
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-04-26 18:21:18 +00:00
Eskil Abrahamsen Blomfeldt
89a25a3ef1 Don't count all engines as "in use" in cache
Back in 36cb3f3f65, we started
properly reference counting font engines as they were entered into
the font cache. Prior to this, ref.load == 0 would mean that the
engine was essentially owned by the cache.

When the change was made, the condition that an engine must be in
use if its reference is != 0 remained, and the result of this was
used to calculate the limit for when the cache should be flushed.

Since this limit was miscalculated, the cache would keep growing,
even if it only contained unused font engines.

[ChangeLog][QtGui][Text] Fixed a bug which could cause the font
cache to grow larger than it was supposed to.

Task-number: QTBUG-76219
Change-Id: I4d1541756f3bdf5bd9b0301bf47c6db2e220716a
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2019-06-09 20:16:55 +02:00
Qt Forward Merge Bot
f80b7995f3 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Ia7328524f2cd9d5995ac8705f0fe0bf570b2e831
2019-04-04 01:00:07 +02:00
Eskil Abrahamsen Blomfeldt
a65800cc68 Add a clarification about "characters" to QTextCursor docs
The function name QTextCursor::positionInBlock() may give users the
idea that it can be displayed to the user as the visual position of
the cursor in the current block. This becomes confusing with some
writing systems, since e.g. a surrogate pair will count as two
characters while only representing a single visual grapheme.

Since it is an side effect of the encoding that will be unexpected to
many, and since it also touches on some linguistic complexities, we
add a note to the documentation to make users aware of the
consideration needed.

Task-number: QTBUG-74725
Change-Id: Iba28ba8a6ad07ee38dbb7e6a5a4b68c93d4da76a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: René J.V. Bertin <rjvbertin@gmail.com>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2019-04-02 06:51:21 +00:00
Friedemann Kleint
8f1acd29e4 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I71cc71881fb638e207d83a8733bad8f267701c0f
2019-03-26 08:27:02 +01:00
Eskil Abrahamsen Blomfeldt
be6c70ed7f macOS: Don't scale advances to 0 when stretch is AnyStretch
If the stretch is set to AnyStretch, then this is taken to mean
we should accept the font as it is. But on mac, there is a special
code path to scale the advances since the shaper doesn't do it
for us, and this neglected to check the stretch, thus it would
scale the advances by 0%.

This happened when loading a file directly in QRawFont and using
this in a QTextLayout, since no part of the code path will attempt
to calculate the stretch in that case. Reproducible in q3dsviewer
in Qt 3D Runtime 2.3.

Task-number: QT3DS-3132
Change-Id: I8f934f3fac41bf7a93c01cca0416d44003119907
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-03-25 06:30:05 +00:00
Qt Forward Merge Bot
6893919b0c Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/gui/kernel/qplatformintegration.cpp
	src/gui/kernel/qplatformintegration.h
	src/plugins/platforms/wasm/qwasmintegration.cpp
	src/plugins/platforms/xcb/qxcbconnection_screens.cpp

Change-Id: I15063d42e9a1e226d9d2d2d372f75141b84c5c1b
2019-03-20 14:09:30 +01:00
Shawn Rutledge
9f9ed383c6 Replace LDEBUG with categorized logging in QTextDocumentLayout(Private)
This adds four new logging categories:
qt.text.drawing, qt.text.hittest, qt.text.layout and qt.text.layout.table

Task-number: QTBUG-72457
Change-Id: Ifbfd6d16231c7f4ba664bc521699e44f98310f77
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-03-18 10:16:39 +00:00
Friedemann Kleint
859f837d46 Fix some qdoc warnings
src/corelib/itemmodels/qtransposeproxymodel.cpp:166: (qdoc) warning: Unknown command '\details'
src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp:102: (qdoc) warning: '\brief' statement does not end with a full stop.
src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp:233: (qdoc) warning: Undocumented parameter 'index' in QConcatenateTablesProxyModel::flags()
src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp:165: (qdoc) warning: Undocumented parameter 'proxyIndex' in QConcatenateTablesProxyModel::mapToSource()
src/corelib/io/qresource.cpp:275: (qdoc) warning: Can't link to 'isCopressed()'
src/corelib/io/qresource.cpp:555: (qdoc) warning: Can't link to 'compressionType()'
src/network/ssl/qocspresponse.cpp:47: (qdoc) warning: '\brief' statement does not end with a full stop.
src/network/ssl/qocspresponse.cpp:47: (qdoc) warning: Can't link to 'QSslSocket::ocspResponse()'
src/gui/image/qimage.cpp:2247: (qdoc) warning: Undocumented parameter 'f' in QImage::convertTo()
src/gui/image/qimage.cpp:2247: (qdoc) warning: No such parameter 'format' in QImage::convertTo()
src/gui/text/qtextformat.cpp:1420: (qdoc) warning: Undocumented parameter 'styleName' in QTextCharFormat::setFontStyleName()
src/gui/text/qtextformat.cpp:1420: (qdoc) warning: No such parameter 'style' in QTextCharFormat::setFontStyleName()
src/widgets/dialogs/qdialog.cpp:151: (qdoc) warning: Unknown command '\p'
src/widgets/dialogs/qdialog.cpp:167: (qdoc) warning: Unknown command '\p'
src/widgets/dialogs/qdialog.cpp:167: (qdoc) warning: Unknown command '\p'
src/widgets/dialogs/qdialog.cpp:168: (qdoc) warning: Unknown command '\p'

Change-Id: Ide52b70f8e72d53767d489ce1a413cf4c2dce7df
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2019-03-07 15:39:07 +00:00
Qt Forward Merge Bot
043f99954f Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Icc9b061c56e969756f0351c936cdeb8063c86079
2019-02-28 01:00:15 +01:00
Dominik Haumann
16cb578a8d QSyntaxHighlighter: Fix crash when parent is a nullptr
QSyntaxHighlighter has the follwoing constructor taking a QObject

  QSyntaxHighlighter::QSyntaxHighlighter(QObject *parent)
    : QObject(*new QSyntaxHighlighterPrivate, parent)
  {
      if (parent->inherits("QTextEdit")) {
          // ...
      }
  }

Typically, a 'parent' refers to the parent/child hierarchy in Qt
and is allowed to be a nullptr. However, in this case, passing a
nullptr will lead to a crash, as reported in
https://bugs.kde.org/show_bug.cgi?id=404820

This patch makes the QSyntaxHighlighter constructor nullptr safe
by checking if parent is a valid pointer.

Change-Id: Ia4e9b46b94fd37e6ceb2cd0538594353fdc1e349
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Christoph Cullmann <cullmann@kde.org>
2019-02-27 06:36:59 +00:00
Robert Loehning
85b0ce8ca3 Fix can not -> cannot
Change-Id: Ie9992f67ca59aff662a4be046ace08640e7c2714
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-02-25 13:03:45 +00:00
Christian Ehrlicher
a4b8e7141b QtGui/Network/OpenGl/Widgets/Xml: use \nullptr in documentation
Replace null and '\c nullptr' with \nullptr in the documentation.

Change-Id: I58934eea06943309ba895833f1991629870ab45b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-02-20 18:58:58 +00:00