If I derive my class from QObject
(or a subclass), the Qt documentation says that I have to put the Q_OBJECT
macro into my class declaration.
It also ways I need to "run the meta-object compiler" for my class.
I have no idea how to do this. Is this something I need to add to the .pro file? Do I need to edit the makefile? This seems overly complicated for a simple derived class.
I'm using Qt Creator.
EDIT:
Thanks for all the help. I discovered something very important: When I create a new class in Qt Creator, I have to specify "Inherits QWidget" as the type information, even if I'm already specifying a Qt widget as my base class (such as QTextEdit
). It seems strange that Qt Creator couldn't figure that out on its own, but that seems to solve my signal/slot and moc problems.