aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Move the header checking into ExecutableCompilationUnitUlf Hermann2019-06-148-66/+68
| | | | | | | | | We don't need to verify the header unless we want to execute the code. Change-Id: Ieac51c47faafcd7047228b4264aa7750ba3d8889 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-06-2018-38/+72
|\ | | | | | | Change-Id: I71b1212085da85f03f4ff0e3ee5cb56a401998ae
| * Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-06-1918-38/+72
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/imports/sharedimage/qsharedimageloader.cpp src/quick/items/qquickitemviewfxitem_p_p.h Change-Id: I12ce7c32788f4a394188a934e689b4ebac78138b
| | * Fix crash caused by objects self-destructions during displacement animationsYulong Bai2019-06-1711-31/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The root cause was that the QAbstractAnimationJob::finished() might delegate its destruction to change.listener->animationFinished(this), and the original author was aware of that and provided a RETURN_IF_DELETE macro to return early if itself got deleted. In the bug's case, change.listener->animationFinished(this) dispatched to QQuickItemViewPrivate::animationFinished() which called QQuickItemViewPrivate::release() and deleted the QAbstractAnimationJob object itself in the end. However, any objects derived from QAbstractAnimationJob, or holding a pointer to a QAbstractAnimationJob, may potentially fall into the code path calling QAbstractAnimationJob::finished(). Any QAnimationJobChangeListener that directly or indirectly deletes QAbstractAnimationJob should be very suspicious to this kind of "heap-use-after-free" bug. Should ensure that the QAbstractAnimationJob won't be referenced after deletion. In the bug's case, within the code path triggered by ListView displacement animation, the other affected classes by QAbstractAnimationJob are: QQuickItemViewFxItem, QQuickItemViewTransitionableItem, QQuickTransitionManager. To fix this, a new SelfDeletable class is factored out to simplify the self-deletion test logic. Any affected classes are made to have a public member m_selfDeletable. Any code paths that finally reach QAbstractAnimationJob::finished() are wrapped with related util macro. Change-Id: Idd33fc3f2d529fd7d8bb088c329101b1e70dd6c0 Task-number: QTBUG-44308 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | * declarative: fix resource initialization for namespaced buildsTim Blechmann2019-02-231-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | `Q_INIT_RESOURCE` cannot be used from within a Qt namespace. so we move the `Q_INIT_RESOURCE` call to static function defined on the global namespace Change-Id: I9eed7699e969369f861b95cdf3f7376ade73c1b3 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| | * Software Adaptation: Invalidate on dpr changeMorten Johan Sørvig2019-06-174-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | We need to repaint everything on devicePixelRatio change, like we do on size change. Task-number: QTBUG-66810 Change-Id: I6b2c2ae92335a0aca731a4b0e7621cf7d08881e3 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
| | * Fix graphical artifacts after changing only textureAllan Sandfeld Jensen2019-06-132-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | If the size of the texture changes, but subrect stays the same, the geometry changed and is now dirty. Change-Id: I5a4de88fd3f788a686fb2186185da2a0a3faad82 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| | * Avoid number conversion issueLiang Qi2019-06-131-1/+2
| | | | | | | | | | | | | | | Change-Id: Ia118e5885886605f7364d15d30ac67fdb01a5562 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | QQuickMouseArea: synchronize relative position after draggingWang Chuan2019-05-291-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtQuick][QQuickMouseArea] mouseX and mouseY will now be synchronized after dragging the target item Fixes: QTBUG-75993 Change-Id: I0b56f6bd494791f9e2fe55a0cf059a7bad2d63dc Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Do qtVectorPathForPath before starting thread poolUlf Hermann2019-06-141-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids the race condition created by calling it the first time inside the threads. Fixes: QTBUG-76338 Fixes: QTBUG-76069 Change-Id: I6108526eb6f5b5ba9c3334437102fc5959f53030 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | | Move AST -> CompiledData location transformation to scan functionsUlf Hermann2019-06-133-19/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That's the only place where we use it and this way we can remove the AST dependency from the compiled data. Change-Id: I530a0f18a08672acd7031a552885b819e6fe2b84 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-06-146-7/+75
|\| | | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/qml/qjsengine/tst_qjsengine.cpp Change-Id: I34df194046a91ee8a076ce28022eb99d68e7f362
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-06-136-7/+75
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4memberdata.cpp Change-Id: I4e9ffc89d65279a42516f5547e93fb47fb571834
| | * Add simple DelegateChooser example to documentationMichael Brasser2019-06-111-1/+35
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-73964 Change-Id: Ic789839de12e046cc1d8fced75ffa0c93960c165 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * JIT: Don't store accumulator on getTemplateLiteralUlf Hermann2019-06-121-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | We don't use the accumulator in that method. It could contain any random value. Fixes: QTBUG-75642 Change-Id: I41f958c1174cce76d0d77e14d5617d441aaf1e11 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * Allow destroying QJSValues from other threadsUlf Hermann2019-06-111-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QVariants are commonly passed around between threads and QVariants can wrap QJSValues. Therefore we need to allow this. The persistent value is freed immediately if we're still in the same thread. Otherwise a message is passed to the QJSEngine that owns it. If there is no QJSEngine we assume that we can free the value immediately. As such a thing can only happen via private API we can make sure this assumption holds. Fixes: QTBUG-75939 Change-Id: I14c09fd5d6ef7ba689f66656f2bcbb5c88bacf89 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * Fix use after free crash in QQmlDelegateModelNils Jeisecke2019-06-061-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When iterating over the cache in QQmlDelegateModel::_q_itemsInserted(), _q_itemsRemoved, _q_itemsMoved, _q_modelReset() and _q_itemsMoved, updating some of the item's modelIndex can trigger layout change in the view, which might in turn remove a QQmlDelegateModelItem from the cache, causing us to dereference an already deleted pointer. To prevent a crash, we always check whether the item is still valid in the original cache and skip it if it has been removed in the meanwhile. This fix is similar to 5df747fc but reduces runtime impact by performing the lookup only when d->m_cache has detached from the loop's copy. Fixes: QTBUG-76254 Change-Id: I9d7e0118e64e9ec7d8efae04e6ae319804f31981 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | * Avoid number conversion issueUlf Hermann2019-06-111-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ia3f9bde43719859104759033283e697be72f7f53 Fixes: QTBUG-76286 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * Avoid assertion when having a ShaderEffect as a delegateJan Arve Sæther2019-05-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The assertion occurred when it initially tried to create an item from the delegate because it needed to show the contents of the first item when the combobox was collapsed. So, in order to do that ComboBox would create an object from the delegate by calling delegateModel->object(). Since the ShaderEffect was not ready to be constructed yet (it didn't have a window, see QQuickOpenGLShaderEffect::maybeUpdateShaders() ) it would call polish on itself in order to try later. Shortly after, it called delegateModel->release(). This didn't delete the object immediately (it called deleteLater() on the object), but it removed the engine and context it was associated with). However, this left it in the list of QQuickWindowPrivate::itemsToPolish. Due to this, QQuickWindow would call updatePolish on it shortly after (as a response to an expose event in our case). But the ShaderEffect was still not associated with an engine, so it would ultimately assert with no engine. The fix is to simply check if the ShaderEffect has an engine, and return early if that happens. Then when the dropdown opens, the ShaderEffect will get a polish() because of QQuickItemPrivate::recursiveRefFromEffectItem(), and it will have both an engine and a window and will properly initialize its shaders. Fixes: QTBUG-67343 Change-Id: Ib8ceb92d0fafb9b958407a50db5daa7b45e1d82a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | Convert uses of QTime as a timer to QElapsedTimerEdward Welbourne2019-06-124-10/+10
| | | | | | | | | | | | | | | | | | Change-Id: Ia34d3980e48d2978c8c77e65b1ee2aa7f71fd985 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | Register QRegularExpressionValidator in QtQuickUlf Hermann2019-06-126-5/+114
| | | | | | | | | | | | | | | | | | | | | | | | This should replace QRegExpValidator. RegExpValidator is deprecated now. Task-nunber: QTBUG-72588 Change-Id: I072deb382914fd322ce192509782b241824ccd7b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | qtlite: Fix build with -no-feature-translationMikhail Svetkin2019-06-111-2/+2
| | | | | | | | | | | | | | | | | | Change-Id: I9d6adc8d0a74c457bdff68a1c712995ffaee7a6a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | Port from QLatin1Literal to QLatin1StringGiuseppe D'Angelo2019-06-112-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | QLatin1Literal is an undocumented and deprecated typedef for QLatin1String, just use the original. Change-Id: Ib6e2b7ac369be12aed0e455c91cf31b807eae4ed Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | add std::function overload to qmlRegisterSingletonTypeFabian Kosmale2019-06-115-7/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes enables passing stateful lambdas to qmlRegisterSingletonType, which helps when porting away from setContextProperty. Unfortunately, we cannot directly add an overload for std::function, as this causes ambiguity in the overload set when a lambda of the form auto f = [](QQmlEngine*, QJSEngine*) -> QObject* is passed to the function (which is what the examples do) We therefore use a template to support abribtrary callables f, then SFINAE them out if f is not convertible to the desired std::function, or when f is convertible to a plain C function pointer, thus removing the ambiguity Change-Id: I6ca95ad692d8bb785e420b85bf3d8c1d0007ce17 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge "Merge remote-tracking branch 'origin/5.13' into dev"Qt Forward Merge Bot2019-06-1135-379/+526
|\ \ \
| * | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-06-1135-379/+526
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4value_p.h src/qml/qml/qqmlmetatype.cpp src/qml/qml/qqmltypewrapper.cpp src/quick/items/qquicktableview.cpp Change-Id: I684f8e01a711580512848bf1253f39b39fcbf4c7
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-06-064-6/+54
| | |\| | | | | | | | | | | | | Change-Id: I59cb196ab17ed8504b33db01d827052eb6891efa
| | | * Doc: Remove superfluous double quotes in code snippetsPaul Wicking2019-06-042-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Fixes: QTBUG-75957 Change-Id: I2c9c70461a828978d1413b8cbdb407663b4b7493 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
| | | * Fix for loading translations automatically from resourcesTasuku Suzuki2019-06-011-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When qml file is in resources, translations under i18n was not loaded Task-number: QTBUG-76085 Change-Id: I75315ceb6a1e6ab10309634a3c445a82476d525c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | | * Parser: Accept templated readonly propertiesUlf Hermann2019-05-311-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I37d313e3156a44eb4487b1be007aa93ace18d882 Fixes: QTBUG-76018 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * | Fix heap-use-after-free with QQuickListViewAllan Sandfeld Jensen2019-06-044-19/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure we stop FXViewItems from tracking so we don't have pointers to dead QQuickListViewPrivate object on QQuickItem destruction. Fixes: QTBUG-71581 Change-Id: I80291086697b1455d9319969fe5cba0ea4d04a73 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | * | QQuickTableView: Don't try to forceLayout with no columnsDavid Edmundson2019-06-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | forceLayout is user invokable. If it's called before columns are loaded our call to firstColumn call QMap::firstKey will assert/crash. Insertion of columns later will trigger a layout. Change-Id: Id102e3ab4756ddd3f433037783dc70e1b29101c8 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-06-025-8/+33
| | |\| | | | | | | | | | | | | Change-Id: Icf36857844b6643d9fbe3c841b1d9b78943435d4
| | | * QQuickTextControl: Fix Qt::ImAbsolutePosition queryVova Mshanetskiy2019-05-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt::ImAbsolutePosition is documented to return cursor position, not anchor position. That's also what QQuickTextInput and QWidgetTextControl return. Change-Id: I91f9343f5f33c9d43875dbad515bfda77c13058d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | | * Doc: Fix incorrect snippet in Repeater QML type documentationTopi Reinio2019-01-231-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-73199 Change-Id: I83f0754577b382b26f484bfdc4f6b3a2a921b5f1 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| | | * In qmlUnregisterType() also remove the type from undeletableTypesUlf Hermann2019-05-291-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-76074 Change-Id: I7f5ca6af0955524f9a417811c2e9f960c2b3efb3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | | * Add a workaround for ia64 to move Value bits 63-61 to 49-47 for pointersJason Duerstock2019-05-301-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-56264 Change-Id: Ifdede70d95f5846e160772c43d22bc2a4123959b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | * QQuickWidget: fix missing update on show event for software rendererKirill Burtsev2019-05-281-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The triggerUpdate call was incorrectly removed by merge 42f485231c Fixes: QTBUG-68566 Change-Id: Ibf37d88315d3ef9879e6cb9728a1c4ef4655c72b Reviewed-by: Michal Klocek <michal.klocek@qt.io>
| | * | Improve "Type error" when looking up a property of null or undefinedDavid Faure2019-05-311-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: MenuItem.qml:98: TypeError: Type error After: MenuItem.qml:101: TypeError: Cannot read property 'height' of null The wording matches the similar error messages in qv4runtime.cpp. Change-Id: I3d9b3506195fe8e17e78117f2f51aba2adbc0564 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Laurent Montel <laurent.montel@kdab.com>
| | * | Fix mistakes in 9b36512b9453f429644b0c388d381f7a2fc0f825Allan Sandfeld Jensen2019-05-286-6/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Undo change to signature of textureProviderDestroyed, and reinstate test for disconnected item having a window, and instead ensure we are destroyed earlier while the item is still valid. Fixes: QTBUG-76055 Change-Id: I0c6c13cd44d3364984e0245b3b048f4aa183b43a Reviewed-by: Daniel Smith <Daniel.Smith@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-2615-338/+385
| | |\| | | | | | | | | | | | | Change-Id: I208cd36d2b7add94f36e4d86cf0c790a1e4a7e86
| | | * Don't add local for anonymous function's "name"Ulf Hermann2019-05-213-10/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead, populate their "name" property directly from the surrounding object pattern if applicable, without adding locals. This fixes some ecmascript tests where functions were assigned to the key "eval" in an object. The JS engine then rejected that because you shouldn't use eval in strict mode. That should be close enough to test for regressions. Fixes: QTBUG-75880 Change-Id: Iacc45a3f7b0eb90cddc6ecf6d2bada616d2cf355 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | | * Doc - minor cleanupKavindra Palaraja2019-05-211-307/+281
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Small fixes to improve readability * Fixed some typos * Updated the link to an old-ish MSDN article * Used a list instead of a long paragraph in the introduction area * Swapped a long list for a table for environment variables Change-Id: Id7eeee5c5b24f96e4577212a385cfa766e809d1f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | | * Fix lookups of properties in QML singletonsSimon Hausmann2019-05-216-11/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An unqualified name that points to a QML singleton will evaluate to a QQmlTypeWrapper JS object. A member lookup in such an object is not guaranteed to always produce the same property. The property cache check may protect us from that, but we must still retrieve the QObject singleton for every lookup. Task-number: QTBUG-75896 Change-Id: Ibd9bac6e5c2047f838758811790b299ace636446 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | | * Fix leaking scene graph rendering contextsSimon Hausmann2019-03-152-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using the threaded render loop, the rendering thread assumes ownership of the rendering context. If the rendering thread is never started, that context is leaked. This happens in tests sometimes when we create and destroy a window without waiting for exposure. So this patch maintains the ownership in the render loop for created contexts until the per-window thread is started. Task-number: QTBUG-74348 Change-Id: Ifa397fab0833c82110ac4571c1e3790351c43afd Reviewed-by: BogDan Vatra <bogdan@kdab.com> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | | * Print a warning when encountering a non-relative URL in a qmldir fileUlf Hermann2019-05-161-3/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is not supported because supporting it would encourage users to create components that won't work on other systems or that will confuse qmlplugindump. QML still parses and loads those components, but you should really use relative paths. Task-number: QTBUG-48809 Change-Id: I9c81671cb5c4ea59b8c884ff24ad02e82047e9d6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | | * Re-add cache for looking up attached properties objectsUlf Hermann2019-05-161-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | c018df5b4075ae962966d4df7653d476dab02840 removed an optimization in qmlAttachedPropertiesObject. The attached properties ID was implicitly cached as it was static in a method templated by the type the attached properties were registered for. We don't actually need the ID for this, as we can also cache the function pointer. Fixes: QTBUG-75609 Change-Id: I15e728ce4bbb89062a84ee6f113b1188faa32b92 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | | * Fix assert in QSGBasicInternalImageNode::updateGeometryAllan Sandfeld Jensen2019-05-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handle that hCells and vCells might be 0 with non-0 innerTarget. Fixes: QTBUG-73768 Change-Id: Id9dde2368e8cdfe40e5b287b16c0473ad7c12d69 Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* | | | Clean up frozen(), sealed(), nonExtensible() and propertiesFrozen()Ulf Hermann2019-05-314-65/+45
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They all had some interesting bugs and duplicated each other: a, propertiesFrozen() changed each property individually, creating a lot of unnecessary intermediate classes. frozen() changed them all at once. b, If a class happened to contain only properties that matched the characteristics of being "sealed" or "frozen", sealed(), frozen() and propertiesFrozen() would set the flags in place and return the same class. This is bad because it violates the assumption that an InternalClass is immutable and it breaks the recursive freezing algorithm we rely on for the global object. It would stop freezing child objects at any such class, even if the children were not frozen. c, propertiesFrozen() did not set any of the flags even though it effectively sealed and froze the class. Therefore, when requesting the same class as frozen() it would iterate through all the properties again. d, frozen() implicitly also sealed the object and made it non-extensible. sealed() also implicitly made it non-extensible. This is impractical as we want to allow objects to be extensible even though all their properties are frozen. Therefore we only set the flag that belongs to each method now. We do know, however, that a frozen object is implicitly sealed. Therefore we can short-circuit this transition. Furthermore, we need to remove the assert in InternalClass::init() as you can indeed use frozen objects as prototypes for others, but that needs to be recorded in the original InternalClass via the isUsedAsProto flag. In order to set this flag, we need to perform a transition and therefore, derive from the old InternalClass. The JavaScript isFrozen() method asks for an _implicitly_, "duck typed", frozen state, which is different from what our "isFrozen" flag denotes. Therefore we add a separate const method that just checks whether all properties are frozen. Task-number: QTBUG-76033 Change-Id: I375fef83fb99035d470490fdf2348766b090831e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | QQuickDropArea: Use QRegularExpression rather than QRegExpUlf Hermann2019-05-271-8/+11
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-72588 Change-Id: I943ada1bcf21b4affdd55a95e90be13d2a5bb454 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>