Where can I find (and modify) the source code for QT quick elements
-
Re: Where can I find the source code of the Qt Quick elements ?
The above is a very old thread about this, but I'm guessing this have changed in the past ten years, so starting a new thread.
I'm learning QML, and would like to read and make experimental edits to the source code of the elements I'm using -- starting with ComboBox. My QT install is at ~/Qt5.15.2/. In my Qt Creator project, all of the paths (Qt5Core_DIR, Qt5Quick_DIR, etc), point to paths beneath ~/Qt5.15.2. There are dozens of files called ComboBox.qml. Some of them are pure QML, some of them use QtQuick.Templates, which I believe are C++ files.
Questions --
- Among the dozens of ComboBox.qml files in my installation, how can I find the actual sources being used for my application?
- Once I identify the correct sources, can I simple edit them and see changes reflected after I build my app, or do the QML files get compiled cached somewhere?
- Is there documentation I can look at which will answer these questions?
-
Re: Where can I find the source code of the Qt Quick elements ?
The above is a very old thread about this, but I'm guessing this have changed in the past ten years, so starting a new thread.
I'm learning QML, and would like to read and make experimental edits to the source code of the elements I'm using -- starting with ComboBox. My QT install is at ~/Qt5.15.2/. In my Qt Creator project, all of the paths (Qt5Core_DIR, Qt5Quick_DIR, etc), point to paths beneath ~/Qt5.15.2. There are dozens of files called ComboBox.qml. Some of them are pure QML, some of them use QtQuick.Templates, which I believe are C++ files.
Questions --
- Among the dozens of ComboBox.qml files in my installation, how can I find the actual sources being used for my application?
- Once I identify the correct sources, can I simple edit them and see changes reflected after I build my app, or do the QML files get compiled cached somewhere?
- Is there documentation I can look at which will answer these questions?
@Morgan-Liu-Packard said in Where can I find (and modify) the source code for QT quick elements:
Re: Where can I find the source code of the Qt Quick elements ?
The above is a very old thread about this, but I'm guessing this have changed in the past ten years, so starting a new thread.
Gitorious is long gone. Use https://github.com/qt/qt5 or https://code.qt.io/cgit/ instead. @SGaist's suggestions to download via the website or installer remain valid.
I'm learning QML, and would like to read and make experimental edits to the source code of the elements I'm using -- starting with ComboBox. My QT install is at ~/Qt5.15.2/. In my Qt Creator project, all of the paths (Qt5Core_DIR, Qt5Quick_DIR, etc), point to paths beneath ~/Qt5.15.2. There are dozens of files called ComboBox.qml. Some of them are pure QML, some of them use QtQuick.Templates, which I believe are C++ files.
Ignore the versions in the Qt Creator directory.
<Qt version>/<compiler>/qml/QtQuick/Controls/ComboBox.qml is the QtQuick Controlls 1.x version.
<Qt version>/<compiler>/qml/QtQuick/Controls.2/*/ComboBox.qml are implementations of various styles. QtQuick.Templates provide non-visual structure for the style implementations to build on.
Questions --
- Among the dozens of ComboBox.qml files in my installation, how can I find the actual sources being used for my application?
See above.
- Once I identify the correct sources, can I simple edit them and see changes reflected after I build my app, or do the QML files get compiled cached somewhere?
Editing in place will probably work. Defining a custom style is a better idea.
- Is there documentation I can look at which will answer these questions?
https://doc.qt.io/qt-5/qtquickcontrols-index.html is a user level guide for Controls.
https://wiki.qt.io/Main goes into more detail about modifying Qt.
https://qmlbook.github.io/index.html is an excellent introduction to using Qt and QML. -
@Morgan-Liu-Packard said in Where can I find (and modify) the source code for QT quick elements:
Re: Where can I find the source code of the Qt Quick elements ?
The above is a very old thread about this, but I'm guessing this have changed in the past ten years, so starting a new thread.
Gitorious is long gone. Use https://github.com/qt/qt5 or https://code.qt.io/cgit/ instead. @SGaist's suggestions to download via the website or installer remain valid.
I'm learning QML, and would like to read and make experimental edits to the source code of the elements I'm using -- starting with ComboBox. My QT install is at ~/Qt5.15.2/. In my Qt Creator project, all of the paths (Qt5Core_DIR, Qt5Quick_DIR, etc), point to paths beneath ~/Qt5.15.2. There are dozens of files called ComboBox.qml. Some of them are pure QML, some of them use QtQuick.Templates, which I believe are C++ files.
Ignore the versions in the Qt Creator directory.
<Qt version>/<compiler>/qml/QtQuick/Controls/ComboBox.qml is the QtQuick Controlls 1.x version.
<Qt version>/<compiler>/qml/QtQuick/Controls.2/*/ComboBox.qml are implementations of various styles. QtQuick.Templates provide non-visual structure for the style implementations to build on.
Questions --
- Among the dozens of ComboBox.qml files in my installation, how can I find the actual sources being used for my application?
See above.
- Once I identify the correct sources, can I simple edit them and see changes reflected after I build my app, or do the QML files get compiled cached somewhere?
Editing in place will probably work. Defining a custom style is a better idea.
- Is there documentation I can look at which will answer these questions?
https://doc.qt.io/qt-5/qtquickcontrols-index.html is a user level guide for Controls.
https://wiki.qt.io/Main goes into more detail about modifying Qt.
https://qmlbook.github.io/index.html is an excellent introduction to using Qt and QML.@jeremy_k Thanks so much for your reply! Much appreciated. If I understand correctly, there are actually two combobox.qml files which are used to create the ComboBox type, the main one under Controls, and then a style-related on under Controls.2. Is this correct?
-
@jeremy_k Thanks so much for your reply! Much appreciated. If I understand correctly, there are actually two combobox.qml files which are used to create the ComboBox type, the main one under Controls, and then a style-related on under Controls.2. Is this correct?
@Morgan-Liu-Packard What I wrote above doesn't seem to be true. It looks to me like <Qt version>/<compiler>/qml/QtQuick/Controls/ComboBox.qml is the 1.x version (docs here), and <Qt version>/<compiler>/qml/QtQuick/Controls.2/ComboBox.qml is the 2.x version (docs here).
-