Can no longer build due to no matching function.
-
Thanks for the reply, I deleted the UI file only. I kept the headers from the old file but when I replaced the file I kept all the names the same. I also deleted the call code for the UI file and retyped it.
-
Then, since you're in a hurry, the quick way: move these files out of the source tree, recreate your widget, copy back your custom code if you had any
-
@SGaist Is it fine to copy the GUI as well or should I remake that? As in all my labels and edits etc.
-
You can copy it, just check that all names are correct
-
@SGaist So, I just copied over all the code to a completely new project in a new folder and Qt is still throwing me the same error as in the original post.
-
Don't overwrite the new files with the content of the old one, just cherry-pick the modifications you made e.g. slot added etc.
-
@SGaist Right, I only copied the code from the old slots directly into the ones in the new project made by Qt, still getting the same error.
-
So, recreating your widget from scratch in a new project and just copying the slot code gives you the same error ?
-
@SGaist Yup, new folder, new project I created all new files in Qt added all my GUI back, followed to slot, then copied the code in and still get the same error
-
Did you check that all names were matching ? Ui widget name vs C++ widget name ?
-
@SGaist Right, sorry to be causing so many problems, but thank you for the help! Everything is working now, I missed some of the includes, however I can't use .setModal(true); on a new window opening because it's saying the class has no member called setModal
behindlogin behindlogin; behindlogin.setModal(true); behindlogin.exec(); connClose();
-
You're welcome !
setModal and exec are methods from QDialog. From what I understood you have a QMainWindow, no ?
-
@SGaist Ahh yes, I've changed from a Dialog to a MainWindow as I wanted the menu bar at the top.
-
So problem solved ? :)
-
@SGaist The code actually compiles now! Thank you, the only issue left is I've replaced the code with
behindlogin behindlogin; behindlogin.show(); connClose(); Which causes the window to open and them immediately close after
-
If you have something like:
{ behindlogin behindlogin; behindlogin.show(); connClose(); } <- behindlogin is destroyed here
-
@SGaist Right, so I've replaced it with
behindlogin *behindLogin;
in the header file and then
behindLogin =new behindlogin(this); behindLogin->show();
in the main cpp file but it's saying that behindlogin does not name a type?
-
Is behindlogin a member variable of a class ?
-
@SGaist Uh, honestly I'm not sure.. I'm very new to Qt and I've been following tutorials. Everything I've looked at makes it look like this should work but I can't figure out what I'm doing incorrectly.
-
Hi,
@dejarked said:
in the main cpp file but it's saying that behindlogin does not name a type?
That means you forgot to #include the header that defines the
behindlogin
.@dejarked said:
@SGaist Uh, honestly I'm not sure.. I'm very new to Qt and I've been following tutorials. Everything I've looked at makes it look like this should work but I can't figure out what I'm doing incorrectly.
Is your code exactly the same as what's in the tutorial?