App template
-
Hi folks,
Is there a recommended app template which does things that most apps need these days:
- Builds for WASM, Windows, MacOS, iOS, Android
- Demonstrate folder structure for platform specific stuff like AndroidManifest.xml and Info.plist
- Demonstrate adding third party code libraries
- Demonstrate adding QML control library and registering C++ types
This looks pretty good to me, but does not have (1).
I have looked at some of the examples, e.g. the ToDo list app, but on 6.8 QtCreator shows lots of warnings in the QML and the project view shows generated files.
Has someone out there incorporated all the best practices and created a nice clean template I can follow?
Thanks!
-
@Justin-Steventon said in App template:
This looks pretty good to me, but does not have (1).
Why do you need that? You just need to have a Kit for every platform you want to build for and then switch the Kit.
-
Right, I mean that when I switch kits that the build works properly for that platform and produces a ready-to-go app. When I look at the samples, there is always more to do. For example, each platform has its own flavor of launch icons. It is common to see an app that does this for one platform, but it does not easily extend to others. Or at least I want to know what the recommended way to do that is.
Ideally, I would like to just write code and spend as little time as possible learning the per-platform configurations.
-
there's no universal template.
What will satisfy you may not satisfy another dev and conversely.
and in most cases, the per-platform code is minor.
If you really want a template that perfectly suits your own tastes, then you will have to write your own template yourself or adapt the one that is the closest match.
-
I doubt you will find anything much better than the one you listed: https://github.com/emericg/QmlAppTemplate
I help manage a similar one, but if you found the
emericg
project lacking, you might find the one I contribute to lacking in very similar ways: https://github.com/219-design/qt-qml-project-template-with-ciAt a glance, it seems like the
219-design
template has formatter checking (clang-format and qmlfmt), whereas I'm not sure theemericg
project does. In the219-design
template we also have some dummy unit tests and a script for launching the GUI in the CI (with Xvfb).But I will say the
emericg
project looks to have a cleaner organization. I admire it for that, and for its well-done README. It, too, has CI for the builds, which is great.It's a bit hard to achieve "clean" and also support all of WASM/Windows/MacOS/iOS/Android/QML/third-party-libs.
If you find other contenders, please share them! We're all still learning all the time.
Also: please consider contributing back to any open-source templates. I bet the
emericg
project would listen to small, actionable critiques. We of the219-design
template would definitely listen to small and actionable ideas. -
Thanks, this is great. While I agree that there is no one-size-fits-all, especially considering how much people want in the baseline (ci-cd, gui tests, etc), it still looks to me like the strength of Qt could be captured better - perhaps with more than one template.
I will see if emericg has some bandwidth. Perhaps we can fund one that everyone can just pick up.