Is it possible to emit a Qt signal from a const method?

It is possible to emit a signal from a const method by adding “const” to the signal declaration, like so:

void sigLog(QString text) const;

I tested this and it does compile and run, even though you don’t actually implement the signal as a normal method yourself (i.e. Qt is okay with it).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)