Skip to content

Commit

Permalink
qtquick Add QtQuick::Group::closeAllDockWidgets()
Browse files Browse the repository at this point in the history
Can't name it close as it clashes with View::close().
Part of issue #513
  • Loading branch information
iamsergio committed Jul 5, 2024
1 parent bb11431 commit ca414cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/qtquick/views/Group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,3 +280,8 @@ void Group::setMDISize(QSize sz)

layout->resizeDockWidget(m_group, sz);
}

bool Group::closeAllDockWidgets()
{
return m_inDtor || m_group->close();
}
3 changes: 3 additions & 0 deletions src/qtquick/views/Group.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ class DOCKS_EXPORT Group : public QtQuick::View, public Core::GroupViewInterface
/// Sets the size of this group in the MDI layout
Q_INVOKABLE void setMDISize(QSize);

/// Convenience that just calls close() on all its dock widgets
/// Returns whether all dock widgets accepted the close
Q_INVOKABLE bool closeAllDockWidgets();

protected:
void removeDockWidget(Core::DockWidget *dw) override;
Expand Down

0 comments on commit ca414cf

Please sign in to comment.