class Ui::MainWindow has no member named 'lineEdit'
-
-
i added some objects in mainwindow.ui

And got this error

This problem is only with new objects
There are no such problems with other projects, only with this onetried:
Rebuild
Reopening the project
Re-entry to QT
Deleting *.pro.userIt didn't help.
@BITniki said in class Ui::MainWindow has no member named 'lineEdit':
This problem is only with new objects
There are no such problems with other projects, only with this oneI do not know why this is the case.
You presumably have verified that your
mainwindow.cpphas#include "ui_mainwindow.h"at the start?Make sure there is not some other
ui_mainwindow.hlying around somewhere. You have discovered that lives in the build output directory. Make sure there isn't one in, say, the same source directory as yourmainwindow.cpp.Delete all files in the build output directory (not your sources directory!). That should force a full rebuild.
Other than that I don't know.
-
i added some objects in mainwindow.ui

And got this error

This problem is only with new objects
There are no such problems with other projects, only with this onetried:
Rebuild
Reopening the project
Re-entry to QT
Deleting *.pro.userIt didn't help.
@BITniki
I can't tell from your screenshot, I assume you have verified thatQLineEdit'sname is spelledlE_Port(first char lowercaseL) and notIE_Port(first char uppercaseI)?Make sure your designer changes are being saved to the
.uifile, and the build is re-running theuicto process the.uifile. That generates a file namedui_mainwindow.hin the build output directory (for Debug or Release, where the.objfiles are generated when compiling). Read that in and look at it. You should see it change/be regenerated any time you build after altering anything in the designer. Is that happening? What does it have in its content relating tolE_Port? -
@JonB
it's lowercaseLinlE_PortSorry, I didn't quite understand you, but there my mainwindow.ui file

and my ui_mainwindow.h file

Alse, there my build settings

Hope thats help@BITniki
The generated files seem to look good.This problem is only with new objects
What you show is a warning in the editor. This will happen when you add a new object in the designer but not yet rebuilt. Ignore it for now. If you actually build your project, does it compile successfully? If not show the compiler error output.
-
i added some objects in mainwindow.ui

And got this error

This problem is only with new objects
There are no such problems with other projects, only with this onetried:
Rebuild
Reopening the project
Re-entry to QT
Deleting *.pro.userIt didn't help.
@BITniki said in class Ui::MainWindow has no member named 'lineEdit':
This problem is only with new objects
There are no such problems with other projects, only with this oneI do not know why this is the case.
You presumably have verified that your
mainwindow.cpphas#include "ui_mainwindow.h"at the start?Make sure there is not some other
ui_mainwindow.hlying around somewhere. You have discovered that lives in the build output directory. Make sure there isn't one in, say, the same source directory as yourmainwindow.cpp.Delete all files in the build output directory (not your sources directory!). That should force a full rebuild.
Other than that I don't know.
-
@JonB
Thanks.
I fixed the problem.
In the folder with the project, there was another ui_mainwindow.h
I don't understand how it got there, but thank you -
@BITniki , we need to rename a name_of_project.pro.user to name_of_project.pro.user.backup
