Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Widget::render()
- {
- QImage *tex = new QImage();
- QPainter painter(tex);
- int lastZ = 0;
- int z = 1;
- while (lastZ < z)
- {
- bool found = false;
- for (int i = 0; i < cWidgets.length(); i++)
- {
- Widget *act = cWidgets.at(i);
- int actZ = act->zIndex();
- if (actZ == z)
- {
- Point pos = act->globalPos();
- painter.drawImage(QPoint(pos.x(), pos.y()), *act->paint());
- found = true;
- }
- }
- if (found)
- {
- lastZ = z;
- z++;
- }
- else
- {
- lastZ = z;
- }
- }
- }
Add Comment
Please, Sign In to add comment