michal Posted January 14, 2021 Share Posted January 14, 2021 Hello , I have a problem with render order WidgetWindows . Let's have windows win_1 and win_2 , when I set both win_1->setOrder(1) and win_2->setOrder(2) , on init stage , it's working, win_2 is top. But when I set win_2->setOrder(2) in update loop , win_2 is still under the win_1. It's some way to refresh gui to render WidgetWindows in correct order ? Thank you for any help. Michal WidgetWindow.cpp Link to comment
moroz Posted January 15, 2021 Share Posted January 15, 2021 Hi. Try Widget::raise(...) by next way. int update() override { auto gui = Gui::get(); static int o = 0; if (Input::isKeyDown(Input::KEY_C)) o = 1 - o; m_window1->setOrder(o); m_window2->setOrder(1- o); gui->getVBox()->raise(m_window1); gui->getVBox()->raise(m_window2); return 1; } 1 Link to comment
michal Posted January 15, 2021 Author Share Posted January 15, 2021 Thank you, gui->getVBox()->raise , works for me. 1 Link to comment
Recommended Posts