2021-01-08 02:49 AM
Hello, In my project I have 2 screen, Lets call it SCR-1 and SCR-2. First SCR-1 will be displayed for 1 sec and post SCR-2 will be displayed all time. Everything works fine till thn.
In my project sometimes, I need to again put SCR-1 (with SCR-1 for 1 sec and thn SCR-2) during run time. When I try to do same, I am facing assert function. So screen is able to successfully change from SCR-2 to SCR-1 but post 1 sec while trying to go for SCR-2, touchgfx is going for assert.
Below are the stack information. Here SCR-2 is main screen
void FrontendApplicationBase::gotoMainScreenScreenNoTransitionImpl()
{
touchgfx::makeTransition<MainScreenView, MainScreenPresenter, touchgfx::NoTransition, Model >(¤tScreen, ¤tPresenter, frontendHeap, ¤tTransition, &model);
}
Its going for assert while at add(customizedArea), basically I added customizedArea as customized widget.
QRCodeWidget customizedArea;
void MainScreenView::setupScreen() {
customizedArea.setXY(QR_CODE_AREA_X_LOCATION, QR_CODE_AREA_Y_LOCATION); //From widget
customizedArea.setQRCode(&code); //From QRCodeWidget
customizedArea.setScale(SCALE_FOR_QR_CODE); //From QRCodeWidget
add(customizedArea); //Add to root container of your screen (view)
customizedArea.setVisible(false);
customizedArea.invalidate();
MainScreenViewBase::setupScreen();
}
Solved! Go to Solution.
2021-01-08 03:09 AM
I solved issue by removing customized widget during tearDownScreen.
2021-01-08 03:09 AM
I solved issue by removing customized widget during tearDownScreen.
2021-01-08 08:14 AM
Maybe better is change order in setupScreen, good practice is call as first
MainScreenViewBase::setupScreen();
2021-01-08 08:25 AM
Sure I will make that change. Thanks