Il 04/05/23 15:51, Sune Vuorela ha scritto:
On 2023-05-04, Marc Mutz via Development<development@qt-project.org> wrote:that keeps unported code running. The main issue isn't the scoping, the main issue will be the missing implicit conversion to underlying_type.In few cases the implicit conversion to underlying_type is kind of important.Especially in the cases where the api has int and is mostly used with enums or is somehow user extendable. Qt::ItemDataRole is one of them that comes to mind. switch(role) { case Qt::UserRole+1: .... QEvent::Type is another one where one registerEventType, recieves an int and then force-cast it to QEvent::Type and still compares back to that int in other places. There are definitely more.
There's little reason why registerEventType returns `int` and not QEvent::Type, by the way. Model roles could become scoped enumerations, which can be explicitly constructed from integers (all of this just to retain the switch()-ability -- otherwise a model role should be represented by a wrapper type around integers. Certainly not be kept as a plain int).
My 2 c, -- Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Senior Software Engineer KDAB (France) S.A.S., a KDAB Group company Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com KDAB - The Qt, C++ and OpenGL Experts
smime.p7s
Description: Firma crittografica S/MIME
-- Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development