I was looking at Qt example here:
and inside the constructor, they have:
Window::Window() { editor = new QTextEdit(); // Memory leak? Q
If there is an exception thrown between new and addWidget then yes there is a memory leak. Otherwise the parent control takes ownership of the memory.
QHBoxLayout *buttonLayout = new QHBoxLayout(); // Memory leak? //make sure you don't throw here buttonLayout->addWidget(sendButton);