class Ui::MainWindow has no member named 'lineEdit'
-
-
@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.cpp
has#include "ui_mainwindow.h"
at the start?Make sure there is not some other
ui_mainwindow.h
lying 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.
-
@BITniki
I can't tell from your screenshot, I assume you have verified thatQLineEdit's
name is spelledlE_Port
(first char lowercaseL
) and notIE_Port
(first char uppercaseI
)?Make sure your designer changes are being saved to the
.ui
file, and the build is re-running theuic
to process the.ui
file. That generates a file namedui_mainwindow.h
in the build output directory (for Debug or Release, where the.obj
files 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
? -
@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.
-
@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.cpp
has#include "ui_mainwindow.h"
at the start?Make sure there is not some other
ui_mainwindow.h
lying 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.