Hco*_*org 11
cbegin() and cend() where introduced for compatibility with Standard Library containers, which all contain such functions since C++11.
Qt just wants to keep it interface similar to the standard library.
constBegin() etc. are just older versions (Qt added them before C++11 was released). There is no difference in using them.
我会使用constBegin(),constEnd()因为它们更明确和'Qt风格',但这只是我个人的偏好.cbegin()/ cend()可能被一些为标准容器实现的算法使用(因此它们存在于Qt中 - 它们有助于重用一些代码).如果您希望在某些时候想要在Qt之外重用代码,请使用它们.