Tutorial sobre widgets – Widgets filhos
Podemos adicionar um widget filho à janela criada no exemplo anterior, passando window como pai para seu construtor. Neste caso, adicionamos um botão à janela e o posicionamos em um local específico:
|
![]() |
O botão agora é um filho da janela e será excluído quando a janela for destruída. Observe que ocultar ou fechar a janela não a destrói automaticamente. Ela será destruída quando o exemplo for encerrado.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.
