aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix vertical position of PathTextEskil Abrahamsen Blomfeldt2020-01-291-2/+2
| | | | | | | | | | | | | | The PathText would always translate to y=0, regardless of what y was set to. We should obviously get the y coordinate of the shape *before* translating it into position to find the distance from the baseline. This change also updates the example, which had not been updated to the changed origin of the PathText, and it adds a Lancelot test for keeping track of the PathText shape rendering. Change-Id: I940ac956af5229842739f8d8751a1f13bb86b8e7 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Handle required properties declared in C++Fabian Kosmale2020-01-283-5/+20
| | | | | | Fixes: QTBUG-81561 Change-Id: I97a0f5013b6e3662ffaad53c5cc871404e11a310 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Properly refcount QQmlDelegateModelItemMetaTypeUlf Hermann2020-01-286-24/+26
| | | | | | | Consistently store it in QQmlRefPointer so that it doesn't leak. Change-Id: Id1f06228f6eb477b758901d61c1b71928671dc6a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Deprecate QQuickWindow::createTextureFromId()Laszlo Agocs2020-01-272-1/+9
| | | | | | Task-number: QTBUG-79268 Change-Id: I70f60ddf6e97e0b082f4df77e26a33f9305a4f0c Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* use initializer listsTim Jenssen2020-01-241-6/+4
| | | | | Change-Id: Ie33ce3e0fb4a2a373d6eb2f0d3788105409e0389 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Make QtQuick::Item::mapFrom/ToItem also accept point and rectAlbert Astals Cid2020-01-241-90/+104
| | | | | | | | [ChangeLog][QtQuick][Item] Item.mapToItem() and mapFromItem() now work with QPointF and QRectF types as well as with raw numbers. Change-Id: Ifeb5c36e1bc5a283df4e11c8cf2af960de3f287b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Make QtQuick::Item::mapFrom/ToGlobal also accept pointAlbert Astals Cid2020-01-241-24/+50
| | | | | | | | [ChangeLog][QtQuick][Item] Item.mapToGlobal() and mapFromGlobal() now work with QPointF as well as with raw numeric coordinates. Change-Id: I6a335c95a014bc77a927c781586619e62dce2f02 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Change some unite(const QHash &) to insert(const QHash &)Mårten Nordheim2020-01-242-2/+2
| | | | | | | | | | None of the other code handles it like a multi hash, so let's change the calls from unite() to insert since we now have an option which won't silently create a multi hash. Change-Id: I520295bde81c4ad1b0665308fcaf5fe41c6c3039 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add support to match against QObject properties in DelegateChooserJoni Poikelin2020-01-241-3/+9
| | | | | | | | | | | | | | Views could use an array of QObject instances as a model, as an alterative to a QAIM subclass; but DelegateChooser only supported querying the value based on the model role name. Now a QObject property name can also be used as roleValue. [ChangeLog][QtQuick][Item Views] DelegateChooser now supports using a property name as roleValue when an array of QObject instances is used as the model for a view. Fixes: QTBUG-81580 Change-Id: I3e5b57ce0456520667e342741efbe46417f0843c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQuickImageProvider: PDF is a scalable format like SVGShawn Rutledge2020-01-231-4/+4
| | | | | | | | | We could perhaps determine this by asking the QImageReader in readImage(), but supportsOption(ScaledSize) might return true for some other non-scalable formats. Change-Id: Ia18e9245c408245933774520ab68655905251e4d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Deduplicate QQuickImageBase/QQuickBorderImage::loadPaolo Angelelli2020-01-233-147/+94
| | | | | | | | | | | These two methods share a whole lot of duplicated logic, and already show signs of divergence due to maintenance going to the one and not the other. This patch removes the duplication. Change-Id: I6a83dd7f354a94547e44198ec679b323f2c5240e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Long live QML inline componentsFabian Kosmale2020-01-2331-155/+1186
| | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtQml] It is now possible to declare new QML components in a QML file via the component keyword. They can be used just as if they were declared in another file, with the only difference that the type name needs to be prefixed with the name of the containing type outside of the file were the inline component has been declared. Notably, inline components are not closures: In the following example, the output would be 42 // MyItem.qml Item { property int i: 33 component IC: Item { Component.onCompleted: console.log(i) } } // user.qml Item { property int i: 42 MyItem.IC {} } Fixes: QTBUG-79382 Change-Id: I6a5ffc43f093a76323f435cfee9bab217781b8f5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add Qt.uiLanguage and QJSEngine::uiLanguage propertiesSimon Hausmann2020-01-2310-20/+131
| | | | | | | | | | | | | | [ChangeLog][QtQml] Added Qt.uiLanguage and QJSEngine::uiLanguage properties These properties mirror the same value in QML and C++ and can be used freely. They also provide API symmetry to Qt for MCUs. QQmlApplicationEngine binds to this property and applies translations accordingly by constructing a QLocale with the value and using QTranslator::load(locale). Change-Id: Id87d6ee64679b07ff3cb47844594e8eeebd8c8b6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Christian Kamm <mail@ckamm.de>
* qmlworkerscript: Fix wrong type used in docsMaximilian Goldstein2020-01-231-1/+1
| | | | | Change-Id: I6064b5339936fce22c3fc42fc4a6af72312e5415 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlPropertyData: Save some bitsFabian Kosmale2020-01-233-82/+153
| | | | | | | | | | There are some flags which are only used when the type equals FunctionType and respectively some which are only used when the type does not equal FunctionType. By reusing those bits and changing there semantics depending on type, we can grow BitsLeftInFlags by 50%. Change-Id: I7099d6e87826a49aae5f283160c488004ac5b0e1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-235-11/+13
|\ | | | | | | Change-Id: I88e94fe3398a59f10c5a8b142204db5f3ccb2657
| * Remove shadereffect dependency from shapesKarim Pinter2020-01-223-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | Uses wavefrontmesh only if the shadereffect feature is there. Path doesn't need to depend on shadereffect feature only on gui module. The shape also missed a sgtexture header. Fixes: QTBUG-81296 Change-Id: I78425ef8a09226b99e9b9f6010dda9dac9009fe5 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * Initialize boolean m_hasItemChangeListenersDavid Edmundson2020-01-211-1/+1
| | | | | | | | | | | | | | Found by a valgrind warning of an unintialized jump. Change-Id: I24279c97042e1971eaff35c3363fc1250e5c6c6e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * Fix printing of garbled UTF-8 characters from QML verify() statementsDimitrios Apostolou2020-01-201-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Messages that contain QtPositioning.coordinate are including the degree unicode symbol U+00B0. These were printed as garbage from QML tests that use the verify() function. This was caused by the message argument being encoded using toLatin1() on its conversion to const char *. This caused both garbled text and invalid XML output in the test runs, which in turn was causing coin's agent to fail while deserialising the test XML log. This was fixed by changing from toLatin1() to toUtf8(). Since testlib is receiving plain const char * arguments for the "description" argument, it was deemed correct to standardize on UTF-8 as the proper encoding for it, to avoid losing any information (QTBUG-81474). When it's output to the console it can be re-encoded depending on the system's locale, of course. Task-number: QTBUG-81474 Fixes: QTBUG-80527 Change-Id: I0f1fdb7d414d9dfd30d4638b00088c9502c339bd Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Introduce PathText path elementEskil Abrahamsen Blomfeldt2020-01-213-0/+326
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For text rendering in Qt Quick, we currently have the limitation that when rendering text at such a large size that the distance fields start showing artifacts, the only option is to use NativeRendering, which will look nice, but which will use a lot of texture memory for the glyph cache, since it will actually cache the glyphs at the requested size. A suggested approach would be to fall back to using triangulated paths when the font gets large enough, but the work on this was never completed. It turns out that we can get this now, basically for free, since we already support rendering arbitrary QPainterPaths using Qt Quick Shapes. The only thing missing is the ability to add the path of a given text to the shape. This patch fills in that gap. Note that this is currently not supported by nvidia renderer. [ChangeLog][QtQuick] Added PathText path element which can be used together with Qt Quick Shapes to get text rendering that does not cache glyphs in a texture, but triangulates the outlines of the glyphs instead. Change-Id: I436e1476b129b324cf7a54f89a1b18e0579e8185 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Upgrade qsb files to version 4Laszlo Agocs2020-01-2163-0/+0
| | | | | | | | | | Change-Id: Ic1a1f5ff49c34d72495bc74083f37db118c935c1 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | QQuickTableView: make syncView/syncDirection/model private implementation ↵Yulong Bai2020-01-203-14/+25
| | | | | | | | | | | | | | | | | | | | virtual For usage in HeaderView, moving getters/setters/sych-ers in private implementation virtual, keep public APIs clean and also make private implementations overridable. Change-Id: I4ad04665b7268354a49dc9711944ee0c6fd2738f Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-2010-76/+233
|\| | | | | | | | | | | | | Conflicts: src/quick/items/qquickitemview.cpp Change-Id: Ib9faebdbef5eebb80f4e6aeb5b15b5df7494b157
| * Text and TextEdit: document MarkdownText formatShawn Rutledge2020-01-175-62/+209
| | | | | | | | | | | | | | Task-number: QTBUG-81306 Change-Id: I8ee50727f4e75eee8c0997f17193d8c99e855551 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
| * Fix documented types for DelegateChoice propertiesMichael Brasser2020-01-151-4/+4
| | | | | | | | | | Change-Id: I0a5907354e7a983e7c7ad36aa9d86c3bf87d264e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * QQuickItemView: fix crash when changing modelWang Chuan2020-01-152-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When visible items become invisible, ListView will try to cache them and redisplay these items if necessary. However, we can't cache items when changing to a new model, since the old one will be deleted later Fix by adding a flag to let ListView know we are clearing items and prevent cache unnecessary items Fixes: QTBUG-80203 Change-Id: I50dcd3f0586c93496b143bdad0e59751360501a8 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * fix for out-of-screen preview windowsUlf Hermann2020-01-142-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | The problem was that the screen position was changed by the user and it did not check this before it set it to that saved position. Also added a warning if it is still happening - which is not expected anymore. Fixes: QTBUG-79323 Change-Id: Id3d945626461016d51fcad9f8882c3d39544a985 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Don't use deprecated QMatrix class anymoreJarek Kobus2020-01-172-10/+12
| | | | | | | | | | | | Task-number: QTBUG-46653 Change-Id: I3570c84014788b7b66d9cb54b77f9964ae15af6d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Replace QVariant::type with QVariant::userTypeOlivier Goffart2020-01-1733-188/+190
| | | | | | | | | | | | | | | | | | | | | | as type is going to be deprecated. This change was done automatically with the help of clazy. In addition, ColumnRoleMetadata was changed to take an int instead of a QVariant::Type Change-Id: Ibc02d7b52e7d931a56c19fdebc4788b5e6df2a39 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | QHashedStringRef: add split methodFabian Kosmale2020-01-172-0/+20
| | | | | | | | | | Change-Id: I971e8d7ceb4acfbe53d8b35c249eaa872f181839 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Replace call to deprecated QNetworkReply::error methodFabian Kosmale2020-01-177-8/+8
| | | | | | | | | | | | Change-Id: I14198038a01acdd415e90fd733dc03b122591179 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | QQuickTextNodeEngine: reduce redundant rendering of glyphsWang Chuan2020-01-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The glyphs between two text blocks that have different text format will be rendered twice, and in this case the rich text will be display incorrectly.(e.g., the first text block is a superscript and the second is a normal text) Fixes this by reduce the redundant rendering of glyphs between two differently formatted text blocks Fixes: QTBUG-80759 Change-Id: I51ca3f7df1ad368d28df9beb6124a87bf50f0e01 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Add Q_GADGET Wrapper for QQmlPropertyPierre-Yves Siret2020-01-153-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This enable exposing a QQmlProperty as a value type to QML code. Only object and name are exposed as a properties to keep it simple. We might want later to expose the property of a Binding or a Behavior as a property for complex usecases. This permits exposing it as one self contained value instead of a pair of unrelated object and name. Task-number: QTBUG-70964 Task-number: QTBUG-73892 Change-Id: I3a46212446f43f3a7e301943cb49d3a48c377de3 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | QQmlListProperty: Add replace and removeLast functionsUlf Hermann2020-01-1513-65/+362
| | | | | | | | | | | | | | | | | | | | | | This allows us to implement QmlListWrapper::virtualPut(). Also, the additional functions make the list properties useful in other contexts. Fixes: QTBUG-79263 Change-Id: I528bc69222ca7743f0fc3697c3aed2a3468b4d87 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Allow overriding type registrationsUlf Hermann2020-01-151-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously if the same revision of the same type was registered multiple times, the first registration would dominate. Now, the last one does. [ChangeLog] If you register the same revision of the same type multiple times, the last registration is the one QML will use. This allows you to override qmlRegisterSingleton*() calls, for example in order to register a singleton instance for a type tagged with QML_SINGLETON. Task-number: QTBUG-79331 Change-Id: I32a2acabc89af6faa89d8ccb6380a473bc8b8ddd Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | qqmlxmlhttprequest: Add ability to disable file:// requestsMaximilian Goldstein2020-01-151-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | Introduces two new flags: QML_XHR_ALLOW_FILE_READ: Controls whether GET can be used with file://. QML_XHR_ALLOW_FILE_WRITE: Controls whether PUT can be used with file://. In Qt 6 these will be off by default. At the moment having these unset while using either GET or PUT on file:// will just result in a warning. Change-Id: I2d85e88f1ddba8153ccbbd833ec7de5c1d0d8b5b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-147-20/+161
|\| | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickitemsmodule.cpp src/quick/items/qquickitemview.cpp Change-Id: I02191959a5023c4320f5487a7fb3a71f8711195f
| * Register PointerScrollEvent and document the WheelHandler.wheel signalShawn Rutledge2020-01-133-4/+142
| | | | | | | | | | | | | | | | | | | | | | Writing an onWheel() handler script was working and mentioned briefly in docs; but PointerScrollEvent and the signal were not documented. Also fixed the type of QtQuick::WheelEvent::inverted: bool not int. Fixes: QTBUG-81302 Change-Id: I31342955c42e20ff52460a1b7ee95da325e38af6 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
| * Remove unneeded/unused signalAlbert Astals Cid2020-01-132-2/+0
| | | | | | | | | | | | | | | | | | | | QQuickMultiPointHandler inherits from QQuickPointerDeviceHandler, which inherits from QQuickPointerHandler that already has a marginChanged signal. It's the only place that signal gets actually emitted from. Amends da722fb448f06cf43780e6f857a1ccd9f07176d6 Change-Id: I8ba3129ed69903d6f3cff56401c8a18580af0375 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * QQuickItemView: Fix iteration/deletion logicUlf Hermann2020-01-101-12/+16
| | | | | | | | | | | | | | | | If a QVector has been modified from the outside, all its iterators are invalid. Therefore, we need to do index-based iteration here. Change-Id: I02b850daf6aadd8f8a81cc93b0d295e1170d7dd6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * On QQmlEngine destruction drop singletons before type loaderUlf Hermann2020-01-101-2/+2
| | | | | | | | | | | | | | | | The singleton destruction can trigger additional types to be loaded. Fixes: QTBUG-80840 Change-Id: Ifa406b2a1cfd3b9e9b36e8005dfc0808eebf15cf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * SequenceObject: Better message when trying to write readonly containerUlf Hermann2020-01-091-1/+3
| | | | | | | | | | | | | | Before it would only output "Type Error". Change-Id: Ibd3a85f327c3ce8c58295c7e900c516b77c85a2b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | QQmlMetaObject: Don't assert on validity of list propertiesUlf Hermann2020-01-131-11/+16
| | | | | | | | | | | | | | | | | | | | Apparently the memberdata can be nullptr as long as you don't try to access it. This is what readPropertyAsList() does, and the ResolvedList ctor should follow suit. Fixes: QTBUG-81032 Change-Id: I9133ea9f7889884b2e91dba7630c4827fc97136d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Doc: Explain how to specify multiple paths in QML2_IMPORT_PATHUlf Hermann2020-01-131-0/+7
| | | | | | | | | | | | | | | | And why you cannot specify URLs or resource paths that way. Task-number: QTBUG-69435 Change-Id: Ia6aac89239302bcfe625f4cca877b74be065e800 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Add PointerScrollEvent QML registrationShawn Rutledge2020-01-131-1/+5
| | | | | | | | | | | | | | | | | | | | Since registration of this type was neglected in 5.14 (yet was still usable in WheelHandler.onWheel() { } anyway), it didn't get included in cc1a604c704f848927b3fa0a97b0a50b0b79d2a4. Task-number: QTBUG-81302 Change-Id: I24645f4f982310655901c45aca6cdccfbafa911e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Generate registrations for all examplesUlf Hermann2020-01-132-12/+9
| | | | | | | | | | | | | | | | Now that we can generate all QML type information at build time, we should also use it. Change-Id: I647c72bbe38fdb2deb565b75c86a696af3d15b61 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QML list property: Avoid crash if contained object is deletedFabian Kosmale2020-01-132-9/+9
| | | | | | | | | | | | Task-number: QTBUG-81123 Change-Id: I3dd1a42e444f817722368cd268c2f987a99fbf1c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | QQmlImport: Allow importing multiple versions of the same moduleUlf Hermann2020-01-101-1/+7
| | | | | | | | | | | | | | | | | | Previously, once a plugin had been loaded, the static module registrations were disregarded. Therefore, if there were static and dynamic registrations in the same plugin, only one set was ever loaded. Change-Id: I24f52cc579a833041c51f15555caf226a6189c99 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Generate registrations for all importsUlf Hermann2020-01-1074-11038/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we can generate all QML type information at build time, we should also use it. Move the types for QtTest into the testlib import plugin. They don't need to be exported from QtQuickTest. Trigger the resource initialization of the shapes library from the plugin so that we retain a dependency and the linker doesn't optimize the module initialization away. Change-Id: Icc8cb338aa03ef1e3085e29356a5db7b73ba0a01 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-0924-104/+247
|\| | | | | | | | | | | | | | | | | Conflicts: src/particles/qquickitemparticle.cpp src/qmlmodels/qqmladaptormodel.cpp tests/auto/particles/qquickitemparticle/tst_qquickitemparticle.cpp Change-Id: Ibd8fbb91da6893a09f4ffe61ad0b95d8149bbc87