Reusable QML Module and Type.
-
wrote on 30 Nov 2023, 19:38 last edited by
Hello everyone,
I am working on creating reusable QML modules.
For example DateTime pickers QML types.The thing is that I want to create many QML types that select date and time like in this page.
But If my custom QML Type contains a button, then if someone uses the module in a bigger project with some nice design for the buttons, this will break the style of the app.
My approach for solving this is to have a custom Style in a custom Module called
MyDesigns
.
The custom Design has a type called MyButton.
So for all my other reusable modules that contain a button, I use theMyButton
type.If someone just wants to use my reusable modules,
They could use myMyDesigns
module or create a module with the same nameMyDesigns
with aMyButton
type that does not break the style of their app.Is there a better way to do this?
-
Hello everyone,
I am working on creating reusable QML modules.
For example DateTime pickers QML types.The thing is that I want to create many QML types that select date and time like in this page.
But If my custom QML Type contains a button, then if someone uses the module in a bigger project with some nice design for the buttons, this will break the style of the app.
My approach for solving this is to have a custom Style in a custom Module called
MyDesigns
.
The custom Design has a type called MyButton.
So for all my other reusable modules that contain a button, I use theMyButton
type.If someone just wants to use my reusable modules,
They could use myMyDesigns
module or create a module with the same nameMyDesigns
with aMyButton
type that does not break the style of their app.Is there a better way to do this?
wrote on 1 Dec 2023, 11:21 last edited byI found this nice explanation.
Let's see if can make it work.
2/2