The problem went away when I removed Q_OBJECT from the code.