Il 13/08/2018 16:40, Tor Arne Vestbø ha scritto:
Or:if (event->device()->pointerType() != QQuickPointerDevice::Finger Gives me all the info I need, and having to type or read this instead is worse in my opinion:
This is actually against the old "non-enum class" coding standards: one must repeat the enumeration name in the enumerators. Then, the difference is between something like
QQuickPointerDevice::FingerPointerType (?) and QQuickPointerDevice::PointerType::Finger So quite minor, all in all...
if (event->device()->pointerType() != QQuickPointerDevice::PointerType::Finger && I think we should revisit this policy, and only use it when there’s actually a clash.
Which is always "too late" if we're talking about public APIs, as they're set in stone.
By the way, the C++ community has already recognized the excessive verbosity of enum classes, and there are proposals such as
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1099r0.htmlthat would drastically simplify the syntax. In the meanwhile, I would not work around it -- we need *some* enum scoping anyhow, and enum classes are the simplest way possible to not forget about it.
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 http://lists.qt-project.org/mailman/listinfo/development