| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Example of a QML TableView with custom table model.
Inspired from the original pixelator example from the widget world.
Change-Id: Ic33e6d2e9320fe135d56dde92326dd8a606fe109
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is no need that QQmlAdaptorModel sets up the connection
between QQmlDelegateModel and QAIM. QQmlDelegateModel can do
this internally. This removes more of the dependency to
QQmlDelegateModel, and will make it easier to reuse the
class also for other models as well (first and foremost
the upcoming QQmlTableInstanceModel).
Change-Id: I957ac7bf85c6976ac79df0500a3c1ec3f8be42e2
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Different property names are mapped to the same property key through a
the identifier hash table. In the case of QTBUG-69280 we map a for-in
loop "for (var prop in testCase)" in TestCase.qml to an internal
iterator object, which signals whether it's finished or not by setting a
"done" property on the iterator result object to a boolean. On the
setter side, the property is specified via
result->put(engine->newString("done"))
and on the getter side the code uses
result->get(engine->id_done())
For this to work, the newly created string has to map to the same
identifier, otherwise we end up with differing property keys and wrong
values.
The test failure of QTBUG-69280 reproduced a scenario where two strings,
"pathChanged" and "done", mapped to the same index in the hash table
after a rehashing (growing), despite different string hash values. As a
consequence of the hash collision they had adjacent entries in the hash
table, with "pathChanged" coming first.
A subsequent garbage collection run ended up with "pathChanged" being
not marked and subject to removal from the identifier table.
IdentifierTable::sweep() wiped the entry for "pathChanged" and lastEntry
to the now free index and also remembered the exact string hash value.
In the next iteration, sweep() looked at the entry for "done", which
should move to the now free slot, as both strings map to the same index.
However sweep() didn't do that because the comparison of string hash
values failed.
The fix is to compare table indices (covered by
sweepFirstEntryInSameBucketWithDifferingHash) and respect bucket boundaries
(covered by dontSweepAcrossBucketBoundaries).
However it may happen that entries that would map to the same bucket end
up after another bucket because of the insertion order. This would lead
to
Q_ASSERT(table[lastIdx] == nullptr);
failing right after
lastIdx = (lastIdx + 1) % alloc;
Instead the determination of the next free slot must follow the same
logic as in addEntry, by finding the first null entry. This is covered
by sweepAcrossBucketBoundariesIfFirstBucketFull.
Task-number: QTBUG-69280
Change-Id: I284f53418d0a75e2edb631f8bacca8c5a596e603
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
| |
Change-Id: Id640b596c1d8d52221f2f2be8807d6e245971bdc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
It's not useful to know the modelIndex without the count that it
exceeded. Also, print the names of the variables.
Change-Id: I97d83dad3980fa0fc3d85759a2adfb2b723a6ce1
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
|
|
|
|
|
|
|
|
| |
This way, you can just paste the path into e.g. Creator's locator
instead of having to find the application's build directory yourself.
Change-Id: If44d8fdf8c3c14c64a1f28432b13b8bdd9f80863
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Whenever we set a model index on a model item, set row and
column explicit as well. We used to calculate row and column
by calling out to QQmlDelegateModel from within
QQmlDelegateModelItem. But we want to remove the dependency
to QQmlDelegateModel as much as possible, to be able to reuse
QQmlDelegateModelItem also from other model classes (first and
foremost the upcoming QQmlTableInstanceModel).
Change-Id: Ib80b31250010b2611ba1715d3324145117add865
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
| |
The issue has been worked around in the macOS platform plugin.
Task-number: QTBUG-69040
Change-Id: I3b7ca71eb355c3ded11afbeb3e792179729c5208
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
| |
Change-Id: I60eb8a7185a2e6f62b56b1fd3dca01cbc6f784ab
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We need Items to receive accurate positions for stationary touch
points: that is, the last-known position from the previous touch
event. (And we hope that all actual touch-capable platforms also send
proper QPA events with correct positions for stationary points.
We assert that it's a bug if they don't.)
As explained in qtbase 7cef4b6463fdb73ff602ade64b222333dd23e46c, it's
OK to retain a copy of a QTest::QTouchEventSequence for this purpose,
so that the QMap<int, QTouchEvent::TouchPoint> previousPoints will not
be discarded between events.
Change-Id: I12a04323b0d82dc325348c0fa3e067a4b63f57e9
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We need Handlers to receive accurate positions for stationary touch
points: that is, the last-known position from the previous touch
event. (And we hope that all actual touch-capable platforms also send
proper QPA events with correct positions for stationary points.
We assert that it's a bug if they don't.)
As explained in qtbase 7cef4b6463fdb73ff602ade64b222333dd23e46c, it's
OK to retain a copy of a QTest::QTouchEventSequence for this purpose,
so that the QMap<int, QTouchEvent::TouchPoint> previousPoints will not
be discarded between events.
We have done this in other tests, but not consistently; e.g.
468626e99a90d6ac21cb311cde05c658ccb3b781 fixed the PinchArea test.
Change-Id: I4dbe69f8dcc4b1cca30fd7ce91d7d2ecf5ec4bc3
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
ECMAScript 2015 clarified the handling of out-of-range years,
requiring that an exception be raised:
http://www.ecma-international.org/ecma-262/7.0/index.html#sec-corrections-and-clarifications-in-ecmascript-2015-with-possible-compatibility-impact
http://www.ecma-international.org/ecma-262/7.0/index.html#sec-date.prototype.toisostring
Change-Id: I91d76703705f3919d2ee77557e36af362db1adf9
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
| |
When parsing or converting from a QDateTime, we didn't always check
that the resulting Date object was within range (1e8 days either side
of the start of 1970).
Change-Id: I1bee69f9070829f68998d576c19907a827fabc39
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
| |
Properly support member functions that are generators in classes.
Change-Id: I5fc8d5b58a17c61a446b43d6576bb83de5ecd920
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instructions always occupy two numbers, an even and the following
odd one, for the single byte and four byte encoding.
An instruction of 0x0 is now a NOP, but 0x1 implies that the
instruction type is using two bytes, and the following byte needs
to be read as well to get the correct instruction type.
Encoding and decoding of those two byte instructions is fully
transparent, and adding more instructions now doesn't require
any special handling.
The first 127 instructions in the FOR_EACH_MOTH_INSTR macro will
get a single byte encoding, the remaining ones will use two bytes.
When adding new instructions, make sure to put often used and fast
instructions into the first 127 instructions, while adding rarely
used (or slow) instructions to the end (before Debug though).
Change-Id: Id772a109641ab68feb228c3abd05f41ae7075e94
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change the encoding, so that even instructions are short ones,
odd instructions long. This implies that the lowest bit encodes
whether an instruction is short or long (1 vs 4 byte encoded).
This prepares for allowing us to extend the totoal number of
instructions beyond 128.
Change-Id: I4732e7241d3593b24ad25cd69555edc25f38d2f6
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
| |
Set the classes name as defined in the ES7 spec.
Change-Id: I5ef1d317dfdf92f5e7c141b9092fa391a64ce8af
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
| |
Change-Id: I7c2d9c09b3059dcd6ce2eb356a74980a3410a245
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
Those are mostly working now, but when calling super properties
the this object is not setup correctly.
Change-Id: Ib42129ae6e729eeca00275f707f480371b7e42a5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
GetLookup and GetLookupA were doing exactly the same thing. Only keep
the version that expects the base object in the accumulator and
rename it to GetLookup.
Change-Id: Ia14256880cef23f7b70d8c7e6bb74aba371b8d9a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
As with function expressions, class expressions also get an implicitly
defined name if they are directly assigned to a named variable.
Change-Id: I5fda9d74c1c299107f15b82245333b54ca6d8917
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
Implement super call support for class constructor
functions.
Change-Id: I3c64276234689cf4f644b095e0fc8ca1c634ac53
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
Move code into qv4stackframe_p.h, so that it can be re-used from
different places. Clean up VME::exec and the generatorfunctions
using this.
Change-Id: Ib4f7eceeb5f55d98dd6ccf2584d13a3b864caea1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
| |
Change-Id: I86e89e07197aec6071809c2d32bd5c98cb7ac6f6
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
It's unused and shouldn't exist. Also de-inline currentContext()
to avoid a dependency on the CppStackFrame in the header.
Change-Id: I44724f8097883dc1b1064430778f45f7811460df
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
We'll need a more flexible interface here to support derived
constructors properly. There's also quite some code in the
generator functions that could benefit from some cleanups.
Change-Id: I951b5d2171efa80d52fd6b0155f8f2c78af2f3b5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
Support the new.target meta property in the codegen, and
add support for passing the newtarget into the constructor
vtable methods and the execution context.
Change-Id: I62ea58e5e92d894035a76e35776203e9837c383b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
Turns out that the overloading of vtable methods and regular
ones is problematic in some cases. So let's rather make it explicit
which methods are part of the vtable, and which aren't.
Change-Id: Ifee32a26104d30f3c82bca8b5a9cdea2d4f4f526
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Allow for nullptr entries in the vtable. To nevertheless
get some decent error checking if one of the methods is
reimplemented, use a base class for Managed that contains
a full set of the vtable entries all being nullptr's.
Change-Id: Ibc53973b539f87331e8e465a6c44436a30acbefd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
Move both the code from qv4object and qv4managed into
a new qv4vtable_p.h file.
Change-Id: Ib1d58120b6c3b9b779b2692526c7e40a5265c4db
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
| |
This is required to be able to support the super() call.
Change-Id: I9998680341d701727ac1697187ad33481bdde422
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Attempt to locate the qmlcachegen binary in the host bin directory if
possible.
Task-number: QTBUG-68724
Change-Id: If0d28408a316b3dd33f4734464e0d5fe44c9fc2c
Reviewed-by: Rolf Eike Beer <eb@emlix.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
It was only used in a few places now, that can be replaced by
either using a PropertyKey, or by limiting the fast path
optimization in the runtime to array indices smaller than
INT_MAX. Since there are less branches this should even be
faster for pretty much all use cases.
Change-Id: Ib4f2f2f3e27f14ad180b810546e82ac83170b106
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
| |
identifier -> asPropertyKey
Change-Id: I4e6f33bdad12e901303ec6101dd2b8d6b0e99ac4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Get rid of makeIdentifier(), as toPropertyKey() will take
care of it.
Rename identifier() to propertyKey() and check that the
key is valid.
Remove String/StringOrSymbol::asArrayIndex(), we don't need it
anymore.
Change-Id: I3c490fabc1475c9ea288b49b1638b6fa1bc237b7
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
Change all uses of Identifier to use the new PropertyKey class
and get rid of Identifier.
Change-Id: Ib7e83b06a3c923235e145b6e083fe980dc240452
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
This will replace Identifier over the next few commits.
The advantage of PropertyKey is that it can be stored on
the JS stack, so that a GC run won't accidentally clean
up the string/symbol referenced by the key.
Change-Id: Ib4daa4616bcfa537e6d371ef7c7740bc7727a50d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Rename from/asHeapObject to from/asStringOrSymbol and fix
the signature.
Add a isStringOrSymbol() method and redefine isValid() to also
include array indices.
Change-Id: Ic8272bfbe84d15421e2ebe86ddda7fdaa8db4f3e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
This finalizes the refactoring of Object's vtable API. Also added
the receiver argument to the method as required by the ES7 spec.
Change-Id: I36f9989211c47458788fe9f7e929862bcfe7b845
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Pass an Identifier through those virtual methods to unify
the string and integer based versions.
Also add the receiver that's required in ES7
Change-Id: I4e7f01b4c97cc80bcb3c485f6343f28213dc9e6b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
Set the prototype chain up correctly when subclassing.
Many things still won't work, as we do not yet support
the super keyword at all.
Change-Id: Id5dbe3de9ffad98d67b7e6f6958b2cd727733786
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
| |
Change-Id: I29b9a35c080c50469ac1a3ff5f83a31349e801ad
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
git describe can produce different strings for the same sha1, depending
on the version of git (length of short hash) and whether release tag was
in place when build was done (v5.11.1-0- vs. v5.11.0-66-).
Instead use rev-parse to get the unambiguous commit sha1 which is also
what is used from the .tag file.
Change-Id: If378f03eb764e2d858bda5b662106aa4402d6559
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
As QIntValidator input value which is over the highest acceptable value,
but consisting of a number of digits equal to or less than the max value
is now considered as intermediate tst_qquicktestinput is now fixed
according.
Task-number: QTBUG-59650
Task-number: QTBUG-69228
Change-Id: I1fefdba1f2b834fe14a8dee5249734c37588a950
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is quite common in JavaScript to use exceptions for error handling, but
there was no way to generate an exception from C++ context, i.e. when
the JS run-time invoked a C++ method or a slot.
This patch adds an naive way to report run-time errors to QJSEngine from
CPP context. The user may set a custom error message, but the location
points always to the caller context in JavaScript.
[ChangeLog][QtQml][QJSEngine] Added API to throw run-time errors.
Task-number: QTBUG-39041
Change-Id: If59627b83d50351eb225adde63187fc251aa349e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
When we have one or more failures, make sure that the auto-test fails.
This produces a few additional failures but oddly also "fixes" some
tests that are marked as expected failure.
Change-Id: I0bbbed463b326336ab9caa33f434520c90ed36de
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
The changes made in 134d980a7fcf61c5440019bcfb3fdfc39c3f5f3c and
2b779fbd25aaf09897ee2cdc4edffd12a980420b were still a bit too broad.
Tighten the condition further so original behavior is restored
for smaller to medium drags.
Change-Id: I9006e9cea80c1ef79e0b8d6a47b2a497532bef57
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Previously small and large flicks would go to the next item, but there
was a small range just under halfway where it would snap to the previous
position (most easily hit with smaller delegates). Get rid of this
blindspot.
Change-Id: Ib8d026cad9427b2d209a9646b3ea515f578457ae
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
| |
Rename QV4::CompiledData::Binding::containsTranslations() to
isTranslationBinding() in an attempt to improve the readability of the
code.
Change-Id: I73898298c4295d0def812c0526d908254d73c243
Reviewed-by: Michael Brasser <michael.brasser@live.com>
|
|
|
|
|
|
|
| |
It was too hard to debug behavior in this test.
Change-Id: Iaec9534cca17bdd90b94cfa8fa8b21b7026839ae
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|