stable_sort(row_items.begin(), row_items.end(),
[](const shared_ptr<RowItem> &a, const shared_ptr<RowItem> &b) {
stable_sort(row_items.begin(), row_items.end(),
[](const shared_ptr<RowItem> &a, const shared_ptr<RowItem> &b) {
const vector< shared_ptr<TimeItem> > time_items(view_.time_items());
assert(none_of(time_items.begin(), time_items.end(),
[](const shared_ptr<TimeItem> &t) { return !t; }));
QPainter p(this);
const vector< shared_ptr<TimeItem> > time_items(view_.time_items());
assert(none_of(time_items.begin(), time_items.end(),
[](const shared_ptr<TimeItem> &t) { return !t; }));
QPainter p(this);
for (LayerPaintFunc *paint_func = layer_paint_funcs;
*paint_func; paint_func++) {
ViewItemPaintParams time_pp(rect(), view_.scale(), view_.offset());
for (LayerPaintFunc *paint_func = layer_paint_funcs;
*paint_func; paint_func++) {
ViewItemPaintParams time_pp(rect(), view_.scale(), view_.offset());
(t.get()->*(*paint_func))(p, time_pp);
ViewItemPaintParams row_pp(rect(), view_.scale(), view_.offset());
(t.get()->*(*paint_func))(p, time_pp);
ViewItemPaintParams row_pp(rect(), view_.scale(), view_.offset());