Kirigami2 for developement on Windows [Rant]

The tutorial now mentions how to install Kirigami on Windows with Craft.

5 Likes

And now the tutorial also includes the requirements to get your Kirigami app styled right, with both qqc2-desktop-style and Breeze icons. :slight_smile:

No need to deal with the iconTheme.rcc, writing your own Craft blueprint or linking KIconTheme. All you need is to install Breeze, KIconThemes and qqc2-desktop-style, then use the method mentioned by jackh, but with org.kde.desktop, so:

if (qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE")) {
    QQuickStyle::setStyle(QStringLiteral("org.kde.desktop"));
}

org.kde.desktop is a better idea for desktop and general apps and org.kde.breeze is preferred on Android, something that Redstrate very helpfully added to the readme in Frameworks / QQC2 Desktop Style · GitLab.

5 Likes

Thanks a lot for updating the tutorial!
I will try to test it on a fresh windows install today.

I have installed craft on a fresh windows install and executed craft kirigami kcoreaddons ki18n breeze kiconthemes qqc2-desktop-style like it now says in the tutorial. After creating the project files and generating/building with cmake out of the craft env, the application does work as expected, except for the icons.

@Luis
Thanks for your hint with copying the iconTheme.rcc into a data folder next to the binary. This works for me, and i can now build an application with the correct icons showing :partying_face:
image

Just for completeness, i want to add, that i have choosen Qt5 when craft asked for the Version. Also, i have noticed, that the org.kde.desktop theme does now show the title correctly without H... The breeze theme does still show H... instead of Hello.

But thanks again for improving the tutorial page!

1 Like

I built it from within the Craft env, not outside it. The result I got was that the produced executable contained the Breeze icons even when you double click on C:\CraftRoot\bin\helloworld.exe (a.k.a. when you run it outside the Craft env). Does this work for you, without need for the rcc?

Edit: just retested on Windows:

Sorry i am not a native english speaker and i think there is a misunderstanding. With out of the craft environment i do not mean outside. So i was in fact calling cmake from within a craft environment.
I was just using a power shell, calling the craftenv.ps1 script and then used cmake -B build/ -DCMAKE_INSTALL_PREFIX="~/kde5/usr and cmake --build build

The compilation goes well and i can start the application from the craft power shell, but not directly with a double click from the explorer. The same happens for the binary created by cmake install. Have you added the craftroot\bin path to your windows path?

Edit:
I have just seen that your helloworld.exe is located in the CraftRoot\bin folder. Then of course it will be working for you. The data folder and the iconTheme.rcc do both exist there :slight_smile:

On Windows you don’t need -DCMAKE_INSTALL_PREFIX=“~/kde5/usr”. In fact I think it might mess things up.

Also, I deliberately updated the tutorial to have an install step, it’s required for everything to Just Work :tm:.

Right, this is done by the installation of KIconThemes done by Craft.

So just to confirm, running the app by double clicking on C:\CraftRoot\bin\helloworld.exe does work for you, yeah? I just want to know if following the exact steps in the tutorial works.

aah, now i understand it properly!
In the craft environment CMAKE_INSTALL_PREFIX is set to the craft root. When then executing cmake --install build, it copys the exe into the bin folder of the craftroot.

So yes, i can confirm that this does work properly for me!
Thanks again for your help!

2 Likes