How to implement custom type
-
wrote on 24 Oct 2022, 13:16 last edited by
I want to implement a new Text class based on the existing Text class but with added functionality, events and properties. Is there a good tutorial that will demonstrate exactly how I can do this ?
-
wrote on 25 Oct 2022, 14:28 last edited by
Create a new xml file as NewText.qml and use the existing Text in it like
ExistingText {
...
} -
Create a new xml file as NewText.qml and use the existing Text in it like
ExistingText {
...
}wrote on 25 Oct 2022, 15:03 last edited byWhat @JoeCFD said is what I have done to customise some built-in QML components but it depends whether everything that needs doing can be done at the QML level. For example, if extensions are needed at the underlying C++ level there is not really any support to do this. Probably you would need to copy the source of
QQuickText
to a new class and add the extensions to it.
1/3