compile_commands.json is metadata export from cmake which is used
by the static analysis tools. One way to feed information to these
tools is to have a symbolic link in the source directory to the
compile_commands.json file in the build directory.
.cache is the folder that contains the index file generated by clangd.
git should ignore both.
Change-Id: I63ab801ef2d52093be7527ff70ee88a40399fbb5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Add a CMake bool variable QT_QML_GENERATE_QMLLS_INI to indicate
to qt_add_qml_module that .qmlls.ini files have to be generated for
each directory where qt_add_qml_module is invoked. The .qmlls.ini
files are generated in the source directory.
This option needs to be set explicitly by the user, either as normal
or as cache variable.
The .qmlls.ini files are required for qmlls to work properly in any
editor, without needing custom qmlls-client implementations for every
client that passes the build folder on to qmlls.
Each source directory with a CMakeLists.txt that does the
qt_add_qml_module command gets a .qmlls.ini that contains all the build
folders of all qt_add_qml_module-commands of the current source
directory. This mimics how qmlls searches for the .qmlls.ini (starting
at the source file directory and going up until it finds a .qmlls.ini),
and avoids having to save a map from source folders to build folders in
the .ini file.
Warn the user when using CMake versions <= 3.19:
QT_QML_GENERATE_QMLLS_INI requires deferring the calls to write the
.qmlls.ini files to make sure that all build paths of all
qt_add_qml_module calls of the current directory can be written
inside the .qmlls.ini file.
For multi-config build, this just makes use of the last generated
config and overwrites the .qmlls.ini files for the other files.
This is similar to what CMake does for compile_commands.json on
the ninja multi-config generator, see
https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7477 for
example.
Added some documentation about the option, and also a test.
Fixes: QTBUG-115225
Task-number: QTCREATORBUG-29419
Task-number: QTCREATORBUG-29407
Change-Id: I4a463ff7af534de266359176188fb016d48cf2c4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The CMakeUserPresets.json file can be used to simplify configuring Qt,
particularly with tools such as Visual Studio and Visual Studio Code.
As opposed to the CMakePresets.json, the CMakeUserPresets.json should
only contain user specific configurations, and should never be checked
into source code management system.
This file is already ignored in the top level Qt super-project, but to
facilitate working with each individual submodule, we should also have
this .gitignore in each submodule.
Pick-to: 6.5 6.6
Change-Id: I7e8baa9b3bea437d61841ec20cf8fbd4d5826750
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Qt Quick Controls 2 was named that way because it was a follow-up to
Qt Quick Controls 1.x. Now that Qt Quick Controls 1 is no longer
supported, we don't need to have "2" in the name. Work on this was
already started for the documentation in
1abdfe5d5a.
By doing this renaming a few weeks before feature freeze, it won't
affect the release but still results in as little time possible spent
manually fixing conflicts in cherry-picks from non-LTS releases as a
result of the renaming.
This patch does the following:
- Renames directories.
- Adapts CMakeLists.txt and other files to account for the new paths.
A follow-up patch will handle documentation.
It does not touch library names or other user-facing stuff, as that
will have to be done in Qt 7.
Task-number: QTBUG-95413
Change-Id: I170d8db19033ee71e495ff0c5c1a517a41ed7634
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
[ChangeLog][QtQmlCore] Added QtCore QML module. Currently this only
contains the StandardPaths singleton, but in the future could expose
lots of useful types from Qt Core to QML.
Fixes: QTBUG-92806
Change-Id: Ib99e2c5512ee04d6af1322f985fc9da965cf13a4
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
[ChangeLog][Styles] The Default style was renamed to Basic to account
for the introduction of the platform styles (macOS, Windows), which
will be used by default (where possible) when no style is specified.
Fixes: QTBUG-85984
Task-number: QTBUG-68814
Task-number: QTBUG-86403
Change-Id: I22b3199c8662e4ee5d55a1be1a51c9856ac62376
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
To ignore files like foo.pro.user.4.8-pre1
Change-Id: I465b36eda8a3a57854c25802d003d86ca7356f86
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
After qtbase commits defe266 and 9c42959, we can use 'builtin_resources'
and 'install_qml_files' configs to get qml_module.prf to do all that for
us without having to write custom qrc/copy/install rules. This allows us
to unconditionally enable the Qt Quick Compiler for the resources. The
rest, i.e. optionally leaving out the QML files, will be handled via the
Qt deployment tools.
Task-number: QTBUG-67501
Change-Id: I18f2122ff4945496921b7183c365497c37dfe3a3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
If it's in the command-line, it is added to the precompiled header,
which won't be regenerated if the macro changed. Instead, let's create a
header that can be #included only in the file it needs to.
Since qmldevtools compiles the file that has this new #include, we need
to ensure it was created before the module is compiled.
Change-Id: I940917d6763842499b18fffd1513b9c64cd98387
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
In practice, deferring the execution of the delegates (until
accessed) means that the default delegate item does not get created
at all, when a custom control replaces it at construction time.
Button {
background: Rectangle { ... }
}
Before, such custom Button would never be faster than the original
one, because the default delegate was first created and then thrown
away at construction time. Originally, this was not considered a huge
problem, because the plan was to keep the default delegates so light-
weight that it wouldn't matter. However, then came the fancy styles
with shadows and effects and thus, heavier default delegates. There's
also a growing demand for more features, and the default delegates
are slowly getting heavier...
Now, after this patch, if you replace a heavy default delegate with
a light and simple custom delegate, the result is a much faster
control. For example, replacing Material style Button's background,
which has a shadow effect, with a plain Rectangle gives a ~10x boost,
because the default background with its heavy shadow effect is not
executed at all.
At the same time, deferring the execution of the default delegates
avoids troubles with asynchronous incubation, because we don't need
to destroy an object in the middle of the incubation process.
Task-number: QTBUG-50992
Change-Id: I2274bff99b9ff126d3748278d58d859222910c98
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
The Imagine style is based on image assets. The style comes with a
default set of images, but the images can be easily changed by
providing a directory with images using a predefined naming convention.
[ChangeLog][Controls] Added the Imagine style, which is based on
image assets that can be provided using a predefined naming convention.
Task-number: QTPM-517
Change-Id: I550d7dac9a9686d60bec15655ac92dea9f36149c
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
MenuBar is an ordinary Item. It can be located basically anywhere, but
the idea is to introduce a new ApplicationWindow::menuBar property in a
follow-up commit. Currently the example snippets are using the header
property.
[ChangeLog][Controls][MenuBar] Introduced a MenuBar control.
Task-number: QTBUG-60350
Change-Id: Ie66dc457a3d8edbe8362fab2a591dc49442c95e2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
1) First of all, Popup's QObject-parent depends on the way the Popup
is declared in QML, or what is passed as a parent to createObject()
when creating dynamic instances. For example:
- Popup becomes a QObject child of of the contentItem:
ApplicationWindow {
Popup { }
}
- Popup becomes a QObject child of the window:
ApplicationWindow {
Item {
Popup { }
}
}
- Popup becomes a QObject child of the specified parent:
ApplicationWindow {
Component {
id: component
Popup { }
}
Component.onComplete: component.createObject(overlay)
}
Since QQuickWindow and QQuickView did not set the QObject-parent
of their contentItem and rootObject, respectively, we had troubles
finding popup instances, because window->findChildren<QQuickPopup>()
and window->contentItem()->findChildren<QQuickPopup>() would produce
inconsistent results. This has been fixed in qtdeclarative commit
af6655885, so now we can use window->findChildren() reliably.
2) Popups inherit font from the associated window, not the parent item.
It was wrong to call resolveFont() in setParentItem(), because the
parent item might not change even though the associated window does.
The piece of code was moved to setWindow() instead.
3) QQuickPopupItemPrivate::resolveFont() did not propagate the
default font at all when the font was resolved before being associated
to a window.
4) After the above fixes had been applied, to ensure that popups always
inherit fonts and propagate them down to children as appropriate, we
got a new test failure in tst_controls::Popup::test_font() indicating
that there were extra font change notifiers triggered at creation time.
This was fixed by associating "top-level" popups with the window as
soon as they are appended to ApplicationWindow's default property,
instead of waiting until the popup is complete and then doing a lookup
in the parent hierarchy.
Task-number: QTBUG-61114
Change-Id: I6185c76d50835cb7a06b03db0a3ac9ddad64bdd3
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
This test was added in 88a62b3 that fixed the scrollbar cursor. It was
not possible to test in QML, so a separate C++ test was added. It was
noticed that most interactive controls have the exact same issue, so we
want to utilize the same test for testing the cursors of all relevant
controls.
Change-Id: I7c307de9f72760b0993007246beb3357a1b5ec2b
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
This example shows how to integrate custom styled
components with tooling. The example uses states in the styling items,
so they can be easily edited and checked in the designer.
Change-Id: Ie665bb3938cdb1b135dbbd4163e1b901e61a6be0
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
This can be used to take screenshots of items loaded from snippets,
without the window frame being included as would be the case if
using e.g. qmlscene.
Change-Id: I376148a66a26be846c102e768ffade204cea448b
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>