Just wanted to share something very irritating that just have happened to me.

class SomeClass: public QFrame {
Q_OBJECT
public:
    SomeClass(...);

private:
    class Private;
    Private * const d;
};

class SomeClass::Private: public Ui::SomeClassBase {
public:
    Private(SomeClass * parent)
        : q(parent)
    {
    /* ... */
    }

    const SomeClass q;
    QBasicTimer timer;
};

SomeClass::SomeClass(QWidget * parent)
    : QFrame(parent), d(new Private(this))
{
    d->setupUi(this);
    /* ... */
}

Compiled and ran this, and everything just stoped working. The instant I called:

SomeClassi * sc = new SomeClass();
sc->show();

Program just stopped doing anything. (and it took me some time to realize that it is not doing anything, and not only failing to show the widget)

I went on to discover what the problem is - commenting out parts of the code (obviously, the snippet above is not the whole code) to see what is causing the issue, and nothing seemed to be the problem.


You can support my work on , or you can get my book Functional Programming in C++ at if you're into that sort of thing.