summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextlayout.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix QTextEdit cursor rectangle vertical positioningZhang Hao2021-09-181-2/+5
| | | | | | | | | | | | | | | When there are characters with different pointsize in QScriptLine, the value of si.descent is less than sl.descent, which will cause the y value of the cursor rectangle to be too large. If si.descent is less than sl.descent, the height of the cursor rectangle is equal to base plus si.descent. Amends e99a883bd382ca950192bd66cafb2a1de6394ce7 Fixes: QTBUG-96288 Done-with: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Pick-to: 6.1 6.2 Change-Id: I4a8566b32cfa75d8ca1a584f5e8e577c5c9caf0d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix QTextFormat::FullWidthSelection for right-to-left text layoutsOliver Eftevaag2021-07-101-4/+11
| | | | | | | | | | | | | | | Using the QTextFormat::FullWidthSelection property to select a line would previously not take into account right-to-left text layouts. With this patch, the whole line should now be drawn correctly for both left-to-right, and right-to-left layouts. Pick-to: 6.2 6.1 5.15 Fixes: QTBUG-91125 Change-Id: Ide7b340cd7b4060e7c00e55e0011a86ffdfb5eb4 Done-with: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Avoid overflow in text layoutEirik Aavitsland2021-06-171-1/+2
| | | | | | | | | | Fixes oss-fuzz issue 34597. Fixes: QTBUG-94197 Pick-to: 6.2 6.1 5.15 Change-Id: Icabcd5a87b809b6a5ae0f1a696ec3b5dd906886b Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Remove Qt6 switches from QtGuiAllan Sandfeld Jensen2021-05-051-14/+0
| | | | | | | Removing now dead code Change-Id: I021539da6517fdb8443f8ae9431fc172b7910cfc Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Draw the cursor considering the descent is 0Tang Haixiang2021-04-201-3/+3
| | | | | | | | | | | | | | When the descent of the item is 0, ascent is the height of the item, base(base = si.ascent)> sl.base. At this time, sl.descent is not considered. The calculated y value may be <0. Fixes: QTBUG-86823 Fixes: QTBUG-92468 Pick-to: 5.15 6.0 6.1 Change-Id: I9cf088dec9162595e52ff72aa90ec3153a30fb72 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Assert that engine isn't nullptr before dereferencingVolker Hilsheimer2021-04-191-0/+1
| | | | | | | | | | | The engine pointer is guaranteed to be initialized in line 1838, so we can assert that the correct value is passed into the function to fix static analyzer warning 1d9b8ce922ee0891fb0d477dc17fdb8d. Change-Id: I773bbaa579afec0d7a79d4393ee66fd26ba9629b Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Add new enum value VisualTabCharacter into QCharZhang Hao2021-04-151-1/+1
| | | | | | | | | | | | | | With this enumeration value, users can get the width of the current font TAB character more conveniently In addition, added some documentation about where users may use this enumeration. Fixes: QTBUG-92205 Done-with: Volker Hilsheimer <volker.hilsheimer@qt.io> Done-with: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Change-Id: I9794b7553e9299e351f9182de02866d07a1393fc Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Avoid overflow in text layoutEirik Aavitsland2021-01-281-0/+4
| | | | | | | | | Fixes oss-fuzz issue 29313. Pick-to: 6.0 5.15 Change-Id: Idbabd162fa9e0dbce687981bdbcc75be37189a61 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Robert Löhning <robert.loehning@qt.io>
* Avoid overflowing QFixed in text layoutEirik Aavitsland2020-12-101-0/+3
| | | | | | | Pick-to: 6.0 5.15 5.12 Fixes: QTBUG-89172 Change-Id: Icb78c8eeb1dbe4c5d4c6476beebafc0115a91e8c 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>
* Doc: Fix documentation warnings for Qt GUITopi Reinio2020-08-281-0/+4
| | | | | | | | | | | | * Drop deprecation warnings for now-dropped items * Use the 'qt6' define and a new \nothing doc macro to conditionally document items on Qt 6 * Add a custom module header for docs that pulls in also Vulkan headers * Add \internal command for internal classes/functions * Move QtGUI-related code snippets from widgets to gui docs Change-Id: Ieb386b96631a49568d09059906d307c45c01d93a Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Remove "internal" parameter in QTextLine::draw()Jonas Karlsson2020-08-281-5/+10
| | | | | | | | | | The method is split up into a private and public version, where the parameter is moved into the private method. Fixes: QTBUG-84210 Change-Id: I79e9e02c9b4cc25d31db066e5a9567fdb9bc9fd0 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Allow arbitrary baseline shift in QTextCharacterFormatJordi Pujol Foyo2020-08-261-5/+15
| | | | | | | | | | | | | | | Added 6 new methods in QTextFormat and QTextDocument to allow setting/getting specific % positioning for baseline and super/ subscript. Modified QTextLayout to honor those new settings. [ChangeLog][QtGui][QTextLayout,QTextFormat,QTextDocument] Allow text layout modification based on baseline offset and super/subscript % height positioning Fixes: QTBUG-18260 Change-Id: I0796f18224aac8df6baf8359c35022fd98fe64ef Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QTextLayout: Remove deprecated methodsMarcel Krems2020-08-251-32/+0
| | | | | Change-Id: I7991428fb3526e48c0ceda0dcc46ea8a0918cb95 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Use QList instead of QVector in gui implementationJarek Kobus2020-07-071-8/+8
| | | | | | | Task-number: QTBUG-84469 Change-Id: I366e845249203d80d640355a7780ac2f91a762f1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use qsizetype in QListLars Knoll2020-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | The change creates a slight source incompatibility. The main things to take care of are * code using printf statements on list.size(). Using qsizetype in printf statements will always require a cast to work on both 32 and 64 bit. * A few places where overloads now get ambiguous. One example is QRandomGenerator::bounded() that has overloads for int, uint and double, but not int64. * Streaming list.size() to a QDataStream will change the format depending on the architecture. [ChangeLog][QtCore][QList] QList now uses qsizetype to index into elements. Change-Id: Iaff562a4d072b97f458417b670f95971bd47cbc6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix the vertical alignment of images in a text documentDominik Holland2020-06-181-3/+16
| | | | | | | | | | | Try to align with the HTML standard as much as possible. AlignBottom is now really the bottom of the line (not the text). AlignMiddle is between AlignTop and AlignBottom. Change-Id: Ia067b96209c2ab0becbff99cf15bb8ab193ee2c6 Fixes: QTBUG-84981 Pick-to: 5.15 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QtGui: fix deprecated QChar conversionsMarc Mutz2020-05-111-2/+2
| | | | | | | | | 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 <volker.hilsheimer@qt.io>
* Fix bug in QTextLayout::min/maxWidth for WrapAtWordBoundaryOrAnywhereJan Arve Sæther2020-05-051-20/+31
| | | | | | | | | | | | | | | | | | | | | | | | | In that specific wrapping mode, it will first try a normal word wrap. If it doesn't fit within the specified line width it will discard the result of that and try WrapAnywhere by calling layout_helper() recursively. The problem was that at the point it called itself again it had already adjusted eng->maxWidth: eng->maxWidth += line.textWidth; This was not restored, but carried on to the recursive call to layout_helper(), so the end result was that the maximumWidth would accumulate text widths from parts of the same line twice. Due to the same recursive behavior the minimumWidth also had a problem: It always returned the width of the widest word because it took the qMax() of the minimum widths of the two passes, (WordWrap and then WrapAnywhere) effectively making the minimum width always be the width of the widest word (even though it could wrap at finer granularity). Pick-to: 5.15 Task-number: QTBUG-77337 Change-Id: Ie7e9c17b157506352c2da38cc7f4a8dfa1283966 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devSimon Hausmann2020-03-161-13/+16
|\ | | | | | | | | | | | | Conflicts: src/corelib/kernel/qmetatype.cpp Change-Id: I88eb0d3e9c9a38abf7241a51e370c655ae74e38a
| * Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-03-111-13/+16
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/plugin/qlibrary.cpp src/corelib/plugin/qlibrary_unix.cpp src/corelib/plugin/qpluginloader.cpp Change-Id: I866feaaa2a4936ee5389679724c8471a5b4b583d
| | * Fix non-trivial soft-hyphen line breaksAllan Sandfeld Jensen2020-03-101-13/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The effect of the soft-hyphen needs to be updated once the final the break point has been found. This change cleans the logic by using two variables keeping track of soft-hyphen at current evaluated position and at last confirmed break point. Also adds tests for supression of soft-hyphens in the tight WrapAnywhere case. Fixes: QTBUG-35940 Fixes: QTBUG-44257 Change-Id: I7a89a8ef991b87691879bb7ce40cec4a3605fdd5 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | | Remove references to QTextDocumentPrivate from public APIEskil Abrahamsen Blomfeldt2020-03-041-7/+7
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <ritt.ks@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Doc/QtGui: replace some 0 with \nullptrChristian Ehrlicher2020-01-261-1/+1
| | | | | | | | | | | | | | | | | | Replace some 'is 0' or 'are 0' where 0 referes to a nullptr with 'is \nullptr' and 'are \nullptr' Change-Id: Ic18d0c8bcf64159b4c8fae8c9499839954a98884 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
* | Tidy nullptr usageAllan Sandfeld Jensen2019-12-061-4/+4
|/ | | | | | | | | | | 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.12' into devLiang Qi2019-01-041-0/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also blacklist tst_QRawFont::unsupportedWritingSystem() and tst_QGlyphRun::mixedScripts() on windows for now. Conflicts: qmake/generators/makefile.cpp src/corelib/itemmodels/qstringlistmodel.cpp src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp tests/auto/gui/text/qglyphrun/BLACKLIST tests/auto/gui/text/qrawfont/BLACKLIST Task-number: QTBUG-72836 Change-Id: I10fea1493f0ae1a5708e1e48d0a4d7d6b76258b9
| * Draw ShowTabsAndSpaces symbols with the correct fontEskil Abrahamsen Blomfeldt2019-01-031-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | We would draw the tab and space symbols without setting the correct font on the painter first. [ChangeLog][QtGui][Text] Fixed so ShowTabsAndSpaces will use the correct font. Fixes: QTBUG-62540 Change-Id: I3b7d6d317473e7aab722dafe1a128c57a830f634 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | QtGui: Remove unused brushes [-Wclazy-unused-non-trivial-variable]Sergio Martins2018-12-101-2/+0
| | | | | | | | | | | | Change-Id: If7e5340ec8acdfd70ea919286da5940db7a4def9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-11-221-3/+57
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qdir.cpp src/corelib/kernel/qtimer.cpp src/corelib/kernel/qtimer.h Done-With: Edward Welbourne <edward.welbourne@qt.io> Change-Id: I683d897760ec06593136d77955f8bc87fdef3f9f
| * Fix vertical alignment of inline imagesLars Knoll2018-11-191-3/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inline images can have 4 different alignments. Unfortunately, AlignTop and AlignBottom can only be set once we have laid out the whole line and know the total height of the line, as one could otherwise end up with lines that are too high. To fix this, position the images for these cases in a second loop after we have calculated the length of the line and the maximal image height in that line. Task-number: QTBUG-59310 Change-Id: I1fd4cd39e43a13d1967b9f5c9ce8270a99269cd9 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Fix constness of QPaintDevice argumentsLuca Beldi2018-11-191-4/+15
|/ | | | | | | | | | | | QFont, QFontMetrics, QFontMetricsF and QTextLayout constructors use only const methods of QPaintDevice so there is no reason for them to require a non-const pointer argument Fixes: QTBUG-65967 Change-Id: Ibfcdef2a25f0cd4284dad76135fc4c9bf5667d7a Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Don't position cursor inside complex graphemes when clicking outside lineEskil Abrahamsen Blomfeldt2018-06-281-2/+1
| | | | | | | | | | | | | | | | | | | | | If you clicked to the right of a text line ended with a grapheme consisting of several characters, either because it was a unicode surrogate pair or a ligature, we would always to the previous character in logical order, without checking if this was a valid cursor position. One result of this would be that hitting backspace when the cursor was positioned in an invalid position, would cause the entire contents of the document to become invalid. Instead we should search backwards for the previous grapheme boundary using QTextEngine::previousLogicalPosition(). [ChangeLog][QtGui][Text] Fixed position of text cursor set by clicking outside the bounds of a text line that ends with a surrogate pair or ligature. Task-number: QTBUG-69085 Change-Id: I7224c065f332f398bdfbb3f42b2b3ec8280c76a4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Show nbsps as a degree symbol to differeniate from normal spacesAndy Shaw2018-03-161-2/+3
| | | | | | | | | | | | | | When using QTextOption::ShowTabsAndSpaces then spaces and nbsps would appear the same. So since using the degree symbol to illustrate nbsps is an accepted standard, we use that and spaces are illustrated as before. [ChangeLog][QtGui] Display non-breaking spaces as a degree symbol when QTextOption::ShowTabsAndSpaces is used. Task-number: QTBUG-57479 Change-Id: I20c72c9e1640457c034b87587a8975cb73228803 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-03-021-1/+2
|\ | | | | | | Change-Id: I42ec9e6aafc203465cbeb88af70c7af26b7df8ed
| * Fix ligature handling in QTextLine::cursorToX()Lars Knoll2018-02-281-1/+2
| | | | | | | | | | | | | | | | | | | | If the script item is rtl, we need to subtract the offset inside the ligature again, as the full width of the ligature would have already been added in the loop before. Change-Id: I544ac6fa19484b35335767e1ba1befc3dfa07693 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | QTextEngine: micro optimize insertionPointsForLineAnton Kudryavtsev2018-02-151-4/+2
| | | | | | | | | | | | | | | | | | Don't use out param, use return by value instead. Also since we don't need CoW replace QVector with std::vector Change-Id: I5b6ea286b83e2ab959b5734cc1af31cc63c06553 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | fix selection rendering issues if rounding leads to left-out pixelsChristoph Cullmann2018-02-151-9/+5
|/ | | | | | | | | | | | instead of manual qFloor, use the toAlignedRect() function to get the minimal enclosing rectangle this will in some cases over-paint one-pixel, which is preferable to under-paint which leaves gaps inside painting text lines that can not be fixed by the user of the painting routines Task-number: QTBUG-66036 Change-Id: I8d6c2f7370e55bd544e1ff93d5c07b554b20ffeb Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Dominik Haumann <dhaumann@kde.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* doc: Add missing class qualifiers to uses of FormatRangeMartin Smith2018-01-121-2/+2
| | | | | | | | | struct FormatRange is contained in QTextLayout, so uses of it as parameters in friend functions of struct FormatRange must be qualified with QTextLayout:: Change-Id: I6d3ad3020240bff3b948fb571971694b44708c54 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Update usage of QFontMetrics::width() to new APIEskil Abrahamsen Blomfeldt2017-12-081-2/+2
| | | | | | | | | | | | | | QFontMetrics(F)::width() has been deprecated and is replaced by horizontalAdvance(). This updates all usage of it in tests and documentation. It is worth noting that many or most of the usages of QFontMetrics::width() probably intended to use boundingRect().width(), but since it currently works, I have not looked into that, just replaced the function name mechanically. Change-Id: Iec382e5bad0b50f37a6cfff841bfb46ed4d4555f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-05-291-0/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf mkspecs/common/msvc-desktop.conf mkspecs/win32-g++/qmake.conf mkspecs/win32-icc/qmake.conf src/platformsupport/fontdatabases/mac/coretext.pri src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm Change-Id: I74a6f7705c9547ed8bbac7260eb4645543e32655
| * doc: Add warning about QTextLayout::beginLayout() and clearLayout()Eskil Abrahamsen Blomfeldt2017-05-221-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If you keep around QTextLines referring to the previous contents of the layout, you can experience crashes when using these after the layout has been cleared. Since QTextLine is a value type, this is not very obvious in the API, so we should at least give a warning in the docs. Task-number: QTBUG-60804 Change-Id: I81b2b640eec5f62b0af1e878aadd9fa23654ec18 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QTextLayout optimization: avoid calling [] when at() will doDavid Faure2017-04-051-29/+29
|/ | | | | | | | The 'lines' and 'items' containers are both declared mutable, so [] detaches even in const functions. Change-Id: I29ac74302af2fab390b3cf3f9d05ea2cace6840b Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-11-171-7/+10
|\ | | | | | | | | | | | | | | Conflicts: mkspecs/features/mac/default_post.prf mkspecs/features/uikit/default_post.prf Change-Id: I2a6f783451f2ac9eb4c1a050f605435d2dacf218
| * Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-161-2/+6
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/common/linux-android.conf src/gui/opengl/qopengl.h src/network/socket/qnativesocketengine_winrt.cpp src/network/socket/qnativesocketengine_winrt_p.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/eglfs/api/qeglfsintegration.cpp src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp sync.profile Change-Id: If70aaf2c49df91157b864cf0d7d9513546c9bec4
| | * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-11-151-2/+6
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/plugins/platforms/eglfs/qeglfsintegration.cpp src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp Change-Id: Id2da7c775439adb62646d5b741ee7c638042b34b
| | | * Don't count no-break spaces as trailing spacesEskil Abrahamsen Blomfeldt2016-11-091-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No-break-spaces should not be counted in the space data, but rather be treated as any other non-breakable character. We were already taking care of this in the loop we reach if the item starts with a character which isn't whitespace, but there is a second loop for items that begin with whitespace characters. The result of this was that in certain circumstances where you gave the nbsp its own format and made the line wrap, the previous line would count an extra trailing space and it would swallow the first character in its following line. [ChangeLog][QtGui][Text] Fixed a bug where a no-break space would sometimes cause the first character of the containing line to not be displayed. Task-number: QTBUG-56714 Change-Id: Idd760a389052e6de70f6cc397122b217987fa5f2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | | Improve use of QHash to minimize double hashingAllan Sandfeld Jensen2016-11-101-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid looking up by key twice in a row in various locations, but instead using iterators and index lookup. Change-Id: I61a079115199ab9c041ad3a26d36b45ee3f775e0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | Fix possible crash in calculateRightBearingForPreviousGlyph().John Preston2016-10-101-4/+6
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LineBreakHelper saves previousGlyph for calculating right bearing of this glyph when it is needed. But between the saving of this glyph and the calculation the fontEngine can change (if we move to the different item). So we need to save the fontEngine together with the glyph and use this saved fontEngine for the saved glyph, while still using the current fontEngine for calculating right bearing of the current glyph. [ChangeLog][QtGui][QTextLine] Fixed a possible UB in the calculation of glyph right bearing when a QTextLine layout is performed. Change-Id: I14c729a1f761a45eaba85754c0b15a27faff7458 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-031-10/+9
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/3rdparty/double-conversion/include/double-conversion/utils.h src/corelib/global/qnamespace.qdoc src/corelib/tools/qsimd_p.h tests/auto/corelib/io/qfile/tst_qfile.cpp Change-Id: I3ca1007bab5355d251c13002a18e93d81c254d34
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-131-10/+9
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/unix/compile.test src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java src/testlib/qtestcase.cpp src/testlib/qtestcase.qdoc Change-Id: Ied3c471dbc9a076c8de33d673bd557e88575609d