[Development] How to fix TableView's API break?

Ulf Hermann ulf.hermann at qt.io
Mon Dec 19 08:47:20 CET 2022

> So, how to fix the above? One could easily fix the API break, but one is 
> left with broken APIs all over the place. There's no straightforward 
> deprecation mechanism for QML either, and we've dropped versioned includes.

We haven't actually dropped versioned imports. An unversioned import 
just always imports the latest version. Versioned imports are somewhat 
broken in subtle ways (as they have always been). Therefore we recommend 
unversioned imports, but if there is a specific reason to use a 
versioned import, you still can.

There is in fact a deprecation mechanism via the @Deprecated QML 
annotation, but that is not public (yet), and it only works for 
QML-defined types, not for C++-defined ones. It shouldn't be too hard to 
add an analogous DEPRECATED property attribute and a Q_DEPRECATED method 
attribute to moc. Or we might re-use the C++ attributes and macros. Not 
in 6.4, though.

In the past we have just documented properties and methods as 
\deprecated in qdoc and left it at that. For example, FileDialog has 
some deprecated members.

best regards,

More information about the Development mailing list