Skip to content

CMake: Split "internal" components into proper sub-modules, fix up imports

ivan tkachenko requested to merge work/ratijas/modules into master

No one really knew how those "internal" component registrations worked in the generated main qmldir for org.kde.kirigami module. Looking at Qt official modules, they don't even use that keyword either: they split components into modules, "explicitly hiding" some of them under "impl" or "private" directories. So let's just acknowledge their existence, and properly install them as QML modules on their own, with generated qmldir and whatnot. Static builds also need linking for all submodules.

Note: There was one singleton type whose file name differed from its imported component's name. I renamed the file to match the type name so that we won't have to deal with CMake type registration tricks more than necessary.

Apart from porting relative directory imports to module names, I took the liberty of unifying all import aliases for Kirigami submodules:

  • import org.kde.kirigami as Kirigami
  • import org.kde.kirigami.private as KP
  • import org.kde.kirigami.private.globaltoolbar as KirigamiGlobalToolBar
  • import org.kde.kirigami.templates as KT
  • import org.kde.kirigami.templates.private as KTP

QML: Rename QtQuick.Templates as T2 import aliases to just T

Following the refactoring on splitting Kirigami into proper private modules, let's also use more widespread and conventional import alias for QtQuick.Templates. Since now all kirigami.templates imports are aliased as KT, there would be no confusion with stdlib ones.

Edited by ivan tkachenko

Merge request reports