* \brief Wrap the view() into a PartMdiView. * * A new view is only created the first time this method is called; * after that, a pointer to the pre-existing view is returned. */
| 51 | * after that, a pointer to the pre-existing view is returned. |
| 52 | */ |
| 53 | ContentDockWidget* AbstractPart::dockWidget() const { |
| 54 | if (!m_dockWidget) { |
| 55 | m_dockWidget = new ContentDockWidget(const_cast<AbstractPart*>(this)); |
| 56 | connect(m_dockWidget, &ads::CDockWidget::closed, [this] { |
| 57 | const bool deleteOnClose = Settings::readDockPosBehavior() == Settings::DockPosBehavior::AboveLastActive; |
| 58 | if (deleteOnClose && !m_suppressDeletion) { |
| 59 | m_dockWidget->dockManager()->removeDockWidget(m_dockWidget); |
| 60 | m_dockWidget = nullptr; |
| 61 | deleteView(); |
| 62 | } |
| 63 | }); |
| 64 | } |
| 65 | return m_dockWidget; |
| 66 | } |
| 67 | #endif |
| 68 | |
| 69 | #ifndef SDK |
no test coverage detected