Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. When you call this->setCentralWidget(NULL) does it call the destructor?
Forum Updated to NodeBB v4.3 + New Features

When you call this->setCentralWidget(NULL) does it call the destructor?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 746 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tmason101
    wrote on last edited by
    #1

    Hello,

    As the title suggests, I would like to know if calling this->setCentralWidget(NULL) calls the deconstructor for the widget currently set as the central widget of the container.

    Thank you.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andreyc
      wrote on last edited by
      #2

      According to the "sources":http://code.woboq.org/qt5/qtbase/src/widgets/widgets/qmainwindow.cpp.html#_ZN11QMainWindow16setCentralWidgetEP7QWidget and "doc":http://qt-project.org/doc/qt-5/qmainwindow.html#setCentralWidget yes setCentralWidget deletes a previous widget and calls its destructor.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved