Bug 507602

Summary: qmltypes file is empty, the type used for qml language server is not being generated.
Product: [Frameworks and Libraries] layer-shell-qt Reporter: mateusvascosc
Component: generalAssignee: Aleix Pol <aleixpol>
Status: REOPENED ---    
Severity: normal CC: nicolas.fella
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: empty qmltypes

Description mateusvascosc 2025-07-28 17:09:26 UTC
Created attachment 183606 [details]
empty qmltypes

SUMMARY
qmltypes file is empty, the type used for qml language server is not being generated.

STEPS TO REPRODUCE
1. build the module
2. import the module in qml
3. no bindings appear on qmlls (in neovim or in vscode) 
4. open .../org/kde/layershell/LayerShellQtQml.qmltypes file and no types are declared.

OBSERVED RESULT
types give this warning with the qmlls lsp and no autocomplete
'LayerShell.Window' is used but it is not resolved [unresolved-type]
if building the app, the layer shell module works as expected

EXPECTED RESULT
types and autocomplete should show with qmlls.


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: 6.15.8
KDE Plasma Version: 
KDE Frameworks Version: 6.4
Qt Version: 6.9

ADDITIONAL INFORMATION
Comment 1 Bug Janitor Service 2025-07-28 18:19:11 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/layer-shell-qt/-/merge_requests/83
Comment 2 Nicolas Fella 2025-07-30 23:25:33 UTC
Git commit 397398dfd8361836210e178a4e73abd7bd31edd5 by Nicolas Fella.
Committed on 30/07/2025 at 19:39.
Pushed by nicolasfella into branch 'master'.

Port to declarative type registration

M  +2    -0    src/CMakeLists.txt
M  +3    -2    src/declarative/CMakeLists.txt
D  +0    -51   src/declarative/layershellqtplugin.cpp
A  +49   -0    src/declarative/types.cpp     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
A  +55   -0    src/declarative/types.h     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]

https://invent.kde.org/plasma/layer-shell-qt/-/commit/397398dfd8361836210e178a4e73abd7bd31edd5
Comment 3 mateusvascosc 2025-07-31 14:16:10 UTC
There is still a type giving error, the LayerShell.Window.anchors is giving type missing. 
Manually changing the qmltypes file worked for me.
The type of the anchors property is listed as Anchors, but the enum is named as Anchor, changing it to Anchors fixed the issue, but i still had to overwrite the qmltypes file.

TLDR:
Qmltypes has an Enum with name Anchor, but the type used is Anchors. So the Enum or type should be changed.
Comment 4 Nicolas Fella 2025-08-04 10:59:05 UTC
Anchors is the name of the corresponding flags, so that part is correct. The issue is something else
Comment 5 Bug Janitor Service 2025-08-04 11:09:21 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/layer-shell-qt/-/merge_requests/86
Comment 6 Nicolas Fella 2025-08-05 11:20:21 UTC
Git commit 5e57a060c67580e7f473da0c74c5f08b6f967cf2 by Nicolas Fella.
Committed on 05/08/2025 at 11:04.
Pushed by nicolasfella into branch 'master'.

Register anchors flags to QML

M  +1    -1    src/interfaces/window.h
M  +1    -1    tests/main.cpp

https://invent.kde.org/plasma/layer-shell-qt/-/commit/5e57a060c67580e7f473da0c74c5f08b6f967cf2