summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextdocumentlayout.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use QPainter::brushOriginF() where appropriateChristian Ehrlicher2025-06-251-1/+1
| | | | | | | | Replace QPainter::brushOrigin() with brushOriginF() to not loose precision. Change-Id: I86f9e4c3399d32755f0b2b062ad7654149edab1b Reviewed-by: Axel Spoerl <[email protected]>
* Fix regression in drawing table cell border when border-collapse enabledSanthosh Kumar2025-06-051-1/+1
| | | | | | | | | | | | | | The patch 732962d604e7469f9a9f02fe0cd3d1fd04caddb8 enables drawing a border around cells within the table when set through CSS styling. But this caused a regression when border-collapse is enabled without setting the cell border. This patch enables drawing borders for table cells when either of those conditions is satisfied. Fixes: QTBUG-136590 Pick-to: 6.10 6.9 6.8 Change-Id: Ibf43c404439c9fee1cfd2b40789150edb76c6971 Reviewed-by: Nils Jeisecke <[email protected]> Reviewed-by: Christian Ehrlicher <[email protected]>
* QTextDocument: repair AlignBaseline for inline objectsDavid Faure2024-07-201-2/+13
| | | | | | | | | | | | | | | The code from QTBUG-14414 (Qt4 commit ee9455ed2a83084692d969c398ecb91bcd4fc33a) was removed in commit 199f9c54484b0dae3bc81f83c880a965192ecb24, due to an oversight: that commit was only about images, while there's also the case of inline objects that contain actual text. Such objects are easy to overlook because they are not provided by Qt itself. They are however common in applications that implement word-processor-looking "variables", like a place-holder for "page number", for instance). Pick-to: 6.8 6.7 Change-Id: I2ff1476583bdfe24abcc523cffb65ce116b7faf9 Reviewed-by: Axel Spoerl <[email protected]>
* Straighten out various logging categoriesUlf Hermann2024-06-191-3/+3
| | | | | | | | | | | | Either make them static or declare them in a header. We want them to be static wherever possible, in order to reduce the number of visible symbols. If they can't be static, however, they should at least be declared in only one place. Task-number: QTBUG-67692 Change-Id: I6f3b596ed4f0adc9873dd0a5f54f055a991a6207 Reviewed-by: Thiago Macieira <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]>
* Draw list bullets/numbers with CSS text color, not palette colorShawn Rutledge2024-04-191-5/+3
| | | | | | | | | | | | | | | | | | | | | When CSS has been used to customize the text color, render the bullet with the same color. This is consistent with web browsers, and with Qt Quick rendering. In QTextDocumentLayoutPrivate::drawListItem(), the pen color is the text color, so use it instead of brush color. Add a baseline test for lancelot: the background and general text are customized, then some list items are customized further, and some of them have colored text spans. Repeat with different styles of numbered and bullet lists and checklists. Fixes: QTBUG-2188 Task-number: QTBUG-213 Task-number: QTBUG-57833 Pick-to: 6.5 6.7 Change-Id: I71e84d00172e4b37aef57c8badd2ec43c10113d9 Reviewed-by: Sami Shalayel <[email protected]>
* Support rendering CSS 'border' property for html tableSanthosh Kumar2024-04-181-3/+13
| | | | | | | | | | | | We supported CSS 'border-width', 'border-style' and 'border-color' for HTML tables since 8a9bec35fb0c60a0e5990c1a12ffe6f39fdbf2d. Now we also support the 'border' property, which is shorthand to set all four borders' width, style and color. Fixes: QTBUG-123167 Pick-to: 6.7 6.6 Change-Id: I5f29b94ab9facf412a9c230d554efb5c69368b6b Reviewed-by: Shawn Rutledge <[email protected]>
* Include what you need: <QPointer>Marc Mutz2023-10-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | All these TUs relied on transitive includes of qpointer.h, maybe to a large extent via qevent.h, though, given that qevent.h is more or less the only public QtBase header that includes qpointer.h, something else seems to be at play here. Said qevent.h actually needs QPointer in-name-only, so a forward declaration would suffice. Prepare for qevent.h dropping the include. The algorithm I used was: If the TU mentions 'passiveGrabbers', the name of the QEvent function that returns QPointers, and the TU doesn't have qpointer.h included explicitly, include it. That may produce False Positives, but better safe than sorry. Otherwise, in src/, add an include to all source and header files which mention QPointer. Exception: if foo.h of a foo.cpp already includes it, don't include again. Task-number: QTBUG-117670 Change-Id: I3321cccdb41ce0ba6d8a709cea92427aba398254 Reviewed-by: Fabian Kosmale <[email protected]>
* Avoid infinite loop when loading huge filesEskil Abrahamsen Blomfeldt2023-06-081-2/+7
| | | | | | | | | | | | | | | | | | | | QTextDocumentLayout could get into an infinite loop when the contents exceeded QFIXED_MAX. Specifically, QFIXED_MAX is used as meaning "one infinite page" which means that newPage() will just return when it sees this page height. If the page actually grew larger than this, though, we would treat it as a page break and enter a loop where we try to call newPage() to create new pages and never return. The layout engine cannot support documents this large, so we detect the case and then just finish the layout loop early when it is encountered. Pick-to: 6.5 6.6 Fixes: QTBUG-112968 Change-Id: I485303d714d112119a971c43e0086bf6d3d23e9f Reviewed-by: Eirik Aavitsland <[email protected]>
* Default to WindowText color in QTextDocumentLayoutPrivate::drawBlock()Axel Spoerl2023-06-041-1/+1
| | | | | | | | | | | | | | | | | When a block is drawn in a text document, drawBlock is checking, whether the block has a BackgroundBrush property defined. If none is defined, the color used to draw lines around the block defaults to QPalette::Dark. This was implemented, assuming a light color scheme. In a dark color scheme, the lines become hardly or even not visible. This patch changes the default to Inactive/WindowText of the underlying QPalette. This provides contrast to the document's text content and is dark/light sensitive. Fixes: QTBUG-113990 Pick-to: 6.5 Change-Id: Ie855852f441a0efb11c318c7edb27395151cbcce Reviewed-by: Oliver Eftevaag <[email protected]>
* Fix build with -no-feature-cssparserTasuku Suzuki2023-01-171-0/+2
| | | | | | Pick-to: 6.5 Change-Id: I146ac61f92acdcd22c46ca27a1fca48c47817e3c Reviewed-by: Volker Hilsheimer <[email protected]>
* Fix assert when resizing text table with percentage widthsEskil Abrahamsen Blomfeldt2023-01-041-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Since Qt 6.3.x, qBound() has started asserting that max > min. This caused a crash in the QTextDocumentLayout code for assigning widths to table columns that were sized using percentages, which depended on previous qBound() behavior of just snapping to the minimum size if max < min. There are some specific conditions for this to happen: First of all, the available width in the table must be too small to fit all minimum widths (which is calculated based on content). In addition, the requested widths have to be given as percentages of the table width, and these have to add to something lower than 100%. With these conditions, you may get a case where the calculated percentage width of a column is larger than the minimum width, but lower than the remaining width in the table, causing the assert in qBound(). We simply accept the minimum width as the rule in these cases, which matches behavior without the assert and which looks correct when resizing the window to be smaller than the table. Fixes: QTBUG-108183 Pick-to: 6.4 6.5 Change-Id: I16d18dd9b2e7a77fe86d1a353b426075b5050b8e Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Lars Knoll <[email protected]>
* Long live Q_UNREACHABLE_RETURN()!Marc Mutz2022-10-151-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a combination of Q_UNREACHABLE() with a return statement. ATM, the return statement is unconditionally included. If we notice that some compilers warn about return after __builtin_unreachable(), then we can map Q_UNREACHABLE_RETURN(...) to Q_UNREACHABLE() without having to touch all the code that uses explicit Q_UNREACHABLE() + return. The fact that Boost has BOOST_UNREACHABLE_RETURN() indicates that there are compilers that complain about a lack of return after Q_UNREACHABLE (we know that MSVC, ICC, and GHS are among them), as well as compilers that complained about a return being present (Coverity). Take this opportunity to properly adapt to Coverity, by leaving out the return statement on this compiler. Apply the macro around the code base, using a clang-tidy transformer rule: const std::string unr = "unr", val = "val", ret = "ret"; auto makeUnreachableReturn = cat("Q_UNREACHABLE_RETURN(", ifBound(val, cat(node(val)), cat("")), ")"); auto ignoringSwitchCases = [](auto stmt) { return anyOf(stmt, switchCase(subStmt(stmt))); }; makeRule( stmt(ignoringSwitchCases(stmt(isExpandedFromMacro("Q_UNREACHABLE")).bind(unr)), nextStmt(returnStmt(optionally(hasReturnValue(expr().bind(val)))).bind(ret))), {changeTo(node(unr), cat(makeUnreachableReturn, ";")), // TODO: why is the ; lost w/o this? changeTo(node(ret), cat(""))}, cat("use ", makeUnreachableReturn)) ); where nextStmt() is copied from some upstream clang-tidy check's private implementation and subStmt() is a private matcher that gives access to SwitchCase's SubStmt. A.k.a. qt-use-unreachable-return. There were some false positives, suppressed them with NOLINTNEXTLINE. They're not really false positiives, it's just that Clang sees the world in one way and if conditonal compilation (#if) differs for other compilers, Clang doesn't know better. This is an artifact of matching two consecutive statements. I haven't figured out how to remove the empty line left by the deletion of the return statement, if it, indeed, was on a separate line, so post-processed the patch to remove all the lines matching ^\+ *$ from the diff: git commit -am meep git reset --hard HEAD^ git diff HEAD..HEAD@{1} | sed '/^\+ *$/d' | recountdiff - | patch -p1 [ChangeLog][QtCore][QtAssert] Added Q_UNREACHABLE_RETURN() macro. Change-Id: I9782939f16091c964f25b7826e1c0dbd13a71305 Reviewed-by: Marc Mutz <[email protected]> Reviewed-by: Thiago Macieira <[email protected]>
* Port from container.count()/length() to size()Marc Mutz2022-10-041-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is semantic patch using ClangTidyTransformator: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]>
* QTextDocumentLayout: Account for topMargin when hit-testingTang Haixiang2022-09-051-1/+1
| | | | | | | | | | | | | | When TopMargin is set in TextBlock and the mouse click position is between Margin (the mouse is not on the textrect), the cursor will usually jump to the end. So topMargin should be considered when hitTest() calculates coordinates. Fixes: QTBUG-91774 Pick-to: 6.4 6.3 6.2 Change-Id: I231377263855b9cd7152684203fc4ed2e9299bb9 Reviewed-by: Volker Hilsheimer <[email protected]> Reviewed-by: Tang Haixiang <[email protected]> Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
* Pass QFixed by valueMarc Mutz2022-07-081-2/+2
| | | | | | | | | It's a glorified int, so pass it by value instead of cref. Pick-to: 6.4 Change-Id: I1c7a37614cd0d2dac63d2d549563600d401d6dad Reviewed-by: Sérgio Martins <[email protected]> Reviewed-by: Lars Knoll <[email protected]>
* QTextDocument: add setLayoutEnabled()David Faure2022-05-261-4/+4
| | | | | | | | | | | | This allows to set up everything first - without paying for the layout calculation at every step - and only then trigger the layout once. Results: 0.065 msecs to create a QGraphicsTextItem with some text (layouted) 0.036 msecs to set everything up in a QGraphicsTextItem with 0 width Change-Id: I138bd1d58941d029bc0a36d2730216778f1fbd97 Reviewed-by: Volker Hilsheimer <[email protected]>
* Fix crash in tst_qquicktext::implicitSizeEskil Abrahamsen Blomfeldt2022-05-201-5/+5
| | | | | | | | | | | | | This reverts commit 1e938c348b936328fafbcaae4c0c7d91003143e5 and bb2f4d08d9d138e4f70d6d6db46e24e34500becc. bb2f4d08d9d causes the crash, but 1e938c348b93 amends it, so this reverts both. When the cause of the crash has been determined and mitigated, the patches can be recreated. Fixes: QTBUG-103719 Change-Id: Ifc36b3771a96f6c85387a5306a0402d4c508d006 Reviewed-by: David Faure <[email protected]>
* QTextDocument/QGraphicsTextItem: skip layout in setTextWidth(0)David Faure2022-05-171-5/+5
| | | | | | | | | | | | | | | | | | In a QGraphicsTextItem without a width yet, there's no need to do any layouting. The use case is obviously items with an app-defined size, not the default where text items adapt to their contents. Results: 0.065 msecs to create a QGraphicsTextItem with some text (layouted) 0.036 msecs to set everything up in a QGraphicsTextItem with 0 width QTextEdit was abusing the width 0 to mean "no wrap, width comes from contents", but since the value -1 means that already in QTextDocument, QTextEdit now uses a width of -1 for that meaning. Change-Id: I67ad59c305e5dd34830886e4e6c56dde03c93668 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Lars Knoll <[email protected]> Reviewed-by: Jörg Bornemann <[email protected]>
* QtGui: stop using QLatin1Char constructor for creating char literalsSona Kurazyan2022-04-131-1/+1
| | | | | | | | | Required for porting away from QLatin1Char/QLatin1String in scope of QTBUG-98434. Change-Id: I308d86cefcbfd126929b68f9a853d420840c965f Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Marc Mutz <[email protected]>
* Use block char format to render list item bullets and numbersAlbert Astals Cid2022-01-051-1/+1
| | | | | | | | | | | | | It needs to be rendered with the format of the block not the format of the first letter of the block; otherwise if the first letter is black or italics or something, but the rest of the block isn't, the list item text looks out of place. Task-number: QTBUG-3583 Fixes: QTBUG-99148 Pick-to: 6.3 6.2 5.15 Change-Id: I63d8d6d6b7cee6bd9938fe1cf42a5f90da1bc0d3 Reviewed-by: Shawn Rutledge <[email protected]>
* Fix qtdeclarative baseline test failure for text tablesVolker Hilsheimer2021-12-061-3/+3
| | | | | | | | | | | | | | Amend 97cfd4940157817dd761fd02f2e6da4afc5b4a30, which resulted in incorrectly laid out tables in Text elements. Reported by the baseline test for the scenegraph. Not reproducible using a QtWidget text widget, so no unit-test added here. Pick-to: 6.2 5.15 Task-number: QTBUG-86671 Task-number: QTBUG-97463 Change-Id: I607b1fea3fb5923f81f05a3646bafebec3dcf3b5 Reviewed-by: Eirik Aavitsland <[email protected]>
* Don't let text table cells shrink below their minimum widthVolker Hilsheimer2021-12-021-0/+1
| | | | | | | | | | | | | | We calculate the minimum width, but then use it only to make sure that the maximum width is at least as large as it. Without setting the layout struct's minimumWidth as well, table cells can be smaller. Add a test case. Fixes: QTBUG-86671 Fixes: QTBUG-97463 Pick-to: 6.2 5.15 Change-Id: Idf4ad015938abb8d3e599e9a58e002f29c0067be Reviewed-by: Allan Sandfeld Jensen <[email protected]>
* Don't shrink a column when it spans multiple columnsVolker Hilsheimer2021-12-011-0/+2
| | | | | | | | | | | | | | | | | | If a cell spans multiple columns, then the merged cells' starting column's maximum width should never become smaller than what was calculated from previous rows. Otherwise, we'd distribute the space of the column that has a span across all merged columns, resulting in unnecessary line breaks esp if WrapAnywhere is enabled. Add a test case. Fixes: QTBUG-91691 Fixes: QTBUG-95240 Pick-to: 6.2 5.15 Change-Id: Ic27dbdb128071e50fba049de85c9f23ba2f059b3 Reviewed-by: Eirik Aavitsland <[email protected]>
* Support background-color CSS styling on <hr/>Shawn Rutledge2021-10-141-2/+7
| | | | | | | | | [ChangeLog][QtGui][CSS] The background-color style can now be applied to <hr/> to set the rule color. Task-number: QTBUG-74342 Change-Id: Ib960ce4d38caa225f258b6d228fb794cef43e1b7 Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
* gui: Fix typos in source code commentsJonas Kvinge2021-10-121-1/+1
| | | | | | Pick-to: 5.15 6.2 Change-Id: Ie53e5542a8f93856470982939ecd8ec90b323d69 Reviewed-by: Eirik Aavitsland <[email protected]>
* QTextDocumentLayout: remove multiple calls to lineHeightTypeWaqar Ahmed2021-09-161-5/+7
| | | | | | | | | | Get LineHeightType once and reuse the value. There still are 2 calls to lineHeightType from inside the QTextBlockFormat::lineHeight but leaving them cause they need a bigger change. Change-Id: I4016a5e483a0358d43f73d174a74545d4f3be338 Reviewed-by: Konstantin Ritt <[email protected]> Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
* Fix rendering of text checkboxes when text is selectedShawn Rutledge2021-06-161-4/+8
| | | | | | | Fixes: QTBUG-94532 Pick-to: 5.15 6.1 6.2 Change-Id: I4343558dcec6149dcdcc0f7ca32c49fdc67452af Reviewed-by: Volker Hilsheimer <[email protected]>
* 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 Pick-to: 5.15 Pick-to: 6.0 Change-Id: Ie450332f06ee40e60c8e4c6c7d10834bff1acf74 Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
* Use (new) erase()/erase_if() algorithmsMarc Mutz2020-12-051-5/+1
| | | | | Change-Id: I45c18fd45c20b226e44d16315e3ebb6c305d4ab0 Reviewed-by: Thiago Macieira <[email protected]>
* QTextDocument: allow css border-style of table collapsed cell bordersChristian Ehrlicher2020-11-261-1/+1
| | | | | | | | | | | | 8664ee610d3d8bb8a2a578a6aa6bfd38afe4fcda added support for collapsed borders but set the style to solid no matter what border-style defined. Fix it by properly setting the desired border style. Task-number: QTBUG-36152 Change-Id: Ie527511f831e7f62ab7064d4958b35ddbf1a9403 Pick-to: 5.12 Reviewed-by: Nils Jeisecke <[email protected]> Reviewed-by: Samuel Gaist <[email protected]>
* Adjust code format, add space after 'if'Zhang Sheng2020-11-161-2/+2
| | | | | | Change-Id: Ice081c891ff7f4b766f49dd4bd5cf18c30237acf Reviewed-by: Allan Sandfeld Jensen <[email protected]> Reviewed-by: hjk <[email protected]>
* Another round of 0->nullptr cleanupAllan Sandfeld Jensen2020-07-311-1/+1
| | | | | Change-Id: Ic8db7dc252f8fea46eb5a4f334726d6c7f4645a6 Reviewed-by: Sona Kurazyan <[email protected]>
* Use QList instead of QVector in gui implementationJarek Kobus2020-07-071-19/+19
| | | | | | | Task-number: QTBUG-84469 Change-Id: I366e845249203d80d640355a7780ac2f91a762f1 Reviewed-by: Tor Arne Vestbø <[email protected]> Reviewed-by: Friedemann Kleint <[email protected]>
* Merge remote-tracking branch 'origin/5.15' into devLiang Qi2020-05-181-2/+5
|\ | | | | | | | | | | | | Conflicts: src/corelib/text/qbytearray.cpp Change-Id: I63706409464d31391012bacdadfd1f6300509787
| * Fix invalid text layout data when a full layout run is interruptedStefan Löffler2020-05-141-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a QTextDocument is laid out, this is done in "chunks" to keep programs responsive. During the layout process, blocks are split into lines. When a full (re)layout is interrupted (e.g. because a QHighlighter changes some formats before the layout for all chunks is completed), later chunks are skipped. This results in invalid data (e.g., blocks not split into lines). This change ensures that full layout runs of the root frame are completed even after interruptions. Fixes: QTBUG-20354 Change-Id: I041c73a532a5abe74d577ca49810191b5594dca2 Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
* | QtGui: fix deprecated QChar conversionsMarc Mutz2020-05-111-1/+1
| | | | | | | | | | | | | | | | | | Conversions from non-char-types to QChar are going to be deprecated. Use QChar::fromUcs2(), fromUcs4(), QLatin1Char(), or convert the constructor argument to char16_t. Change-Id: Ib45ebd5560aa3a2bc460037ab09773607485c6e2 Reviewed-by: Volker Hilsheimer <[email protected]>
* | Remove references to QTextDocumentPrivate from public APIEskil Abrahamsen Blomfeldt2020-03-041-2/+2
|/ | | | | | | | | | | | | | | The private object of QTextDocument has been exposed through public APIs marked internal, which we should avoid as much as possible, since it clutters the headers. For accessing private data without adding friends, we have a nice pattern of adding a static get() function to the private class itself. Fixes: QTBUG-55059 Change-Id: I03e949a677e03487e95f24e3608a06aa0a3511ab Reviewed-by: Konstantin Ritt <[email protected]> Reviewed-by: Simon Hausmann <[email protected]>
* Replace most use of QVariant::type and occurrences of QVariant::TypeOlivier Goffart2020-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | I made a clazy automated check that replaced the use of QVariant::Type by the equivalent in QMetaType. This has been deprecated since Qt 5.0, but many uses were not yet removed. In addition, there was some manual changes to fix the compilation errors. Adapted the Private API of QDateTimeParser and QMimeDataPrivate and adjust QDateTimeEdit and QSpinBox. QVariant(QVariant::Invalid) in qstylesheet made no sense. But note that in QVariant::save, we actually wanted to use the non-user type. In the SQL module, many changes were actually reverted because the API still expects QVarient::Type. Change-Id: I98c368490e4ee465ed3a3b63bda8b8eaa50ea67e Reviewed-by: Lars Knoll <[email protected]>
* Tidy nullptr usageAllan Sandfeld Jensen2019-12-061-12/+12
| | | | | | | | | | | 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 <[email protected]> Reviewed-by: Lars Knoll <[email protected]>
* 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 <[email protected]> Reviewed-by: Ville Voutilainen <[email protected]>
* | Make QTextBlockFormat::MarkerType an enum classShawn Rutledge2019-10-101-2/+2
| | | | | | | | | | | | | | This came up during API review. Change-Id: I9198e1eb96db0c21e46a226a032919bb62d3ca66 Reviewed-by: Giuseppe D'Angelo <[email protected]>
* | Fix build with QT_NO_CSSPARSER / -no-feature-cssparserNils Jeisecke2019-10-041-0/+28
| | | | | | | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Shawn Rutledge <[email protected]>
* | QTextDocument: Fix device scaling for QTextFrameFormat margins, padding and ↵Nils Jeisecke2019-09-171-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <[email protected]>
* | QTextDocument: allow css-styling of table cell bordersNils Jeisecke2019-08-081-58/+815
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows to set the width, style and color of each table cell's edge (left, right, top, bottom). Setting the table's border-collapse mode will disable explicit cell spacing. The basic CSS border collision rules are applied (wider border wins, vertical over horizontal). Setting the table's border width to a value >= 1 and enabling borderCollapse will now draw a simple and clean table grid (1px) with an outer border of the specified width and color. [ChangeLog][QtGui][QTextDocument] Added CSS style table cell border formatting with border-collapse mode. Change-Id: I324d82284802df4c88c13c5b902fec1f4768b67e Fixes: QTBUG-36152 Reviewed-by: Shawn Rutledge <[email protected]>
* | QTextDocumentLayout: Refactor pagination logic for bordersNils Jeisecke2019-08-081-12/+40
| | | | | | | | | | | | | | | | | | | | | | The new helper class BorderPaginator encapsulates the existing pagination logic for drawing correctly clipped borders on all pages a cell appears on. This will allow reuse of that logic for drawing CSS-style borders. Change-Id: I47ed4a8802513aef30d97f14591c7d4716bfdbb8 Reviewed-by: Shawn Rutledge <[email protected]>
* | QTextDocumentLayout: Fix regression in table column width calculationNils Jeisecke2019-08-071-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | 87748cc18e6a0d9e65933aa2462dc78ab8f9f22e introduces rounding of column widths to avoid table border render artifacts. For variable columns we must make sure that the maxWidth (= unwrapped content width) is not rounded down as this can cause erroneous wrapping of the content at rendering time. Fixes: QTBUG-43589 Change-Id: Iee155702a12374116a63050e5025df91f097a8e4 Reviewed-by: Shawn Rutledge <[email protected]>
* | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-06-141-2/+8
|\| | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/makefile.cpp qmake/generators/unix/unixmake2.cpp src/corelib/thread/qthread_unix.cpp tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp Change-Id: I1df0d4ba20685de7f9300bf07458c13376493408
| * Fix printing of table headers in multi-frame QTextDocumentsEirik Aavitsland2019-04-111-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | 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 <[email protected]>