| 1445 | } |
| 1446 | |
| 1447 | void Widget::addWidget(Widget* _widget) |
| 1448 | { |
| 1449 | // сортировка глубины от большого к меньшему |
| 1450 | |
| 1451 | int depth = _widget->getDepth(); |
| 1452 | |
| 1453 | for (size_t index = 0; index < mWidgetChild.size(); ++index) |
| 1454 | { |
| 1455 | Widget* widget = mWidgetChild[index]; |
| 1456 | if (widget->getDepth() < depth) |
| 1457 | { |
| 1458 | mWidgetChild.insert(mWidgetChild.begin() + index, _widget); |
| 1459 | _updateChilds(); |
| 1460 | return; |
| 1461 | } |
| 1462 | } |
| 1463 | |
| 1464 | mWidgetChild.push_back(_widget); |
| 1465 | } |
| 1466 | |
| 1467 | void Widget::_updateChilds() |
| 1468 | { |