Target was previously named `qml`, which overlaps with the target name
in `src/qml`. At least in the case of the (officially unsupported) MSVS
generator, this resulted in an invalid build configuration (generated a
solution file containing two projects with the same name).
The target name was used to determine the name of the app's executable
file (e.g. `qml.exe` in Windows). This is now achieved through the
`OUTPUT_NAME` target property.
Change-Id: Ifbccceab11c8ad23e7f1b7a8cc7570d66cb6941f
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Amends 88e588b6bf, after which MSVC
complained with
warning C4003: not enough arguments for function-like macro invocation
'QT_QML_TRACE_LISTCOMPOSITOR'
Stream out an empty string instead.
Pick-to: 6.8
Change-Id: I0f556722a7466ebb1af31d2723957e9d778899fe
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Warnings generated by dependencies are generally not relevant to the QML
document at hand. They are at least 2 steps removed from the actual
code.
Pick-to: 6.8
Fixes: QTBUG-118588
Fixes: QTBUG-128868
Change-Id: I830020ce557abd750c7ef38f9f73e3f03a4fb5c2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
If we cannot properly resolve the types we should still set the
accumulator to something so that the type propagator can continue.
Amends commit 6a2308e500
Change-Id: Idf3d093ca877bcf11f6a9a82a9d01ccead19e2cc
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit adds a comment with the info on when the snippet
is applicable.
Task-number: QTBUG-127443
Pick-to: 6.8 6.7
Change-Id: Ia89df2334c32e58795f976072ec18775a8c0d2e8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
The test fails locally as well, not just in CI. But only two of
the test data fail, so only blacklist those.
Task-number: QTBUG-82058
Pick-to: 6.8
Change-Id: I3460138c7bd898149b5dbf0889204a44489a53e2
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Since we ran out of time, we're not going to make out styles bind on
popupType for 6.8.
Remove the claim that we are.
Also mention that we might make that decision later on.
Pick-to: 6.8 6.8.0
Change-Id: Iad0b8dedff0b66e75adb5b80e6bbd5d087ae5d66
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The logic in the QML file calls retranslate() on a 100ms timer, so the
timer might fire more than once before we hit our check that the
calledTranslate signal was emitted.
Pick-to: 6.8
Change-Id: I31153a1c0fc47b137adc349c496867bec35c9383
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
This reverts commit 1d59171d19.
There are a number of places where we pass invalid metatypes to the
various lookup methods in place of metatypes for QObject-derived
pointers. Miraculously this actually works because we can determine the
type of QObject pointers via run time inspection.
We cannot replace the "not initialized" type with an explicit one
before all of those miracles are de-mystified.
Fixes: QTBUG-129202
Change-Id: I84e4d769dc00ef6ebdfcdc9717e30c17e30e811e
Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
If the QtQuick lint plugin doesn't find the types it's looking for, it
shouldn't just crash but rather warn.
Pick-to: 6.8
Fixes: QTBUG-129194
Change-Id: I23be6c6c4561d5394d5f060951d4bbc9eca0f52c
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Use set_property instead of manually appending to the list and writing
it back to the property. Also use list(JOIN) instead of replacing
semicolons by hand.
Change-Id: I69d989da6b8e731af63ee1c8fc0e4dcb8f00fb5b
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Add the IMPORT_PATH information to .qmlls.ini so that qmlls can use this
information to find the QML modules outside of the build folder, in the
same way as qmllint does.
Collect all the target names whose QT_QML_IMPORT_PATH variable needs to
be added to the .qmlls.ini and print them in the same fashion as the
build path (like the DEPENDENCIES).
Pick-to: 6.8
Fixes: QTBUG-129086
Change-Id: I3840ce11b5cf322af104d99b45d66bfe7e0e5d02
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Added the instruction that you cant use QActivityView and added
the minimum main.cpp needed for the API to work.
Fixes: QTBUG-129031
Pick-to: 6.8 6.8.0
Change-Id: I65c5a048ae7653aa6348f02e11f103cae10e779c
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
In the build of the `tests/auto/qml/qqmlmoduleplugin/pluginWrongCase`
library, the target name overlapped with that of the library in
`tests/auto/qml/qqmlmoduleplugin/plugin`.
At least in the case of the (officially unsupported) MSVS generator this
resulted in an invalid build configuration (generated a solution file
containing two projects with the same name).
Change-Id: I050f6f854b734632003fda92b34666faf2137f50
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
tst_qquickpopup::popupWindowDestructedBeforeQQuickPopup() verifies that
the popup window is deleted upon the destruction of the popup object.
Since both objects are destructed in the same frame, and almost
simultaneously, the QTRY_COMPAREs weren't sufficient in making sure that
the objects are deleted in the correct order.
An existing comment suggest that the popup window should be destructed
after the popup object, but I believe that's false, since the popup
window is simply destructed in the popup's destructor.
With this in mind, it makes sense to update the comment to instead
mention that we expect the popup window to be destructed first.
We can verify that the ordering is correct, by connecting a lambda to
the popup windows destroyed signal, and check the signalspy for the
popup object.
Pick-to: 6.8 6.8.0
Change-Id: I3a40926795978b5fbda3478a6bedc691dc8ae162
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Ed Cooke <ed.cooke@qt.io>
Taking into account, that:
1. Id is not part of QmlObject, because of the "flaw" in DOM design,
2. Id-s are common and widely used. Meaning that
pushing each Id through DocumentSymbol tree each time
might be somewhat counter-efficient,
it was decided to favor explicit handling of Id-s as part of the assembling
of QmlObject during the "initial" traversal.
Such change implies more attentive treatment of Id-s in the future...
Task-number: QTBUG-120002
Change-Id: I8fa501cb349efb453108060c4f262a968e8d99d3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Unfortunately, there is discrepancy between the
semantic, structural and "DOM" representation of Items of the document,
therefore some reorganization needs to be done.
Namely, DocumentSymbols, representing DomItem::Id-s and
DomItem::EnumDecl(along with its children),
which are present at the level of QmlComponent need to be
"pushed down" the tree and "readopted" to the structurally relevant
parent Symbols. Same procedure applies to the inline components.
In the end the top Symbol should be the one representing root QmlObject
of the main QmlComponent (this one is coming purely from the assumption that
this will be more user-friendly)
Details
reorganizeForOutlineView expects a SymbolsList.
It requires explicitly that the first element is a Symbol representing QmlFile.*
First, reorganization within each QmlComponentm is taking place,
then each inline Component is "pushed down".
Order in the "children"-s list is not important,
because Outline client is taking care of it and sort Symbols with respect to Ranges.
Ranges should not be touched or readjusted though,
because they respect structural hierarchy.
* This is a bit of a short-cut to simplify the reorganization,
by being clear about the expectations:
QmlFile contains Symbols representing QmlComponents as children,
where the first QmlComponent is the main one, containing at least one
symbol representing QmlObject.
Alternatively it would require to do generic lookups first, to identify
QmlComponents and then do the rest.
Task-number: QTBUG-120002
Change-Id: Ica882182b025d36d38aa3fa283e8b8ecaf7c7b49
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Because of the way Dom stores PropertyDefinitions and Bindings,
the following expressions like `property var a: 4;` are stored
inside DOM (QmlObject to be precise) as first: propertyDefinition of `a`,
second as binding `a:4;` Hence leading to "duplicates" in the Outline view.
It was decided that in such cases "representational "priority
should be given to Binding, hence it's necessary
to filter out PropertyDefinition.
This is done using the ColonTokenRegion of PropertyDefinition from the FileLocations
Note: this could have been done later, during the rearrangement of
DocumentSymbol tree, however, to do that during the "first" visit "should be"
more computationally efficient.
Task-number: QTBUG-120002
Change-Id: I8cef8d3205c8559556937f4ccc56924ead0434f3
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
This commit introduces support for detail field of DocumentSymbol.
For Dom::Id it's the .name()
For EnumMember is implicit or explicit .value()
For QmlObject it's
- .idStr if it exists
- "root" if .idStr doesnt's exist + object is indeed root
- null otherwise
For MethodInfo it's a signature, however, because this field
is absent from the MethodInfo struct, it needs to be derived here.
Dom lacks unified support for querying signatures, esp. of "Singal"-s,
hence it's manually handled and a bit messy.
As for Binding, detail is constructed using BindingValue
Task-number: QTBUG-120002
Change-Id: I96ed605d96caaa778e09a156bed51ac4a4f09b50
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Initial refactoring made by Sami prompted me to wrap and unify writeOut method
further :)
Task-number: QTBUG-128423
Change-Id: I5fc25828eea13762c510f6a31d078b38cace7415
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Add a method to print the method signature, to be used in the Outline
feature of qmlls that reuses existing method formatting methods.
Extract some common code from the method formatting methods to reuse
them in the signature method.
Task-number: QTBUG-128423
Change-Id: I88b46da38ce2bed1db173e3cbc97bdf7707f32bf
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
This commit introduces a mapping between DomType and SymbolKind.
It was decided to proceed with the static fixed-sized array instead
of map or hash-map due to the knowledge of size beforehand, plus
very small size of the mapping collection.
This TypeSymbolRelations are also utilized to filter out DomItem-s,
which are not supported, like Dom::List, Dom::Map, etc.
Note: Due to the current Dom design, SymbolKind for MethodInfo needs
to be handled separately
Task-number: QTBUG-120002
Change-Id: Icadd89e77f5d4c71215ee10cd921c2cd915e771d
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
This commit introduces necessary functionality for fetching
ranges of items and their names
Task-number: QTBUG-120002
Change-Id: If19c1cbe43be020ad02b8a7ab6f7781a7c15054f
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
This commit introduces a main
DocumentSymbolUtils::assembleSymbolsForQmlFile function, which
employes a DocumentSymbolVisitor (which will walk through the
relevant DomItem-s, assembling DocumentSymbols along the way)
alongside some other helping functions.
Design decisions
On the top/user level we care about the "derivation"/assembling
of QList<DocumentSymbol> from DomItem, representing QmlFile.
For that on the "high level" there is no need to manage any state,
hence free DocumentSymbolUtils::assembleSymbolsForQmlFile() is exposed.
The "assembling" function is passed to it as a dependency injection
propagated to the DocumentSymbolVisitor facilitating testing.
However because the assembling process itself involves
non trivial visiting of the DomTree, DocumentSymbolVisitor has been introduced
as "implementation details", hence it's not exposed. Another reason
for limiting the visibility was to use that entity only where it's used,
allowing to save some time on refining its API and testing,
concentrating more on the high-level functionality.
The initial aspiration behind DocumentSymbolVisitor
was to separate visiting logic from the "converting" or assembling logic.
However there are still some nuances to that.
DocumentSymbol structure mostly consists of fields
that could be derived from the DomItem obj, using DOM API.
However there is also a field `children`, which is unfortunately
not that easy to assemble using only DomItem::visitTree API.
For that some stack management is needed, which is modified
in both Opening and ClosingVisitor of DomItem::visitTree
Notes:
1. for the easier testability, it could have been better to
introduce another free function assembleSymbolsFor(DomItem),
however this time I decided to keep the interface minimal.
2. Return value of buildSymbolOrReturnChildren is SymbolsList and not
variant<Symbol,SymbolsList>, for example, is to keep the interface simpler.
Moreover, conceptually, when working with "raw" "lists" we return pointer to
the head, meaning that return type is not affected by the size of the "list".
Filtering
Unfortunately, only Fields filtering is not enough.
For example, QmlComponent stores QmlObject-s in a QList, which are
wrapped in Dom::List, however this and similar wrappers are
completely irrelevant for the DocumentSymbol and Outline, hence
they need to be filtered out based on the DomType. Another
example, is filtering out properties, which are bound at the
definition, because they will be represented by the Binding.
^^^All mentioned above could indeed be done inside the visitor itself,
however I decided to stick with the following separation of concerns:
DocumentSymbolVisitor is "hierarchy"-preserving wrapper over
DomItem::visitTree, hence fields-filtering is also part of it.
Everything what relates to the DomItem -> DocumentSymbol is
part of DocumentSymbolUtils:: namespace.
The drawback of this is there are 2 places of filtering:
1. inside the visitor (fieldsfilter)
2. inside DocumentSymbolUtils::buildSymbolOrReturnChildren
The advantages of this is
1. DocumentSymbolVisitor API is rather
minimal and its main responsibility is indeed to visit all relevant
parts of the DomTree taking care of the hierarchical order.
2. It is not that difficult to cover all relevant functionality
using dependency injection principle
Notes:
1. FieldsFilter could have been and tested explicitly as well, however
for the sake of time, it was disregarded this time
2. Inside the test, in the "af" it's possible to also add verification
of the parameters, however again, it was disregarded this time
Task-number: QTBUG-120002
Change-Id: Idd6c45e90058111b4102692c8b71d46edf7f82c6
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
This commit introduces a DocumentSymbolSupport module, with the mock
test, which is properly populated in the last commit of the chain.
Task-number: QTBUG-120002
Change-Id: If28ed02424578f5e7b9d33f5915cd7ecabf0bd64
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Amends 56c16d0e97 that only ignores
"normal" bindings from warnings in custom parsed contexts, and also
ignore list bindings from custom parsed contexts.
Pick-to: 6.8 6.7 6.5
Change-Id: I66538ddaac49686a5ad6b6560ddbdbd50bebb717
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
We want the generated code to live in the same namespace as the type
registrations.
Fixes: 6.8
Fixes: QTBUG-118898
Change-Id: I41f6484ac9bd83df93b7f0b4896d432bcd0d23c4
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
If the MenuBar is native, all menus inside it needs to be
native as well, even if AA_DontUseNativeMenuWindows is set.
If the application don't want a native menu bar, it needs
to additionally set AA_DontUseNativeMenuBar.
As it stood, we QQuickMenu would refuse to create a native
menu for a native MenuBar if AA_DontUseNativeMenuWindows
was set. And this would lead to an assert in
QQuickMenuPrivate::nativeHandle().
This patch will therefore change this, so that we respect
AA_DontUseNativeMenuWindows only if the MenuBar is not
already native.
Pick-to: 6.8 6.8.0
Change-Id: I4b8bc0ab8bf409f3a6c755e70223df3e042f8220
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
As discussed, this is no longer a tech preview in 6.8
Task-id: QTBUG-129225
Pick-to: 6.8 6.8.0
Change-Id: I79375c07be495212b985652aa444ce43a6842c4c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
If the value type has a suitable ctor, we can pass it a pointer to the
object just created.
Change-Id: I146c7dfc4f879ceb26201511d1c3b4127ad90dbe
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Varanka <sami.varanka@qt.io>
The Gamma Ray documentation is no longer available on doc.qt.io.
Replace the URL in documentation with the correct one.
This issue was reported as user feedback through the survey on
doc.qt.io.
Pick-to: 6.8 6.8.0
Change-Id: If5882799bae536d48142ecd27869c073bef4699e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
If we ever decide to change the default value of QQuickPopup::popupType,
we'll need to make changes like this one, in order for tests to wait
long enough for popup windows to be exposed, and make scene-independent
positional calculations.
Task-number: QTBUG-126553
Pick-to: 6.8 6.8.0
Change-Id: I811db75496af439a06db9711fd8756b75438568e
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
The test relies on Qt::TabFocusAllControls to move focus.
Pick-to: 6.8
Change-Id: I635a7882d2b557e15f17626ad4abf2184569396d
Reviewed-by: Doris Verria <doris.verria@qt.io>
Individual tests set AA_DontUseNativeMenuWindows to true, so we need
to restore it before each test, just like we do for the
AA_DontUseNativeMenuBar attribute.
Pick-to: 6.8
Change-Id: Ib6831b4fb9a7599fda6b9d673b23deaf3dc80892
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
There are two QT QML types that can be used for translations, namely,
qsTr() and qsTranslate(). This change adds a description to the docs to
help the user determine when to use qsTranslate() over qsTr().
qsTranslate() takes an explicit context as its first argument, whereas
qsTr() takes the text to be translated as its first argument. If the
user has a translation context that differs from the file context for
some strings, then it would be better to use qsTranslate() for those
strings.
Fixes: QTBUG-127796
Pick-to: 6.7 6.8
Change-Id: Ic7d44228f293666c112ecf47cf989ce2617f71e0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
The reason for the blacklisting (not being able to set the cursor)
is not limited to the CI.
The plan is to fix this properly, but for now fix the blacklisting.
Pick-to: 6.8
Task-number: QTBUG-82052
Change-Id: Ie735eeaf668a732a73f6829ded19f919d7ecf55f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
We use pathconf in some of our tests to determine if the file system
on Darwin is case sensitive. But pathconf returns -1 if the case
sensitivity can't be determined, with errno set to ENOTSUP.
The convention in this case is to treat the file system as not being
case sensitive (as reported by NSURLVolumeSupportsCaseSensitiveNamesKey
and VOL_CAP_FMT_CASE_SENSITIVE in equivalent APIs), so we need to check
explicitly for a return value of 1.
Pick-to: 6.8
Change-Id: I692e396bbfddfd0754a89dff2207588a10627579
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Liang Qi <liang.qi@qt.io>
4fecfcc867f8215defaa40b50f0340654a36b4c7 in qtbase removed the old
beginEntryList method (after e583c3d5163a5512abac85e32359652e28a053f7
added a new version taking IteratorFlags) - so now we need to adjust
declarative.
Pick-to: 6.8
Change-Id: I9cf3f82d36fd6621dff2950031dc8f26de7dc1a2
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
b020bff6e9a2e45760bab61bdb84efc078c45f7f in qtbase changed the name
mangling that moc uses; normal code shouldn't care about this, but
tst_qqmlproperycache peeks into the internals, so we need to adjust it.
Change-Id: I16d4ee28b208d0e720f16bc92bfd7623842d9375
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This needs to be done until the moc transition is finished.
Change-Id: Iad58dbfffa8c47cb29e9db4aba7a3d56e186a9e9
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
ShaderTools are not a component in the Qt6BuildInternals. Split
find_package call to two correct.
Amends cde11110f3
Pick-to: 6.5 6.7 6.8
Change-Id: I15ea3d6d8a7f89047daea55968c318cbf3a30449
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
When assigning a list model to a HorizontalHeaderView, the layout
needs to be transposed because TableView (which HeaderView inherits)
will otherwise layout in a column-major order. But there are two
ways this can be done: in the model or in the view. And as it
stood, HeaderView would actually do both.
It's preferred to transpose the view instead of the model. This
is faster and doesn't require the use of a proxy model. And it
also supports transposing models other than QAIM (e.g a JavaScript
arrays). The reason QTransposeProxyModel was used in HeaderView in
the first place was (probably) because the support for transposing
TableView was implemented after HeaderView was implemented.
This patch will therefore remove the code in QQuickHeaderView
that tranposes the model. This will remove some complexity
from the code, and reduce memory overhead.
Note that transposing the view will now always be done
when needed from QQuickHeaderViewBasePrivate::syncModel().
Change-Id: Ic53eeaffcc947bcff76667a23dcfd390a917ba63
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
If you click outside a menu bar menu, all menus will be
closed by QQuickPopupWindow. But such clicks will also be
forwarded to the window under the mouse (by QGuiApplication).
The result is that if you click on top of the menu bar to
close the current menu, you will also end up clicking on a
MenuBarItem, which therefore reopens the menu again.
To solve this bug, we let forwardEventToParentMenuOrMenuBar()
return a bool that tells if the event should be blocked from
further propagation or not. That way we can return true if we
detect that the click is on top the menu bar, and should not
be forwarded down to it if we also use it to close all menus.
Pick-to: 6.8 6.8.0
Change-Id: I9ba638801218393528536c49a186ae5b2c190a5a
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Use the newly introduced QQmlFormatOptions and QQmlFormatSettings
classes to read and use .qmlformat.ini files while formatting.
Fixes: QTBUG-128866
Change-Id: I15ae2141e49bce9a3a7c3cdde237761411f8d1b7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Move the code from tools/qmlformat.cpp that parses .qmlformat.ini files
into a newly created qmlformat library under src/qmlformat.
This would allow qmlls to reuse the same code.
Task-number: QTBUG-128866
Change-Id: Ibf7e52be744ea11c235d0b853ffa80f778c14a2b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>