I am stuck on a weird problem. In several Qt programs I use extended versions of QLabel, QCheckBox and QGroupBox. For example here is qmygroupbox.h

#ifndef QMYGROUPBOX_H
#define QMYGROUPBOX_H

#include <qgroupbox.h>
#include <QMouseEvent>

class QMyGroupBox: public QGroupBox
{
Q_OBJECT
public:
QMyGroupBox(QWidget *parent = 0);
signals:
void groupBoxClicked(QString text);
private:
void mousePressEvent (QMouseEvent *event);
};

#endif

In QtCreator I promote a QGroupBox, for example, to QMyGroupBox. This has been working well for years. Now in one program I am getting link errors:

mainwindow.obj:-1: error: LNK2019: unresolved external symbol "public: __thiscall QMyCheckBox::QMyCheckBox(class QWidget *)" (??0QMyCheckBox@@QAE@PAVQWidget@@@Z) referenced in function "public: void __thiscall Ui_MainWindow::setupUi(class QMainWindow *)" (?setupUi@Ui_MainWindow@@QAEXPAVQMainWindow@@@Z)
mainwindow.obj:-1: error: LNK2019: unresolved external symbol "public: __thiscall QMyGroupBox::QMyGroupBox(class QWidget *)" (??0QMyGroupBox@@QAE@PAVQWidget@@@Z) referenced in function "public: void __thiscall Ui_MainWindow::setupUi(class QMainWindow *)" (?setupUi@Ui_MainWindow@@QAEXPAVQMainWindow@@@Z)
mainwindow.obj:-1: error: LNK2019: unresolved external symbol "public: __thiscall QMyLabel::QMyLabel(class QWidget *)" (??0QMyLabel@@QAE@PAVQWidget@@@Z) referenced in function "public: void __thiscall Ui_MainWindow::setupUi(class QMainWindow *)" (?setupUi@Ui_MainWindow@@QAEXPAVQMainWindow@@@Z)

I have not been able to what is different about this program. I am using Qt 4.8.6 with MSVC 11.0 (VS 2010). Other programs with the same toolchain, same usage of the promoted widgets build without problems.

Any suggestions?