Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

[SOLVED] Why can't i emit a signal from a method that's not declared in a .h file?

$
0
0
Hi, I’ve got the following problem. I’m trying to emit a custom signal from a function in my .cpp file, basically it looks like this: something.h class something : public QObject { Q_OBJECT   signals: void someKindOfSignal(); } something.cpp void someMethod() { emit someKindOfSignal() }   something::something(QObject *parent):QObject(parent) { } Now, why can’t i emit a signal from the someMethod() function? From what i understand, i can emit a signal from any method that has been declared inside my .h file, everything else just gives my compiler errors (identifier not found), but why? I also can write ‘emit someSignal()’ from the constructor something::something(etc), but not in any method that has been declared outside of the .h file.

Viewing all articles
Browse latest Browse all 13965

Trending Articles