<table><tr><td style="">kossebau added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D23695">View Revision</a></tr></table><br /><div><div><p>I have never seen a range-based for loop with qmap/qhash. But then I also only now learned about the existence of QKeyValueIterator being triggered by your question :)</p>

<p>Looking further, given the definition of range-for, for what I understand, we are still out of luck when it comes to QMap/QHash, as the <tt style="background: #ebebeb; font-size: 13px;">begin_expr</tt> and <tt style="background: #ebebeb; font-size: 13px;"> end_expr</tt> are expected to be <tt style="background: #ebebeb; font-size: 13px;">begin()</tt> and <tt style="background: #ebebeb; font-size: 13px;">end()</tt> for classes, which for the Qt hash containers are bound to the value iterators. So to my best knowledge and experimenting, not possible.<br />
If anyone reading this can tell better, please do, learning all the time.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R39 KTextEditor</div></div></div><br /><div><strong>BRANCH</strong><div><div>portawayfromforeachforitemconstructionestimation_autotests</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D23695">https://phabricator.kde.org/D23695</a></div></div><br /><div><strong>To: </strong>kossebau, Kate, cullmann<br /><strong>Cc: </strong>cullmann, kwrite-devel, kde-frameworks-devel, LeGast00n, GB_2, domson, michaelh, ngraham, bruns, demsking, sars, dhaumann<br /></div>