Aren't these pretty much identical statements (one is static, the other dynamic). By work I mean display as it should do, both compile.
I feel like I'm missing something stupid.
The first creates a QLabel that has a global lifetime -- the scope of the local pointer variable does not affect the lifetime of the global (dynamic) object (label).
The second creates a QLabel that is local to the current scope -- linked to the local variable that names it. When the local variable goes out of scope (that is, when the function that creates the label terminates), the QLabel is also destroyed. This happens so fast that you never see anything appear on screen.