4

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

Adrian Toman
  • 11,316
  • 5
  • 48
  • 62
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
  • 74,642
  • 33
  • 187
  • 332