4

What is the purpose of passing a parent into a constructor of a Qt class object?

Adrian Toman
  • 11,168
  • 5
  • 47
  • 61
Darren
  • 61
  • 2
  • 5

1 Answers1

4

They ensure your heap-allocated QWidgets are taken care of nicely (delete called when it needs to be and such).

For a detailed explanation, see this answer to a similar question.

Community
  • 1
  • 1
rubenvb
  • 72,003
  • 32
  • 177
  • 319