You are using an obsolete web browser, or you have the page styles (CSS) disabled. You'll be able to access this site, but only a visually simplified version.

It’s a C++ thing

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


01 class SomeClass: public QFrame {
02 Q_OBJECT
03 public:
04 SomeClass(...);
05
06 private:
07 class Private;
08 Private * const d;
09 };
10
12 class SomeClass::Private: public Ui::SomeClassBase {
13 public:
14 Private(SomeClass * parent)
15 : q(parent)
16 {
17 /* ... */
18 }
19
20 const SomeClass q;
21 QBasicTimer timer;
22 };
23
24 SomeClass::SomeClass(QWidget * parent)
25 : QFrame(parent), d(new Private(this))
26 {
27 d->setupUi(this);
28 /* ... */
29 }

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.