Stop propagation of keyboard messages if a child use it

This fix a new bug with the new EditorView's scroll-bars. As 1,2,3,4,5,6
keys change the zoom, they will change the viewport size, and scroll-bars
will be removed/added. We cannot continue iterating the View::m_children
collection after m_children is modified (scroll-bars are removed/added).
This commit is contained in:
David Capello 2014-02-03 00:22:24 -03:00
parent d3c72bedf2
commit 936b741f90

View File

@ -1234,7 +1234,8 @@ bool Widget::onProcessMessage(Message* msg)
if (static_cast<KeyMessage*>(msg)->propagateToChildren()) {
// Broadcast the message to the children.
UI_FOREACH_WIDGET(getChildren(), it)
(*it)->sendMessage(msg);
if ((*it)->sendMessage(msg))
return true;
}
// Propagate the message to the parent.