[SOLVED] Removing .ui form leads to segmentation fault
I' trying to remove the .ui form and all its associates pointer from the .h and .cpp file. After removing them, I ran qmake and rebuild the project. However, when I Run the project, the program end unexpectedly. I tried debugging by putting breakpoints, but it did not even enter the main function.
Am I missing any step in removing the ui file? Thanks in advance.
You should rather delete your build directory when doing that.
Pradeep P N
Remove the .ui name from the * .pro* file.
Ex: FORMS +=
in above case if you have deleted about.ui & inputrecordrange.ui, you just remove the names from FORMS
Thanks SGaist. Deleting the whole build directory helped me to solve that problem. And yes Pradeep, I did removed the .ui file before too. But that alone didn't help.
One thing to note though; after deleting the build directory, I still had segmentation fault which is caused by the code below:
@QHBoxLayout *layout = new QHBoxLayout;
So I changed it to this:
@QHBoxLayout layout = new QHBoxLayout;
QWidget w = new QWidget;
You're welcome !
By default there's no central widget, hence the crash.
So I believe the code didn't crash when I was initially using the form as the form provides a default central widget.
Since you have it working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)