summaryrefslogtreecommitdiffstats
path: root/src/gui
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Fix punctation in QPdfWriter::addFileAttachmentKai Koehne2020-02-281-1/+1
| | | | | Change-Id: Ic00ffd88ecbaa88409bf968f6794fad6f53a2f0e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.14' into 5.15Lars Knoll2020-02-272-2/+4
|\ | | | | | | Change-Id: I4212d070d5752275085e754b96f0392113604dba
| * 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>
* | QScreen::virtualSiblingAt(): pass QPoint by valueShawn Rutledge2020-02-262-2/+2
| | | | | | | | | | | | | | It's too small to bother with passing by reference. Change-Id: I793678f5ae352b7f24d2c7e758dc75827c2190df Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | Add replacement message to deprecation of QImage::alphaChannel()Allan Sandfeld Jensen2020-02-251-1/+2
| | | | | | | | | | Change-Id: I1d8afecc6da5df6fef72ecc59d14ac455c43d9a6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-02-222-28/+39
|\| | | | | | | Change-Id: Iace12004afdfe765a3068dfcf6f1320c1123c539
| * 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>
* | rhi: Allow querying the native buffer objects behind a QRhiBufferLaszlo Agocs2020-02-2110-0/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | Modeled after QRhiTexture's NativeTexture query. This becomes valuable in advanced cases of integrating external native rendering code with Qt Quick(3D), because it allows using (typically vertex and index) buffers created by Quick(3D) in the custom renderer as well, without having to duplicate the content by manually creating native buffers with the same vertex and index data. Change-Id: I659193345fa1dfe6221b898043f0b75ba649d296 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | rhi: Do not rely on unspecified relation between readbacks and FramesInFlightLaszlo Agocs2020-02-217-17/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new queriable resource limit value MaxAsyncReadbackFrames. Change the autotest to rely on this instead of relying on the unspecified, works-by-accident relation between readbacks and FramesInFlight. This way even if the behavior diverges in some backend in the future, clients (well written ones, that is), will continue to function correctly. Also clarify the docs for FramesInFlight, and change d3d and gl to return the correct value (which is 1 from QRhi perspective; the expanded docs now explain a bit what this really means and what it does not). Change-Id: I0486715570a9e6fc5d3dc431694d1712875dfe01 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Friedemann Kleint2020-02-203-4/+87
|\| | | | | | | Change-Id: Ide8768d0d95aaeec943658aea27a03737d7dbf3f
| * 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>
* | Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"Liang Qi2020-02-183-6/+14
|\ \
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Liang Qi2020-02-183-6/+14
| |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qlinkedlist.h src/plugins/platforms/wasm/qwasmintegration.cpp src/plugins/platforms/wasm/qwasmscreen.cpp Change-Id: Iefca7f9f4966bdc20e7052aca736874861055738
| | * 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>
* | | Send the LanguageChange event to all top level windows, not just widgetsAndy Shaw2020-02-181-0/+4
|/ / | | | | | | | | | | | | | | | | | | | | By sending it to all top level windows it will make it possible for non widget based controls to listen for this event if it cares about it so it can handle translation updates as appropriate. Task-number: QTBUG-78141 Task-number: QTBUG-82020 Change-Id: I8f35cdcccd81a199ff780c3f4f3d2c663480d638 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Parse grayscale ICC profilesAllan Sandfeld Jensen2020-02-171-35/+81
| | | | | | | | | | | | | | | | | | Parse them into color profiles, they are a simple subset with just a single TRC and a whitepoint. Change-Id: I300537d488feb3e907a1acff928b2519ffa75088 Fixes: QTBUG-81830 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | Deprecate QTabletEvent::device() in favor of deviceType()Shawn Rutledge2020-02-172-1/+9
| | | | | | | | | | | | | | | | | | The idea is to reserve device() to return a pointer to a QInputDevice in the future, which is in sync with QQuickPointerEvent::device() and with QTouchEvent::device(). Change-Id: Ifda6e8aea72d5121955b31bdcbd91bf1bfa4cec4 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Mark missing deprecation in QTabletEventAllan Sandfeld Jensen2020-02-142-0/+15
| | | | | | | | | | | | | | | | One constructor deprecated since 5.4, and two convenience variants of a method deprecated in 5.0. Change-Id: Ib1bba9ad529b3065461b86f80c9ec8dfc95f9ae1 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Avoid dangling QGuiApplicationPrivate pointerEirik Aavitsland2020-02-131-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The static self pointer of QGuiApplicationPrivate was not reset at destruction (in constrast to the corresponding QGuiApplication::self). This could cause crashes when calling Qt API after QGuiApplication destruction. Fixing this revealed an issue with QGuiApplication::font(), which would assert QGuiApplicationPrivate::self. But the QApplication autotest actually calls this function with no QApplication instance. That autotest passes only coincidentally, since another QApplication instance has been created and deleted already, and the dangling self pointer of that instance was never reset. To improve the robustness of the api, replace the assert/crash with just a warning and return an "empty" QFont. (The assert was added for 5.0 for QTBUG-28306 in order to give a nicer warning when mixing QWidget and QtCore/GuiApplication. However it never got that effect in practice, since that issue was fixed at the same time by another, better patch for the duplicate bug QTBUG-28076). Fixes: QTBUG-81954 Change-Id: I3fa6cad1625a3e70631b5170d53119d63492b534 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | rhi: Allow detecting texelFetch supportLaszlo Agocs2020-02-137-2/+20
| | | | | | | | | | Change-Id: I166c89af99e1289ae60febf2f41fab07eab9f7e8 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | a11y: Remove a ### Qt6 that doesn't make much senseJan Arve Sæther2020-02-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the enum names are "the same", the comment seems to suggest to change the enum value of Canvas to 0x401. I don't see any benefit to that really. In addition, we are today using UIA in favor of MSAA, and the closest matching role (controlTypeId) seems to be for a static image (UIA_ImageControlTypeId), which is quite different from the semantic of IA2_ROLE_CANVAS. For the record, here's a list of similar roles for different a11y APIs: IA2: IA2_ROLE_CANVAS An object that can be drawn into and to manage events from the objects drawn into it. Also refer to IA2_ROLE_FRAME, IA2_ROLE_GLASS_PANE, and IA2_ROLE_LAYERED_PANE. MSAA: ROLE_SYSTEM_DIAGRAM The object represents a graphical image that is used to diagram data. UIA: UIA_ImageControlTypeId Identifies the _Image_ control type. atspi: ATSPI_ROLE_CANVAS Object that can be drawn into and is used to trap events. Change-Id: Ic2ead0dc40be0ae2e798f49285eb6a392cc29142 Reviewed-by: André de la Rocha <andre.rocha@qt.io>
* | rhi: vulkan: Fix descriptor update with more objects involvedLaszlo Agocs2020-02-101-7/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Once the number of buffers or images exceeds the QVarLengthArray limit, it moves over to heap-based allocation, and then reallocated to grow as needed. Problem is, if we keep references to the elements, those may get invalidated on every grow. This was not an issue until the element count reached the preallocated (stack) count. So instead, store indices and fill in the pointers in the VkWriteDescriptorSet only before issuing vkUpdateDescriptorSets(). Change-Id: I99f26f5e14cb28107edb1db86a21afa135858589 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | rhi: Add depth bias and slope scaled depth biasLaszlo Agocs2020-02-066-1/+37
| | | | | | | | | | | | | | | | | | Beware of the API terminology: GL 'factor' = 'slope scaled depth bias', GL 'units' = '(constant) depth bias'. Task-number: QTBUG-81843 Change-Id: I03e3618d007cbf7100add0de4950a6163d788cc7 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | rhi: d3d: Make DepthClipEnable set to trueLaszlo Agocs2020-02-061-0/+1
| | | | | | | | | | | | | | | | ...which is the natural default, and matches other backends. Task-number: QTBUG-81852 Change-Id: I6d0788b18eb7601661ef646e650114a503a12215 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | rhi: metal: Make sure the resources are sorted based on the native bindingsLaszlo Agocs2020-02-061-49/+81
| | | | | | | | | | | | | | | | | | | | | | | | ...before generating batches for the encoder's set* methods. Otherwise there is a chance we end up in an assertion in case the native binding number for a buffer/texture/sampler happens to be smaller than the native binding of the previous. (we pre-sort based on the SPIR-V binding but that is not what the Metal API works with in the end) Task-number: QTBUG-81822 Change-Id: Iddfed168e065e3c7f6a09ad6dd4efdafa891b339 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | Rename Qt::ReturnByValue_t -> Qt::ReturnByValueConstantSze Howe Koh2020-02-062-6/+6
| | | | | | | | | | | | | | | | | | Copy the convention of QDeadlineTimer::ForeverConstant Task-number: QTBUG-48701 Change-Id: Ic7760b7ffec630f1cd47361f5adda3f17fffb9f6 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-02-0412-16/+96
|\| | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf examples/widgets/widgets/imageviewer/imageviewer.cpp src/corelib/text/qchar.cpp src/corelib/time/qdatetime.cpp Change-Id: I9762f5c4ff650799219729d6aee79ac07ce9024a
| * 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>
* | rhi: Improve isClipDepthZeroToOne() docLaszlo Agocs2020-02-031-9/+24
| | | | | | | | | | | | | | | | Quick 3D is now having a use case for calling this directly, so use this opportunity for enhancing the docs to make it clear what this is about. Change-Id: I19ec956ac25175dbfb754192abaad8d65a6eeb0e Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | Suppress deprecation warnings for QFont::ForceIntegerMetricsEskil Abrahamsen Blomfeldt2020-02-031-0/+3
| | | | | | | | | | | | | | | | | | This flag has been deprecated, but until we remove it completely we need to continue supporting it, so we just suppress the warnings for now. Change-Id: I464e1cce42f78af76d46ec12eeb3e8d53d64d6a3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Allow creating a valid QColorSpace one value at a timeAllan Sandfeld Jensen2020-02-011-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | The change to using setters left a quirk from the previous un-mutable design where you couldn't set values on an invalid color space and create a valid one. This changes that so it works as expected for an imperative API, but is also needed for the declarative QML bindings. Change-Id: I246cfc38b364b156238151c42c1df82a3f1cc9d3 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | rhi: Enable sampler address mode W in the APILaszlo Agocs2020-01-3013-48/+71
| | | | | | | | | | | | | | | | | | | | | | Internally this is already supported by all backends. The frontend was just not exposing addressW, instead defaulting to the (arbitrarily chosen) ClampToEdge. Add the parameter to newSampler(), but make it optional, defaulting to the more natural Repeat (because that's what one would get with OpenGL for WRAP_R by default) Change-Id: I0b991d8b649db37d4da86ac8e98ab7845601cf67 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* | Deprecate QImageIOHandler gamma correctionAllan Sandfeld Jensen2020-01-304-0/+12
| | | | | | | | | | | | | | | | | | Don't do gamma correction at image decoding time, it can be a whole lot more than just a simple gamma function, so it is better to use QColorSpace and QColorTransform. Change-Id: Iebc960bad6ecdd878240be965699d2df869572ad Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-292-2/+4
|\| | | | | | | Change-Id: I98b1a5a11ece3957a1115c1d9be8841759206ffe
| * 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