Skip to content

Port Kirigami tutorial to Qt6

Thiago Sueto requested to merge work/thiagosueto/kirigami6 into master

This MR has a lot of required changes to be an actual port to Qt6, which is why it's big:

  • makes QML use versionless imports
  • changes contents/ui/ to qml/
  • switches QT_MAJOR_VERSION with 6 (since versionless imports won't work on 5)
  • switches to declarative type registration [1]
  • switches engine.load() to engine.loadFromModule()
  • switches actions.{main,left,right} and contextualActions with just actions
  • switches Kirigami.Overlaysheet with Kirigami.Dialog
  • switches the installed package selection to Qt6/KF6
  • switches from BasicListItem to Controls.ItemDelegate/Kirigami.TitleSubtitle et al
  • removes mention of the Kirigami Gallery (which wasn't ported until recently and won't be available on distros so soon)

[1] = does not include "connect C++ to QML" and we need to fix ecm_finalize_qml_module()

And a few QoL fixes that improve the overall experience:

  • removes broken reflinks
  • show full code for examples
  • update all images to make Kirigami attractive as a product
  • adds mx-auto to fix spacing between side-by-side images
  • adds the br html tag to space images properly when to the side of text
  • adds titles for the code to match the images and to make it easier to scan where things are from
  • sets width and height to get reasonable default window sizes
  • adds a desktop file (for Wayland window icons...)
  • switches from ... to // ... so examples are copy-pasteable without breaking things

This MR is not intended to:

  • Replace uses of QApplication for metadata with KAboutData (yet)
  • Update FormCard (because it must be done in conjunction with the snippet repo)
  • Update the explanation on connecting C++ and QML (because it's useful to know both + it's a big enough step on its own)
  • Add a "Porting to Kirigami 6" page
  • Remove all broken links (because we can in fact fix those Kirigami API links soon-ish)
  • Rewrite the tutorial (we need something now that users can reference to learn Kirigami while a new one is being made)

To-do:

  • Figure out why ecm_finalize_qml_module() is broken when using the default KDE_INSTALL_QMLDIR (blocker)
  • components-progressbars (only screenshots, nonblocker)
  • components-actiontoolbars (I spent some time thinking about it and I still have no idea why you'd use it, nonblocker)

To test this MR:

git clone https://invent.kde.org/documentation/develop-kde-org.git
cd develop-kde-org
git switch work/thiagosueto/kirigami6
hugo serve
# Open localhost:1313
Edited by Thiago Sueto

Merge request reports