summaryrefslogtreecommitdiffstats
path: root/src/gui
Commit message (Collapse)AuthorAgeFilesLines
* Add the include for QPointer to avoid MSVC compilation errorShawn Rutledge2020-03-031-0/+1
| | | | | | | | It has been reported that 7447e2b337f12b4d04935d0f30fc673e4327d5a0 needs amending to build on MSVC 2019, although it was OK in CI. Change-Id: Id22c2a3608529abebd66c0e8f401bc6f26f45e18 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix geometry handling for native child windowsFriedemann Kleint2020-02-282-6/+17
| | | | | | | | | | | | Don't move the native child window position for native child windows. Initial-patch-by: Błażej Szczygieł <spaz16@wp.pl> Task-number: QTBUG-82312 Fixes: QTBUG-79166 Change-Id: I117ef08da13c8e90ff60cf034126c9efdc17b836 Reviewed-by: Błażej Szczygieł <mumei6102@gmail.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* QTextMarkdownImporter: fix use after free; add fuzz-generated testsShawn Rutledge2020-02-282-3/+6
| | | | | | | | | | | | | | It was possible to end up with a dangling pointer in m_listStack. This is now avoided by using QPointer and doing nullptr checks before accessing any QTextList pointer stored there. We have 2 specimens of garbage that caused crashes before; now they don't. But only fuzz20450 triggered the dangling pointer in the list stack. The crash caused by fuzz20580 was fixed by updating md4c from upstream: 4b0fc030777cd541604f5ebaaad47a2b76d61ff9 Change-Id: I8e1eca23b281256a03aea0f55e9ae20f1bdd2a38 Reviewed-by: Robert Loehning <robert.loehning@qt.io>
* Fix a quadratic behavior in the BiDi algorithmLars Knoll2020-02-271-2/+1
| | | | | | | | Reset the lastETPosition after we changed DirET to DirEN, to avoid iterating over the same set of characters many times. Change-Id: Ib4113d0ba87ad70fc6bb386632eb094f943c080d Reviewed-by: Robert Loehning <robert.loehning@qt.io>
* Fix bounding box of zero-width entities in QFontEngineFTAllan Sandfeld Jensen2020-02-271-0/+3
| | | | | | | | | | | | Freetype can give us non empty bounds for zero-width characters, this change just makes us skip metrics of characters already found to not contribute to text advance. The coretext and windows font-engines already uses the already calculated advance. Change-Id: I82b3521a4fb92614be509be5982cd5ab9c1eb7de Fixes: QTBUG-58854 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QShaderGenerator: Allow more expressions in input nodesNicolas Guichard2020-02-201-6/+3
| | | | | | | | | | | | | | | | | | Currently QShaderGenerator will crash when encountering some expressions in input nodes. For example, this node prototype would make it crash: "VERTEX_COLOR": { "outputs": ["color", "alpha"], "rules": [ "headerSnippets": ["in vec4 vertexColor;"], "substitution": "vec3 $color = vertexColor.rgb; float $alpha = vertexColor.a;" ] } Change-Id: I37abb8099d376843a4cb13228140467dc1b8f60c Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QShaderGenerator: Don't crash when a node has multiple outputsNicolas Guichard2020-02-201-28/+39
| | | | | | | | | | | | | | | | | | | | | | It was already possible to declare a node prototype with multiple outputs, but trying to assign to all those outputs was not possible and instead resulted in a crash. It is now possible to declare nodes like this without crashing: "SEPERATE_XYZ": { "inputs": ["vector"], "outputs": ["x", "y", "z"], "rules": [ { "substitution": "float $x = $vector.x; float $y = $vector.y; float $z = $vector.z;" } ] } Change-Id: I748e77e84c9120dc688c573eee33dc13c6bfbace Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Doc: Update description of QTextDocument::characterCountPaul Wicking2020-02-201-0/+3
| | | | | | | | | | | | A QTextDocument always contains a QChar::ParagraphSeparator, so characterCount() will always return actual count + 1. The tests confirm this behavior, make it explicit in the docs. Fixes: QTBUG-80597 Change-Id: I91040fb6eb2c4fae5235458c695110f8f15bdfea Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* QShaderGraph: don't generate statements with undefined inputsNicolas Guichard2020-02-191-0/+47
| | | | | | | | | | | | | | | This fixes the shader generation for graphs like this one: Function0 ------> Output0 (with unbound input) Input ------> Function1 ------> Output1 With those graphs, createStatements will not return any statement for nodes Function0 and Output0. Change-Id: Iec32aa51623e176b03ae23e580f06d14df80a194 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix QShaderGenerator crashing when a node port name prefixed another oneNicolas Guichard2020-02-191-3/+39
| | | | | | | | | | | | | | QShaderGenerator didn't handle substitutions like `vec4 $color = mix($color1, $color2, $fac);` Note that `$color` is a prefix to `$color1` and `$color2`. For the substitution `QByteArray::replace` was used so if `$color` was handled first and replaced by `v1`, `$color1` and `$color2` were never correctly replaced and instead became `v11` and `v12` which caused a crash later on. Change-Id: Idaf800fdac468f33c323eb722701da5f8eb918d6 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Make libmd4c a private dependency of Qt GUIDmitry Shachnev2020-02-181-1/+1
| | | | | | | | | Otherwise, when Qt is built with system libmd4c, all applications using Qt GUI have to link with it, even if they do not use it. Change-Id: I662dfd4caf29bb692b62c20cef0e99148a87a99a Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* wasm: add platform qsettingsLorn Potter2020-02-181-7/+1
| | | | | | | | | | | | | | Since the backend is async, the settings will not be ready to read/write instantly as on other platforms, but only be ready after the filesystem has been synced to the sandbox. This takes at least 250 to 500 ms. The QSettings status() or isWritable() can be used to discern when the settings are ready for use. This also fixes a crash in threaded wasm Task-number: QTBUG-70002 Change-Id: I080bdb940aa8e9a126d7358b524f32477db151b6 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Fix typo in QGuiApplication's documentationYuhang Zhao2020-02-181-1/+1
| | | | | Change-Id: Ie6a05c8d71b81777ae79a5ff3db380b284d56313 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QShaderGraph: Fix statement creation for graphs with dangling branchesNicolas Guichard2020-02-171-5/+12
| | | | | | | | | | | | | | | | | | For graphs like this one: Input ----> Function1 ----> Output \ ---> Function2 (unbound output) We would have generated only 2 statements, for Function1 and Output. This change fixes this by treating Function2 like an output. Therefore it generates 4 statements: Input, Function1, Output and Function2. Change-Id: Iaada40b9b949d771806dd47efad4f7ef2a775b48 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add \since to namespace QColorConstantsFriedemann Kleint2020-02-121-0/+1
| | | | | | | Introduced by 77de5a329c98c3787725cb3c0a50d8f369b9479c. Change-Id: Ib99dd38c72a74f2ae9c0dfbcecf659fe75f9a27d Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Markdown importer: properly set hyperlinksGiuseppe D'Angelo2020-02-032-2/+78
| | | | | | | | The "title" in markdown is the tooltip, not the name attribute of a link. Also, tell the char format that it's an anchor. Change-Id: I2978848ec6705fe16376d6fe17f31007cce4b801 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Markdown importer: use Unicode decodingGiuseppe D'Angelo2020-02-031-2/+2
| | | | | | | | | | | | | | | Given we feed UTF-8 data into the importer, it must be able to cope with Unicode. Build md4c with UTF-8 support, advertise it at usage site, and change a couple of broken decodings. Driveby: the textedit example used the wrong codec to decode a Markdown file. While the Markdown spec doesn't deal with encodings, using the default one for HTML is certainly wrong. Port the loading of both markdown and plaintext to UTF-8, as that what _saving_ via QTextDocumentWriter would use by default. Change-Id: I51c6214cfe45ebfc5a67a7366f7866a5328366ec Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix 'the the' typo in commentsLinus Jahn2020-02-025-8/+8
| | | | | Change-Id: I00fcb1c2374e7ca168b6240f9d41c0323fb0867c Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Fix NEON support on Android armeabi-v7aAllan Sandfeld Jensen2020-01-302-2/+2
| | | | | | Task-number: QTBUG-81461 Change-Id: Ic3e8367aee990291fc676204b9299530953fc87a Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* Doc: Update out dated QImage::constScanLine documentationJoni Poikelin2020-01-301-1/+3
| | | | | Change-Id: I0c09a9a6168422c7e41ded289a3e5ba39b84b0ee Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Doc: Add see also link to QScreen::handle()Paul Wicking2020-01-301-0/+2
| | | | | | | | | As the method returns a pointer to a private type (QPA), add see also with link to QPA docs. Fixes: QTBUG-76978 Change-Id: If59670ca0a9a47b42b6441baa23525eb20f92979 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Don't use libpng allocated buffer to store ICC profile dataAllan Sandfeld Jensen2020-01-301-1/+1
| | | | | | | | The data becomes invalid by the next PNG read or write. Fixes: QTBUG-81671 Change-Id: I738f5c2abbeebf2c9080d64fef7e66cc082afe89 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Doc: Fix copy-paste error in QOpenGLTexture::Target docsLeena Miettinen2020-01-281-1/+3
| | | | | | | | Add a link to https://www.khronos.org/opengl/wiki/Array_Texture. Fixes: QTBUG-49802 Change-Id: Ic740dd758c41a8f3e471a503bd2d02f6d3096f50 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Merge remote-tracking branch 'origin/5.14.1' into 5.14Liang Qi2020-01-281-1/+1
|\ | | | | | | | | | | | | | | Conflicts: mkspecs/features/create_cmake.prf Done-With: Artem Pisarenko <artem.k.pisarenko@gmail.com> Change-Id: I2ecb9fdca06fe687be8ab3457a58dd81e5e81c4c
| * Merge 5.14 into 5.14.1Kari Oikarinen2020-01-156-20/+70
| |\ | | | | | | | | | Change-Id: Ie90edfd16f48e1907fd18288473ac403f62b9032
| * | Restore QHighDPIScaling::isActive() 5.13 behaviorMorten Johan Sørvig2020-01-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 5.13, isActive() would become true only if there was a scale factor >1 present. This was accidentally changed in 5.14, where isActive() becomes true whenever e.g. AA_EneableHighDpiScaling is set, no matter the actual scale factor values. Change-Id: Iacbe2010cddbc3b9015ac24004ae2fe417d4f434 Fixes: QTBUG-80967 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | Doc: Update the stylesheet reference for widgets and richtextVenugopal Shivashankar2020-01-271-1/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the Qt-specific properites to the list. Fixes: QTBUG-37938 Change-Id: I178de6cd5e17cd282a20ccee9ce8355f540c38a1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Allow benign errors when writing PNGsAllan Sandfeld Jensen2020-01-231-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise we can end up not writing anything due to recoverable libpng error reports. Change-Id: I4d4db42305482babffbe2bcf25535a35b51502a9 Fixes: QTBUG-81604 Reviewed-by: Boudewijn Rempt <boud@valdyas.org> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | | macOS: Remove doc references to the Carbon frameworkTor Arne Vestbø2020-01-221-2/+2
| | | | | | | | | | | | | | | Change-Id: I4d496acfc3d810d6334baba99cd697168bef0b75 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Doc: Add the line-height CSS property to the listVenugopal Shivashankar2020-01-211-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently, it is one of the text CSS properties that Qt supports. Fixes: QTBUG-34053 Task-number: QTBUG-34053 Change-Id: I3076ab2f51f1519f41610b1e81dfecbb8dbc0256 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | Doc: Update text that refers to deprecated member function width()Paul Wicking2020-01-171-33/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add see also links from the deprecated function to the replacement. * Change introduction text to reflect new function name rather than the old and deprecated width(). * Change see also and inline references to width(), so that they now refer to horizontalAdvance(). Task-number: QTBUG-65141 Change-Id: Iadfbc517e5df96e32058516f8795bd210cc4c5e4 Reviewed-by: Nico Vertriest <nico.vertriest@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* | | Doc: Fix qdoc compilation errors qtbaseNico Vertriest2020-01-175-6/+3
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-79824 Change-Id: I5a39525e3e735415ba96e2d585c5de754deb15de Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* | | QColor: add casts to ushortGiuseppe D'Angelo2020-01-171-4/+4
| |/ |/| | | | | | | | | | | | | Silence lossy conversion warnings on MSVC. Task-number: QTBUG-80997 Change-Id: I0e5778b9f20b599de6fc8894c4b98fbc1b1510b9 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | doc: explain QWheelEvent::angleDelta() more thoroughlyShawn Rutledge2020-01-131-9/+19
| | | | | | | | | | | | | | | | | | | | | | | | It has been a QPoint for a long time now, to support both the usual vertical mouse wheel and also the wheel tilt for horizontal scrolling, or the actual horizontal wheel if the mouse has one, or the simulation of a horizontal wheel via touchpad gestures; but the docs continued to read as if it was just one value. Task-number: QTBUG-71575 Change-Id: I3efa686ace4f09c7f237f72bf0500fbfbd3213cb Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Remove empty block at beginning of imported markdownRainer Keller2020-01-131-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | An empty QTextDocument already contains a block; so when the formatting is fully determined, if the document is still empty, then instead of inserting a new block, we can set formatting on the cursor, which affects the pre-existing block, before inserting text. This avoids leaving a blank line (the default block) above the inserted content. Fixes: QTBUG-81060 Change-Id: I14e45e300a602493aa59680417d74d4c2b25862d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Windows QPA: Update documentation on command line optionsFriedemann Kleint2020-01-101-3/+21
| | | | | | | | | | | | | | | | Sort alphabetically and add recent relevant options with version information. Change-Id: I10c8cc82ce357775ed68cb811a0c906cd38633a5 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | QInputDeviceManager: initialize device countsSamuli Piippo2020-01-091-1/+1
| | | | | | | | | | | | | | | | | | The device counts were used before they were initialized, causing problems e.g. with mouse cursor. Fixes: QTBUG-81207 Change-Id: Ic9dadcaebeb4c4a64bb506e4236d5a9260e0fdbc Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Share updates to QGuiApplicationPrivate::app_pal via helper functionTor Arne Vestbø2020-01-092-5/+16
| | | | | | | | | | Change-Id: I2f582358efaadcd33b39c52317222322c589423f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Disable support for RasterOpModes in GL paint engineJean-Michaël Celerier2020-01-091-0/+1
|/ | | | | | | | This leads to crashes for instance when displaying a text cursor in a graphics scene. Change-Id: I1b5c884ddb8325a7f5bdbc6027f0fae13f139a1c Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Restore High DPI scale factorsFriedemann Kleint2020-01-071-3/+3
| | | | | | | | | Change the default rounding policy to "Round" so that 2 is used for 150% (144DPI) on Windows, as it was in 5.13. Fixes: QTBUG-80934 Change-Id: I0cba986ce6afc9e2737c656000ad854c07844360 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QTextDocument: Set the font family to be after the families setAndy Shaw2020-01-061-4/+2
| | | | | | | | | | | | This amends a1f4321bbba2f3bff24d753ce766be738dbfa61a as the font families should take precedence over the font family set. If the font family is already included in the families then it should keep its placement. Otherwise it should be appended. Task-number: QTBUG-80475 Change-Id: I0049189c88b6879e57619815ec780960e9c0a300 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix semi-transparent text on Linux with subpixel anti-aliasingAllan Sandfeld Jensen2020-01-051-1/+5
| | | | | | | | | | | | The newly optimized rgbBlend function wasn't updated to handle SourceOver compositing when dealing with semi-transparent text color. The extra composition isn't SIMD optimized but short-cut for all opaque colors. Fixes: QTBUG-80982 Change-Id: I88c1e60fd5e80a8c7f9e6b0e7de8248c7c00ebc2 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QTextDocument: Give fontFamily() precedence over fontFamilies()Ulf Hermann2020-01-022-26/+14
| | | | | | | | | | If the singular fontFamily() is given, then this is obviously the one to be preferred over any plural fontFamilies(). Make sure it always ends up first in the list of emitted font families. Change-Id: I1e3b1ba29721c8298b1a0d4a1e1da49ba5b4e7ac Fixes: QTBUG-80475 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Don’t reset highDpicaleFactorRoundingPolicyMorten Johan Sørvig2019-12-191-2/+0
| | | | | | | | | Don’t reset highDpicaleFactorRoundingPolicy in the QGuiApplication destructior. This is a static property, independent of the application object lifetime. Change-Id: Ibf55e2a6ea1ae6429fce3f0e9d58323111aac374 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* High-DPI: restore rounding behavior on AndroidMorten Johan Sørvig2019-12-191-0/+8
| | | | | | | | | | | | | Qt 5.14 introduced QApplication::scaleFactorRoundingPolicy, where the default policy rounds the scale factor to an integer, which matches Qt's behavior on Windows and X11. However, Qt has never rounded scale factors on Android. Restore the historical behavior and document the platform difference. Change-Id: I0f8e8fb65e3874338ea290bbb12da350da22f099 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Deliver theme changes synchronouslyTor Arne Vestbø2019-12-192-2/+3
| | | | | | | | | Otherwise the expose event that AppKit triggers will be delivered before we've propagated the theme change, and we fail to draw the UI using the new theme. Change-Id: I502122a2bf02a866d136106d831f0c2a0dfe26f2 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Doc: Add since versionPaul Wicking2019-12-191-0/+2
| | | | | | | | | | for QCursor::swap and QOperatingSystemVersion::currentType. Fixes: QTBUG-80854 Fixes: QTBUG-80891 Change-Id: Ia256fa0d3ad4665f44b933f5a4a8d4ee87e9fc13 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Sync implementation of QGuiApplication and QApplication setPaletteTor Arne Vestbø2019-12-171-3/+4
| | | | | | | | | The two static setPalette methods in QApplication and QGuiApplication should have the same behavior in terms of what signals and events they emit. Change-Id: I54579d490e31f3783e2d4fea689ca799a070ff1d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Let sendApplicationPaletteChange() decide when it needs to exit earlyTor Arne Vestbø2019-12-171-2/+4
| | | | | Change-Id: I7a8e6c0b54d2a16a17b292a4102e05f743bcbe29 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Remove ApplicationResourceFlags::ApplicationPaletteExplicitlySetTor Arne Vestbø2019-12-171-4/+1
| | | | | | | | | After 8fb881900c7b it's tracked by AA_SetPalette. Since the latter is publicly observable we remove the internal flag instead. Change-Id: Ie69799f1b45d68017cb9eaab2a9986cc9ac9ca38 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>