Skip to content

Commit 9e1ba74

Browse files
committed
Eradicate Java-style iterators and mark the module free of them
Java-style iterators are scheduled for deprecation, or at the very least banned from use in Qt's own implementation. Change-Id: I3b65526968551baf48d1acb1e7184a3800092b56 Reviewed-by: Mårten Nordheim <[email protected]>
1 parent 9be2dd6 commit 9e1ba74

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.qmake.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
load(qt_build_config)
22

3+
DEFINES += QT_NO_JAVA_STYLE_ITERATORS
4+
35
MODULE_VERSION = 5.14.0

src/plugins/platforms/webgl/qwebglcontext.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,8 @@ static int bufferSize(GLsizei count, GLint elemsPerVertex, GLenum type, GLsizei
228228
static void setVertexAttribs(QWebGLFunctionCall *event, GLsizei count)
229229
{
230230
event->addInt(currentContextData()->vertexAttribPointers.count());
231-
QHashIterator<GLuint, ContextData::VertexAttrib> it(currentContextData()->vertexAttribPointers);
232-
while (it.hasNext()) {
233-
it.next();
231+
const auto &vertexAttribPointers = currentContextData()->vertexAttribPointers;
232+
for (auto it = vertexAttribPointers.cbegin(), end = vertexAttribPointers.cend(); it != end; ++it) {
234233
const ContextData::VertexAttrib &va(it.value());
235234
if (va.arrayBufferBinding == 0 && va.enabled) {
236235
int len = bufferSize(count, va.size, va.type, va.stride);

0 commit comments

Comments
 (0)