summaryrefslogtreecommitdiffstats
path: root/src/gui/text
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-12-0925-244/+244
|\ | | | | | | Change-Id: Ia24cc8b86def0d9d9c17d6775cc519e491b860b1
| * Tidy nullptr usageAllan Sandfeld Jensen2019-12-0625-244/+244
| | | | | | | | | | | | | | | | | | | | | | Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-12-053-4/+8
|\| | | | | | | Change-Id: I9d63a4c4b229a831b5369f6ec74ac97ba6d6556a
| * Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-12-043-4/+8
| |\ | | | | | | | | | Change-Id: Ia70e81943ef097941339f9ef9ace28592a2eb740
| | * Fix assert in QTextDocument CSS parser on "border-width: 1pt"David Faure2019-12-033-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code was assuming that if the parsing of the value worked, then it must be a list of 4 variants. But in this case it's just a single length. This came from <td> using 4 values for border-width while other elements use a single value. But the storage is shared. So the fix is to use 4 values everywhere. When reading 4 and there's only one, it gets duplicated, so the caller can just use the first one in that case. Task-number: QTBUG-80496 Change-Id: I682244b6e3781c4d673a62d5e6511dac263c58e8 Reviewed-by: Nils Jeisecke <nils.jeisecke@saltation.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2019-11-272-4/+4
|\| | | | | | | | | | | Change-Id: I5bdfe94f7eec1ba328c4a4b54d12dbc0da7fc3ac
| * | Improve QTextDocumentPrivate cursor performanceLangonda Agag2019-11-252-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cursors in QTextDocumentPrivate are held in a QList. This becomes a serious performance problem with lots of extra selections due to a call to QTextDocumentPrivate::removeCursor() from the QTextCursor destructor. Given the following test program: QPlainTextEdit *editor = ... std::list< QTextCursor> list; for(int i = 0; i < 100000; ++i) { QTextCursor c(editor->document()); c.setPosition(std::rand()%100); list.push_front(c); } list.clear(); // <-- clear calls hangs for 3+ seconds // due to time spent in // QTextDocumentPrivate::removeCursor() // due to QList::removeAll() call Note the push_front because it exacerbates the issue because the entire list will be traversed. The change submitted changes the structure to a set, removing the issue. In theory, this limits that a cursors cannot be in the structure twice, but this neither happens nor would it make sense. Change-Id: I817dc5d1bda1d98c6725a531b32d1c711a029a34 Reviewed-by: Langonda Agag <namezero@afim.info> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-11-2515-54/+98
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qhash.h src/gui/kernel/qevent.h src/widgets/kernel/qshortcut.cpp src/widgets/kernel/qshortcut.h Change-Id: If61c206ee43ad1d97f5b07f58ac93c4583ce5620
| * | Avoid initializing QFlags with 0 or nullptr in further casesFriedemann Kleint2019-11-223-24/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | Amends qtbase/af2daafde72db02454d24b7d691aa6861525ab99. Where applicable, port over to member initialization, thus also fixing nullptr warnings. Change-Id: Iaaf2dbbbcf2952253390b8839fd15a1b17be32c0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * | Deprecate constructing QFlags from a pointerAllan Sandfeld Jensen2019-11-208-17/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | This was used to support QFlags f = 0 initialization, but with 0 used as a pointer literal now considered bad form, it had been changed many places to QFlags f = nullptr, which is meaningless and confusing. Change-Id: I4bc592151c255dc5cab1a232615caecc520f02e8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Fix kerning with fractional pixel sizeEskil Abrahamsen Blomfeldt2019-11-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since most of our APIs for pixel size are integer-based, we would assume it was when passing it to Harfbuzz. But QRawFont (and the internal APIs in Qt and Harfbuzz) support floating point pixel sizes. The result would be that setting e.g. pixel size 20.25 would give the same glyph positions as 20.75, but the glyphs would be some fraction of a pixel larger. Using floats instead should have no impact on the common case where the pixel size is an integer, but it should also enable the other case, where QRawFont is used (or potentially future APIs that do not have the integer limitation.) [ChangeLog][QtGui][Text] Fixed a problem where pixel sizes would be truncated before calculating glyph positions. Fixes: QTBUG-67091 Change-Id: Ib066b1330ddcf52d4b344412e350aa9a60c847ff Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
| * | Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"Qt Forward Merge Bot2019-11-151-0/+4
| |\ \
| | * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-11-151-0/+4
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/rhi/qshader.cpp tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp Change-Id: I1c4ae718eb3592a0a0a90af9d11553f3ab68cad5
| | | * Use default QTD font size for mono font when importing markdownEike Ziller2019-11-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QFontDatabase::systemFont(FixedFont) determines the font for inline code and code blocks in a markdown document. Now we change the size of that font to the same size as QTextDocument::defaultFont() so that the user has the ability to customize the font size in each document instead of only system-wide. Change-Id: Ief7367336f7613e88695dbb08bcb7e9f50db8961 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * | | QStyleSheetStyle: add new property to QPushButton: iconRichard Moe Gustavsen2019-11-142-0/+34
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is currently no proper way to change the icon of a pushbutton from css. But there is a need for doing so (QTBUG-2982), and the typical work-around is to instead use the css property 'qproperty-icon'. But setting qproperties from the style is not a good idea in the first place, since it modifies the state of the widget it draws. Moreover, such properties are only set once (in QStyle::polish()), and will not have any effect on pseudo states, like hover. To close this gap, this patch will add a css property 'icon' that can be set on a QPushButton. This property will follow normal css cascading, and respect pseudo states, equal to any other css property. [ChangeLog][QtWidgets][QStyle] You can now set the CSS property 'icon' on a QPushButton to override which icon to draw. Fixes: QTBUG-79137 Change-Id: Ie7e0b0fa4f19471f51108cd4ca931356219d562e Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-11-084-9/+28
| |\| | | | | | | | | | Change-Id: I963b5f48b5d6f3500ca379fbd7f1a4290b570175
| | * Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-11-062-2/+8
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf mkspecs/features/mac/default_post.prf src/corelib/tools/qsimd_p.h src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm util/qfloat16-tables/gen_qfloat16_tables.cpp Change-Id: If48fa8a3bc3c983706b609a6d3822cb67c1352a4
| | | * If only family is set, prefer that in the families list after resolvingAndy Shaw2019-11-051-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a font with only a family set is resolved with one that has been setup with setFamilies() then the family needs to be prepended to the families list after resolving. This is so that the font still prefers the one set as just a family with no famillies set. This also amends the QFontDialog test to account for this too. [ChangeLog][QtGui][Text] Resolving a font that just has a family set with families set will prepend the family to the families so that it is still the first preference for the font. Task-number: QTBUG-46322 Change-Id: Icc4005732f95b2b4c684e592b06b31e133270e44 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| | | * QFontDatabase: improve logging outputMitch Curtis2019-10-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * | QTextMarkdownWriter: preserve empty listsv5.14.0-beta3Shawn Rutledge2019-11-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | You can save a "skeletal" document with list items to fill in later, the same as you can do in HTML or ODF format. Reading them back via QTextDocument::fromMarkdown() isn't always perfect though. Fixes: QTBUG-79217 Change-Id: Iacdb3e6792250ebdead05f314c9e3d00546eeb9f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| | * | Avoid crashing when the end of an empty markdown list is detectedShawn Rutledge2019-11-051-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The markdown parser generates empty lists in some cases when a character that can be used as a bullet is found on a line by itself. cbEnterBlock() and cbLeaveBlock() are called symmetrically in such cases. QStack::pop() on an empty stack triggers an assert, so push and pop need to be done symmetrically too. But it's difficult to actually create the list as soon as the MD_BLOCK_UL or MD_BLOCK_OL callback occurs, without breaking the case fixed in 7224d0e427d71e559b928c44634839b4791c1416 (and probably other cases). That's because QTextCursor::insertList() creates a list item at the same time as it creates the list itself, and also inherits block formatting from the previous block. We now insert empty lists with empty items whenever the need for that is detected though, and there's a failsafe to prevent popping in case something still goes wrong with that logic. We aren't strict about reproducing the original markdown when regenerating it via toMarkdown(), but it's getting closer. Fixes: QTBUG-78870 Change-Id: Ided194ce7aec2710c60dbac42761ee4169ed9b78 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Robert Loehning <robert.loehning@qt.io>
* | | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-11-011-2/+15
|\| | | | | | | | | | | | | | | Change-Id: I68a6ed3184e62fa89c47c564bb01002c0918d0fd
| * | | Update UCD data to Unicode 12.1.0's Revision 24Edward Welbourne2019-10-301-2/+15
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Had to teach the update program to accept category Lm as for Joining_Transparent, for the sake of a new ArabicShaping.txt entry. Added three new Unicode versions, several new scripts and a new word-break class. Updated UCD's test data for tst_QTextBoundaryFinder. This left 57 tests failing; I have commented out the data rows for those tests, pending someone with more knowledge addressing this. Task-number: QTBUG-79631 Task-number: QTBUG-79418 Change-Id: Ic33d3b3551195d47a84d98e84020f57a68f0b201 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | | Replace Q_ALIGNOF usage in qtbase with C++11 alignof keywordVolker Hilsheimer2019-10-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The macro is not documented, so not part of the public Qt API. It is made obsolete by the alignof keyword in C++11. Remove the usage of the macro across qtbase, in particular the workarounds for compilers that didn't support alignof, and that will not be supported in Qt 6. The macro definition is left in place, no need to break existing code. Task-number: QTBUG-76414 Change-Id: I1cfedcd4dd748128696cdfb546d97aae4f98c3da Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-10-276-20/+42
|\| | | | | | | | | | | Change-Id: I182a639748760393f9e6b0724259201588aeaae3
| * | QFontDatabase: Delete redundant semicolonsJüri Valdmann2019-10-252-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | There are too many semicolons. Delete some. Fixes two warnings from Clang 9.0.1. Change-Id: I363a6a2de9c075c03da62c58ad46828c04a95440 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * | Enforce QTextDocument::MarkdownFeature compatibility at compile timeShawn Rutledge2019-10-244-18/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We use md4c for parsing markdown. It provides flags to control the feature set that will be supported when parsing particular documents. QTextMarkdownImporter::Feature is a fine-grained set of flags that exactly match the md4c feature flags that we support in Qt so far. QTextMarkdownImporter is a private exported class (new in 5.14). We don't expect the corresponding flags in md4c to change in incompatible ways in the future: the md4c authors have as much respect for avoiding compatibility issues as we do, and likely will only add features, not remove them. We now enforce QTextMarkdownImporter::Features compatibility with QTextDocument::MarkdownFeatures by setting them directly. We check QTextMarkdownImporter::Features compatibility with md4c's #define'd feature flags using static asserts, so that any hypothetical incompatibility would be detected at compile time. The enum conversion from QTextDocument::MarkdownFeatures to QTextMarkdownImporter::Features is moved to a new QTextMarkdownImporter constructor; thus the conversions from QTextDocument::MarkdownFeatures to QTextMarkdownImporter::Features, and then to unsigned (in QTextMarkdownImporter::import()) are adjacent in the same private class implementation. If incompatibility ever occurred, we would need to replace one or both of those with another suitable conversion function. Change-Id: I0bf8a21eb7559df1d38406b948ef657f9060c67b Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-10-262-19/+13
|\| | | | | | | | | | | Change-Id: I379794a01cbf6fb39d94b24cc8c90b1971a212b9
| * | Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-10-241-2/+6
| |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qstandardpaths_unix.cpp src/corelib/tools/qsharedpointer_impl.h tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp Change-Id: Iae95c5778dc091058f16f6db76f04a0178a9e809
| | * Fix cursor not showing in empty block preceding a tableKari Hormi2019-10-141-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | Remove mapping from CJK/Latin to Common script in Harfbuzz NGEskil Abrahamsen Blomfeldt2019-10-211-17/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original commit message says this is to ensure compatibility with the old Harfbuzz, but since OpenType features such as kerning are often matched based on the writing system of the glyphs, it will break kerning (and other OpenType features) for text in these languages in some fonts. Even font that were successfully kerned by the old Harfbuzz are broken. To avoid regressing on finding cursor positions inside ligatures, we need to amend 9f837af9458ea4825b9a8061de444f62d8a7a048. This would enable cursor positions inside ligatures for languages where they are only used for cosmetic purposes, and this was generalized to Common and Greek at the time. This now has to be expanded to include all the writing systems that were previously covered by "Common". [ChangeLog][Text] Fixed kerning error with certain fonts. Fixes: QTBUG-77908 Change-Id: Id261fef05f86841b1533b7d87207c3d17e01e96e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-10-147-11/+11
|\| | | | | | | | | | | Change-Id: I129dd579f92cb2592a38ca043472b45cb926ae12
| * | Make QTextBlockFormat::MarkerType an enum classShawn Rutledge2019-10-106-10/+10
| | | | | | | | | | | | | | | | | | | | | This came up during API review. Change-Id: I9198e1eb96db0c21e46a226a032919bb62d3ca66 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
| * | Merge remote-tracking branch 'origin/5.13' into 5.14Liang Qi2019-10-101-1/+1
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/xcb/qxcbscreen.h src/src.pro Change-Id: I4e1981e69a1ddcbe4078ec6ab2a64b0da6a445de
| | * Fix warning about out of bounds access in QString::operator[]Lars Knoll2019-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fixes runtime warnings that got triggered by change c2d2757bccc68e1b981df059786c2e76f2969530. Change-Id: I50620b179de8608f45d6f2ef053eeb8b1e10ae43 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-10-103-4/+3
|\| | | | | | | | | | | Change-Id: Iab9b3a7d004a2e4b4de816f4a2d7ed2fb936d3ae
| * | CoreText: Warn the user when family alias lookup slows down the applicationTor Arne Vestbø2019-10-082-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the user specifies a font family in their application that doesn't exist in the system, or one that uses the localized family name, we will end up resolving the family alias for all fonts in the system, which typically adds 600-800ms of startup time. Let the user know when this happens. Change-Id: Id8d6f55028e37f681ec4a686df25d33240b5a30f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| * | Fix double free when debug printing QFont with non-default verbosityTor Arne Vestbø2019-10-081-2/+1
| | | | | | | | | | | | | | | | | | Change-Id: Ieb7fa19e8bdd98f5283f7f6d8751e6532c8e0fc4 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-10-062-0/+30
|\| | | | | | | | | | | Change-Id: Ife31dad3c8dc43c5ff4d266e6d646230c5d20a50
| * | Fix build with QT_NO_CSSPARSER / -no-feature-cssparserNils Jeisecke2019-10-042-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | Some parts of the new QTextDocument table border logic depend on the QCss namespace which is not available with -no-feature-cssparser. Change-Id: Ib8396894dc35872f22c634e1d6c38968d3dd4756 Reviewed-by: Timo Aarnipuro <timo.aarnipuro@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Get rid of QList forward declarationsLars Knoll2019-10-042-3/+0
|/ / | | | | | | | | | | | | | | Include qcontainerfwd.h instead where required. This prepares for unifying QList and QVector. Change-Id: I6c85e2bdd44fb41aedd884b0d551f682760df5b5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.13' into 5.14Liang Qi2019-09-301-5/+6
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qrandom.cpp src/corelib/io/qfileinfo.cpp src/corelib/kernel/qeventdispatcher_win.cpp src/corelib/kernel/qeventdispatcher_win_p.h src/gui/text/qfontdatabase.cpp src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm src/plugins/platforms/windows/qwindowsglcontext.cpp src/testlib/qtestcase.cpp Done-With: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Done-With: Edward Welbourne <edward.welbourne@qt.io> Change-Id: I4893212471aa24be804c989a581810e2f714545c
| * iOS: Fix fallback fonts on iOS 13+Eskil Abrahamsen Blomfeldt2019-09-261-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 922d195020d54d7e599d135f6a5e0338100e08f1, 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>
| * Ensure that QFont::fromString() doesn't parse empty font specificationsShawn Rutledge2019-09-241-5/+6
| | | | | | | | | | | | | | | | 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>
* | QTextDocument: Fix device scaling for QTextFrameFormat margins, padding and ↵Nils Jeisecke2019-09-172-16/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | border Those values must be scaled to device coordinates - otherwise borders, margins etc. will be too small when rendered on high dpi devices (printers etc.). This change will add the scaling to those values. QTextDocument::print applies 2cm margins to the root frame of a unpaginated QTextDocument. Those margins were previously scaled to device coordinates in order to give the correct result. But because scaling is now done inside QTextDocumentLayout that scaling must be removed and pixel values based on qt_defaultDpi are provided instead. Fixes: QTBUG-78318 Change-Id: I6fe6dcc25f846341f6a2fe5df2f54baea473fdfd Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Fix qdoc warningsFriedemann Kleint2019-09-102-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | src/corelib/global/qnamespace.qdoc:3279: (qdoc) warning: Can't link to 'QGuiApplication::setHighDdpiScaleFactorRoundingPolicy()' src/corelib/time/qislamiccivilcalendar.cpp:49: (qdoc) warning: Can't link to 'QJijriCalendar' src/network/ssl/qsslsocket.cpp:1510: (qdoc) warning: Can't link to 'QSslConfiguration::defaultCaCertificates()' src/network/access/qhttp2configuration.cpp:49: (qdoc) warning: '\brief' statement does not end with a full stop. src/gui/text/qtextformat.cpp:532: (qdoc) warning: Undocumented enum item 'TableBorderCollapse' in QTextFormat::Property src/gui/text/qtextdocument.cpp:2066: (qdoc) warning: Undocumented enum item 'UnknownResource' in QTextDocument::ResourceType src/gui/kernel/qguiapplication.cpp:3500: (qdoc) warning: Undocumented parameter 'policy' in QGuiApplication::setHighDpiScaleFactorRoundingPolicy() Change-Id: I3573ef98cf9b58d16525c356270fe009fdffcf45 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into 5.14Friedemann Kleint2019-09-091-8/+7
|\| | | | | | | | | | | | | Conflicts: tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp Change-Id: Idd3ca5cb9a2b95a4c3513b2a4c8966e6f56193f1
| * Merge remote-tracking branch 'origin/5.13.1' into 5.13Qt Forward Merge Bot2019-09-051-8/+7
| |\ | | | | | | | | | Change-Id: Ic633850940bbe17dcedc1609217a052b6f81ce4b
| | * Fix crash when text contains too many directional charsv5.13.1Rainer Keller2019-08-311-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 1232205e32464d90e871f39eb1e14fcf9b78a163) Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | Merge remote-tracking branch 'origin/dev' into 5.14Liang Qi2019-08-279-51/+138
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/kernel/qwidget.cpp src/widgets/kernel/qwidget_p.h src/widgets/kernel/qwidgetrepaintmanager.cpp src/widgets/kernel/qwidgetwindow.cpp tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp Change-Id: Ifae457d0427be8e2465e474b055722e11b3b1e5c