Signal isn't recognized after connecting it to a slot
-
@SGaist CalculateTimeStep is being called in a header file. I figured that I wouldn't need the .cpp file since I'm only using three mini-functions throughout the entire class. Additionally, I could have classes inherit these functions later.
CalculateTimeStep is called from a timer that's inside StartTimeStepTimer();
void StartTimeStepTimer(){ QTimer* updateTimer = new QTimer(this); QObject::connect(updateTimer, &QTimer::timeout, this, &TimeStep::CalculateTimeStep); updateTimer->start(FPSms); }
-
And where is StartTimeStepTimer() called?
Please provide a minimal, compilable example to reproduce your problem. -
I'm sorry, but now that you've mentioned it and after taking another look at my code, I think the problem lies within the fact that I forgot to call StartTimeStepTimer in the initializer class, my bad. I would test to verify that, but unfortunately, I've come across another issue, and I can't compile without fixing it first. I haven't done anything to my project to cause an error like this, so I'm not sure what I can do to fix it... I've already tried reinstalling Qt Creator, but I can't seem to shake the error. Are you familiar with anything like this?
-
As far as I know, the error from the image stems from the QGuiApplication file, which I've never touched. This one error is causing a domino effect, leading to about a hundred other ambiguous errors. Strangely, it's specific to this project, despite the fact that I haven't added anything to warrant an error like this. I've also tried cleaning and rebuilding the project from the IDE, but that also doesn't help. If I could get some help with this, I'd be ever so grateful.
gameinitializer.h:3:10: In included file: no member named 'clock_t' in the global namespace; did you mean 'clockid_t'?
ctime:60:11: error occurred here
pthread.h:382:13: 'clockid_t' declared he -
I've just realized that the image I sent can be a little misleading, so I have a couple of other images, proving that the error doesn't just come from the game initializer class; no matter where I go in the project. The error always shows up somewhere at the top.
-
Show the relevant header, maybe you added a
using namespace
or forgot the;
at the end of the class. -
Show the relevant header, maybe you added a
using namespace
or forgot the;
at the end of the class.@Christian-Ehrlicher That's my problem. Because the error points to many different header files, it's hard to tell which one is truly relevant. Excuse me for using images, but there's too much code here, and because I'm a new user, Qt flags my posts as spam if there are too many characters.
All the errors point to this file, which I never touch (it's engine related)
!
the error that always appears at the top points to the engine-related header files in my project...
-
Start over with a simple main.cpp
-
-
Start over with a simple main.cpp
@Christian-Ehrlicher
Hey, so after a bit of research yesterday, I found that when you have a file names time.cpp/time.h in your project, Qt gets confused and throws this exact error. The files didn't show up in my Qt project manager, so I didn't realize that they were for some reason in my project, but as I was moving my files to a clean project like you suggested, I found that both time.cpp and time.h were sitting in my project files! I removed them and it worked perfectly. Thank you so much for the recommendation!here's the stack overflow page I was reading yesterday
https://stackoverflow.com/questions/43813563/clock-t-and-clock-in-does-not-declared-in-this-scope-in-qt -
This has nothing to do with Qt - you must not use a filename which is also used by the c or c++ system headers which you did.
-
This has nothing to do with Qt - you must not use a filename which is also used by the c or c++ system headers which you did.
@Christian-Ehrlicher Noted.