[Development] Conventions for using qmlRegisterType in qtdeclarative

Olivier Goffart olivier at woboq.com
Wed Apr 11 14:06:40 CEST 2018

On 2018-04-11 11:00, Tomasz Olszak wrote:
> Hello,
> In [1] Michael Brasser pointed out that I should introduce new
> revision after adding new property to QQmlLoggingCategory.
> First question:
> 1. Why in [2] QQuickTextInput is registered for versions > 9 with
> revision 0? I would expect that it should be registered with revision
> 9 for imports >= 2.9. Am I missing something?
> 2. What is the convention regarding revisions? What should be
> QQmlLoggingCategory::defaultLogLevel revision if I add the property in
> Qt 5.12 (1 or 12)
> I would like to kindly ask someone experienced in this area to review [1]
> [1] https://codereview.qt-project.org/#/c/224198
> [1] https://code.woboq.org/qt5/qtdeclarative/src/quick/items/qquickitemsmodule.cpp.html

That's because this revision thingy is both confusing, error prone, and 
IMHO useless.
If it was me, this should never have been done.

To answer your question more precisely:

1. It apprars QQuickTextInput is not explicitly registered for version > 
9, so it is implicitly the same as the version 9 which is fine for there 
are no revision higher than 9 in that class

2. From what I can see, the usage in qquickitemsmodule.cpp is mixed. I'd 
argue that 12 would make it less confusing and error prone.
You may want to hear another more objective opinion though :-).


Woboq - Qt services and support - https://woboq.com - https://code.woboq.org

More information about the Development mailing list