summaryrefslogtreecommitdiffstats
path: root/src/gui/text
Commit message (Collapse)AuthorAgeFilesLines
* Windows font engine: Silence warnings about not being able to enumate font ↵Friedemann Kleint2021-01-131-2/+2
| | | | | | | | | | | | families Turn the warning into a qCDebug() statement and add explanatory comment. Fixes: QTBUG-85683 Change-Id: I2a6a7a089a660294f3e9c3096299c75635b3b215 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 29b2387587fe2ed2a73bdcbfa928acb755537284) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Add details to QFont::toStringPaul Wicking2021-01-121-1/+20
| | | | | | | | | | Add details that explain the return value. Fixes: QTBUG-81467 Change-Id: Ifad407a27259711fc9abe1bacc7ba9db105bdcc0 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 8c395a20eddc15ae923b7658f275fa87c8d33db9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Explain how boundingRect handles null QRectFPaul Wicking2021-01-111-1/+3
| | | | | | | | Fixes: QTBUG-87107 Change-Id: Ib7f9bd58b0f3454167dc61f95e0d8e6dec52a5ed Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit 149ad1e615bf0974e52a681af73e9fb04bc1c762) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QPdfWriter: fix embedding fonts in pdf filesChristian Ehrlicher2021-01-091-1/+1
| | | | | | | | | | | | | The container size change from int32_t to int64_t created a subtle error during font serialization. The size of a QByteArray was serialized without a proper cast and therefore now 8 bytes instead 4 bytes were written to the stream. Fixes: QTBUG-89727 Change-Id: If9255a5a3124038356bc5053810f98c7c88f8a01 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 05706bd2b005dd159be34107cc43c92e7f12eb35) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Revert "Fix invalid text layout data when a full layout run is interrupted"Frederik Gladhorn2021-01-071-5/+2
| | | | | | | | | | | | | | | | This reverts commit 09ee4282e5eedf5b44245e8b28b223339f87ddfa. The commit made the layouting time go from linear to quadratic, which is problematic when rendering big documents impractical. I wrote an alternative fix for QTBUG-20354 which will come as separate change since it approaches the problem in a different way. Fixes: QTBUG-89599 Task-number: QTBUG-20354 Change-Id: Ie450332f06ee40e60c8e4c6c7d10834bff1acf74 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit a62fa9b7cc520f3548356182bf5d6642c05be204) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QInputControl: accept surrogate category characterLiang Qi2021-01-051-0/+3
| | | | | | | | | | See also https://unicodebook.readthedocs.io/unicode_encodings.html#utf-16-surrogate-pairs . Fixes: QTBUG-89184 Change-Id: I04eff7f42f0030346603a7b31e4ac854a477030c Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit e688b99995b8c624dbcea296c99fb89262d29e15) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid overflowing QFixed in text layoutEirik Aavitsland2020-12-101-0/+3
| | | | | | | | Fixes: QTBUG-89172 Change-Id: Icb78c8eeb1dbe4c5d4c6476beebafc0115a91e8c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 36ccbee34e89d185918a2925444dac11211e5c60) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPEAndreas Buhr2020-12-0412-35/+35
| | | | | | | | | | | | | | | Q_MOVABLE_TYPE was conceived before C++ had move semantics. Now, with move semantics, its name is misleading. Q_RELOCATABLE_TYPE was introduced as a synonym to Q_MOVABLE_TYPE. Usage of Q_MOVABLE_TYPE is discouraged now. This patch replaces all usages of Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE in QtBase. As the two are synonymous, this patch should have no impact on users. Change-Id: Ie653984363198c1aeb1f70f8e0fa189aae38eb5c Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 0440614af0bb08e373d8e3e40f90b6412c043d14) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix weight when reading old serialized QFontsEskil Abrahamsen Blomfeldt2020-11-211-1/+4
| | | | | | | | | | | | | | | | | | | The QFont::fromString() needs to differ between strings produced before and after Qt 6.0 when interpreting the weight value, since in older strings this will be the legacy scale. Luckily the number of tokens in the string can be used for this purpose, since many tokens were added in Qt 6.0. This broke KDE, where font settings are stored in QSettings and serialized using QFont::toString() from Qt 5. Fixes: QTBUG-88589 Change-Id: I199737fed61917f8b9d8f86176ead29a89eb8e0c Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit 1d14067680f02f47b2f8ff375c44eb64633eec02) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Adjust code format, add space after 'if'Zhang Sheng2020-11-168-36/+36
| | | | | | Change-Id: Ice081c891ff7f4b766f49dd4bd5cf18c30237acf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: hjk <hjk@qt.io>
* QChar: make construction from integral explicitGiuseppe D'Angelo2020-11-152-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QChar should not be convertible from any integral type except from char16_t, short and possibly char (since it's a direct superset). David provided the perfect example: if (str == 123) { ~~~ } compiles, with 123 implicitly converted to QChar (str == "123" was meant instead). But similarly one can construct other scenarios where QString(123) gets accidentally used (instead of QString::number(123)), like QString s; s += 123;. Add a macro to revert to the implicit constructors, for backwards compatibility. The breaks are mostly in tests that "abuse" of integers (arithmetic, etc.). Maybe it's time for user-defined literals for QChar/QString, but that is left for another commit. [ChangeLog][Potentially Source-Incompatible Changes][QChar] QChar constructors from integral types are now by default explicit. It is recommended to use explicit conversions, QLatin1Char, QChar::fromUcs4 instead of implicit conversions. The old behavior can be restored by defining the QT_IMPLICIT_QCHAR_CONSTRUCTION macro. Change-Id: I6175f6ab9bcf1956f6f97ab0c9d9d5aaf777296d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove Qt4Compatible paintingAllan Sandfeld Jensen2020-11-121-9/+0
| | | | | Change-Id: Ie54206ca9b509875568f2158e229fca9cb1860a2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Doc: Add missing brief statements for \property documentationTopi Reinio2020-11-121-2/+2
| | | | | | | | ... where applicable. Fixes: QTBUG-88232 Change-Id: I835df434765caededd35d5114965b4a1663e7942 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Reduce memory reallocations in QTextTablePrivate::update()Robert Loehning2020-11-092-14/+6
| | | | | | | | | | This fixes oss-fuzz issue 21100. Task-number: QTBUG-85139 Pick-to: 5.15 Change-Id: I635c1fa9b16dd527e568ec1e98ea7cac73977020 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Limit value in setFontWeightFromValue()Robert Loehning2020-11-091-1/+2
| | | | | | | | | QFont::setWeight() just accepts values between 0 and 900 anyway. Fixes: oss-fuzz-24986 Pick-to: 5.12 5.15 Change-Id: Ic65139a7821be3a12c65444d010736f03c8b74f5 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix static assert in Markdown parserAndreas Buhr2020-11-081-1/+1
| | | | | | | | | A static assert was misstated. The equality operator has precedence over the bitwise or operator, the static assert was thus not checking what it was intended to check. Fixed by this patch. Change-Id: If21faa617dca1d1786fc6bfaf0b87423e0d35e4e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Rename QRangeCollection to QPageRanges, make it a proper value typeVolker Hilsheimer2020-11-081-6/+4
| | | | | | | | | | | | | | | | | | | | | | | The type is specific about printing, so give it a name in line with QPageLayout and QPageSize. As per API review comment, it's not clear why this type should not be a regular, copyable and movable value type. It stores a list of intervals. Give it value-type semantics, as an implicitly shared class. Convert the parse method into a static factory function. Add a Range type and use it instead of the semantic-free QPair. Move QPrinter getter into QPagedPainteDevice, make it return a copy rather than a pointer, and add a setter. Extend test case to cover all members and more merge cases. Fix bugs found that way. Fixes: QTBUG-88113 Change-Id: If17ea4d410d49f16b097e88b7979db5d72add820 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Support the markdown underline extensionShawn Rutledge2020-11-073-2/+7
| | | | | | | | | | | | | | | | MarkdownDialectGitHub now includes this feature, so *emph* is italicized and _emph_ is underlined. This is a better fit for QTextDocument capabilities; until now, _underlined_ markdown could be read, but would be rendered with italics, because in CommonMark, *emphasis* and _emphasis_ are the same. But QTextMarkdownWriter already writes underlining and italics distinctly in this way. [ChangeLog][QtGui][Text] By default (with MarkdownDialectGitHub), markdown _underline_ and *italic* text styles are now distinct. Fixes: QTBUG-84429 Change-Id: Ifc6defa4852abe831949baa4ce28bae5f1a82265 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix a few qdoc warningsVolker Hilsheimer2020-11-062-3/+3
| | | | | Change-Id: I7cc284ec56f02049d43a23c81659db94bfc3ff42 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Unexport QTextFrame/Block::iterator classesVolker Hilsheimer2020-11-062-32/+20
| | | | | | | | | Inline private constructors, use class initialization consistently. Export only non-inline'd members. Change-Id: I18f38214bbd03af711fe7ee1314d59e06733a0ec Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Fix a bunch of qdoc warningsVolker Hilsheimer2020-11-061-1/+1
| | | | | | | Remove or fix references to removed APIs, and some qdoc syntax fixes. Change-Id: I67d71062cd7a29f4eb74b02199b1482af5e59fc0 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Set the url to have the AtNx filename if one is foundMorten Johan Sørvig2020-11-061-35/+13
| | | | | | | | | | | | | | There’s no need to convert the file name/path to QUrl, and then back again to QString before calling qt_findAtNxFile(). Call qt_findAtNxFile first, and then convert to QUrl. This makes sure the url-name and string-name stays in sync. Change-Id: I8b8939eabbdaff473945ebe31faafd408e9c4295 Pick-to: 5.15 Fixes: QTBUG-60793 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Deprecate QFontDatabase constructorVolker Hilsheimer2020-11-036-51/+44
| | | | | | | | Move private methods into the private class. Fixes: QTBUG-88114 Change-Id: I92fa52980ed5a0675eee310359d8875f614921e6 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Get rid of all instance usage of QFontDatabaseVolker Hilsheimer2020-11-031-5/+3
| | | | | | | | All QFontDatabase APIs are static, use them accordingly. Task-number: QTBUG-88114 Change-Id: I0e4a7508646037e6e2812611262eed8b6d7ad3de Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Add deprecated accessors for legacy font weightEskil Abrahamsen Blomfeldt2020-11-033-0/+71
| | | | | | | | | | | | | | In 3558704ed5c3d2c6dc6d024dfa454997469ca75f we changed the font weights to use the OpenType weights rather than our own non-standard scale. This can cause difficulty for people who have legacy font weights stored as ints and no way to convert them. Therefore, we add accessors for the legacy font weights to ease the transition. Change-Id: I2a591c62895dfa1a2310d9a2d0cdcf08de08f3a4 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix QDataStream compatibility for QTextFormat::TextUnderlineColorLars Knoll2020-11-032-0/+9
| | | | | | | | | The enum value of that property changed. Use the same mapping trick as with two other properties to ensure backwards compatibility in QDataStream. Change-Id: I01b36f9ecbcaf40e7c8523da33ea4c8f12821a63 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* macOS + FreeType: fix crash with non printable unicodeAnton Kudryavtsev2020-11-021-1/+4
| | | | | | | | Task-number: QTBUG-84096 Pick-to: 5.15 Pick-to: 5.12 Change-Id: Ia60b7094ef9e82cf24f5a8b7995000ae65bb379a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix delay first time a font is usedEskil Abrahamsen Blomfeldt2020-10-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since 066daf750fcffff8eeae4d5749607501b9aa9a2f, we would mistakenly populate the fallback list for all ensureAt(index) calls, even when index == 0. This index indicates the main font, is always valid and does not require knowledge of any fallbacks. On Windows (and other platforms where QPlatformDatabase::fallbacksForFamily() is used) this would cause all fonts on the system to be loaded and should only be done when we actually need one of the fallbacks. With the GDI font database, in which font loading is slow because we have to manually read font data, this is especially bad. If we can later move to using DirectWrite for this, we should be able to improve on it, but in any case there is no need to pay the cost of the fallbacks when the application is just using the fonts it has selected (memory-wise this is also a bad idea). On my machine a simple text layout went from 370 ms to 37 ms. [ChangeLog][Text] Fixed an issue where on some platforms, there would be a delay the first time any font was used, sometimes causing a visible delay in the UI. Fixes: QTBUG-71737 Pick-to: 5.15 Change-Id: Ie8ce9b73f02a0e5cf39a2b280968b89f4caaf39e Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* QFontEngine: get rid of userData() trickeryKonstantin Ritt2020-10-282-12/+0
| | | | | | | | it is only used by QWin32PrintEngine and we know for sure QWindowsFontEngine::handle() returns HFONT Change-Id: I7656801e4642caf7df612d2f686061dca92707e0 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix documentation warningsVolker Hilsheimer2020-10-241-4/+2
| | | | | | | | | Declare hidden friends like qdoc expects them, and other signature fixes Document function parameters Remove documentation for removed APIs. Change-Id: I44c1caeed0d40be04612129d074acc30b75f5259 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Deprecate QVariant::TypeLars Knoll2020-10-232-9/+9
| | | | | | | | | It's been obsolete for a long time already. Make sure the compiler now warns about it and remove all remaining uses in qtbase. Change-Id: I0ff80311184dba52d2ba5f4e2fabe0d47fdc59d7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix output with box font engineEskil Abrahamsen Blomfeldt2020-10-201-5/+5
| | | | | | | | | | | | | | | | The box font engine was passing in alpha values in the blue channel instead of alpha channel to QImage::setPixel(), probably assuming that setPixel() accepts the input in the format of the QImage. But the whole point of setPixel() is that it converts the input. If we just want to set the alpha value, we can do it directly on the QImage::bits(). [ChangeLog][Text] Fixed showing boxes for glyphs when there are no fonts available in the font database. Pick-to: 5.15 Change-Id: I7ae067c26b9ecba6aaa046e7e4b9ae520c4b3d23 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QFontDatabase: fix a uint->int implicit conversionGiuseppe D'Angelo2020-10-191-2/+2
| | | | | | | Just use an int, as it'll be converted to that anyhow for insertion. Change-Id: Ie5a9d35a7c10e38cbba49d8915602f9207b8e0ac Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QPdf: consolidate usage of uintGiuseppe D'Angelo2020-10-192-8/+8
| | | | | | | | | Objects in QPdf are indexed by uint. In a couple of places (incl. QFontSubset) int were used instead, causing sign conversion warnings (turned into errors by -Werror). Use uint instead. Change-Id: Ie0436c8aff3b67d8ef95a5f26fc16403e7e02bd1 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QTextTable: fix an implicit uint->int conversionGiuseppe D'Angelo2020-10-191-2/+2
| | | | | | | | Make it explicit; didn't investigate why mixed comparisons are used here. Change-Id: Idd353c76a65ca1c8c4a158886f64c9cbb321494b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use valid glyph index for box font engineEskil Abrahamsen Blomfeldt2020-10-191-2/+2
| | | | | | | | | | | | | | | | | | Glyph index 0 is reserved for "glyph not found", which can confuse Harfbuzz. For QFontEngineBox we always return a valid glyph since it is the fallback font when no other fonts are available. Symptom of issue was that we could get to Q_UNREACHABLE for certain strings when Harfbuzz returned a glyph count of 0. [ChangeLog][QtGui] Fixed a potential crash when rendering text with an empty font database. Fixes: QTBUG-85016 Pick-to: 5.15 Change-Id: Iaf1d003cdff57320bf4327aa8e63dffd9d1da82c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix some bad uses of QSharedPointerData::operator T*Allan Sandfeld Jensen2020-10-161-7/+7
| | | | | | | | Avoid detaching where possible Change-Id: I438d3e66689aeef05951af86a48af2a6910da7c2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Port some more /*implicit*/-like comments to Q_IMPLICITGiuseppe D'Angelo2020-10-161-1/+1
| | | | | Change-Id: Ib70ad3f29365153af647deea54fc45467c413cb9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove dead codeLars Knoll2020-10-123-12/+0
| | | | | | | This code has been deprecated in Qt 5. Change-Id: Ia8e0bc791ac1f43df7124b4f30db3d0bb9966015 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fallback to using the family when doing an exact matchAndy Shaw2020-10-121-6/+23
| | | | | | | | | | If the difference between the families sizes is just 1 where one of them is 0 in size then we can fallback to the family in that case. Pick-to: 5.15 Fixes: QTBUG-87267 Change-Id: I62b25b06c88000b4d7defe91871c07873b1fc792 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Another round of replacing 0 with nullptrAllan Sandfeld Jensen2020-10-074-5/+5
| | | | | | | | | This time based on grepping to also include documentation, tests and examples previously missed by the automatic tool. Change-Id: Ied1703f4bcc470fbc275f759ed5b7c588a5c4e9f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use QStringTokenizer instead of QStringView::splitLars Knoll2020-10-051-2/+9
| | | | | | | | | | | This nicely optimizes a hot spot when our HTML parser was loading Qt documentation. This change improves the loading time of the Qt Concurrent overview page by 30%, both over the previous commit and 5.15. Fixes: QTBUG-86354 Change-Id: I4f401c2e6048096444e482c7724e3e3a6c71516e Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Don't store QTextHtmlParserNode by value in a QListLars Knoll2020-10-052-29/+34
| | | | | | | | | This is a performance bottleneck as the parse nodes are huge and we don't want to reallocate them all the time. Fixes: QTBUG-86354 Change-Id: Ia437acbb5b2c8af1723932d2cd96ba2ae48a871b Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Centralize the implementation of move assignment operatorsGiuseppe D'Angelo2020-10-037-16/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment we have two main strategies for dealing with move assignment in Qt: 1) move-and-swap, used by "containers" (in the broad sense): containers, but also smart pointers and similar classes that can hold user-defined types; 2) pure swap, used by containers that hold only memory (e.g. QString, QByteArray, ...) as well as most implicitly shared datatypes. Given the fact that a move assignment operator's code is just boilerplate (whether it's move-and-swap or pure swap), provide two _strictly internal_ macros to help write them, and apply the macros across corelib and gui, porting away from the hand-rolled implementations. The rule of thumb when porting to the new macros is: * Try to stick to the existing code behavior, unless broken * if changing, then follow this checklist: * if the class does not have a move constructor => pure swap (but consider ADDING a move constructor, if possible!) * if the class does have a move constructor, try to follow the criteria above, namely: * if the class holds only memory, pure swap; * if the class may hold anything else but memory (file handles, etc.), then move and swap. Noteworthy details: * some operators planned to be removed in Qt 6 were not ported; * as drive-by, some move constructors were simplified to be using qExchange(); others were outright broken and got fixed; * some contained some more interesting code and were not touched. Change-Id: Idaab3489247dcbabb6df3fa1e5286b69e1d372e9 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Get rid of some #ifdef qt6Allan Sandfeld Jensen2020-09-302-5/+1
| | | | | | | | | None of this code is even compiled in qt6. Change-Id: I5891cc9459320083ad3908fcbf646f3ba75b8a4d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFontEngine: Do not call getSfntTable with uninitalized valueChristoph Schleifenbaum2020-09-251-2/+2
| | | | | | | | | | On FreeType font engine this results in a call to FT_Load_Sfnt_Table with a pointer to an uninitialized value passed in as FT_ULong* length, crashing. Instead initialize value to 0. Change-Id: I50d6df3b2296a05640d939e862bc50adb0fec921 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit e041f5459660eaa7108fa5888e77e64f7d1b3d1d)
* Fix Qt6 todo in qcssparserAllan Sandfeld Jensen2020-09-231-3/+6
| | | | | | | | Colors with wrong number of elements are now invalid. Change-Id: I32c934894de86095d9790baa5f0d2001d76bcd3c Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix some qdoc warnings: function parameter namesVolker Hilsheimer2020-09-222-9/+12
| | | | | | | In QTextDocument and QTextFormat, standardize language a bit. Change-Id: I7c81ecc7a32e36ec32214e6b5386a2827cfcbc3f Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Include harfbuzz header files without harfbuzz/ parent directoryDimitrios Apostolou2020-09-162-2/+2
| | | | | | | | | | | | | | | | | | | | | This is in accordance to the examples from harfbuzz docs: https://harfbuzz.github.io/ch03s03.html The fix is because `pkg-config --cflags harfbuzz` returns the subdirectory as include path, for example: -I /usr/local/include/harfbuzz and this caused the system-harfbuzz not to be found when /usr/local/include was not included by default (recent change on macOS) and the code was doing #include <harfbuzz/hb.h>. Fixes: QTBUG-85568 Change-Id: I12a34638e8ad5e3085768828457f0bfa1a2c68ad Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Windows: Fix clang error about copy on loopKai Koehne2020-09-141-1/+1
| | | | | | | | | | | clang on Windows shows an error: qtbase/src/gui/text/windows/qwindowsfontdatabase_ft.cpp:122:25: error: loop variable 'key' of type 'const QString' creates a copy from type 'const QString' [-Werror,-Wrange-loop-construct] for (const auto key : keys) { ^ Change-Id: Icdfa5e2a6753450213dcb96df70247c5a71c2293 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>