! * \class ContentDockWidget * * \brief ads::CDockWidget wrapper for aspect views. * * In addition to the functionality provided by ads::CDockWidget, * this class automatically updates the window title when AbstractAspect::caption() is changed * and holds the connection to the actual data visualized in this window via the pointer to \c AbstractPart. */
| 23 | * and holds the connection to the actual data visualized in this window via the pointer to \c AbstractPart. |
| 24 | */ |
| 25 | ContentDockWidget::ContentDockWidget(AbstractPart* part) |
| 26 | : ads::CDockWidget(part->name()) |
| 27 | , m_part(part) { |
| 28 | setWindowIcon(m_part->icon()); |
| 29 | setWidget(m_part->view()); |
| 30 | handleAspectDescriptionChanged(m_part); |
| 31 | |
| 32 | // resize the MDI sub window to fit the content of the view |
| 33 | resize(m_part->view()->size()); |
| 34 | |
| 35 | // Must be unique and must not be changed after the dock was added to the dockmanager, because |
| 36 | // the objectname is used in the content manager map |
| 37 | setObjectName(m_part->uuid().toString()); |
| 38 | |
| 39 | connect(m_part, &AbstractPart::aspectDescriptionChanged, this, &ContentDockWidget::handleAspectDescriptionChanged); |
| 40 | connect(m_part, QOverload<const AbstractAspect*>::of(&AbstractPart::childAspectAboutToBeRemoved), this, &ContentDockWidget::handleAspectAboutToBeRemoved); |
| 41 | } |
| 42 | |
| 43 | ContentDockWidget::~ContentDockWidget() { |
| 44 | m_closing = true; |