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.
↧