Skip to main content
Monika
Associate
September 15, 2020
Solved

I deleted a widget (progress bar) now I get a compiler error - seems the old widgets are still attempting to be initialized.

  • September 15, 2020
  • 1 reply
  • 1430 views

So total rookie here. I thought that if I delete a widget and generate code any code related to the deleted widget would also be removed. But in the .cpp file of the screen where the widget used to be, I'm seeing methods called on the object that doesn't exist!

Here's the errors I'm seeing

0693W000003Rl7eQAC.png

Here's some of the code that shouldn't be there

0693W000003Rl7jQAC.png

Do I have to delete the unneeded code manually?

This topic has been closed for replies.
Best answer by Martin KJELDSEN

Any code inside gui/ is user-code, meaning that the designer does not remove this, even if widgets on the canvas used by that code are removed. The designer can't know. The user code is disjointed from the gui code inside generated/ - You have to fix the compilation errors yourself, but you can "safely" remove the code that references a component that no longer exists =)

/Martin

1 reply

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
September 15, 2020

Any code inside gui/ is user-code, meaning that the designer does not remove this, even if widgets on the canvas used by that code are removed. The designer can't know. The user code is disjointed from the gui code inside generated/ - You have to fix the compilation errors yourself, but you can "safely" remove the code that references a component that no longer exists =)

/Martin

Monika
MonikaAuthor
Associate
September 15, 2020

Okay, thanks Martin!

Martin KJELDSEN
Principal III
September 15, 2020

No problem!