Skip to content

Commit

Permalink
Add DockRegistry::dockwidgetsReferencedByDropArea
Browse files Browse the repository at this point in the history
  • Loading branch information
iamsergio committed Jul 20, 2024
1 parent dcb7804 commit bafe1f8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/core/DockRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,20 @@ Core::Group *DockRegistry::groupInMDIResize() const
return nullptr;
}

Vector<Core::DockWidget *> DockRegistry::dockwidgetsReferencedByDropArea(Core::DropArea *dropArea) const
{
Vector<Core::DockWidget *> dockWidgets;

for (auto dw : m_dockWidgets) {
auto lastPositions = dw->d->lastPosition();
if (lastPositions->containsPlaceholderFromLayout(dropArea->asLayoutingHost())) {
dockWidgets.append(dw);
}
}

return dockWidgets;
}

void DockRegistry::setCurrentCloseReason(CloseReason reason)
{
d->m_currentCloseReason = reason;
Expand Down
7 changes: 7 additions & 0 deletions src/core/DockRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ class DOCKS_EXPORT DockRegistry : public Core::Object, public Core::EventFilterI
///@brief Returns the Group which is being resized in a MDI layout. nullptr if none
Core::Group *groupInMDIResize() const;


/// Returns all dock widgets which have a "previous position" in the specified DropArea
/// A DropArea is a layout of dock widgets, when a dock widget is closed, the layout will
/// still keep a placeholder for it, so it can be restored to the correct place. This function
/// returns all dock widgets that have such placeholder.
Vector<Core::DockWidget *> dockwidgetsReferencedByDropArea(Core::DropArea *) const;

void setCurrentCloseReason(CloseReason);
CloseReason currentCloseReason();

Expand Down

0 comments on commit bafe1f8

Please sign in to comment.